summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/Makefile.in.orig146
-rw-r--r--Build/source/README.cross3
-rw-r--r--Build/source/README.orig125
-rw-r--r--Build/source/ac/withenable.ac1
-rw-r--r--Build/source/build-aux/README.TL3
-rwxr-xr-xBuild/source/build-aux/config.guess1526
-rwxr-xr-xBuild/source/build-aux/config.sub1658
-rwxr-xr-xBuild/source/build-aux/depcomp589
-rwxr-xr-xBuild/source/build-aux/install-sh519
-rwxr-xr-xBuild/source/build-aux/ltmain.sh8406
-rwxr-xr-xBuild/source/build-aux/missing367
-rw-r--r--Build/source/build-aux/texinfo.tex9153
-rwxr-xr-xBuild/source/build-aux/ylwrap223
-rw-r--r--Build/source/configure.in.orig287
-rw-r--r--Build/source/libs/README.orig250
-rw-r--r--Build/source/libs/ac/withenable.ac1
-rw-r--r--Build/source/libs/configure.in.orig84
-rw-r--r--Build/source/libs/dummy/Makefile.am10
-rw-r--r--Build/source/libs/dummy/Makefile.in420
-rw-r--r--Build/source/libs/dummy/aclocal.m4618
-rwxr-xr-xBuild/source/libs/dummy/configure3403
-rw-r--r--Build/source/libs/dummy/configure.ac21
-rw-r--r--Build/source/libs/freetype/ac/freetype.ac3
-rw-r--r--Build/source/libs/freetype/ac/withenable.ac3
-rw-r--r--Build/source/libs/freetype2/ac/freetype2.ac3
-rw-r--r--Build/source/libs/freetype2/ac/withenable.ac3
-rw-r--r--Build/source/libs/gd/ac/gd.ac3
-rw-r--r--Build/source/libs/gd/ac/withenable.ac3
-rw-r--r--Build/source/libs/graphite/COPYING1
-rw-r--r--Build/source/libs/graphite/INSTALL236
-rw-r--r--Build/source/libs/graphite/Makefile.am62
-rw-r--r--Build/source/libs/graphite/Makefile.in699
-rw-r--r--Build/source/libs/graphite/README32
-rw-r--r--Build/source/libs/graphite/TODO4
-rw-r--r--Build/source/libs/graphite/aclocal.m47533
-rw-r--r--Build/source/libs/graphite/build.bat1
-rw-r--r--Build/source/libs/graphite/build_d.bat1
-rwxr-xr-xBuild/source/libs/graphite/config/config.guess1555
-rwxr-xr-xBuild/source/libs/graphite/config/config.sub1685
-rwxr-xr-xBuild/source/libs/graphite/config/depcomp530
-rwxr-xr-xBuild/source/libs/graphite/config/install-sh519
-rw-r--r--Build/source/libs/graphite/config/ltmain.sh6930
-rwxr-xr-xBuild/source/libs/graphite/config/missing375
-rwxr-xr-xBuild/source/libs/graphite/configure22334
-rw-r--r--Build/source/libs/graphite/configure.ac137
-rw-r--r--Build/source/libs/graphite/debian/changelog174
-rw-r--r--Build/source/libs/graphite/debian/compat1
-rw-r--r--Build/source/libs/graphite/debian/control83
-rw-r--r--Build/source/libs/graphite/debian/copyright259
-rw-r--r--Build/source/libs/graphite/debian/libgraphite-dev.dirs4
-rw-r--r--Build/source/libs/graphite/debian/libgraphite-dev.docs5
-rw-r--r--Build/source/libs/graphite/debian/libgraphite-dev.install4
-rw-r--r--Build/source/libs/graphite/debian/libgraphite3.dirs1
-rw-r--r--Build/source/libs/graphite/debian/libgraphite3.install1
-rw-r--r--Build/source/libs/graphite/debian/libgraphite3.shlibs1
-rwxr-xr-xBuild/source/libs/graphite/debian/rules12
-rw-r--r--Build/source/libs/graphite/doc/GTF_3_0.odtbin0 -> 32225 bytes
-rw-r--r--Build/source/libs/graphite/doc/V2_Engine_Interface.odtbin0 -> 25593 bytes
-rw-r--r--Build/source/libs/graphite/doc/V2_Segment_Interface.odtbin0 -> 29845 bytes
-rw-r--r--Build/source/libs/graphite/doc/V2_TextSource_Interface.odtbin0 -> 21265 bytes
-rw-r--r--Build/source/libs/graphite/doc/hungarian.txt126
-rw-r--r--Build/source/libs/graphite/doc/policy.txt19
-rw-r--r--Build/source/libs/graphite/graphite-engine.ac13
-rw-r--r--Build/source/libs/graphite/include/Makefile.am29
-rw-r--r--Build/source/libs/graphite/include/graphite/BinTree.h71
-rw-r--r--Build/source/libs/graphite/include/graphite/FileFont.h260
-rw-r--r--Build/source/libs/graphite/include/graphite/Font.h416
-rw-r--r--Build/source/libs/graphite/include/graphite/GenericResource.h86
-rw-r--r--Build/source/libs/graphite/include/graphite/GrAppData.h39
-rw-r--r--Build/source/libs/graphite/include/graphite/GrClient.h39
-rw-r--r--Build/source/libs/graphite/include/graphite/GrCommon.h145
-rw-r--r--Build/source/libs/graphite/include/graphite/GrConstants.h268
-rw-r--r--Build/source/libs/graphite/include/graphite/GrData.h226
-rw-r--r--Build/source/libs/graphite/include/graphite/GrDebug.h200
-rw-r--r--Build/source/libs/graphite/include/graphite/GrExt.h13
-rw-r--r--Build/source/libs/graphite/include/graphite/GrFeature.h203
-rw-r--r--Build/source/libs/graphite/include/graphite/GrMstypes.h40
-rw-r--r--Build/source/libs/graphite/include/graphite/GrPlatform.h189
-rw-r--r--Build/source/libs/graphite/include/graphite/GrResult.h171
-rw-r--r--Build/source/libs/graphite/include/graphite/GrStructs.h97
-rw-r--r--Build/source/libs/graphite/include/graphite/GrWrappers.h13
-rw-r--r--Build/source/libs/graphite/include/graphite/GraphiteProcess.h45
-rw-r--r--Build/source/libs/graphite/include/graphite/HashMap.h328
-rw-r--r--Build/source/libs/graphite/include/graphite/IGrEngine.h36
-rw-r--r--Build/source/libs/graphite/include/graphite/IGrJustifier.h58
-rw-r--r--Build/source/libs/graphite/include/graphite/IGraphiteProcess.h44
-rw-r--r--Build/source/libs/graphite/include/graphite/ITextSource.h69
-rw-r--r--Build/source/libs/graphite/include/graphite/MemoryUsage.h156
-rw-r--r--Build/source/libs/graphite/include/graphite/Segment.h627
-rw-r--r--Build/source/libs/graphite/include/graphite/SegmentAux.h392
-rw-r--r--Build/source/libs/graphite/include/graphite/SegmentPainter.h234
-rw-r--r--Build/source/libs/graphite/installed-top.pc.in5
-rw-r--r--Build/source/libs/graphite/license/LICENSING.txt43
-rw-r--r--Build/source/libs/graphite/license/License_CPLv05.txt86
-rw-r--r--Build/source/libs/graphite/license/License_GPLv2.txt342
-rw-r--r--Build/source/libs/graphite/license/License_LGPLv21.txt506
-rw-r--r--Build/source/libs/graphite/makefile.vc814
-rw-r--r--Build/source/libs/graphite/silgraphite.pc.in7
-rw-r--r--Build/source/libs/graphite/src/Makefile.am22
-rw-r--r--Build/source/libs/graphite/src/Makefile.in767
-rw-r--r--Build/source/libs/graphite/src/font/FileFont.cpp429
-rw-r--r--Build/source/libs/graphite/src/font/Font.cpp950
-rw-r--r--Build/source/libs/graphite/src/font/FontTableCache.h52
-rw-r--r--Build/source/libs/graphite/src/font/Makefile.am7
-rw-r--r--Build/source/libs/graphite/src/font/TtfTypes.h388
-rw-r--r--Build/source/libs/graphite/src/font/TtfUtil.cpp1935
-rw-r--r--Build/source/libs/graphite/src/font/TtfUtil.h147
-rw-r--r--Build/source/libs/graphite/src/generic/BinTree.h71
-rw-r--r--Build/source/libs/graphite/src/generic/BinTree_i.cpp225
-rw-r--r--Build/source/libs/graphite/src/generic/Debug.cpp83
-rw-r--r--Build/source/libs/graphite/src/generic/GenericResource.h86
-rw-r--r--Build/source/libs/graphite/src/generic/HashMap.h328
-rw-r--r--Build/source/libs/graphite/src/generic/HashMap_i.cpp561
-rw-r--r--Build/source/libs/graphite/src/generic/Makefile.am8
-rw-r--r--Build/source/libs/graphite/src/generic/Util.cpp261
-rw-r--r--Build/source/libs/graphite/src/painter/Makefile.am5
-rw-r--r--Build/source/libs/graphite/src/painter/SegmentPainter.cpp2986
-rw-r--r--Build/source/libs/graphite/src/segment/FileInput.cpp266
-rw-r--r--Build/source/libs/graphite/src/segment/FileInput.h104
-rw-r--r--Build/source/libs/graphite/src/segment/FontCache.cpp308
-rw-r--r--Build/source/libs/graphite/src/segment/FontCache.h105
-rw-r--r--Build/source/libs/graphite/src/segment/FontFace.cpp598
-rw-r--r--Build/source/libs/graphite/src/segment/FontFace.h246
-rw-r--r--Build/source/libs/graphite/src/segment/GrCharStream.cpp652
-rw-r--r--Build/source/libs/graphite/src/segment/GrCharStream.h183
-rw-r--r--Build/source/libs/graphite/src/segment/GrClassTable.cpp382
-rw-r--r--Build/source/libs/graphite/src/segment/GrClassTable.h188
-rw-r--r--Build/source/libs/graphite/src/segment/GrEngine.cpp2030
-rw-r--r--Build/source/libs/graphite/src/segment/GrEngine.h622
-rw-r--r--Build/source/libs/graphite/src/segment/GrFSM.cpp526
-rw-r--r--Build/source/libs/graphite/src/segment/GrFSM.h245
-rw-r--r--Build/source/libs/graphite/src/segment/GrFeature.cpp321
-rw-r--r--Build/source/libs/graphite/src/segment/GrFeatureValues.h71
-rw-r--r--Build/source/libs/graphite/src/segment/GrGlyphTable.cpp650
-rw-r--r--Build/source/libs/graphite/src/segment/GrGlyphTable.h429
-rw-r--r--Build/source/libs/graphite/src/segment/GrPass.cpp1995
-rw-r--r--Build/source/libs/graphite/src/segment/GrPass.h748
-rw-r--r--Build/source/libs/graphite/src/segment/GrPassActionCode.cpp1492
-rw-r--r--Build/source/libs/graphite/src/segment/GrPseudoMap.h48
-rw-r--r--Build/source/libs/graphite/src/segment/GrSlotState.cpp1481
-rw-r--r--Build/source/libs/graphite/src/segment/GrSlotState.h1287
-rw-r--r--Build/source/libs/graphite/src/segment/GrSlotStream.cpp2368
-rw-r--r--Build/source/libs/graphite/src/segment/GrSlotStream.h577
-rw-r--r--Build/source/libs/graphite/src/segment/GrTableManager.cpp2691
-rw-r--r--Build/source/libs/graphite/src/segment/GrTableManager.h583
-rw-r--r--Build/source/libs/graphite/src/segment/Main.h181
-rw-r--r--Build/source/libs/graphite/src/segment/Makefile.am26
-rw-r--r--Build/source/libs/graphite/src/segment/MemoryUsage.cpp781
-rw-r--r--Build/source/libs/graphite/src/segment/Platform.cpp113
-rw-r--r--Build/source/libs/graphite/src/segment/Segment.cpp3547
-rw-r--r--Build/source/libs/graphite/src/segment/SegmentAux.cpp256
-rw-r--r--Build/source/libs/graphite/src/segment/TestFSM.cpp3416
-rw-r--r--Build/source/libs/graphite/src/segment/TestPasses.cpp1005
-rw-r--r--Build/source/libs/graphite/src/segment/TransductionLog.cpp2091
-rw-r--r--Build/source/libs/graphite/src/segment/XmlTransductionLog.cpp1583
-rw-r--r--Build/source/libs/graphite/src/segment/resource.h15
-rw-r--r--Build/source/libs/graphite/test/Makefile.am2
-rw-r--r--Build/source/libs/graphite/test/Makefile.in478
-rw-r--r--Build/source/libs/graphite/test/ProfileHarness/GrUtfTextSrc.cpp310
-rw-r--r--Build/source/libs/graphite/test/ProfileHarness/GrUtfTextSrc.h146
-rw-r--r--Build/source/libs/graphite/test/ProfileHarness/Makefile.am14
-rw-r--r--Build/source/libs/graphite/test/ProfileHarness/Makefile.in447
-rw-r--r--Build/source/libs/graphite/test/ProfileHarness/ProfileHarness.cpp476
-rw-r--r--Build/source/libs/graphite/test/ProfileHarness/makefile.vc111
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/GrJustifier.cpp566
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/GrJustifier.h82
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/Makefile.am38
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/Makefile.in478
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/Makefile.vc121
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/RegressionTest.cpp748
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/RtTextSrc.h74
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/SimpleTextSrc.cpp93
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/SimpleTextSrc.h113
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/TestCase.cpp1974
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/TestCase.h245
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/arabicText.wpx137
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/bridgingStackingText.wpx158
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/burmeseText.wpx138
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/grtest_arabic.ttfbin0 -> 304748 bytes
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/grtest_badCmap.ttfbin0 -> 1013012 bytes
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/grtest_badVersion.ttfbin0 -> 58160 bytes
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/grtest_burmese.ttfbin0 -> 176660 bytes
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/grtest_roman.ttfbin0 -> 1069592 bytes
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/grtest_taiviet.ttfbin0 -> 115564 bytes
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/grtest_xline.ttfbin0 -> 61132 bytes
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/main.h89
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/makedebug.bat2
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/readme.txt19
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/romanText.wpx206
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/stdafx.cpp8
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/stdafx.h12
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/taivietText.wpx162
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/xline.gdl146
-rw-r--r--Build/source/libs/graphite/test/RegressionTest/xlineText.wpx132
-rw-r--r--Build/source/libs/graphite/test/examples/burmese/Padauk.ttfbin0 -> 232884 bytes
-rw-r--r--Build/source/libs/graphite/test/examples/burmese/bh1.utx4
-rwxr-xr-xBuild/source/libs/graphite/test/examples/khmer/cloudsku2.txt29
-rwxr-xr-xBuild/source/libs/graphite/test/examples/khmer/mond40gr6.ttfbin0 -> 906948 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errBadGloc.ttfbin0 -> 57988 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errBadGloc2.ttfbin0 -> 57996 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errBadPass.ttfbin0 -> 58132 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errBadStackMachine.ttfbin0 -> 58216 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errBadSubs.ttfbin0 -> 58132 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errBadVersion.ttfbin0 -> 58160 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errGarbageFsm.ttfbin0 -> 58160 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errGarbageGlat.ttfbin0 -> 58144 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errGarbageSilf.ttfbin0 -> 58144 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errSilfVerMismatch.ttfbin0 -> 58252 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errSubsUnderflow.ttfbin0 -> 58196 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/errTooManyClasses.ttfbin0 -> 58200 bytes
-rw-r--r--Build/source/libs/graphite/test/fonterrors/fonterrors.gdl43
-rw-r--r--Build/source/libs/graphite/test/fonterrors/readme.txt43
-rw-r--r--Build/source/libs/graphite/uninstalled-top.pc.in6
-rw-r--r--Build/source/libs/graphite/withenable.ac4
-rw-r--r--Build/source/libs/libpng/ac/libpng.ac3
-rw-r--r--Build/source/libs/libpng/ac/withenable.ac3
-rw-r--r--Build/source/libs/obsdcompat/ac/withenable.ac3
-rw-r--r--Build/source/libs/t1lib/ac/t1lib.ac4
-rw-r--r--Build/source/libs/t1lib/ac/withenable.ac3
-rw-r--r--Build/source/libs/teckit/Makefile.am.orig7
-rw-r--r--Build/source/libs/teckit/ac/teckit.ac3
-rw-r--r--Build/source/libs/teckit/ac/withenable.ac3
-rw-r--r--Build/source/libs/xpdf/ac/withenable.ac3
-rw-r--r--Build/source/libs/zlib/ac/withenable.ac3
-rw-r--r--Build/source/libs/zlib/ac/zlib.ac3
-rw-r--r--Build/source/m4/README28
-rw-r--r--Build/source/m4/kpse-asm.m441
-rw-r--r--Build/source/m4/kpse-common.m4235
-rw-r--r--Build/source/m4/kpse-cross.m450
-rw-r--r--Build/source/m4/kpse-freetype-flags.m429
-rw-r--r--Build/source/m4/kpse-freetype2-flags.m436
-rw-r--r--Build/source/m4/kpse-gd-flags.m429
-rw-r--r--Build/source/m4/kpse-graphite-flags.m430
-rw-r--r--Build/source/m4/kpse-kpathsea-flags.m430
-rw-r--r--Build/source/m4/kpse-lex.m423
-rw-r--r--Build/source/m4/kpse-libpng-flags.m429
-rw-r--r--Build/source/m4/kpse-macos-framework.m423
-rw-r--r--Build/source/m4/kpse-obsdcompat-flags.m421
-rw-r--r--Build/source/m4/kpse-pkgs.m4120
-rw-r--r--Build/source/m4/kpse-setup.m4140
-rw-r--r--Build/source/m4/kpse-t1lib-flags.m428
-rw-r--r--Build/source/m4/kpse-teckit-flags.m430
-rw-r--r--Build/source/m4/kpse-web2c.m482
-rw-r--r--Build/source/m4/kpse-win32.m425
-rw-r--r--Build/source/m4/kpse-xpdf-flags.m430
-rw-r--r--Build/source/m4/kpse-zlib-flags.m428
-rw-r--r--Build/source/m4/libtool.m47357
-rw-r--r--Build/source/m4/ltoptions.m4368
-rw-r--r--Build/source/m4/ltsugar.m4123
-rw-r--r--Build/source/m4/ltversion.m423
-rw-r--r--Build/source/m4/lt~obsolete.m492
-rw-r--r--Build/source/texk/Makefile.in.orig91
-rw-r--r--Build/source/texk/README.orig103
-rw-r--r--Build/source/texk/ac/withenable.ac1
-rw-r--r--Build/source/texk/afm2pl/Makefile.in.orig43
-rw-r--r--Build/source/texk/afm2pl/ac/withenable.ac3
-rw-r--r--Build/source/texk/afm2pl/configure.in.orig25
-rw-r--r--Build/source/texk/am/man.am50
-rw-r--r--Build/source/texk/bibtex8/Makefile.in.orig50
-rw-r--r--Build/source/texk/bibtex8/ac/withenable.ac3
-rw-r--r--Build/source/texk/bibtex8/configure.in.orig13
-rw-r--r--Build/source/texk/cjkutils/Makefile.in.orig14
-rw-r--r--Build/source/texk/cjkutils/ac/withenable.ac3
-rw-r--r--Build/source/texk/cjkutils/configure.in.orig58
-rw-r--r--Build/source/texk/configure.in.orig57
-rw-r--r--Build/source/texk/detex/ac/withenable.ac3
-rw-r--r--Build/source/texk/devnag/ac/withenable.ac3
-rw-r--r--Build/source/texk/dtl/ac/withenable.ac3
-rw-r--r--Build/source/texk/dummy/Makefile.am10
-rw-r--r--Build/source/texk/dummy/Makefile.in420
-rw-r--r--Build/source/texk/dummy/aclocal.m4618
-rwxr-xr-xBuild/source/texk/dummy/configure3403
-rw-r--r--Build/source/texk/dummy/configure.ac21
-rw-r--r--Build/source/texk/dvi2tty/ac/withenable.ac3
-rw-r--r--Build/source/texk/dvidvi/ac/withenable.ac3
-rw-r--r--Build/source/texk/dviljk/Makefile.in.orig112
-rw-r--r--Build/source/texk/dviljk/ac/withenable.ac3
-rw-r--r--Build/source/texk/dviljk/configure.in.orig20
-rw-r--r--Build/source/texk/dvipdfm/Makefile.in.orig81
-rw-r--r--Build/source/texk/dvipdfm/ac/withenable.ac3
-rw-r--r--Build/source/texk/dvipdfm/acinclude.m4.orig105
-rw-r--r--Build/source/texk/dvipdfm/configure.in.orig58
-rw-r--r--Build/source/texk/dvipdfm/m4/maw-time.m434
-rw-r--r--Build/source/texk/dvipdfmx/Makefile.in.orig616
-rw-r--r--Build/source/texk/dvipdfmx/ac/withenable.ac3
-rw-r--r--Build/source/texk/dvipdfmx/configure.in.orig149
-rw-r--r--Build/source/texk/dvipos/ac/withenable.ac3
-rw-r--r--Build/source/texk/dvipsk/Makefile.in.orig164
-rw-r--r--Build/source/texk/dvipsk/ac/withenable.ac3
-rw-r--r--Build/source/texk/dvipsk/configure.in.orig34
-rw-r--r--Build/source/texk/gsftopk/Makefile.in.orig64
-rw-r--r--Build/source/texk/gsftopk/ac/withenable.ac3
-rw-r--r--Build/source/texk/gsftopk/configure.in.orig28
-rw-r--r--Build/source/texk/kpathsea/Makefile.in.orig258
-rw-r--r--Build/source/texk/kpathsea/common.ac.orig117
-rw-r--r--Build/source/texk/kpathsea/configure.in.orig73
-rw-r--r--Build/source/texk/lacheck/ac/withenable.ac3
-rw-r--r--Build/source/texk/makeindexk/Makefile.in.orig54
-rw-r--r--Build/source/texk/makeindexk/ac/withenable.ac3
-rw-r--r--Build/source/texk/makeindexk/configure.in.orig18
-rw-r--r--Build/source/texk/musixflx/Makefile.in.orig42
-rw-r--r--Build/source/texk/musixflx/ac/withenable.ac3
-rw-r--r--Build/source/texk/musixflx/configure.in.orig14
-rw-r--r--Build/source/texk/one/Makefile.am24
-rw-r--r--Build/source/texk/one/Makefile.in764
-rw-r--r--Build/source/texk/one/ac/withenable.ac4
-rw-r--r--Build/source/texk/one/aclocal.m4921
-rw-r--r--Build/source/texk/one/config.h.in59
-rwxr-xr-xBuild/source/texk/one/configure13781
-rw-r--r--Build/source/texk/one/configure.ac28
-rw-r--r--Build/source/texk/one/one.c16
-rw-r--r--Build/source/texk/ps2pkm/Makefile.in.orig64
-rw-r--r--Build/source/texk/ps2pkm/ac/withenable.ac3
-rw-r--r--Build/source/texk/ps2pkm/configure.in.orig23
-rw-r--r--Build/source/texk/seetexk/ac/withenable.ac3
-rw-r--r--Build/source/texk/tetex/Makefile.in.orig113
-rw-r--r--Build/source/texk/tetex/configure.in.orig12
-rw-r--r--Build/source/texk/tex4htk/Makefile.in.orig79
-rw-r--r--Build/source/texk/tex4htk/ac/withenable.ac3
-rw-r--r--Build/source/texk/tex4htk/configure.in.orig11
-rw-r--r--Build/source/texk/ttf2pk/Makefile.in.orig64
-rw-r--r--Build/source/texk/ttf2pk/ac/withenable.ac3
-rw-r--r--Build/source/texk/ttf2pk/configure.in.orig19
-rw-r--r--Build/source/texk/ttfdump/Makefile.in.orig148
-rw-r--r--Build/source/texk/ttfdump/ac/withenable.ac3
-rw-r--r--Build/source/texk/ttfdump/configure.in.orig31
-rw-r--r--Build/source/texk/web2c/Makefile.in.orig1144
-rw-r--r--Build/source/texk/web2c/ac/web2c.ac62
-rw-r--r--Build/source/texk/web2c/ac/withenable.ac4
-rw-r--r--Build/source/texk/web2c/alephdir/am/aleph.am102
-rw-r--r--Build/source/texk/web2c/am/bootstrap.am110
-rw-r--r--Build/source/texk/web2c/am/cweb.am30
-rw-r--r--Build/source/texk/web2c/am/texmf.am108
-rw-r--r--Build/source/texk/web2c/am/web.am166
-rw-r--r--Build/source/texk/web2c/cftests/cftest.ch7
-rw-r--r--Build/source/texk/web2c/cftests/cftest.p2
-rw-r--r--Build/source/texk/web2c/cftests/cftest.web15
-rw-r--r--Build/source/texk/web2c/cftests/lcftest.p2
-rw-r--r--Build/source/texk/web2c/cftests/ocftest.p2
-rw-r--r--Build/source/texk/web2c/configure.in.orig502
-rw-r--r--Build/source/texk/web2c/doc/Makefile.in.orig64
-rw-r--r--Build/source/texk/web2c/etexdir/am/etex.am77
-rw-r--r--Build/source/texk/web2c/luatexdir/am/luatex.am564
-rw-r--r--Build/source/texk/web2c/mpdir/Makefile.in.orig41
-rw-r--r--Build/source/texk/web2c/mpdir/am/mp.am59
-rw-r--r--Build/source/texk/web2c/mpware/Makefile.in.orig63
-rw-r--r--Build/source/texk/web2c/omegadir/am/omega.am88
-rw-r--r--Build/source/texk/web2c/omegafonts/Makefile.in.orig73
-rw-r--r--Build/source/texk/web2c/omegaware/am/omegaware.am106
-rwxr-xr-xBuild/source/texk/web2c/omegaware/otangle.test7
-rw-r--r--Build/source/texk/web2c/otps/Makefile.in.orig53
-rw-r--r--Build/source/texk/web2c/pdftexdir/Makefile.in.orig71
-rw-r--r--Build/source/texk/web2c/pdftexdir/am/pdftex.am163
-rw-r--r--Build/source/texk/web2c/synctexdir/am/synctex.am172
-rw-r--r--Build/source/texk/web2c/synctexdir/am/synctex.mk42
-rwxr-xr-xBuild/source/texk/web2c/tiedir/tie.test12
-rw-r--r--Build/source/texk/web2c/web2c/native/config.h119
-rw-r--r--Build/source/texk/web2c/web2c/native/kpathsea/c-auto.in181
-rw-r--r--Build/source/texk/web2c/xetexdir/am/xetex.am71
-rw-r--r--Build/source/texk/xdv2pdf/Makefile.in.orig80
-rw-r--r--Build/source/texk/xdv2pdf/ac/withenable.ac3
-rw-r--r--Build/source/texk/xdv2pdf/configure.in.orig66
-rw-r--r--Build/source/texk/xdvipdfmx/Makefile.in.orig660
-rw-r--r--Build/source/texk/xdvipdfmx/ac/withenable.ac3
-rw-r--r--Build/source/texk/xdvipdfmx/configure.in.orig181
-rw-r--r--Build/source/utils/README.orig83
-rw-r--r--Build/source/utils/ac/withenable.ac1
-rw-r--r--Build/source/utils/dialog/ac/withenable.ac3
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/CHANGES1429
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/COPYING504
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/README61
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/VERSION1
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/arrows.c111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/buttons.c655
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/calendar.c645
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/checklist.c704
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/columns.c174
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/config.guess1516
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/config.hin4
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/config.sub1626
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/configure11878
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/configure.in183
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/dialog-config.in135
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/dialog.11247
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/dialog.32617
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/dialog.c1695
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/dialog.h758
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/dialog.lsm23
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/dialog.pl454
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/dlg_colors.h182
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/dlg_keys.c725
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/dlg_keys.h130
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/editbox.c683
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/formbox.c886
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/fselect.c856
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/guage.c239
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/headers-sh.in150
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/inputbox.c217
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/inputstr.c745
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/install-sh294
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/makefile.in235
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/menubox.c808
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/mixedform.c121
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/mixedgauge.c393
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/mkdirs.sh51
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/mouse.c139
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/mousewget.c91
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/msgbox.c311
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/pause.c221
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/POTFILES.in32
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/ar.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/be@latin.po109
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/bg.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/ca.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/cs.po108
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/cy.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/da.po109
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/de.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/dialog.pot109
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/el.po107
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/eo.po109
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/es.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/et.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/eu.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/fi.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/fr.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/ga.po108
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/gl.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/hi.po112
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/hr.po109
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/hu.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/id.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/it.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/ja.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/ku.po112
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/lt.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/makefile.inn261
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/mg.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/mk.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/ms.po109
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/nb.po108
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/nl.po112
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/pl.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/pt.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/pt_BR.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/rm.po113
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/ro.po114
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/ru.po114
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/rw.po126
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/sq.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/sr.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/sv.po109
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/th.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/tr.po112
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/uk.po113
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/vi.po113
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/wa.po110
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/zh_CN.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/po/zh_TW.po111
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/progressbox.c187
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/rc.c587
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/README40
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/calendar17
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/calendar-stdout14
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/calendar217
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/calendar2-stdout14
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/calendar321
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/calendar3-stdout18
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist42
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist-8bit44
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist-utf851
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist142
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist1040
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist240
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist340
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist440
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist541
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist642
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist746
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist845
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/checklist923
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist9.txt21
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/admin.funcs200
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/common.funcs338
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.funcs1303
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifman129
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifman2137
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg268
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg430
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg514
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifpoll19
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifpoll2107
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifreq120
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifreq268
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.rcnews79
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.sendifm174
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.sendifm215
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.trnrc13
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.wheel54
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/ifpatch101
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/copismall296
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/debian.rc117
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/dialog.py353
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/dselect21
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/editbox55
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/editbox-utf856
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/editbox258
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/editbox331
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/form167
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/form1-both68
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/form1-extra68
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/form1-help68
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/form1-utf877
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/form283
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/form368
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/form469
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/form570
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/form670
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/fselect21
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/fselect-stdout14
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/fselect126
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/fselect1-stdout23
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/fselect217
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/fselect2-stdout14
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/gauge21
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/gauge022
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/gauge0-input-fd26
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/gauge227
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/gauge321
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/infobox20
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/infobox120
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/infobox220
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/infobox321
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/infobox421
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/infobox538
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/infobox640
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox32
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-both38
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-extra37
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-help37
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox134
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox232
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox333
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox431
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox533
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-8bit29
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-utf836
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputbox740
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu59
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu-stdout52
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu184
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu296
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu3105
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu485
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/install/FDISK.TEST28
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/install/makefile.in35
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/install/setup.c371
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/install/setup.help49
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/killall13
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/listing8
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox36
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox-8bit38
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox-utf845
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox139
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox1035
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox239
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox340
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox440
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox543
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox641
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox744
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox843
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/menubox939
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/mixedform60
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/mixedform260
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/mixedgauge24
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox15
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox-help22
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox133
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox233
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox321
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-8bit34
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-eucjp24
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-utf847
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox522
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox616
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/msgbox6a16
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/password32
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/password133
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/password233
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/passwordform168
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/passwordform1-utf877
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/pause16
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/pause-help24
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/progress19
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/progress219
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/radiolist36
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/radiolist1040
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/radiolist238
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/radiolist342
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/radiolist442
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/rotated-data23
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/slackware.rc124
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/sourcemage.rc123
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/suse.rc126
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/tailbox18
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg22
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg132
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg233
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/testdata-8bit39
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/textbox53
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox.txt24
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/textbox253
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/textbox329
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/timebox17
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/timebox-stdout14
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/timebox217
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/timebox2-stdout14
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/wheel63
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/samples/whiptail.rc116
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/yesno22
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/yesno-both32
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/yesno-extra31
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/yesno-help26
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/yesno222
-rwxr-xr-xBuild/source/utils/dialog/dialog-1.1-20080819/samples/yesno322
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/tailbox.c364
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/textbox.c961
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/timebox.c388
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/trace.c154
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/ui_getc.c450
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/util.c2040
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/version.c33
-rw-r--r--Build/source/utils/dialog/dialog-1.1-20080819/yesno.c151
-rw-r--r--Build/source/utils/dummy/Makefile.am10
-rw-r--r--Build/source/utils/dummy/Makefile.in420
-rw-r--r--Build/source/utils/dummy/aclocal.m4618
-rwxr-xr-xBuild/source/utils/dummy/configure3403
-rw-r--r--Build/source/utils/dummy/configure.ac21
-rw-r--r--Build/source/utils/pdfopen/Makefile.am.orig12
-rw-r--r--Build/source/utils/pdfopen/ac/withenable.ac3
-rw-r--r--Build/source/utils/pdfopen/configure.ac.orig25
-rw-r--r--Build/source/utils/ps2eps/Makefile.in.orig53
-rw-r--r--Build/source/utils/ps2eps/ac/withenable.ac3
-rw-r--r--Build/source/utils/ps2eps/configure.in.orig9
-rw-r--r--Build/source/utils/psutils/Makefile.in.orig230
-rw-r--r--Build/source/utils/psutils/ac/withenable.ac3
-rw-r--r--Build/source/utils/psutils/configure.in.orig15
-rw-r--r--Build/source/utils/t1utils/ac/withenable.ac3
-rw-r--r--Build/source/utils/tpic2pdftex/Makefile.in.orig57
-rw-r--r--Build/source/utils/tpic2pdftex/ac/withenable.ac3
-rw-r--r--Build/source/utils/tpic2pdftex/configure.ac.orig15
652 files changed, 225688 insertions, 0 deletions
diff --git a/Build/source/Makefile.in.orig b/Build/source/Makefile.in.orig
new file mode 100644
index 00000000000..9b8886dc1c2
--- /dev/null
+++ b/Build/source/Makefile.in.orig
@@ -0,0 +1,146 @@
+# $Id$
+# @configure_input@
+# Makefile for teTeX distribution, also used for TeX Live.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+srcdir = @srcdir@
+VPATH = $(srcdir)
+
+SHELL = /bin/sh
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+scriptdir = $(bindir)
+texmf = @texmfmain@
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_DATA = @INSTALL_DATA@
+
+NCURSESDIR=libs/ncurses
+ZLIBDIR=libs/zlib
+LIBPNGDIR=libs/libpng
+LIBT1DIR=libs/t1lib
+LIBTYPE1DIR=$(LIBT1DIR)/../type1
+LIBXPDFDIR=libs/xpdf
+GDDIR=libs/gd
+FREETYPEDIR=libs/freetype
+FREETYPE2DIR=libs/freetype2
+ICUDIR=libs/icu-xetex
+TECKITDIR=libs/teckit
+LIBOBSDCOMPATDIR=libs/obsdcompat
+GRAPHITEDIR=libs/graphite-engine
+
+# Subdirectories that have makefiles
+ESUBDIRS = @ESUBDIRS@ texk
+LIBSDIRS = @LIBSDIRS@
+
+# Subdirectories for which we want to run make (un)install; these are
+# different for xdvik standalone distribution where we don't want to
+# install kpathsea and friends by default.
+INSTDIRS = @INSTDIRS@
+
+default: all
+install install-exec install-data uninstall: all
+ for dir in $(INSTDIRS); do \
+ echo making $@ in $$dir; \
+ (cd $$dir && $(MAKE) $@) || exit 1; \
+ done
+# only do this at make install, because the binaries won't be there with
+# just install-data, and fmtutil.cnf won't be there with just install-exec.
+ if test "$@" = install; then \
+ echo "top-level make $@: running texlinks ..."; \
+ cd texk/tetex && $(MAKE) run-texlinks; \
+ fi
+
+strip: install
+ cd $(bindir) && strip * >/dev/null 2>&1 || true
+
+check:
+ cd texk; TEXMF='{$(texmf),$(texmf)-dist}' TEXMFCNF=$(texmf)/web2c $(MAKE) $@
+
+Makefile: Makefile.in config.status
+ $(SHELL) ./config.status
+
+all clean mostlyclean:
+ esubdirs="$(LIBSDIRS) $(ESUBDIRS)"; \
+ for dir in $$esubdirs; do \
+ echo making $@ in $$dir; \
+ (if test -f $$dir/Makefile; then cd $$dir && $(MAKE) $@; else true; fi) || exit 1; \
+ done
+ @echo "make $@ done."
+
+# to build libraries only, when working on drivers.
+lib: @LIBSDEP@
+
+distclean: clean
+ cleandirs="$(LIBSDIRS) $(ESUBDIRS)"; \
+ for dir in $$cleandirs; do \
+ echo making $@ in $$dir; \
+ (if test -f $$dir/Makefile; then cd $$dir && $(MAKE) $@; else true; fi) || exit 1; \
+ done
+ rm -f Makefile *.status *.cache *.log dialogconfig.h TAGS
+ rm -f libs/config.log libs/config.status libs/config.cache
+realclean: distclean
+
+tags TAGS:
+ rm -f TAGS
+ find . -name '*.[ch]' -print | xargs etags --append -o TAGS
+
+#
+# This is the default target for the Build script in TeX Live.
+world: strip
+ @echo "make $@ done."
+
+pdftex pdfetex:
+ cd texk/web2c && $(MAKE) $@
+ test -f texk/web2c/pdftex && ls -l texk/web2c/pdftex
+ test -f texk/web2c/pdfetex && ls -l texk/web2c/pdfetex
+
+$(NCURSESDIR)/lib/libncurses.a:
+ cd $(NCURSESDIR); $(MAKE)
+$(ZLIBDIR)/libz.a:
+ cd $(ZLIBDIR); $(MAKE) libz.a
+$(LIBPNGDIR)/libpng.a:
+ cd $(LIBPNGDIR); $(MAKE) libpng.a
+$(LIBT1DIR)/libt1.a:
+ cd $(LIBT1DIR); $(MAKE) libt1.a
+$(LIBTYPE1DIR)/libtype1.a:
+ cd $(LIBTYPE1DIR); $(MAKE) libtype1.a
+$(LIBXPDFDIR)/xpdf/libxpdf.a:
+ cd $(LIBXPDFDIR)/xpdf; $(MAKE) libxpdf.a
+$(LIBXPDFDIR)/goo/libGoo.a:
+ cd $(LIBXPDFDIR)/goo; $(MAKE) libGoo.a
+$(LIBXPDFDIR)/fofi/libfofi.a:
+ cd $(LIBXPDFDIR)/fofi; $(MAKE) libfofi.a
+$(GDDIR)/libgd.a:
+ cd $(GDDIR); $(MAKE) libgd.a
+$(FREETYPEDIR)/lib/.libs/libttf.a:
+ cd $(FREETYPEDIR); $(MAKE)
+$(FREETYPE2DIR)/.libs/libfreetype.a:
+ cd $(FREETYPE2DIR); $(MAKE)
+$(ICUDIR)/lib/libsicuuc.a $(ICUDIR)/lib/libsicule.a $(ICUDIR)/lib/libsicudata.a:
+ cd $(ICUDIR); $(MAKE)
+$(TECKITDIR)/lib/.libs/libTECkit.a:
+ cd $(TECKITDIR); $(MAKE)
+$(LIBOBSDCOMPATDIR)/libopenbsd-compat.a:
+ cd $(LIBOBSDCOMPATDIR); $(MAKE) libopenbsd-compat.a
+$(GRAPHITEDIR)/src/.libs/libgraphite.a:
+ cd $(GRAPHITEDIR); $(MAKE)
+
+# Prevent GNU make v3 from overflowing arg limit on SysV.
+.NOEXPORT:
diff --git a/Build/source/README.cross b/Build/source/README.cross
new file mode 100644
index 00000000000..a30f666dd44
--- /dev/null
+++ b/Build/source/README.cross
@@ -0,0 +1,3 @@
+ Cross compiling
+ ===============
+
diff --git a/Build/source/README.orig b/Build/source/README.orig
new file mode 100644
index 00000000000..1d05986a26a
--- /dev/null
+++ b/Build/source/README.orig
@@ -0,0 +1,125 @@
+$Id$
+Copyright 2004, 2006, 2007, 2008, 2009 TeX Users Group.
+You may freely use, modify and/or distribute this file.
+
+For a high-level overview of building TeX Live, see
+http://tug.org/texlive/build.html.
+
+To configure and make the source tree, run ./Build.
+To build (mostly) without optimization, run ./Build --debug.
+To make without configuring, run TL_CONFIGURE=true ./Build.
+
+(Nearly everything the Build script does can be overridden via
+environment variables; just take a look to see all the names.)
+
+Prerequisites:
+- GNU make. If your GNU make is invoked by some name other than `make',
+ try setting the envvar TL_MAKE to what is needed.
+
+- GNU clisp and GNU libffcall, must be present for xindy. See more
+ details in utils/README. (Alternative: Build --without-xindy.)
+
+- libfontconfig (again both headers and library) must be present for
+ XeTeX, except on MacOSX. (Alternative: Build --without-xetex.)
+
+- X11 headers and libraries must be present for pdfopen and xdvi.
+
+- Bison and Flex (or maybe equivalents) are needed for web2c.
+
+The binaries will be left in ./inst/bin/<stdplatform>.
+For TeX Live, ignore the other files and directories that end up in ./inst.
+
+The new binaries are not directly usable from that location. Instead,
+copy them to Master/bin/<tlplatformname>/.
+
+That should be it for normal builds. Email tex-live@tug.org if problems.
+
+To make a usable TeX installation, you have to have (thousands of)
+support files as well as the binaries that are built here. The support
+files are maintained completely independently. The best basis for
+dealing with them is the TeX Live (plain text) database,
+Master/tlpkg/texlive.tlpdb, and/or our installer. More information is
+under Master/tlpkg. See also http://tug.org/texlive/distro.html.
+
+For unusual situations:
+
+- If your C++ needs to find the standard library in, say, /usr/local/lib,
+(i.e., configure fails saying the compiler doesn't work), try:
+env LD_OPTIONS=-R/usr/local/lib ./Build
+
+- Running ./reautoconf here reruns autoconf as needed. Use --help for more.
+
+
+Build information:
+ amd64-freebsd: built on Freebsd 7.0-RELEASE amd64,
+ --with-fontconfig=/usr/local
+
+ hppa-hpux: built on HP-UX 10.20, gcc 3.3.4
+ --with-fontconfig=/u/tiarno/fc --without-graphite --without-luatex
+
+ i386-darwin: MacOSX 10.4 with support for 10.3, 10.4, and 10.5
+
+ i386-linux: Debian sarge, gcc 3.3.5, libc 2.3.2, Linux 2.6.9-67.0.4.ELsmp
+ chroot /home/texlive/sarge; Build --with-xindy --with-clisp=...
+
+ i386-solaris: Solaris 10 11/06 s10x_u3wos_10 X86
+ system gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
+
+ powerpc-darwin: like i386-darwin
+
+ powerpc-linux
+OS: gentoo GNU/Linux
+kernel 2.6.23
+gcc (GCC) 4.2.3 (Gentoo 4.2.3 p1.0)))
+bison (GNU Bison) 2.3)
+flex 2.5.35
+m4 (GNU M4) 1.4.11)
+GNU Make 3.81
+
+ sparc-solaris
+OS: Sun Solaris 8
+compiler: Sun Studio 11
+bison (GNU Bison) 2.3
+flex version 2.5.4
+GNU m4 1.4.5
+GNU Make 3.81
+ xe(la)tex and xdvipdfmx depend on fontconfig.
+ Because Solaris 8 does not include fontconfig, we used fontconfig
+ package (version 2.3.2) from http://www.blastwave.org/
+ (together with it's dependencies)
+
+ sparc-linux
+OS: Debian GNU/Linux 3.1 (Sarge), kernel 2.4.27-2-sparc64
+gcc (GCC) 3.3.5 (Debian 1:3.3.5-13)
+bison (GNU Bison) 1.875d
+flex 2.5.31
+GNU m4 1.4.2
+GNU Make 3.80
+
+ powerpc-aix
+OS: AIX 4.3
+compiler: IBM C for AIX Compiler, Version 5 (xlc)
+bison (GNU Bison) 1.34
+flex version 2.5.4
+GNU m4 1.4
+GNU Make 3.79.1
+ xe(la)tex and xdvipdfmx depend on fontconfig.
+ You can download fontconfig for AIX from
+ http://www-03.ibm.com/servers/aix/products/aixos/linux/download.html
+ ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/fontconfig/
+
+ alpha-linux
+OS: Debian GNU/Linux 4.0 (Etch), kernel 2.4.34.6
+gcc (GCCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
+bison (GNU Bison) 2.3
+flex 2.5.33
+GNU M4 1.4.8
+GNU Make 3.81
+ Remarks:
+ - you have to set the ulimit high enough before compiling clisp and texlive
+ ulimit -s 16384
+ did suffice for me
+ - compiling of texk/web2c/pdftexdir/writezip.c is broken and triggers a
+ compiler error with the above gcc. Disabling optimization -O2 using
+ Build --debug ... resolved this problem.
+
diff --git a/Build/source/ac/withenable.ac b/Build/source/ac/withenable.ac
new file mode 100644
index 00000000000..fd7510220bf
--- /dev/null
+++ b/Build/source/ac/withenable.ac
@@ -0,0 +1 @@
+## ac/withenable.ac
diff --git a/Build/source/build-aux/README.TL b/Build/source/build-aux/README.TL
new file mode 100644
index 00000000000..7c2e973a185
--- /dev/null
+++ b/Build/source/build-aux/README.TL
@@ -0,0 +1,3 @@
+This directory is the central repository for auxiliary files, mostly shell
+scripts, needed to build the teTeX / TeX live (TL) tree. They are used by
+all packages `owned' by the TL tree, i.e., maintained as part of TL.
diff --git a/Build/source/build-aux/config.guess b/Build/source/build-aux/config.guess
new file mode 100755
index 00000000000..ca2a03ca4f1
--- /dev/null
+++ b/Build/source/build-aux/config.guess
@@ -0,0 +1,1526 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2008-01-08'
+
+# 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, 2006, 2007, 2008 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:*:[456])
+ 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 ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 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:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ 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 ${UNAME_MACHINE}-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:
diff --git a/Build/source/build-aux/config.sub b/Build/source/build-aux/config.sub
new file mode 100755
index 00000000000..6759825a5b7
--- /dev/null
+++ b/Build/source/build-aux/config.sub
@@ -0,0 +1,1658 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2008-01-16'
+
+# 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, 2006, 2007, 2008 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 basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ 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
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ 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
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) 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
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ 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:
diff --git a/Build/source/build-aux/depcomp b/Build/source/build-aux/depcomp
new file mode 100755
index 00000000000..e5f9736c723
--- /dev/null
+++ b/Build/source/build-aux/depcomp
@@ -0,0 +1,589 @@
+#! /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:
diff --git a/Build/source/build-aux/install-sh b/Build/source/build-aux/install-sh
new file mode 100755
index 00000000000..a5897de6ea7
--- /dev/null
+++ b/Build/source/build-aux/install-sh
@@ -0,0 +1,519 @@
+#!/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:
diff --git a/Build/source/build-aux/ltmain.sh b/Build/source/build-aux/ltmain.sh
new file mode 100755
index 00000000000..b36c4ad366c
--- /dev/null
+++ b/Build/source/build-aux/ltmain.sh
@@ -0,0 +1,8406 @@
+# Generated from ltmain.m4sh.
+
+# ltmain.sh (GNU libtool) 2.2.6
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 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
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print informational messages (default)
+# --version print version information
+# -h, --help print short or long help message
+#
+# MODE must be one of the following:
+#
+# clean remove files from the build directory
+# compile compile a source file into a libtool object
+# execute automatically set library path, then run a program
+# finish complete the installation of libtool libraries
+# install install libraries or executables
+# link create a library or an executable
+# uninstall remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.
+# 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.2.6
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=2.2.6
+TIMESTAMP=""
+package_revision=1.3012
+
+# 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
+
+# NLS nuisances: We save the old values to restore during execute mode.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+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
+
+$lt_unset CDPATH
+
+
+
+
+
+: ${CP="cp -f"}
+: ${ECHO="echo"}
+: ${EGREP="/usr/bin/grep -E"}
+: ${FGREP="/usr/bin/grep -F"}
+: ${GREP="/usr/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/opt/local/bin/gsed"}
+: ${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_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 "X${1}" | $Xsed -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 "X${1}" | $Xsed -e "$basename"`
+}
+
+# Generated shell functions inserted here.
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+# In the unlikely event $progname began with a '-', it would play havoc with
+# func_echo (imagine progname=-n), so we prepend ./ in that case:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+case $progname in
+ -*) progname=./$progname ;;
+esac
+
+# 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=:
+ 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'
+
+# 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${mode+: }$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_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname${mode+: }$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 "X$my_directory_path" | $Xsed -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e '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 "X$my_tmpdir" | $Xsed
+}
+
+
+# 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 "X$1" | $Xsed -e "$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 "X$1" | $Xsed \
+ -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_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $SED -n '/^# '$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 ()
+{
+ $SED -n '/^# Usage:/,/# -h/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ $ECHO
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help
+# Echo long help message to standard output and exit.
+func_help ()
+{
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ 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 --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ func_error "missing argument for $1"
+ exit_cmd=exit
+}
+
+exit_cmd=:
+
+
+
+
+
+# Check that we have a working $ECHO.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell, and then maybe $ECHO will work.
+ exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit $EXIT_SUCCESS
+fi
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
+
+# 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_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
+}
+
+# Parse options once, thoroughly. This comes as soon as possible in
+# the script to make things like `libtool --version' happen quickly.
+{
+
+ # 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
+
+ # Parse non-mode specific arguments:
+ while test "$#" -gt 0; do
+ opt="$1"
+ shift
+
+ case $opt in
+ --config) func_config ;;
+
+ --debug) preserve_args="$preserve_args $opt"
+ func_echo "enabling shell trace mode"
+ opt_debug='set -x'
+ $opt_debug
+ ;;
+
+ -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ execute_dlfiles="$execute_dlfiles $1"
+ shift
+ ;;
+
+ --dry-run | -n) opt_dry_run=: ;;
+ --features) func_features ;;
+ --finish) mode="finish" ;;
+
+ --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ case $1 in
+ # Valid mode arguments:
+ clean) ;;
+ compile) ;;
+ execute) ;;
+ finish) ;;
+ install) ;;
+ link) ;;
+ relink) ;;
+ uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+ esac
+
+ mode="$1"
+ shift
+ ;;
+
+ --preserve-dup-deps)
+ opt_duplicate_deps=: ;;
+
+ --quiet|--silent) preserve_args="$preserve_args $opt"
+ opt_silent=:
+ ;;
+
+ --verbose| -v) preserve_args="$preserve_args $opt"
+ opt_silent=false
+ ;;
+
+ --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
+ preserve_args="$preserve_args $opt $1"
+ func_enable_tag "$1" # tagname is set here
+ shift
+ ;;
+
+ # Separate optargs to long options:
+ -dlopen=*|--mode=*|--tag=*)
+ func_opt_split "$opt"
+ set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) opt_help=: ;;
+ --version) func_version ;;
+
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+
+ *) nonopt="$opt"
+ break
+ ;;
+ esac
+ done
+
+
+ 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_duplicate_deps
+ ;;
+ esac
+
+ # Having warned about all mis-specified options, bail out if
+ # anything was wrong.
+ $exit_cmd $EXIT_FAILURE
+}
+
+# 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
+}
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+$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
+
+ test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$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=$mode' for more information."
+}
+
+
+# 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_ltwrapper_scriptname_result=""
+ if func_ltwrapper_executable_p "$1"; then
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+ fi
+}
+
+# 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_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_quote_for_eval "$arg"
+ CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ done
+ 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 "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+ # 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_quote_for_eval "$arg"
+ CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ done
+ case "$@ " in
+ " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+ # 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}"
+ }
+}
+
+# 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)
+ pie_flag="$pie_flag $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ later="$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_quote_for_eval "$arg"
+ lastarg="$lastarg $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_quote_for_eval "$lastarg"
+ base_compile="$base_compile $func_quote_for_eval_result"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ removelist="$removelist $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ removelist="$removelist $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+test "$mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to building PIC objects only
+ -prefer-non-pic try to building non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$mode'"
+ ;;
+ esac
+
+ $ECHO
+ $ECHO "Try \`$progname --help' for more information about other modes."
+
+ exit $?
+}
+
+ # Now that we've collected a possible --mode arg, show help if necessary
+ $opt_help && func_mode_help
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_quote_for_eval "$file"
+ args="$args $func_quote_for_eval_result"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ $ECHO "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ $ECHO "X----------------------------------------------------------------------" | $Xsed
+ $ECHO "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ $ECHO
+ $ECHO "If you ever happen to want to link against installed libraries"
+ $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
+ $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ $ECHO "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ $ECHO " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
+ $ECHO " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ $ECHO
+
+ $ECHO "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ $ECHO "pages."
+ ;;
+ *)
+ $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ $ECHO "X----------------------------------------------------------------------" | $Xsed
+ exit $EXIT_SUCCESS
+}
+
+test "$mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ install_prog="$install_prog$func_quote_for_eval_result"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ case " $install_prog " in
+ *[\\\ /]cp\ *) ;;
+ *) prev=$arg ;;
+ esac
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ install_prog="$install_prog $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_verbose "extracting global C symbols from \`$progfile'"
+ $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+/* DATA imports from DLLs on WIN32 con't be const, because
+ runtime relocations are performed -- see ld's documentation
+ on pseudo-relocs. */"
+ lt_dlsym_const= ;;
+ *osf5*)
+ echo >> "$output_objdir/$my_dlsyms" "\
+/* This system does not cope well with relocations in const data */"
+ lt_dlsym_const= ;;
+ *)
+ lt_dlsym_const=const ;;
+ esac
+
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+extern $lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+$lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ $ECHO >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) symtab_cflags="$symtab_cflags $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+ $opt_debug
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+
+# func_emit_wrapper_part1 [arg=no]
+#
+# Emit the first part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part1 ()
+{
+ func_emit_wrapper_part1_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_part1_arg1=$1
+ fi
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ ECHO=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$ECHO works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$ECHO will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $ECHO "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+"
+}
+# end: func_emit_wrapper_part1
+
+# func_emit_wrapper_part2 [arg=no]
+#
+# Emit the second part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part2 ()
+{
+ func_emit_wrapper_part2_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_part2_arg1=$1
+ fi
+
+ $ECHO "\
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+# end: func_emit_wrapper_part2
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=no
+ if test -n "$1" ; then
+ func_emit_wrapper_arg1=$1
+ fi
+
+ # split this up so that func_emit_cwrapperexe_src
+ # can call each part independently.
+ func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+ func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
+}
+
+
+# func_to_host_path arg
+#
+# Convert paths to host format when used with build tools.
+# Intended for use with "native" mingw (where libtool itself
+# is running under the msys shell), or in the following cross-
+# build environments:
+# $build $host
+# mingw (msys) mingw [e.g. native]
+# cygwin mingw
+# *nix + wine mingw
+# where wine is equipped with the `winepath' executable.
+# In the native mingw case, the (msys) shell automatically
+# converts paths for any non-msys applications it launches,
+# but that facility isn't available from inside the cwrapper.
+# Similar accommodations are necessary for $host mingw and
+# $build cygwin. Calling this function does no harm for other
+# $host/$build combinations not listed above.
+#
+# ARG is the path (on $build) that should be converted to
+# the proper representation for $host. The result is stored
+# in $func_to_host_path_result.
+func_to_host_path ()
+{
+ func_to_host_path_result="$1"
+ if test -n "$1" ; then
+ case $host in
+ *mingw* )
+ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+ case $build in
+ *mingw* ) # actually, msys
+ # awkward: cmd appends spaces to result
+ lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+ func_to_host_path_tmp1=`( cmd //c echo "$1" |\
+ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ *cygwin* )
+ func_to_host_path_tmp1=`cygpath -w "$1"`
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ * )
+ # 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_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ # Allow warning below.
+ func_to_host_path_result=""
+ fi
+ ;;
+ esac
+ if test -z "$func_to_host_path_result" ; then
+ func_error "Could not determine host path corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_path_result="$1"
+ fi
+ ;;
+ esac
+ fi
+}
+# end: func_to_host_path
+
+# func_to_host_pathlist arg
+#
+# Convert pathlists to host format when used with build tools.
+# See func_to_host_path(), above. This function supports the
+# following $build/$host combinations (but does no harm for
+# combinations not listed here):
+# $build $host
+# mingw (msys) mingw [e.g. native]
+# cygwin mingw
+# *nix + wine mingw
+#
+# 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.
+#
+# ARG is a pathlist (on $build) that should be converted to
+# the proper representation on $host. The result is stored
+# in $func_to_host_pathlist_result.
+func_to_host_pathlist ()
+{
+ func_to_host_pathlist_result="$1"
+ if test -n "$1" ; then
+ case $host in
+ *mingw* )
+ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+ # 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_to_host_pathlist_tmp2="$1"
+ # Once set for this call, this variable should not be
+ # reassigned. It is used in tha fallback case.
+ func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e 's|^:*||' -e 's|:*$||'`
+ case $build in
+ *mingw* ) # Actually, msys.
+ # Awkward: cmd appends spaces to result.
+ lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+ func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
+ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ *cygwin* )
+ func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+ $SED -e "$lt_sed_naive_backslashify"`
+ ;;
+ * )
+ # unfortunately, winepath doesn't convert pathlists
+ func_to_host_pathlist_result=""
+ func_to_host_pathlist_oldIFS=$IFS
+ IFS=:
+ for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+ IFS=$func_to_host_pathlist_oldIFS
+ if test -n "$func_to_host_pathlist_f" ; then
+ func_to_host_path "$func_to_host_pathlist_f"
+ if test -n "$func_to_host_path_result" ; then
+ if test -z "$func_to_host_pathlist_result" ; then
+ func_to_host_pathlist_result="$func_to_host_path_result"
+ else
+ func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
+ fi
+ fi
+ fi
+ IFS=:
+ done
+ IFS=$func_to_host_pathlist_oldIFS
+ ;;
+ esac
+ if test -z "$func_to_host_pathlist_result" ; then
+ func_error "Could not determine the host path(s) corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This may break if $1 contains DOS-style drive
+ # specifications. The fix is not to complicate the expression
+ # below, but for the user to provide a working wine installation
+ # with winepath so that path translation in the cross-to-mingw
+ # case works properly.
+ lt_replace_pathsep_nix_to_dos="s|:|;|g"
+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+ $SED -e "$lt_replace_pathsep_nix_to_dos"`
+ fi
+ # Now, add the leading and trailing path separators back
+ case "$1" in
+ :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+ ;;
+ esac
+ case "$1" in
+ *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+}
+# end: func_to_host_pathlist
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "$SHELL $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat <<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+# define setmode _setmode
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# define HAVE_SETENV
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+#ifdef _MSC_VER
+# define S_IXUSR _S_IEXEC
+# define stat _stat
+# ifndef _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifdef __CYGWIN__
+# define FOPEN_WB "wb"
+#endif
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#undef LTWRAPPER_DEBUGPRINTF
+#if defined DEBUGWRAPPER
+# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+static void
+ltwrapper_debugprintf (const char *fmt, ...)
+{
+ va_list args;
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+}
+#else
+# define LTWRAPPER_DEBUGPRINTF(args)
+#endif
+
+const char *program_name = NULL;
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_opt_process_env_set (const char *arg);
+void lt_opt_process_env_prepend (const char *arg);
+void lt_opt_process_env_append (const char *arg);
+int lt_split_name_value (const char *arg, char** name, char** value);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+
+static const char *script_text_part1 =
+EOF
+
+ func_emit_wrapper_part1 yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ "/' -e 's/$/\\n"/'
+ echo ";"
+ cat <<EOF
+
+static const char *script_text_part2 =
+EOF
+ func_emit_wrapper_part2 yes |
+ $SED -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ "/' -e 's/$/\\n"/'
+ echo ";"
+
+ cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_pathlist "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_pathlist "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
+
+static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+
+static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
+static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
+ /* argument is putenv-style "foo=bar", value of foo is set to bar */
+
+static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
+static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
+ /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
+
+static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
+static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
+ /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
+ LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+
+ /* very simple arg parsing; don't want to rely on getopt */
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ printf ("%s", script_text_part1);
+ printf ("%s", script_text_part2);
+ return 0;
+ }
+ }
+
+ newargz = XMALLOC (char *, argc + 1);
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal ("Couldn't find %s", argv[0]);
+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+ tmp_pathspec));
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+ actual_cwrapper_path));
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+ target_name));
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
+ {
+ if (argv[i][env_set_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_set_opt_len + 1;
+ lt_opt_process_env_set (p);
+ }
+ else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_set (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_set_opt);
+ continue;
+ }
+ if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
+ {
+ if (argv[i][env_prepend_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_prepend_opt_len + 1;
+ lt_opt_process_env_prepend (p);
+ }
+ else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_prepend (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_prepend_opt);
+ continue;
+ }
+ if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
+ {
+ if (argv[i][env_append_opt_len] == '=')
+ {
+ const char *p = argv[i] + env_append_opt_len + 1;
+ lt_opt_process_env_append (p);
+ }
+ else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
+ {
+ lt_opt_process_env_append (argv[++i]); /* don't copy */
+ }
+ else
+ lt_fatal ("%s missing required argument", env_append_opt);
+ continue;
+ }
+ if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal ("Unrecognized option in %s namespace: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+ LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+ for (i = 0; i < newargc; i++)
+ {
+ LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
+ path ? (*path ? path : "EMPTY!") : "NULL!"));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
+ path ? (*path ? path : "EMPTY!") : "NULL!"));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char *concat_name;
+
+ LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
+ wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+ tmp_pathspec));
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ char *errstr = strerror (errno);
+ lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal ("Could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp (str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+int
+lt_split_name_value (const char *arg, char** name, char** value)
+{
+ const char *p;
+ int len;
+ if (!arg || !*arg)
+ return 1;
+
+ p = strchr (arg, (int)'=');
+
+ if (!p)
+ return 1;
+
+ *value = xstrdup (++p);
+
+ len = strlen (arg) - strlen (*value);
+ *name = XMALLOC (char, len);
+ strncpy (*name, arg, len-1);
+ (*name)[len - 1] = '\0';
+
+ return 0;
+}
+
+void
+lt_opt_process_env_set (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
+ }
+
+ lt_setenv (name, value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_opt_process_env_prepend (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+ char *new_value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
+ }
+
+ new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_opt_process_env_append (const char *arg)
+{
+ char *name = NULL;
+ char *value = NULL;
+ char *new_value = NULL;
+
+ if (lt_split_name_value (arg, &name, &value) != 0)
+ {
+ XFREE (name);
+ XFREE (value);
+ lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
+ }
+
+ new_value = lt_extend_str (getenv (name), value, 1);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ XFREE (name);
+ XFREE (value);
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ (name ? name : "<NULL>"),
+ (value ? value : "<NULL>")));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ weak_libs="$weak_libs $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname '-L' '' "$arg"
+ dir=$func_stripname_result
+ if test -z "$dir"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "*) ;;
+ *)
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot)
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ arg="$arg $wl$func_quote_for_eval_result"
+ compiler_flags="$compiler_flags $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ arg="$arg $wl$func_quote_for_eval_result"
+ compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+ linker_flags="$linker_flags $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+ # -r[0-9][0-9]* specifies the processor on the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+ # +DA*, +DD* enable 64-bit mode on the HP compiler
+ # -q* pass through compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* pass through architecture-specific
+ # compiler args for GCC
+ # -F/path gives path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+ # @file GCC response files
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ compiler_flags="$compiler_flags $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ deplibs="$deplibs $arg"
+ old_deplibs="$old_deplibs $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ dlfiles="$dlfiles $arg"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ dlprefiles="$dlprefiles $arg"
+ prev=
+ else
+ deplibs="$deplibs $arg"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_duplicate_deps ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ libs="$libs $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ case $lib in
+ *.la) func_source "$lib" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) deplibs="$deplibs $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ dir=$func_stripname_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ $ECHO
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because the file extensions .$libext of this argument makes me believe"
+ $ECHO "*** that it is just a static archive that I should not use here."
+ else
+ $ECHO
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $ladir/$objdir/$old_library"
+ old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ newlib_search_path="$newlib_search_path $func_stripname_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath:" in
+ *"$absdir:"*) ;;
+ *) temp_rpath="$temp_rpath$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ $ECHO
+ if test "$linkmode" = prog; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $ECHO
+ $ECHO "*** And there doesn't seem to be a static archive available"
+ $ECHO "*** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ elif test -n "$old_library"; then
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes &&
+ test "$hardcode_minus_L" != yes &&
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ $ECHO
+ $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ $ECHO "*** But as you try to build a module library, libtool will still create "
+ $ECHO "*** a static module, that should work as long as the dlopening application"
+ $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ $ECHO
+ $ECHO "*** However, this would only work if libtool was able to extract symbol"
+ $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $ECHO "*** not find such a program. So, this module is probably useless."
+ $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ *) temp_deplibs="$temp_deplibs $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ newlib_search_path="$newlib_search_path $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ if $opt_duplicate_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_dirname "$deplib" "" "."
+ dir="$func_dirname_result"
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ objs="$objs$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ $ECHO
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ libobjs="$libobjs $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ libobjs="$libobjs $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
+ # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) dlfiles="$dlfiles $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ deplibs="$deplibs System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which I believe you do not have"
+ $ECHO "*** because a test_compile did reveal that the linker did not use it for"
+ $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ newdeplibs="$newdeplibs $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because a test_compile did reveal that the linker did not use this one"
+ $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ $ECHO "*** make it link in! You will probably need to install it or some"
+ $ECHO "*** library that it depends on before this library will be fully"
+ $ECHO "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ newdeplibs="$newdeplibs $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $ECHO
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ $ECHO "*** I have the capability to make that library automatically link in when"
+ $ECHO "*** you link to this library. But I can only do this if you have a"
+ $ECHO "*** shared version of the library, which you do not appear to have"
+ $ECHO "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
+ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
+ done
+ fi
+ if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
+ $GREP . >/dev/null; then
+ $ECHO
+ if test "X$deplibs_check_method" = "Xnone"; then
+ $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ $ECHO "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ $ECHO "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ $ECHO
+ $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ $ECHO "*** a static module, that should work as long as the dlopening"
+ $ECHO "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ $ECHO
+ $ECHO "*** However, this would only work if libtool was able to extract symbol"
+ $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $ECHO "*** not find such a program. So, this module is probably useless."
+ $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ $ECHO "*** The inter-library dependencies that have been dropped here will be"
+ $ECHO "*** automatically added whenever a program is linked with this library"
+ $ECHO "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ $ECHO
+ $ECHO "*** Since this library must not contain undefined symbols,"
+ $ECHO "*** because either the platform does not support them or"
+ $ECHO "*** it was explicitly requested with -no-undefined,"
+ $ECHO "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ dep_rpath="$dep_rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname="$1"
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ delfiles="$delfiles $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ func_len " $cmd"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ libobjs="$libobjs $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linker_flags="$linker_flags $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ $ECHO 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ $ECHO "$obj" >> $output
+ done
+ $ECHO ')' >> $output
+ delfiles="$delfiles $output"
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ $ECHO "$obj" >> $output
+ done
+ delfiles="$delfiles $output"
+ output=$firstobj\"$file_list_spec$output\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=$obj
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ delfiles="$delfiles $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ libobjs="$libobjs $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ compile_command="$compile_command $compile_deplibs"
+ finalize_command="$finalize_command $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *cegcc)
+ # Disable wrappers for cegcc, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Quote $ECHO for shipping.
+ if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
+ case $progpath in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+ esac
+ qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ oldobjs="$oldobjs $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $addlibs
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $ECHO "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ oldobjs="$oldobjs $gentop/$newobj"
+ ;;
+ *) oldobjs="$oldobjs $obj" ;;
+ esac
+ done
+ fi
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ newdependency_libs="$newdependency_libs $libdir/$name"
+ ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ newdlfiles="$newdlfiles $libdir/$name"
+ ;;
+ *) newdlfiles="$newdlfiles $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlfiles="$newdlfiles $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlprefiles="$newdlprefiles $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$mode" = link || test "$mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ RM="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) RM="$RM $arg"; rmforce=yes ;;
+ -*) RM="$RM $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ origobjdir="$objdir"
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ objdir="$origobjdir"
+ else
+ objdir="$dir/$origobjdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$mode" = uninstall && objdir="$dir"
+
+ # Remember objdir for removal later, being careful to avoid duplicates
+ if test "$mode" = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+ case "$mode" in
+ clean)
+ case " $library_names " in
+ # " " in the beginning catches empty $dlname
+ *" $dlname "*) ;;
+ *) rmfiles="$rmfiles $objdir/$dlname" ;;
+ esac
+ test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" &&
+ test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+ objdir="$origobjdir"
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$mode" = uninstall || test "$mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/Build/source/build-aux/missing b/Build/source/build-aux/missing
new file mode 100755
index 00000000000..1c8ff7049d8
--- /dev/null
+++ b/Build/source/build-aux/missing
@@ -0,0 +1,367 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 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.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case $firstarg in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case $firstarg in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/Build/source/build-aux/texinfo.tex b/Build/source/build-aux/texinfo.tex
new file mode 100644
index 00000000000..3569bd5a864
--- /dev/null
+++ b/Build/source/build-aux/texinfo.tex
@@ -0,0 +1,9153 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2008-11-17.21}
+%
+% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+% 2007, 2008 Free Software Foundation, Inc.
+%
+% This texinfo.tex file is free software: you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation, either version 3 of the
+% License, or (at your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program. If not, see <http://www.gnu.org/licenses/>.
+%
+% As a special exception, when this file is read by TeX when processing
+% a Texinfo source document, you may use the result without
+% restriction. (This has been our intent since Texinfo was invented.)
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
+% ftp://tug.org/tex/texinfo.tex
+% (and all CTAN mirrors, see http://www.ctan.org).
+% The texinfo.tex in any given distribution could well be out
+% of date, so if that's what you're using, please check.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever; this makes foo.ps.
+% The extra TeX runs get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages, to some
+% extent. You can get the existing language-specific files from the
+% full Texinfo distribution.
+%
+% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+ \catcode`+=\active \catcode`\_=\active}
+
+
+\chardef\other=12
+
+% We never want plain's \outer definition of \+ in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+% Save some plain tex macros whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexfootnote=\footnote
+\let\ptexgtr=>
+\let\ptexhat=^
+\let\ptexi=\i
+\let\ptexindent=\indent
+\let\ptexinsert=\insert
+\let\ptexlbrace=\{
+\let\ptexless=<
+\let\ptexnewwrite\newwrite
+\let\ptexnoindent=\noindent
+\let\ptexplus=+
+\let\ptexrbrace=\}
+\let\ptexslash=\/
+\let\ptexstar=\*
+\let\ptext=\t
+\let\ptextop=\top
+{\catcode`\'=\active
+\global\let\ptexquoteright'}% Math-mode def from plain.tex.
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Pre-3.0.
+\else
+ \def\linenumber{l.\the\inputlineno:\space}
+\fi
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+
+% Since the category of space is not known, we have to be careful.
+\chardef\spacecat = 10
+\def\spaceisspace{\catcode`\ =\spacecat}
+
+% sometimes characters are active, so we need control sequences.
+\chardef\colonChar = `\:
+\chardef\commaChar = `\,
+\chardef\dashChar = `\-
+\chardef\dotChar = `\.
+\chardef\exclamChar= `\!
+\chardef\lquoteChar= `\`
+\chardef\questChar = `\?
+\chardef\rquoteChar= `\'
+\chardef\semiChar = `\;
+\chardef\underChar = `\_
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+% The following is used inside several \edef's.
+\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
+
+% Hyphenation fixes.
+\hyphenation{
+ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
+ ap-pen-dix bit-map bit-maps
+ data-base data-bases eshell fall-ing half-way long-est man-u-script
+ man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
+ par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
+ spell-ing spell-ings
+ stand-alone strong-est time-stamp time-stamps which-ever white-space
+ wide-spread wrap-around
+}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen\bindingoffset
+\newdimen\normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal. We also make
+% some effort to order the tracing commands to reduce output in the log
+% file; cf. trace.sty in LaTeX.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\def\loggingall{%
+ \tracingstats2
+ \tracingpages1
+ \tracinglostchars2 % 2 gives us more in etex
+ \tracingparagraphs1
+ \tracingoutput1
+ \tracingmacros2
+ \tracingrestores1
+ \showboxbreadth\maxdimen \showboxdepth\maxdimen
+ \ifx\eTeXversion\undefined\else % etex gives us more logging
+ \tracingscantokens1
+ \tracingifs1
+ \tracinggroups1
+ \tracingnesting2
+ \tracingassigns1
+ \fi
+ \tracingcommands3 % 3 gives us more in etex
+ \errorcontextlines16
+}%
+
+% add check for \lastpenalty to plain's definitions. If the last thing
+% we did was a \nobreak, we don't want to insert more space.
+%
+\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
+ \removelastskip\penalty-50\smallskip\fi\fi}
+\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
+ \removelastskip\penalty-100\medskip\fi\fi}
+\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
+ \removelastskip\penalty-200\bigskip\fi\fi}
+
+% For @cropmarks command.
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Output a mark which sets \thischapter, \thissection and \thiscolor.
+% We dump everything together because we only have one kind of mark.
+% This works because we only use \botmark / \topmark, not \firstmark.
+%
+% A mark contains a subexpression of the \ifcase ... \fi construct.
+% \get*marks macros below extract the needed part using \ifcase.
+%
+% Another complication is to let the user choose whether \thischapter
+% (\thissection) refers to the chapter (section) in effect at the top
+% of a page, or that at the bottom of a page. The solution is
+% described on page 260 of The TeXbook. It involves outputting two
+% marks for the sectioning macros, one before the section break, and
+% one after. I won't pretend I can describe this better than DEK...
+\def\domark{%
+ \toks0=\expandafter{\lastchapterdefs}%
+ \toks2=\expandafter{\lastsectiondefs}%
+ \toks4=\expandafter{\prevchapterdefs}%
+ \toks6=\expandafter{\prevsectiondefs}%
+ \toks8=\expandafter{\lastcolordefs}%
+ \mark{%
+ \the\toks0 \the\toks2
+ \noexpand\or \the\toks4 \the\toks6
+ \noexpand\else \the\toks8
+ }%
+}
+% \topmark doesn't work for the very first chapter (after the title
+% page or the contents), so we use \firstmark there -- this gets us
+% the mark with the chapter defs, unless the user sneaks in, e.g.,
+% @setcolor (or @url, or @link, etc.) between @contents and the very
+% first @chapter.
+\def\gettopheadingmarks{%
+ \ifcase0\topmark\fi
+ \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
+}
+\def\getbottomheadingmarks{\ifcase1\botmark\fi}
+\def\getcolormarks{\ifcase2\topmark\fi}
+
+% Avoid "undefined control sequence" errors.
+\def\lastchapterdefs{}
+\def\lastsectiondefs{}
+\def\prevchapterdefs{}
+\def\prevsectiondefs{}
+\def\lastcolordefs{}
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument. Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
+ \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+ \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
+ \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+ %
+ {%
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \indexdummies % don't expand commands in the output.
+ \normalturnoffactive % \ in index entries must not stay \, e.g., if
+ % the page break happens to be in the middle of an example.
+ % We don't want .vr (or whatever) entries like this:
+ % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
+ % "\acronym" won't work when it's read back in;
+ % it needs to be
+ % {\code {{\tt \backslashcurfont }acronym}
+ \shipout\vbox{%
+ % Do this early so pdf references go to the beginning of the page.
+ \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
+ %
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
+ \pagebody{#1}%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingyyy.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 24pt
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \indexdummies
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1\relax \unvbox#1\relax
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg{\parseargusing{}}
+\def\parseargusing#1#2{%
+ \def\argtorun{#2}%
+ \begingroup
+ \obeylines
+ \spaceisspace
+ #1%
+ \parseargline\empty% Insert the \empty token, see \finishparsearg below.
+}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ \argremovecomment #1\comment\ArgTerm%
+ }%
+}
+
+% First remove any @comment, then any @c comment.
+\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+
+% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
+%
+% \argremovec might leave us with trailing space, e.g.,
+% @end itemize @c foo
+% This space token undergoes the same procedure and is eventually removed
+% by \finishparsearg.
+%
+\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
+\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
+\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
+ \def\temp{#3}%
+ \ifx\temp\empty
+ % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
+ \let\temp\finishparsearg
+ \else
+ \let\temp\argcheckspaces
+ \fi
+ % Put the space token in:
+ \temp#1 #3\ArgTerm
+}
+
+% If a _delimited_ argument is enclosed in braces, they get stripped; so
+% to get _exactly_ the rest of the line, we had to prevent such situation.
+% We prepended an \empty token at the very beginning and we expand it now,
+% just before passing the control to \argtorun.
+% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
+% either the null string, or it ends with \^^M---thus there is no danger
+% that a pair of braces would be stripped.
+%
+% But first, we have to remove the trailing space token.
+%
+\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
+
+% \parseargdef\foo{...}
+% is roughly equivalent to
+% \def\foo{\parsearg\Xfoo}
+% \def\Xfoo#1{...}
+%
+% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
+% favourite TeX trick. --kasal, 16nov03
+
+\def\parseargdef#1{%
+ \expandafter \doparseargdef \csname\string#1\endcsname #1%
+}
+\def\doparseargdef#1#2{%
+ \def#2{\parsearg#1}%
+ \def#1##1%
+}
+
+% Several utility definitions with active space:
+{
+ \obeyspaces
+ \gdef\obeyedspace{ }
+
+ % Make each space character in the input produce a normal interword
+ % space in the output. Don't allow a line break at this space, as this
+ % is used only in environments like @example, where each line of input
+ % should produce a line of output anyway.
+ %
+ \gdef\sepspaces{\obeyspaces\let =\tie}
+
+ % If an index command is used in an @example environment, any spaces
+ % therein should become regular spaces in the raw index file, not the
+ % expansion of \tie (\leavevmode \penalty \@M \ ).
+ \gdef\unsepspaces{\let =\space}
+}
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+% Define the framework for environments in texinfo.tex. It's used like this:
+%
+% \envdef\foo{...}
+% \def\Efoo{...}
+%
+% It's the responsibility of \envdef to insert \begingroup before the
+% actual body; @end closes the group after calling \Efoo. \envdef also
+% defines \thisenv, so the current environment is known; @end checks
+% whether the environment name matches. The \checkenv macro can also be
+% used to check whether the current environment is the one expected.
+%
+% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
+% are not treated as environments; they don't open a group. (The
+% implementation of @end takes care not to call \endgroup in this
+% special case.)
+
+
+% At run-time, environments start with this:
+\def\startenvironment#1{\begingroup\def\thisenv{#1}}
+% initialize
+\let\thisenv\empty
+
+% ... but they get defined via ``\envdef\foo{...}'':
+\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
+\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
+
+% Check whether we're in the right environment:
+\def\checkenv#1{%
+ \def\temp{#1}%
+ \ifx\thisenv\temp
+ \else
+ \badenverr
+ \fi
+}
+
+% Environment mismatch, #1 expected:
+\def\badenverr{%
+ \errhelp = \EMsimple
+ \errmessage{This command can appear only \inenvironment\temp,
+ not \inenvironment\thisenv}%
+}
+\def\inenvironment#1{%
+ \ifx#1\empty
+ out of any environment%
+ \else
+ in environment \expandafter\string#1%
+ \fi
+}
+
+% @end foo executes the definition of \Efoo.
+% But first, it executes a specialized version of \checkenv
+%
+\parseargdef\end{%
+ \if 1\csname iscond.#1\endcsname
+ \else
+ % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
+ \expandafter\checkenv\csname#1\endcsname
+ \csname E#1\endcsname
+ \endgroup
+ \fi
+}
+
+\newhelp\EMsimple{Press RETURN to continue.}
+
+
+%% Simple single-character @ commands
+
+% @@ prints an @
+% Kludge this until the fonts are right (grr).
+\def\@{{\tt\char64}}
+
+% This is turned off because it was never documented
+% and you can use @w{...} around a quote to suppress ligatures.
+%% Define @` and @' to be the same as ` and '
+%% but suppressing ligatures.
+%\def\`{{`}}
+%\def\'{{'}}
+
+% Used to generate quoted braces.
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
+\let\{=\mylbrace
+\let\}=\myrbrace
+\begingroup
+ % Definitions to produce \{ and \} commands for indices,
+ % and @{ and @} for the aux/toc files.
+ \catcode`\{ = \other \catcode`\} = \other
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\! = 0 \catcode`\\ = \other
+ !gdef!lbracecmd[\{]%
+ !gdef!rbracecmd[\}]%
+ !gdef!lbraceatcmd[@{]%
+ !gdef!rbraceatcmd[@}]%
+!endgroup
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \c
+\let\dotaccent = \.
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \t
+\let\ubaraccent = \b
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
+ \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence. (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo. Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+ L\kern-.36em
+ {\setbox0=\hbox{T}%
+ \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
+ \kern-.15em
+ \TeX
+}
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\hfil\break\hbox{}\ignorespaces}
+
+% @/ allows a line break.
+\let\/=\allowbreak
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=\endofsentencespacefactor\space}
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=\endofsentencespacefactor\space}
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=\endofsentencespacefactor\space}
+
+% @frenchspacing on|off says whether to put extra space after punctuation.
+%
+\def\onword{on}
+\def\offword{off}
+%
+\parseargdef\frenchspacing{%
+ \def\temp{#1}%
+ \ifx\temp\onword \plainfrenchspacing
+ \else\ifx\temp\offword \plainnonfrenchspacing
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
+ \fi\fi
+}
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+% Another complication is that the group might be very large. This can
+% cause the glue on the previous page to be unduly stretched, because it
+% does not have much material. In this case, it's better to add an
+% explicit \vfill so that the extra space is at the bottom. The
+% threshold for doing this is if the group is more than \vfilllimit
+% percent of a page (\vfilllimit can be changed inside of @tex).
+%
+\newbox\groupbox
+\def\vfilllimit{0.7}
+%
+\envdef\group{%
+ \ifnum\catcode`\^^M=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ \startsavinginserts
+ %
+ \setbox\groupbox = \vtop\bgroup
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% The \vtop produces a box with normal height and large depth; thus, TeX puts
+% \baselineskip glue before it, and (when the next line of text is done)
+% \lineskip glue after it. Thus, space below is not quite equal to space
+% above. But it's pretty close.
+\def\Egroup{%
+ % To get correct interline space between the last line of the group
+ % and the first line afterwards, we have to propagate \prevdepth.
+ \endgraf % Not \par, as it may have been set to \lisppar.
+ \global\dimen1 = \prevdepth
+ \egroup % End the \vtop.
+ % \dimen0 is the vertical size of the group's box.
+ \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
+ % \dimen2 is how much space is left on the page (more or less).
+ \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
+ % if the group doesn't fit on the current page, and it's a big big
+ % group, force a page break.
+ \ifdim \dimen0 > \dimen2
+ \ifdim \pagetotal < \vfilllimit\pageheight
+ \page
+ \fi
+ \fi
+ \box\groupbox
+ \prevdepth = \dimen1
+ \checkinserts
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+% Old definition--didn't work.
+%\parseargdef\need{\par %
+%% This method tries to make TeX break the page naturally
+%% if the depth of the box does not fit.
+%{\baselineskip=0pt%
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
+%\prevdepth=-1000pt
+%}}
+
+\parseargdef\need{%
+ % Ensure vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
+}
+
+% @br forces paragraph break (and is undocumented).
+
+\let\br = \par
+
+% @page forces the start of a new page.
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
+
+% This defn is used inside nofill environments such as @example.
+\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
+ \leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph. For more general purposes, use the \margin insertion
+% class. WHICH is `l' or `r'.
+%
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+ \nobreak
+ \kern-\strutdepth
+ \vtop to \strutdepth{%
+ \baselineskip=\strutdepth
+ \vss
+ % if you have multiple lines of stuff to put here, you'll need to
+ % make the vbox yourself of the appropriate size.
+ \ifx#1l%
+ \llap{\ignorespaces #2\hskip\inmarginspacing}%
+ \else
+ \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+ \fi
+ \null
+ }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \def\lefttext{#1}% have both texts
+ \def\righttext{#2}%
+ \else
+ \def\lefttext{#1}% have only one text
+ \def\righttext{#1}%
+ \fi
+ %
+ \ifodd\pageno
+ \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
+ \else
+ \def\temp{\inleftmargin\lefttext}%
+ \fi
+ \temp
+}
+
+% @include FILE -- \input text of FILE.
+%
+\def\include{\parseargusing\filenamecatcodes\includezzz}
+\def\includezzz#1{%
+ \pushthisfilestack
+ \def\thisfile{#1}%
+ {%
+ \makevalueexpandable % we want to expand any @value in FILE.
+ \turnoffactive % and allow special characters in the expansion
+ \indexnofonts % Allow `@@' and other weird things in file names.
+ \edef\temp{\noexpand\input #1 }%
+ %
+ % This trickery is to read FILE outside of a group, in case it makes
+ % definitions, etc.
+ \expandafter
+ }\temp
+ \popthisfilestack
+}
+\def\filenamecatcodes{%
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
+ \catcode`-=\other
+ \catcode`\`=\other
+ \catcode`\'=\other
+}
+
+\def\pushthisfilestack{%
+ \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
+}
+\def\pushthisfilestackX{%
+ \expandafter\pushthisfilestackY\thisfile\StackTerm
+}
+\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
+ \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
+}
+
+\def\popthisfilestack{\errthisfilestackempty}
+\def\errthisfilestackempty{\errmessage{Internal error:
+ the stack of filenames is empty.}}
+
+\def\thisfile{}
+
+% @center line
+% outputs that line, centered.
+%
+\parseargdef\center{%
+ \ifhmode
+ \let\next\centerH
+ \else
+ \let\next\centerV
+ \fi
+ \next{\hfil \ignorespaces#1\unskip \hfil}%
+}
+\def\centerH#1{%
+ {%
+ \hfil\break
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ \line{#1}%
+ \break
+ }%
+}
+\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
+
+% @sp n outputs n lines of vertical space
+
+\parseargdef\sp{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+
+\let\c=\comment
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\parseargdef\paragraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
+ \fi
+ \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\parseargdef\exampleindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
+ \fi
+}
+
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading. If WORD is `insert', then do indent at such
+% paragraphs.
+%
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do.
+% We switch the definition of this back and forth according to WORD.
+% By default, we suppress indentation.
+%
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\def\insertword{insert}
+%
+\parseargdef\firstparagraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\noneword
+ \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+ \else\ifx\temp\insertword
+ \let\suppressfirstparagraphindent = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @firstparagraphindent option `\temp'}%
+ \fi\fi
+}
+
+% Here is how we actually suppress indentation. Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
+%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+ \gdef\indent{%
+ \restorefirstparagraphindent
+ \indent
+ }%
+ \gdef\noindent{%
+ \restorefirstparagraphindent
+ \noindent
+ }%
+ \global\everypar = {%
+ \kern -\parindent
+ \restorefirstparagraphindent
+ }%
+}
+
+\gdef\restorefirstparagraphindent{%
+ \global \let \indent = \ptexindent
+ \global \let \noindent = \ptexnoindent
+ \global \everypar = {}%
+}
+
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}. So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+ \catcode`\_ = \active
+ \gdef\mathunderscore{%
+ \catcode`\_=\active
+ \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+ }
+}
+% Another complication: we want \\ (and @\) to output a \ character.
+% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
+% this is not advertised and we don't care. Texinfo does not
+% otherwise define @\.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+ \tex
+ \mathunderscore
+ \let\\ = \mathbackslash
+ \mathactive
+ % make the texinfo accent commands work in math mode
+ \let\"=\ddot
+ \let\'=\acute
+ \let\==\bar
+ \let\^=\hat
+ \let\`=\grave
+ \let\u=\breve
+ \let\v=\check
+ \let\~=\tilde
+ \let\dotaccent=\dot
+ $\finishmath
+}
+\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+ \catcode`^ = \active
+ \catcode`< = \active
+ \catcode`> = \active
+ \catcode`+ = \active
+ \catcode`' = \active
+ \gdef\mathactive{%
+ \let^ = \ptexhat
+ \let< = \ptexless
+ \let> = \ptexgtr
+ \let+ = \ptexplus
+ \let' = \ptexquoteright
+ }
+}
+
+% Some math mode symbols.
+\def\bullet{$\ptexbullet$}
+\def\geq{\ifmmode \ge\else $\ge$\fi}
+\def\leq{\ifmmode \le\else $\le$\fi}
+\def\minus{\ifmmode -\else $-$\fi}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in the cm
+% typewriter fonts as three actual period characters; on the other hand,
+% in other typewriter fonts three periods are wider than 1.5em. So do
+% whichever is larger.
+%
+\def\dots{%
+ \leavevmode
+ \setbox0=\hbox{...}% get width of three periods
+ \ifdim\wd0 > 1.5em
+ \dimen0 = \wd0
+ \else
+ \dimen0 = 1.5em
+ \fi
+ \hbox to \dimen0{%
+ \hskip 0pt plus.25fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \dots
+ \spacefactor=\endofsentencespacefactor
+}
+
+% @comma{} is so commas can be inserted into text without messing up
+% Texinfo's parsing.
+%
+\let\comma = ,
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
+ \iflinks
+ \tryauxfile
+ % Open the new aux file. TeX will close it automatically at exit.
+ \immediate\openout\auxfile=\jobname.aux
+ \fi % \openindices needs to do some work in any case.
+ \openindices
+ \let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ \openin 1 texinfo.cnf
+ \ifeof 1 \else \input texinfo.cnf \fi
+ \closein 1
+ %
+ \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
+% can be set). So we test for \relax and 0 as well as \undefined,
+% borrowed from ifpdf.sty.
+\ifx\pdfoutput\undefined
+\else
+ \ifx\pdfoutput\relax
+ \else
+ \ifcase\pdfoutput
+ \else
+ \pdftrue
+ \fi
+ \fi
+\fi
+
+% PDF uses PostScript string constants for the names of xref targets,
+% for display in the outlines, and in other places. Thus, we have to
+% double any backslashes. Otherwise, a name like "\node" will be
+% interpreted as a newline (\n), followed by o, d, e. Not good.
+% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
+% (and related messages, the final outcome is that it is up to the TeX
+% user to double the backslashes and otherwise make the string valid, so
+% that's what we do).
+
+% double active backslashes.
+%
+{\catcode`\@=0 \catcode`\\=\active
+ @gdef@activebackslashdouble{%
+ @catcode`@\=@active
+ @let\=@doublebackslash}
+}
+
+% To handle parens, we must adopt a different approach, since parens are
+% not active characters. hyperref.dtx (which has the same problem as
+% us) handles it with this amazing macro to replace tokens, with minor
+% changes for Texinfo. It is included here under the GPL by permission
+% from the author, Heiko Oberdiek.
+%
+% #1 is the tokens to replace.
+% #2 is the replacement.
+% #3 is the control sequence with the string.
+%
+\def\HyPsdSubst#1#2#3{%
+ \def\HyPsdReplace##1#1##2\END{%
+ ##1%
+ \ifx\\##2\\%
+ \else
+ #2%
+ \HyReturnAfterFi{%
+ \HyPsdReplace##2\END
+ }%
+ \fi
+ }%
+ \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
+}
+\long\def\HyReturnAfterFi#1\fi{\fi#1}
+
+% #1 is a control sequence in which to do the replacements.
+\def\backslashparens#1{%
+ \xdef#1{#1}% redefine it as its expansion; the definition is simply
+ % \lastnode when called from \setref -> \pdfmkdest.
+ \HyPsdSubst{(}{\realbackslash(}{#1}%
+ \HyPsdSubst{)}{\realbackslash)}{#1}%
+}
+
+\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
+with PDF output, and none of those formats could be found. (.eps cannot
+be supported due to the design of the PDF format; use regular TeX (DVI
+output) for that.)}
+
+\ifpdf
+ %
+ % Color manipulation macros based on pdfcolor.tex.
+ \def\cmykDarkRed{0.28 1 1 0.35}
+ \def\cmykBlack{0 0 0 1}
+ %
+ \def\pdfsetcolor#1{\pdfliteral{#1 k}}
+ % Set color, and create a mark which defines \thiscolor accordingly,
+ % so that \makeheadline knows which color to restore.
+ \def\setcolor#1{%
+ \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \domark
+ \pdfsetcolor{#1}%
+ }
+ %
+ \def\maincolor{\cmykBlack}
+ \pdfsetcolor{\maincolor}
+ \edef\thiscolor{\maincolor}
+ \def\lastcolordefs{}
+ %
+ \def\makefootline{%
+ \baselineskip24pt
+ \line{\pdfsetcolor{\maincolor}\the\footline}%
+ }
+ %
+ \def\makeheadline{%
+ \vbox to 0pt{%
+ \vskip-22.5pt
+ \line{%
+ \vbox to8.5pt{}%
+ % Extract \thiscolor definition from the marks.
+ \getcolormarks
+ % Typeset the headline with \maincolor, then restore the color.
+ \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
+ }%
+ \vss
+ }%
+ \nointerlineskip
+ }
+ %
+ %
+ \pdfcatalog{/PageMode /UseOutlines}
+ %
+ % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
+ \def\dopdfimage#1#2#3{%
+ \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+ \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+ %
+ % pdftex (and the PDF format) support .png, .jpg, .pdf (among
+ % others). Let's try in that order.
+ \let\pdfimgext=\empty
+ \begingroup
+ \openin 1 #1.png \ifeof 1
+ \openin 1 #1.jpg \ifeof 1
+ \openin 1 #1.jpeg \ifeof 1
+ \openin 1 #1.JPG \ifeof 1
+ \openin 1 #1.pdf \ifeof 1
+ \openin 1 #1.PDF \ifeof 1
+ \errhelp = \nopdfimagehelp
+ \errmessage{Could not find image file #1 for pdf}%
+ \else \gdef\pdfimgext{PDF}%
+ \fi
+ \else \gdef\pdfimgext{pdf}%
+ \fi
+ \else \gdef\pdfimgext{JPG}%
+ \fi
+ \else \gdef\pdfimgext{jpeg}%
+ \fi
+ \else \gdef\pdfimgext{jpg}%
+ \fi
+ \else \gdef\pdfimgext{png}%
+ \fi
+ \closein 1
+ \endgroup
+ %
+ % without \immediate, ancient pdftex seg faults when the same image is
+ % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
+ \ifnum\pdftexversion < 14
+ \immediate\pdfimage
+ \else
+ \immediate\pdfximage
+ \fi
+ \ifdim \wd0 >0pt width \imagewidth \fi
+ \ifdim \wd2 >0pt height \imageheight \fi
+ \ifnum\pdftexversion<13
+ #1.\pdfimgext
+ \else
+ {#1.\pdfimgext}%
+ \fi
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ %
+ \def\pdfmkdest#1{{%
+ % We have to set dummies so commands such as @code, and characters
+ % such as \, aren't expanded when present in a section title.
+ \indexnofonts
+ \turnoffactive
+ \activebackslashdouble
+ \makevalueexpandable
+ \def\pdfdestname{#1}%
+ \backslashparens\pdfdestname
+ \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+ }}
+ %
+ % used to mark target names; must be expandable.
+ \def\pdfmkpgn#1{#1}
+ %
+ % by default, use a color that is dark enough to print on paper as
+ % nearly black, but still distinguishable for online viewing.
+ \def\urlcolor{\cmykDarkRed}
+ \def\linkcolor{\cmykDarkRed}
+ \def\endlink{\setcolor{\maincolor}\pdfendlink}
+ %
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by 1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ %
+ % #1 is the section text, which is what will be displayed in the
+ % outline by the pdf viewer. #2 is the pdf expression for the number
+ % of subentries (or empty, for subsubsections). #3 is the node text,
+ % which might be empty if this toc entry had no corresponding node.
+ % #4 is the page number
+ %
+ \def\dopdfoutline#1#2#3#4{%
+ % Generate a link to the node text if that exists; else, use the
+ % page number. We could generate a destination for the section
+ % text in the case where a section has no node, but it doesn't
+ % seem worth the trouble, since most documents are normally structured.
+ \def\pdfoutlinedest{#3}%
+ \ifx\pdfoutlinedest\empty
+ \def\pdfoutlinedest{#4}%
+ \else
+ % Doubled backslashes in the name.
+ {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
+ \backslashparens\pdfoutlinedest}%
+ \fi
+ %
+ % Also double the backslashes in the display string.
+ {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
+ \backslashparens\pdfoutlinetext}%
+ %
+ \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
+ }
+ %
+ \def\pdfmakeoutlines{%
+ \begingroup
+ % Thanh's hack / proper braces in bookmarks
+ \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
+ \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
+ %
+ % Read toc silently, to get counts of subentries for \pdfoutline.
+ \def\numchapentry##1##2##3##4{%
+ \def\thischapnum{##2}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsecentry##1##2##3##4{%
+ \advancenumber{chap\thischapnum}%
+ \def\thissecnum{##2}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsubsecentry##1##2##3##4{%
+ \advancenumber{sec\thissecnum}%
+ \def\thissubsecnum{##2}%
+ }%
+ \def\numsubsubsecentry##1##2##3##4{%
+ \advancenumber{subsec\thissubsecnum}%
+ }%
+ \def\thischapnum{0}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ %
+ % use \def rather than \let here because we redefine \chapentry et
+ % al. a second time, below.
+ \def\appentry{\numchapentry}%
+ \def\appsecentry{\numsecentry}%
+ \def\appsubsecentry{\numsubsecentry}%
+ \def\appsubsubsecentry{\numsubsubsecentry}%
+ \def\unnchapentry{\numchapentry}%
+ \def\unnsecentry{\numsecentry}%
+ \def\unnsubsecentry{\numsubsecentry}%
+ \def\unnsubsubsecentry{\numsubsubsecentry}%
+ \readdatafile{toc}%
+ %
+ % Read toc second time, this time actually producing the outlines.
+ % The `-' means take the \expnumber as the absolute number of
+ % subentries, which we calculated on our first read of the .toc above.
+ %
+ % We use the node names as the destinations.
+ \def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+ \def\numsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
+ \def\numsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
+ \def\numsubsubsecentry##1##2##3##4{% count is always zero
+ \dopdfoutline{##1}{}{##3}{##4}}%
+ %
+ % PDF outlines are displayed using system fonts, instead of
+ % document fonts. Therefore we cannot use special characters,
+ % since the encoding is unknown. For example, the eogonek from
+ % Latin 2 (0xea) gets translated to a | character. Info from
+ % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
+ %
+ % xx to do this right, we have to translate 8-bit characters to
+ % their "best" equivalent, based on the @documentencoding. Right
+ % now, I guess we'll just let the pdf reader have its way.
+ \indexnofonts
+ \setupdatafile
+ \catcode`\\=\active \otherbackslash
+ \input \tocreadfilename
+ \endgroup
+ }
+ %
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \ifx\p\space\else\addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \fi
+ \nextsp}
+ \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ % make a live url in pdf output.
+ \def\pdfurl#1{%
+ \begingroup
+ % it seems we really need yet another set of dummies; have not
+ % tried to figure out what each command should do in the context
+ % of @url. for now, just make @/ a no-op, that's the only one
+ % people have actually reported a problem with.
+ %
+ \normalturnoffactive
+ \def\@{@}%
+ \let\/=\empty
+ \makevalueexpandable
+ \leavevmode\setcolor{\urlcolor}%
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|\relax
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
+ \setcolor{\linkcolor}#1\endlink}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\else
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\setcolor = \gobble
+ \let\pdfsetcolor = \gobble
+ \let\pdfmakeoutlines = \relax
+\fi % \ifx\pdfoutput
+
+
+\message{fonts,}
+
+% Change the current font style to #1, remembering it in \curfontstyle.
+% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+% italics, not bold italics.
+%
+\def\setfontstyle#1{%
+ \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
+ \csname ten#1\endcsname % change the current font
+}
+
+% Select #1 fonts with the current style.
+%
+\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
+
+\def\rm{\fam=0 \setfontstyle{rm}}
+\def\it{\fam=\itfam \setfontstyle{it}}
+\def\sl{\fam=\slfam \setfontstyle{sl}}
+\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}
+
+% Unfortunately, we have to override this for titles and the like, since
+% in those cases "rm" is bold. Sigh.
+\def\rmisbold{\rm\def\curfontstyle{bf}}
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf.
+\newfam\sffam
+\def\sf{\fam=\sffam \setfontstyle{sf}}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this font style.
+\def\ttsl{\setfontstyle{ttsl}}
+
+
+% Default leading.
+\newdimen\textleading \textleading = 13.2pt
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+% can get a sort of poor man's double spacing by redefining this.
+\def\baselinefactor{1}
+%
+\def\setleading#1{%
+ \dimen0 = #1\relax
+ \normalbaselineskip = \baselinefactor\dimen0
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+% PDF CMaps. See also LaTeX's t1.cmap.
+%
+% do nothing with this by default.
+\expandafter\let\csname cmapOT1\endcsname\gobble
+\expandafter\let\csname cmapOT1IT\endcsname\gobble
+\expandafter\let\csname cmapOT1TT\endcsname\gobble
+
+% if we are producing pdf, and we have \pdffontattr, then define cmaps.
+% (\pdffontattr was introduced many years ago, but people still run
+% older pdftex's; it's easy to conditionalize, so we do.)
+\ifpdf \ifx\pdffontattr\undefined \else
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1-0)
+%%Title: (TeX-OT1-0 TeX OT1 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<23> <26> <0023>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+40 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+%
+% \cmapOT1IT
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1IT-0)
+%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1IT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1IT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<25> <26> <0025>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+42 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<23> <0023>
+<24> <00A3>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1IT\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+%
+% \cmapOT1TT
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1TT-0)
+%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1TT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1TT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+5 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<21> <26> <0021>
+<28> <5F> <0028>
+<61> <7E> <0061>
+endbfrange
+32 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <2191>
+<0C> <2193>
+<0D> <0027>
+<0E> <00A1>
+<0F> <00BF>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<20> <2423>
+<27> <2019>
+<60> <2018>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1TT\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+\fi\fi
+
+
+% Set the font macro #1 to the font named #2, adding on the
+% specified font prefix (normally `cm').
+% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
+% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
+% empty to omit).
+\def\setfont#1#2#3#4#5{%
+ \font#1=\fontprefix#2#3 scaled #4
+ \csname cmap#5\endcsname#1%
+}
+% This is what gets called when #5 of \setfont is empty.
+\let\cmap\gobble
+% emacs-page end of cmaps
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\undefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} %where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+% Definitions for a main text size of 11pt. This is the default in
+% Texinfo.
+%
+\def\definetextfontsizexi{%
+% Text fonts (11.2pt, magstep1).
+\def\textnominalsize{11pt}
+\edef\mainmagstep{\magstephalf}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+\def\textecsize{1095}
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstep1}{OT1}
+\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+\def\smallecsize{0900}
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+\def\smallerecsize{0800}
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\titleecsize{2074}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\def\chapnominalsize{17pt}
+\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
+\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
+\setfont\chapsf\sfbshape{17}{1000}{OT1}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+\def\chapecsize{1728}
+
+% Section fonts (14.4pt).
+\def\secnominalsize{14pt}
+\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
+\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep2}{OT1}
+\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}{OT1}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+\def\sececsize{1440}
+
+% Subsection fonts (13.15pt).
+\def\ssecnominalsize{13pt}
+\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
+\setfont\ssecit\itbshape{10}{1315}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1315}{OT1}
+\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1315}{OT1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+\def\ssececsize{1200}
+
+% Reduced fonts for @acro in text (10pt).
+\def\reducednominalsize{10pt}
+\setfont\reducedrm\rmshape{10}{1000}{OT1}
+\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{1000}{OT1}
+\setfont\reducedit\itshape{10}{1000}{OT1IT}
+\setfont\reducedsl\slshape{10}{1000}{OT1}
+\setfont\reducedsf\sfshape{10}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{1000}{OT1}
+\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
+\font\reducedi=cmmi10
+\font\reducedsy=cmsy10
+\def\reducedecsize{1000}
+
+% reset the current fonts
+\textfonts
+\rm
+} % end of 11pt text font size definitions
+
+
+% Definitions to make the main text be 10pt Computer Modern, with
+% section, chapter, etc., sizes following suit. This is for the GNU
+% Press printing of the Emacs 22 manual. Maybe other manuals in the
+% future. Used with @smallbook, which sets the leading to 12pt.
+%
+\def\definetextfontsizex{%
+% Text fonts (10pt).
+\def\textnominalsize{10pt}
+\edef\mainmagstep{1000}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+\def\textecsize{1000}
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
+\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+\def\smallecsize{0900}
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+\def\smallerecsize{0800}
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\titleecsize{2074}
+
+% Chapter fonts (14.4pt).
+\def\chapnominalsize{14pt}
+\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
+\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
+\let\chapbf\chaprm
+\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
+\font\chapi=cmmi12 scaled \magstep1
+\font\chapsy=cmsy10 scaled \magstep2
+\def\chapecsize{1440}
+
+% Section fonts (12pt).
+\def\secnominalsize{12pt}
+\setfont\secrm\rmbshape{12}{1000}{OT1}
+\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep1}{OT1}
+\setfont\sectt\ttbshape{12}{1000}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
+\setfont\secsf\sfbshape{12}{1000}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep1}{OT1}
+\font\seci=cmmi12
+\font\secsy=cmsy10 scaled \magstep1
+\def\sececsize{1200}
+
+% Subsection fonts (10pt).
+\def\ssecnominalsize{10pt}
+\setfont\ssecrm\rmbshape{10}{1000}{OT1}
+\setfont\ssecit\itbshape{10}{1000}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1000}{OT1}
+\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
+\setfont\ssecsf\sfbshape{10}{1000}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1000}{OT1}
+\font\sseci=cmmi10
+\font\ssecsy=cmsy10
+\def\ssececsize{1000}
+
+% Reduced fonts for @acro in text (9pt).
+\def\reducednominalsize{9pt}
+\setfont\reducedrm\rmshape{9}{1000}{OT1}
+\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{900}{OT1}
+\setfont\reducedit\itshape{9}{1000}{OT1IT}
+\setfont\reducedsl\slshape{9}{1000}{OT1}
+\setfont\reducedsf\sfshape{9}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{900}{OT1}
+\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
+\font\reducedi=cmmi9
+\font\reducedsy=cmsy9
+\def\reducedecsize{0900}
+
+% reduce space between paragraphs
+\divide\parskip by 2
+
+% reset the current fonts
+\textfonts
+\rm
+} % end of 10pt text font size definitions
+
+
+% We provide the user-level command
+% @fonttextsize 10
+% (or 11) to redefine the text font size. pt is assumed.
+%
+\def\xword{10}
+\def\xiword{11}
+%
+\parseargdef\fonttextsize{%
+ \def\textsizearg{#1}%
+ \wlog{doing @fonttextsize \textsizearg}%
+ %
+ % Set \globaldefs so that documents can use this inside @tex, since
+ % makeinfo 4.8 does not support it, but we need it nonetheless.
+ %
+ \begingroup \globaldefs=1
+ \ifx\textsizearg\xword \definetextfontsizex
+ \else \ifx\textsizearg\xiword \definetextfontsizexi
+ \else
+ \errhelp=\EMsimple
+ \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
+ \fi\fi
+ \endgroup
+}
+
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. Since
+% texinfo doesn't allow for producing subscripts and superscripts except
+% in the main text, we don't bother to reset \scriptfont and
+% \scriptscriptfont (which would also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+ \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
+ \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
+ \textfont\ttfam=\tentt \textfont\sffam=\tensf
+}
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this because \STYLE needs to also set the
+% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
+% \tenSTYLE to set the current font.
+%
+% Each font-changing command also sets the names \lsize (one size lower)
+% and \lllsize (three sizes lower). These relative commands are used in
+% the LaTeX logo and acronyms.
+%
+% This all needs generalizing, badly.
+%
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
+ \let\tenttsl=\textttsl
+ \def\curfontsize{text}%
+ \def\lsize{reduced}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{\textleading}}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \def\curfontsize{title}%
+ \def\lsize{chap}\def\lllsize{subsec}%
+ \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rmisbold #1}}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
+ \let\tenttsl=\chapttsl
+ \def\curfontsize{chap}%
+ \def\lsize{sec}\def\lllsize{text}%
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
+ \let\tenttsl=\secttsl
+ \def\curfontsize{sec}%
+ \def\lsize{subsec}\def\lllsize{reduced}%
+ \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
+ \let\tenttsl=\ssecttsl
+ \def\curfontsize{ssec}%
+ \def\lsize{text}\def\lllsize{small}%
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts
+\def\reducedfonts{%
+ \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
+ \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
+ \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
+ \let\tenttsl=\reducedttsl
+ \def\curfontsize{reduced}%
+ \def\lsize{small}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \def\curfontsize{small}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallerfonts{%
+ \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
+ \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
+ \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
+ \let\tenttsl=\smallerttsl
+ \def\curfontsize{smaller}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{9.5pt}}
+
+% Set the fonts to use with the @small... environments.
+\let\smallexamplefonts = \smallfonts
+
+% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
+% can fit this many characters:
+% 8.5x11=86 smallbook=72 a4=90 a5=69
+% If we use \scriptfonts (8pt), then we can fit this many characters:
+% 8.5x11=90+ smallbook=80 a4=90+ a5=77
+% For me, subjectively, the few extra characters that fit aren't worth
+% the additional smallness of 8pt. So I'm making the default 9pt.
+%
+% By the way, for comparison, here's what fits with @example (10pt):
+% 8.5x11=71 smallbook=60 a4=75 a5=58
+%
+% I wish the USA used A4 paper.
+% --karl, 24jan03.
+
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\definetextfontsizexi
+
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}{OT1}
+\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
+\setfont\shortcontsl\slshape{12}{1000}{OT1}
+\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
+
+%% Add scribe-like font environments, plus @l for inline lisp (usually sans
+%% serif) and @ii for TeX italic
+
+% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
+% unless the following character is such as not to need one.
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
+ \ptexslash\fi\fi\fi}
+\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
+
+% like \smartslanted except unconditionally uses \ttsl.
+% @var is set to this for defun arguments.
+\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
+
+% like \smartslanted except unconditionally use \sl. We never want
+% ttsl for book titles, do we?
+\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
+
+\let\i=\smartitalic
+\let\slanted=\smartslanted
+\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}}
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+
+% @b, explicit bold.
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% @sansserif, explicit sans.
+\def\sansserif#1{{\sf #1}}
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+% Set sfcode to normal for the chars that usually have another value.
+% Can't use plain's \frenchspacing because it uses the `\x notation, and
+% sometimes \x has an active definition that messes things up.
+%
+\catcode`@=11
+ \def\plainfrenchspacing{%
+ \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
+ \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
+ \def\endofsentencespacefactor{1000}% for @. and friends
+ }
+ \def\plainnonfrenchspacing{%
+ \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
+ \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
+ \def\endofsentencespacefactor{3000}% for @. and friends
+ }
+\catcode`@=\other
+\def\endofsentencespacefactor{3000}% default
+
+\def\t#1{%
+ {\tt \rawbackslash \plainfrenchspacing #1}%
+ \null
+}
+\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
+\setfont\keyrm\rmshape{8}{1000}{OT1}
+\font\keysy=cmsy9
+\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+ \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+ \vbox{\hrule\kern-0.4pt
+ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+ \kern-0.4pt\hrule}%
+ \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+\def\key #1{{\setupmarkupstyle{key}\nohyphenation \uppercase{#1}}\null}
+% The old definition, with no lozenge:
+%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @file, @option are the same as @samp.
+\let\file=\samp
+\let\option=\samp
+
+% @code is a modification of @t,
+% which makes spaces the same size as normal in the surrounding text.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \plainfrenchspacing
+ #1%
+ }%
+ \null
+}
+
+% We *must* turn on hyphenation at `-' and `_' in @code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+% -- rms.
+{
+ \catcode`\-=\active \catcode`\_=\active
+ \catcode`\'=\active \catcode`\`=\active
+ \global\let'=\rq \global\let`=\lq % default definitions
+ %
+ \global\def\code{\begingroup
+ \setupmarkupstyle{code}%
+ % The following should really be moved into \setupmarkupstyle handlers.
+ \catcode\dashChar=\active \catcode\underChar=\active
+ \ifallowcodebreaks
+ \let-\codedash
+ \let_\codeunder
+ \else
+ \let-\realdash
+ \let_\realunder
+ \fi
+ \codex
+ }
+}
+
+\def\realdash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{%
+ % this is all so @math{@code{var_name}+1} can work. In math mode, _
+ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
+ % will therefore expand the active definition of _, which is us
+ % (inside @code that is), therefore an endless loop.
+ \ifusingtt{\ifmmode
+ \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
+ \else\normalunderscore \fi
+ \discretionary{}{}{}}%
+ {\_}%
+}
+\def\codex #1{\tclose{#1}\endgroup}
+
+% An additional complication: the above will allow breaks after, e.g.,
+% each of the four underscores in __typeof__. This is undesirable in
+% some manuals, especially if they don't have long identifiers in
+% general. @allowcodebreaks provides a way to control this.
+%
+\newif\ifallowcodebreaks \allowcodebreakstrue
+
+\def\keywordtrue{true}
+\def\keywordfalse{false}
+
+\parseargdef\allowcodebreaks{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\keywordtrue
+ \allowcodebreakstrue
+ \else\ifx\txiarg\keywordfalse
+ \allowcodebreaksfalse
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
+ \fi\fi
+}
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\txiarg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\txiarg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct.'
+\kbdinputstyle distinct
+
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
+
+% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
+\let\indicateurl=\code
+\let\env=\code
+\let\command=\code
+
+% @clicksequence{File @click{} Open ...}
+\def\clicksequence#1{\begingroup #1\endgroup}
+
+% @clickstyle @arrow (by default)
+\parseargdef\clickstyle{\def\click{#1}}
+\def\click{\arrow}
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url. Perhaps eventually put in
+% a hypertex \special here.
+%
+\def\uref#1{\douref #1,,,\finish}
+\def\douref#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% @url synonym for @uref, since that's how everyone uses it.
+%
+\let\url=\uref
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find. We need it for
+% Polish suppressed-l. --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}} % roman font
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @acronym for "FBI", "NATO", and the like.
+% We print this one point size smaller, since it's intended for
+% all-uppercase.
+%
+\def\acronym#1{\doacronym #1,,\finish}
+\def\doacronym#1,#2,#3\finish{%
+ {\selectfonts\lsize #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+}
+
+% @abbr for "Comput. J." and the like.
+% No font change, but don't do end-of-sentence spacing.
+%
+\def\abbr#1{\doabbr #1,,\finish}
+\def\doabbr#1,#2,#3\finish{%
+ {\plainfrenchspacing #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+}
+
+% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
+%
+\def\pounds{{\it\$}}
+
+% @euro{} comes from a separate font, depending on the current style.
+% We use the free feym* fonts from the eurosym package by Henrik
+% Theiling, which support regular, slanted, bold and bold slanted (and
+% "outlined" (blackboard board, sort of) versions, which we don't need).
+% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
+%
+% Although only regular is the truly official Euro symbol, we ignore
+% that. The Euro is designed to be slightly taller than the regular
+% font height.
+%
+% feymr - regular
+% feymo - slanted
+% feybr - bold
+% feybo - bold slanted
+%
+% There is no good (free) typewriter version, to my knowledge.
+% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
+% Hmm.
+%
+% Also doesn't work in math. Do we need to do math with euro symbols?
+% Hope not.
+%
+%
+\def\euro{{\eurofont e}}
+\def\eurofont{%
+ % We set the font at each command, rather than predefining it in
+ % \textfonts and the other font-switching commands, so that
+ % installations which never need the symbol don't have to have the
+ % font installed.
+ %
+ % There is only one designed size (nominal 10pt), so we always scale
+ % that to the current nominal size.
+ %
+ % By the way, simply using "at 1em" works for cmr10 and the like, but
+ % does not work for cmbx10 and other extended/shrunken fonts.
+ %
+ \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
+ %
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
+ \else
+ % regular:
+ \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
+ \fi
+ \thiseurofont
+}
+
+% Hacks for glyphs from the EC fonts similar to \euro. We don't
+% use \let for the aliases, because sometimes we redefine the original
+% macro, and the alias should reflect the redefinition.
+\def\guillemetleft{{\ecfont \char"13}}
+\def\guillemotleft{\guillemetleft}
+\def\guillemetright{{\ecfont \char"14}}
+\def\guillemotright{\guillemetright}
+\def\guilsinglleft{{\ecfont \char"0E}}
+\def\guilsinglright{{\ecfont \char"0F}}
+\def\quotedblbase{{\ecfont \char"12}}
+\def\quotesinglbase{{\ecfont \char"0D}}
+%
+% This positioning is not perfect (see the ogonek LaTeX package), but
+% we have the precomposed glyphs for the most common cases. We put the
+% tests to use those glyphs in the single \ogonek macro so we have fewer
+% dummy definitions to worry about for index entries, etc.
+%
+% ogonek is also used with other letters in Lithuanian (IOU), but using
+% the precomposed glyphs for those is not so easy since they aren't in
+% the same EC font.
+\def\ogonek#1{{%
+ \def\temp{#1}%
+ \ifx\temp\macrocharA\Aogonek
+ \else\ifx\temp\macrochara\aogonek
+ \else\ifx\temp\macrocharE\Eogonek
+ \else\ifx\temp\macrochare\eogonek
+ \else
+ \ecfont \setbox0=\hbox{#1}%
+ \ifdim\ht0=1ex\accent"0C #1%
+ \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
+ \fi
+ \fi\fi\fi\fi
+ }%
+}
+\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
+\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
+\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
+\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
+%
+\def\ecfont{%
+ % We can't distinguish serif/sans and italic/slanted, but this
+ % is used for crude hacks anyway (like adding French and German
+ % quotes to documents typeset with CM, where we lose kerning), so
+ % hopefully nobody will notice/care.
+ \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
+ \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
+ \else
+ % regular:
+ \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
+ \fi
+ \thisecfont
+}
+
+% @registeredsymbol - R in a circle. The font for the R should really
+% be smaller yet, but lllsize is the best we can do for now.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+ $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
+ \hfil\crcr\Orb}}%
+ }$%
+}
+
+% @textdegree - the normal degrees sign.
+%
+\def\textdegree{$^\circ$}
+
+% Laurent Siebenmann reports \Orb undefined with:
+% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
+% so we'll define it if necessary.
+%
+\ifx\Orb\undefined
+\def\Orb{\mathhexbox20D}
+\fi
+
+% Quotes.
+\chardef\quotedblleft="5C
+\chardef\quotedblright=`\"
+\chardef\quoteleft=`\`
+\chardef\quoteright=`\'
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\envdef\titlepage{%
+ % Open one extra group, as we want to close it in the middle of \Etitlepage.
+ \begingroup
+ \parindent=0pt \textfonts
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \let\page = \oldpage
+ \page
+ \null
+ }%
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % Need this before the \...aftertitlepage checks so that if they are
+ % in effect the toc pages will come out with page numbers.
+ \HEADINGSon
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+%%% Macros to be used within @titlepage:
+
+\let\subtitlerm=\tenrm
+\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
+
+\parseargdef\title{%
+ \checkenv\titlepage
+ \leftline{\titlefonts\rmisbold #1}
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt
+}
+
+\parseargdef\subtitle{%
+ \checkenv\titlepage
+ {\subtitlefont \rightline{#1}}%
+}
+
+% @author should come last, but may come many times.
+% It can also be used inside @quotation.
+%
+\parseargdef\author{%
+ \def\temp{\quotation}%
+ \ifx\thisenv\temp
+ \def\quotationauthor{#1}% printed in \Equotation.
+ \else
+ \checkenv\titlepage
+ \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
+ {\secfonts\rmisbold \leftline{#1}}%
+ \fi
+}
+
+
+%%% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
+
+% Now make TeX use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
+\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
+\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
+\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
+\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -12pt
+ \global\advance\vsize by -12pt
+}
+
+\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+
+% @evenheadingmarks top \thischapter <- chapter at the top of a page
+% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
+%
+% The same set of arguments for:
+%
+% @oddheadingmarks
+% @evenfootingmarks
+% @oddfootingmarks
+% @everyheadingmarks
+% @everyfootingmarks
+
+\def\evenheadingmarks{\headingmarks{even}{heading}}
+\def\oddheadingmarks{\headingmarks{odd}{heading}}
+\def\evenfootingmarks{\headingmarks{even}{footing}}
+\def\oddfootingmarks{\headingmarks{odd}{footing}}
+\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
+ \headingmarks{odd}{heading}{#1} }
+\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
+ \headingmarks{odd}{footing}{#1} }
+% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
+\def\headingmarks#1#2#3 {%
+ \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
+ \global\expandafter\let\csname get#1#2marks\endcsname \temp
+}
+
+\everyheadingmarks bottom
+\everyfootingmarks bottom
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\HEADINGSoff{%
+\global\evenheadline={\hfil} \global\evenfootline={\hfil}
+\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
+\HEADINGSoff
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\undefined
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+\fi
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg{\gdef\thistitle}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemindicate{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. However, if
+ % what follows is an environment such as @example, there will be no
+ % \parskip glue; then the negative vskip we just inserted would
+ % cause the example and the item to crash together. So we use this
+ % bizarre value of 10001 as a signal to \aboveenvbreak to insert
+ % \parskip glue after all. Section titles are handled this way also.
+ %
+ \penalty 10001
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line.
+ \noindent
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a list environment}}
+\def\itemx{\errmessage{@itemx while not in a list environment}}
+
+% @table, @ftable, @vtable.
+\envdef\table{%
+ \let\itemindex\gobble
+ \tablecheck{table}%
+}
+\envdef\ftable{%
+ \def\itemindex ##1{\doind {fn}{\code{##1}}}%
+ \tablecheck{ftable}%
+}
+\envdef\vtable{%
+ \def\itemindex ##1{\doind {vr}{\code{##1}}}%
+ \tablecheck{vtable}%
+}
+\def\tablecheck#1{%
+ \ifnum \the\catcode`\^^M=\active
+ \endgroup
+ \errmessage{This command won't work in this context; perhaps the problem is
+ that we are \inenvironment\thisenv}%
+ \def\next{\doignore{#1}}%
+ \else
+ \let\next\tablex
+ \fi
+ \next
+}
+\def\tablex#1{%
+ \def\itemindicate{#1}%
+ \parsearg\tabley
+}
+\def\tabley#1{%
+ {%
+ \makevalueexpandable
+ \edef\temp{\noexpand\tablez #1\space\space\space}%
+ \expandafter
+ }\temp \endtablez
+}
+\def\tablez #1 #2 #3 #4\endtablez{%
+ \aboveenvbreak
+ \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
+ \ifnum 0#2>0 \tableindent=#2\mil \fi
+ \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
+ \itemmax=\tableindent
+ \advance \itemmax by -\itemmargin
+ \advance \leftskip by \tableindent
+ \exdentamount=\tableindent
+ \parindent = 0pt
+ \parskip = \smallskipamount
+ \ifdim \parskip=0pt \parskip=2pt \fi
+ \let\item = \internalBitem
+ \let\itemx = \internalBitemx
+}
+\def\Etable{\endgraf\afterenvbreak}
+\let\Eftable\Etable
+\let\Evtable\Etable
+\let\Eitemize\Etable
+\let\Eenumerate\Etable
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\envdef\itemize{\parsearg\doitemize}
+
+\def\doitemize#1{%
+ \aboveenvbreak
+ \itemmax=\itemindent
+ \advance\itemmax by -\itemmargin
+ \advance\leftskip by \itemindent
+ \exdentamount=\itemindent
+ \parindent=0pt
+ \parskip=\smallskipamount
+ \ifdim\parskip=0pt \parskip=2pt \fi
+ \def\itemcontents{#1}%
+ % @itemize with no arg is equivalent to @itemize @bullet.
+ \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+ \let\item=\itemizeitem
+}
+
+% Definition of @item while inside @itemize and @enumerate.
+%
+\def\itemizeitem{%
+ \advance\itemno by 1 % for enumerations
+ {\let\par=\endgraf \smallbreak}% reasonable place to break
+ {%
+ % If the document has an @itemize directly after a section title, a
+ % \nobreak will be last on the list, and \sectionheading will have
+ % done a \vskip-\parskip. In that case, we don't want to zero
+ % parskip, or the item text will crash with the heading. On the
+ % other hand, when there is normal text preceding the item (as there
+ % usually is), we do want to zero parskip, or there would be too much
+ % space. In that case, we won't have a \nobreak before. At least
+ % that's the theory.
+ \ifnum\lastpenalty<10000 \parskip=0in \fi
+ \noindent
+ \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
+ \vadjust{\penalty 1200}}% not good to break after first line of item.
+ \flushcr
+}
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call \doitemize, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \doitemize{#1.}\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab do not need to be on their own lines, but it will not hurt
+% if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the @columnfraction, usually a decimal number like .5, but might
+% be just 1. We just use it, whatever it is.
+%
+\def\pickupwholefraction#1 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
+ \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
+ \else
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
+ % separator; typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
+ \fi%
+ \fi
+ \go
+}
+
+% multitable-only commands.
+%
+% @headitem starts a heading row, which we typeset in bold.
+% Assignments have to be global since we are inside the implicit group
+% of an alignment entry. Note that \everycr resets \everytab.
+\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}%
+%
+% A \tab used to include \hskip1sp. But then the space in a template
+% line is not enough. That is bad. So let's go back to just `&' until
+% we encounter the problem it was intended to solve again.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{\checkenv\multitable &\the\everytab}%
+
+% @multitable ... @end multitable definitions:
+%
+\newtoks\everytab % insert after every tab.
+%
+\envdef\multitable{%
+ \vskip\parskip
+ \startsavinginserts
+ %
+ % @item within a multitable starts a normal row.
+ % We use \def instead of \let so that if one of the multitable entries
+ % contains an @itemize, we don't choke on the \item (seen as \crcr aka
+ % \endtemplate) expanding \doitemize.
+ \def\item{\crcr}%
+ %
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ %
+ \everycr = {%
+ \noalign{%
+ \global\everytab={}%
+ \global\colcount=0 % Reset the column counter.
+ % Check for saved footnotes, etc.
+ \checkinserts
+ % Keeps underfull box messages off when table breaks over pages.
+ %\filbreak
+ % Maybe so, but it also creates really weird page breaks when the
+ % table breaks over pages. Wouldn't \vfil be better? Wait until the
+ % problem manifests itself, so it can be fixed for real --karl.
+ }%
+ }%
+ %
+ \parsearg\domultitable
+}
+\def\domultitable#1{%
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup &%
+ \global\advance\colcount by 1
+ \multistrut
+ \vtop{%
+ % Use the current \colcount to find the correct column width:
+ \hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively
+ % marking characters.
+ \noindent\ignorespaces##\unskip\multistrut
+ }\cr
+}
+\def\Emultitable{%
+ \crcr
+ \egroup % end the \halign
+ \global\setpercentfalse
+}
+
+\def\setmultitablespacing{%
+ \def\multistrut{\strut}% just use the standard line spacing
+ %
+ % Compute \multitablelinespace (if not defined by user) for use in
+ % \multitableparskip calculation. We used define \multistrut based on
+ % this, but (ironically) that caused the spacing to be off.
+ % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+\fi
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+
+% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
+% @ifnotxml always succeed. They currently do nothing; we don't
+% attempt to check whether the conditionals are properly nested. But we
+% have to remember that they are conditionals, so that @end doesn't
+% attempt to close an environment group.
+%
+\def\makecond#1{%
+ \expandafter\let\csname #1\endcsname = \relax
+ \expandafter\let\csname iscond.#1\endcsname = 1
+}
+\makecond{iftex}
+\makecond{ifnotdocbook}
+\makecond{ifnothtml}
+\makecond{ifnotinfo}
+\makecond{ifnotplaintext}
+\makecond{ifnotxml}
+
+% Ignore @ignore, @ifhtml, @ifinfo, and the like.
+%
+\def\direntry{\doignore{direntry}}
+\def\documentdescription{\doignore{documentdescription}}
+\def\docbook{\doignore{docbook}}
+\def\html{\doignore{html}}
+\def\ifdocbook{\doignore{ifdocbook}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\ifplaintext{\doignore{ifplaintext}}
+\def\ifxml{\doignore{ifxml}}
+\def\ignore{\doignore{ignore}}
+\def\menu{\doignore{menu}}
+\def\xml{\doignore{xml}}
+
+% Ignore text until a line `@end #1', keeping track of nested conditionals.
+%
+% A count to remember the depth of nesting.
+\newcount\doignorecount
+
+\def\doignore#1{\begingroup
+ % Scan in ``verbatim'' mode:
+ \obeylines
+ \catcode`\@ = \other
+ \catcode`\{ = \other
+ \catcode`\} = \other
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \spaceisspace
+ %
+ % Count number of #1's that we've seen.
+ \doignorecount = 0
+ %
+ % Swallow text until we reach the matching `@end #1'.
+ \dodoignore{#1}%
+}
+
+{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
+ \obeylines %
+ %
+ \gdef\dodoignore#1{%
+ % #1 contains the command name as a string, e.g., `ifinfo'.
+ %
+ % Define a command to find the next `@end #1'.
+ \long\def\doignoretext##1^^M@end #1{%
+ \doignoretextyyy##1^^M@#1\_STOP_}%
+ %
+ % And this command to find another #1 command, at the beginning of a
+ % line. (Otherwise, we would consider a line `@c @ifset', for
+ % example, to count as an @ifset for nesting.)
+ \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
+ %
+ % And now expand that command.
+ \doignoretext ^^M%
+ }%
+}
+
+\def\doignoreyyy#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty % Nothing found.
+ \let\next\doignoretextzzz
+ \else % Found a nested condition, ...
+ \advance\doignorecount by 1
+ \let\next\doignoretextyyy % ..., look for another.
+ % If we're here, #1 ends with ^^M\ifinfo (for example).
+ \fi
+ \next #1% the token \_STOP_ is present just after this macro.
+}
+
+% We have to swallow the remaining "\_STOP_".
+%
+\def\doignoretextzzz#1{%
+ \ifnum\doignorecount = 0 % We have just found the outermost @end.
+ \let\next\enddoignore
+ \else % Still inside a nested condition.
+ \advance\doignorecount by -1
+ \let\next\doignoretext % Look for the next @end.
+ \fi
+ \next
+}
+
+% Finish off ignored text.
+{ \obeylines%
+ % Ignore anything after the last `@end #1'; this matters in verbatim
+ % environments, where otherwise the newline after an ignored conditional
+ % would result in a blank line in the output.
+ \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
+}
+
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it.
+% We rely on the fact that \parsearg sets \catcode`\ =10.
+%
+\parseargdef\set{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ {%
+ \makevalueexpandable
+ \def\temp{#2}%
+ \edef\next{\gdef\makecsname{SET#1}}%
+ \ifx\temp\empty
+ \next{}%
+ \else
+ \setzzz#2\endsetzzz
+ \fi
+ }%
+}
+% Remove the trailing space \setxxx inserted.
+\def\setzzz#1 \endsetzzz{\next{#1}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\parseargdef\clear{%
+ {%
+ \makevalueexpandable
+ \global\expandafter\let\csname SET#1\endcsname=\relax
+ }%
+}
+
+% @value{foo} gets the text saved in variable foo.
+\def\value{\begingroup\makevalueexpandable\valuexxx}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+{
+ \catcode`\- = \active \catcode`\_ = \active
+ %
+ \gdef\makevalueexpandable{%
+ \let\value = \expandablevalue
+ % We don't want these characters active, ...
+ \catcode`\-=\other \catcode`\_=\other
+ % ..., but we might end up with active ones in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}, though.
+ % So \let them to their normal equivalents.
+ \let-\realdash \let_\normalunderscore
+ }
+}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we call \makevalueexpandable in \indexdummies).
+% The command has to be fully expandable (if the variable is set), since
+% the result winds up in the index file. This means that if the
+% variable's value contains other Texinfo commands, it's almost certain
+% it will fail (although perhaps we could fix that with sufficient work
+% to do a one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \message{Variable `#1', used in @value, is not set.}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+% To get special treatment of `@end ifset,' call \makeond and the redefine.
+%
+\makecond{ifset}
+\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
+\def\doifset#1#2{%
+ {%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname SET#2\endcsname\relax
+ #1% If not set, redefine \next.
+ \fi
+ \expandafter
+ }\next
+}
+\def\ifsetfail{\doignore{ifset}}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+% The `\else' inside the `\doifset' parameter is a trick to reuse the
+% above code: if the variable is not set, do nothing, if it is set,
+% then redefine \next to \ifclearfail.
+%
+\makecond{ifclear}
+\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
+\def\ifclearfail{\doignore{ifclear}}
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory=\comment
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within macros and \if's.
+\edef\newwrite{\makecsname{ptexnewwrite}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
+}
+
+% @defindex foo == \newindex{foo}
+%
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}%
+}
+
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+%
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+ % Only do \closeout if we haven't already done it, else we'll end up
+ % closing the target index.
+ \expandafter \ifx\csname donesynindex#2\endcsname \relax
+ % The \closeout helps reduce unnecessary open files; the limit on the
+ % Acorn RISC OS is a mere 16 files.
+ \expandafter\closeout\csname#2indfile\endcsname
+ \expandafter\let\csname donesynindex#2\endcsname = 1
+ \fi
+ % redefine \fooindfile:
+ \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+ \expandafter\let\csname#2indfile\endcsname=\temp
+ % redefine \fooindex:
+ \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+% Take care of Texinfo commands that can appear in an index entry.
+% Since there are some commands we want to expand, and others we don't,
+% we have to laboriously prevent expansion for those that we don't.
+%
+\def\indexdummies{%
+ \escapechar = `\\ % use backslash in output files.
+ \def\@{@}% change to @@ when we switch to @ as escape char in index files.
+ \def\ {\realbackslash\space }%
+ %
+ % Need these in case \tex is in effect and \{ is a \delimiter again.
+ % But can't use \lbracecmd and \rbracecmd because texindex assumes
+ % braces and backslashes are used only as delimiters.
+ \let\{ = \mylbrace
+ \let\} = \myrbrace
+ %
+ % I don't entirely understand this, but when an index entry is
+ % generated from a macro call, the \endinput which \scanmacro inserts
+ % causes processing to be prematurely terminated. This is,
+ % apparently, because \indexsorttmp is fully expanded, and \endinput
+ % is an expandable command. The redefinition below makes \endinput
+ % disappear altogether for that purpose -- although logging shows that
+ % processing continues to some further point. On the other hand, it
+ % seems \endinput does not hurt in the printed index arg, since that
+ % is still getting written without apparent harm.
+ %
+ % Sample source (mac-idx3.tex, reported by Graham Percival to
+ % help-texinfo, 22may06):
+ % @macro funindex {WORD}
+ % @findex xyz
+ % @end macro
+ % ...
+ % @funindex commtest
+ %
+ % The above is not enough to reproduce the bug, but it gives the flavor.
+ %
+ % Sample whatsit resulting:
+ % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
+ %
+ % So:
+ \let\endinput = \empty
+ %
+ % Do the redefinitions.
+ \commondummies
+}
+
+% For the aux and toc files, @ is the escape character. So we want to
+% redefine everything using @ as the escape character (instead of
+% \realbackslash, still used for index files). When everything uses @,
+% this will be simpler.
+%
+\def\atdummies{%
+ \def\@{@@}%
+ \def\ {@ }%
+ \let\{ = \lbraceatcmd
+ \let\} = \rbraceatcmd
+ %
+ % Do the redefinitions.
+ \commondummies
+ \otherbackslash
+}
+
+% Called from \indexdummies and \atdummies.
+%
+\def\commondummies{%
+ %
+ % \definedummyword defines \#1 as \string\#1\space, thus effectively
+ % preventing its expansion. This is used only for control% words,
+ % not control letters, because the \space would be incorrect for
+ % control characters, but is needed to separate the control word
+ % from whatever follows.
+ %
+ % For control letters, we have \definedummyletter, which omits the
+ % space.
+ %
+ % These can be used both for control words that take an argument and
+ % those that do not. If it is followed by {arg} in the input, then
+ % that will dutifully get written to the index (or wherever).
+ %
+ \def\definedummyword ##1{\def##1{\string##1\space}}%
+ \def\definedummyletter##1{\def##1{\string##1}}%
+ \let\definedummyaccent\definedummyletter
+ %
+ \commondummiesnofonts
+ %
+ \definedummyletter\_%
+ %
+ % Non-English letters.
+ \definedummyword\AA
+ \definedummyword\AE
+ \definedummyword\L
+ \definedummyword\OE
+ \definedummyword\O
+ \definedummyword\aa
+ \definedummyword\ae
+ \definedummyword\l
+ \definedummyword\oe
+ \definedummyword\o
+ \definedummyword\ss
+ \definedummyword\exclamdown
+ \definedummyword\questiondown
+ \definedummyword\ordf
+ \definedummyword\ordm
+ %
+ % Although these internal commands shouldn't show up, sometimes they do.
+ \definedummyword\bf
+ \definedummyword\gtr
+ \definedummyword\hat
+ \definedummyword\less
+ \definedummyword\sf
+ \definedummyword\sl
+ \definedummyword\tclose
+ \definedummyword\tt
+ %
+ \definedummyword\LaTeX
+ \definedummyword\TeX
+ %
+ % Assorted special characters.
+ \definedummyword\bullet
+ \definedummyword\comma
+ \definedummyword\copyright
+ \definedummyword\registeredsymbol
+ \definedummyword\dots
+ \definedummyword\enddots
+ \definedummyword\equiv
+ \definedummyword\error
+ \definedummyword\euro
+ \definedummyword\guillemetleft
+ \definedummyword\guillemetright
+ \definedummyword\guilsinglleft
+ \definedummyword\guilsinglright
+ \definedummyword\expansion
+ \definedummyword\minus
+ \definedummyword\ogonek
+ \definedummyword\pounds
+ \definedummyword\point
+ \definedummyword\print
+ \definedummyword\quotedblbase
+ \definedummyword\quotedblleft
+ \definedummyword\quotedblright
+ \definedummyword\quoteleft
+ \definedummyword\quoteright
+ \definedummyword\quotesinglbase
+ \definedummyword\result
+ \definedummyword\textdegree
+ %
+ % We want to disable all macros so that they are not expanded by \write.
+ \macrolist
+ %
+ \normalturnoffactive
+ %
+ % Handle some cases of @value -- where it does not contain any
+ % (non-fully-expandable) commands.
+ \makevalueexpandable
+}
+
+% \commondummiesnofonts: common to \commondummies and \indexnofonts.
+%
+\def\commondummiesnofonts{%
+ % Control letters and accents.
+ \definedummyletter\!%
+ \definedummyaccent\"%
+ \definedummyaccent\'%
+ \definedummyletter\*%
+ \definedummyaccent\,%
+ \definedummyletter\.%
+ \definedummyletter\/%
+ \definedummyletter\:%
+ \definedummyaccent\=%
+ \definedummyletter\?%
+ \definedummyaccent\^%
+ \definedummyaccent\`%
+ \definedummyaccent\~%
+ \definedummyword\u
+ \definedummyword\v
+ \definedummyword\H
+ \definedummyword\dotaccent
+ \definedummyword\ogonek
+ \definedummyword\ringaccent
+ \definedummyword\tieaccent
+ \definedummyword\ubaraccent
+ \definedummyword\udotaccent
+ \definedummyword\dotless
+ %
+ % Texinfo font commands.
+ \definedummyword\b
+ \definedummyword\i
+ \definedummyword\r
+ \definedummyword\sc
+ \definedummyword\t
+ %
+ % Commands that take arguments.
+ \definedummyword\acronym
+ \definedummyword\cite
+ \definedummyword\code
+ \definedummyword\command
+ \definedummyword\dfn
+ \definedummyword\emph
+ \definedummyword\env
+ \definedummyword\file
+ \definedummyword\kbd
+ \definedummyword\key
+ \definedummyword\math
+ \definedummyword\option
+ \definedummyword\pxref
+ \definedummyword\ref
+ \definedummyword\samp
+ \definedummyword\strong
+ \definedummyword\tie
+ \definedummyword\uref
+ \definedummyword\url
+ \definedummyword\var
+ \definedummyword\verb
+ \definedummyword\w
+ \definedummyword\xref
+}
+
+% \indexnofonts is used when outputting the strings to sort the index
+% by, and when constructing control sequence names. It eliminates all
+% control sequences and just writes whatever the best ASCII sort string
+% would be for a given command (usually its argument).
+%
+\def\indexnofonts{%
+ % Accent commands should become @asis.
+ \def\definedummyaccent##1{\let##1\asis}%
+ % We can just ignore other control letters.
+ \def\definedummyletter##1{\let##1\empty}%
+ % Hopefully, all control words can become @asis.
+ \let\definedummyword\definedummyaccent
+ %
+ \commondummiesnofonts
+ %
+ % Don't no-op \tt, since it isn't a user-level command
+ % and is used in the definitions of the active chars like <, >, |, etc.
+ % Likewise with the other plain tex font commands.
+ %\let\tt=\asis
+ %
+ \def\ { }%
+ \def\@{@}%
+ % how to handle braces?
+ \def\_{\normalunderscore}%
+ %
+ % Non-English letters.
+ \def\AA{AA}%
+ \def\AE{AE}%
+ \def\L{L}%
+ \def\OE{OE}%
+ \def\O{O}%
+ \def\aa{aa}%
+ \def\ae{ae}%
+ \def\l{l}%
+ \def\oe{oe}%
+ \def\o{o}%
+ \def\ss{ss}%
+ \def\exclamdown{!}%
+ \def\questiondown{?}%
+ \def\ordf{a}%
+ \def\ordm{o}%
+ %
+ \def\LaTeX{LaTeX}%
+ \def\TeX{TeX}%
+ %
+ % Assorted special characters.
+ % (The following {} will end up in the sort string, but that's ok.)
+ \def\bullet{bullet}%
+ \def\comma{,}%
+ \def\copyright{copyright}%
+ \def\registeredsymbol{R}%
+ \def\dots{...}%
+ \def\enddots{...}%
+ \def\equiv{==}%
+ \def\error{error}%
+ \def\euro{euro}%
+ \def\guillemetleft{<<}%
+ \def\guillemetright{>>}%
+ \def\guilsinglleft{<}%
+ \def\guilsinglright{>}%
+ \def\expansion{==>}%
+ \def\minus{-}%
+ \def\pounds{pounds}%
+ \def\point{.}%
+ \def\print{-|}%
+ \def\quotedblbase{"}%
+ \def\quotedblleft{"}%
+ \def\quotedblright{"}%
+ \def\quoteleft{`}%
+ \def\quoteright{'}%
+ \def\quotesinglbase{,}%
+ \def\result{=>}%
+ \def\textdegree{degrees}%
+ %
+ % We need to get rid of all macros, leaving only the arguments (if present).
+ % Of course this is not nearly correct, but it is the best we can do for now.
+ % makeinfo does not expand macros in the argument to @deffn, which ends up
+ % writing an index entry, and texindex isn't prepared for an index sort entry
+ % that starts with \.
+ %
+ % Since macro invocations are followed by braces, we can just redefine them
+ % to take a single TeX argument. The case of a macro invocation that
+ % goes to end-of-line is not handled.
+ %
+ \macrolist
+}
+
+\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% Most index entries go through here, but \dosubind is the general case.
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{\dosubind{#1}{#2}{}}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% empty if called from \doind, as we usually are (the main exception
+% is with most defuns, which call us directly).
+%
+\def\dosubind#1#2#3{%
+ \iflinks
+ {%
+ % Store the main index entry text (including the third arg).
+ \toks0 = {#2}%
+ % If third arg is present, precede it with a space.
+ \def\thirdarg{#3}%
+ \ifx\thirdarg\empty \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ \edef\writeto{\csname#1indfile\endcsname}%
+ %
+ \safewhatsit\dosubindwrite
+ }%
+ \fi
+}
+
+% Write the entry in \toks0 to the index file:
+%
+\def\dosubindwrite{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+ \fi
+ %
+ % Remember, we are within a group.
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ % Process the index entry with all font commands turned off, to
+ % get the string to sort by.
+ {\indexnofonts
+ \edef\temp{\the\toks0}% need full expansion
+ \xdef\indexsorttmp{\temp}%
+ }%
+ %
+ % Set up the complete index entry, with both the sort key and
+ % the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file (four in the
+ % subentry case), texindex reduces to two when writing the .??s
+ % sorted result.
+ \edef\temp{%
+ \write\writeto{%
+ \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
+ }%
+ \temp
+}
+
+% Take care of unwanted page breaks/skips around a whatsit:
+%
+% If a skip is the last thing on the list now, preserve it
+% by backing up by \lastskip, doing the \write, then inserting
+% the skip again. Otherwise, the whatsit generated by the
+% \write or \pdfdest will make \lastskip zero. The result is that
+% sequences like this:
+% @end defun
+% @tindex whatever
+% @defun ...
+% will have extra space inserted, because the \medbreak in the
+% start of the @defun won't see the skip inserted by the @end of
+% the previous defun.
+%
+% But don't do any of this if we're not in vertical mode. We
+% don't want to do a \vskip and prematurely end a paragraph.
+%
+% Avoid page breaks due to these extra skips, too.
+%
+% But wait, there is a catch there:
+% We'll have to check whether \lastskip is zero skip. \ifdim is not
+% sufficient for this purpose, as it ignores stretch and shrink parts
+% of the skip. The only way seems to be to check the textual
+% representation of the skip.
+%
+% The following is almost like \def\zeroskipmacro{0.0pt} except that
+% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
+%
+\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
+%
+\newskip\whatsitskip
+\newcount\whatsitpenalty
+%
+% ..., ready, GO:
+%
+\def\safewhatsit#1{%
+\ifhmode
+ #1%
+\else
+ % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
+ \whatsitskip = \lastskip
+ \edef\lastskipmacro{\the\lastskip}%
+ \whatsitpenalty = \lastpenalty
+ %
+ % If \lastskip is nonzero, that means the last item was a
+ % skip. And since a skip is discardable, that means this
+ % -\whatsitskip glue we're inserting is preceded by a
+ % non-discardable item, therefore it is not a potential
+ % breakpoint, therefore no \nobreak needed.
+ \ifx\lastskipmacro\zeroskipmacro
+ \else
+ \vskip-\whatsitskip
+ \fi
+ %
+ #1%
+ %
+ \ifx\lastskipmacro\zeroskipmacro
+ % If \lastskip was zero, perhaps the last item was a penalty, and
+ % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
+ % to re-insert the same penalty (values >10000 are used for various
+ % signals); since we just inserted a non-discardable item, any
+ % following glue (such as a \parskip) would be a breakpoint. For example:
+ %
+ % @deffn deffn-whatever
+ % @vindex index-whatever
+ % Description.
+ % would allow a break between the index-whatever whatsit
+ % and the "Description." paragraph.
+ \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
+ \else
+ % On the other hand, if we had a nonzero \lastskip,
+ % this make-up glue would be preceded by a non-discardable item
+ % (the whatsit from the \write), so we must insert a \nobreak.
+ \nobreak\vskip\whatsitskip
+ \fi
+\fi
+}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\parseargdef\printindex{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \smallfonts \rm
+ \tolerance = 9500
+ \plainfrenchspacing
+ \everypar = {}% don't want the \kern\-parindent from indentation suppression.
+ %
+ % See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
+ \openin 1 \jobname.#1s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ \putwordIndexNonexistent
+ \else
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \temp
+ \ifeof 1
+ \putwordIndexIsEmpty
+ \else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\backslashcurfont}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
+ \input \jobname.#1s
+ \enddoublecolumns
+ \fi
+ \fi
+ \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \nobreak
+ \vskip 0pt plus 3\baselineskip
+ \penalty 0
+ \vskip 0pt plus -3\baselineskip
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ % Do our best not to break after the initial.
+ \nobreak
+ \vskip .33\baselineskip plus .1\baselineskip
+}}
+
+% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
+% then page number (#2) flushed to the right margin. It is used for index
+% and table of contents entries. The paragraph is indented by \leftskip.
+%
+% A straightforward implementation would start like this:
+% \def\entry#1#2{...
+% But this freezes the catcodes in the argument, and can cause problems to
+% @code, which sets - active. This problem was fixed by a kludge---
+% ``-'' was active throughout whole index, but this isn't really right.
+%
+% The right solution is to prevent \entry from swallowing the whole text.
+% --kasal, 21nov03
+\def\entry{%
+ \begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent = 2em
+ %
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
+ %
+ % A bit of stretch before each entry for the benefit of balancing
+ % columns.
+ \vskip 0pt plus1pt
+ %
+ % Swallow the left brace of the text (first parameter):
+ \afterassignment\doentry
+ \let\temp =
+}
+\def\doentry{%
+ \bgroup % Instead of the swallowed brace.
+ \noindent
+ \aftergroup\finishentry
+ % And now comes the text of the entry.
+}
+\def\finishentry#1{%
+ % #1 is the page number.
+ %
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \setbox\boxA = \hbox{#1}%
+ \ifdim\wd\boxA = 0pt
+ \ %
+ \else
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ifpdf
+ \pdfgettoks#1.%
+ \ \the\toksA
+ \else
+ \ #1%
+ \fi
+ \fi
+ \par
+ \endgroup
+}
+
+% Like plain.tex's \dotfill, except uses up at least 1 em.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+\def\secondary#1#2{{%
+ \parfillskip=0in
+ \parskip=0in
+ \hangindent=1in
+ \hangafter=1
+ \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ #2
+ \fi
+ \par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % Grab any single-column material above us.
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
+ %
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it in one place.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ \advance\dimen@ by -\ht\partialpage
+ %
+ % box0 will be the left-hand column, box2 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255
+ \penalty\outputpenalty
+}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
+\def\pagesofar{%
+ \unvbox\partialpage
+ %
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
+}
+%
+% All done with double columns.
+\def\enddoublecolumns{%
+ % The following penalty ensures that the page builder is exercised
+ % _before_ we change the output routine. This is necessary in the
+ % following situation:
+ %
+ % The last section of the index consists only of a single entry.
+ % Before this section, \pagetotal is less than \pagegoal, so no
+ % break occurs before the last section starts. However, the last
+ % section, consisting of \initial and the single \entry, does not
+ % fit on the page and has to be broken off. Without the following
+ % penalty the page builder will not be exercised until \eject
+ % below, and by that time we'll already have changed the output
+ % routine to the \balancecolumns version, so the next-to-last
+ % double-column page will be processed with \balancecolumns, which
+ % is wrong: The two columns will go to the main vertical list, with
+ % the broken-off section in the recent contributions. As soon as
+ % the output routine finishes, TeX starts reconsidering the page
+ % break. The two columns and the broken-off section both fit on the
+ % page, because the two columns now take up only half of the page
+ % goal. When TeX sees \eject from below which follows the final
+ % section, it invokes the new output routine that we've set after
+ % \balancecolumns below; \onepageout will try to fit the two columns
+ % and the final section into the vbox of \pageheight (see
+ % \pagebody), causing an overfull box.
+ %
+ % Note that glue won't work here, because glue does not exercise the
+ % page builder, unlike penalties (see The TeXbook, pp. 280-281).
+ \penalty0
+ %
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
+}
+%
+% Called at the end of the double column material.
+\def\balancecolumns{%
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+ \splittopskip = \topskip
+ % Loop until we get a decent breakpoint.
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+ \setbox0=\vbox to\dimen@{\unvbox1}%
+ \setbox2=\vbox to\dimen@{\unvbox3}%
+ %
+ \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+% \unnumberedno is an oxymoron, of course. But we count the unnumbered
+% sections so that we can refer to them unambiguously in the pdf
+% outlines by their "section number". We avoid collisions with chapter
+% numbers by starting them at 10000. (If a document ever has 10000
+% chapters, we're in trouble anyway, I'm sure.)
+\newcount\unnumberedno \unnumberedno = 10000
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno \appendixno = `\@
+%
+% \def\appendixletter{\char\the\appendixno}
+% We do the following ugly conditional instead of the above simple
+% construct for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+%
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% Each @chapter defines these (using marks) as the number+name, number
+% and name of the chapter. Page headings and footings can use
+% these. @section does likewise.
+\def\thischapter{}
+\def\thischapternum{}
+\def\thischaptername{}
+\def\thissection{}
+\def\thissectionnum{}
+\def\thissectionname{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% we only have subsub.
+\chardef\maxseclevel = 3
+%
+% A numbered section within an unnumbered changes to unnumbered too.
+% To achive this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unmlevel = \maxseclevel
+%
+% Trace whether the current chapter is an appendix or not:
+% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
+\def\chapheadtype{N}
+
+% Choose a heading macro
+% #1 is heading type
+% #2 is heading level
+% #3 is text for heading
+\def\genhead#1#2#3{%
+ % Compute the abs. sec. level:
+ \absseclevel=#2
+ \advance\absseclevel by \secbase
+ % Make sure \absseclevel doesn't fall outside the range:
+ \ifnum \absseclevel < 0
+ \absseclevel = 0
+ \else
+ \ifnum \absseclevel > 3
+ \absseclevel = 3
+ \fi
+ \fi
+ % The heading type:
+ \def\headtype{#1}%
+ \if \headtype U%
+ \ifnum \absseclevel < \unmlevel
+ \chardef\unmlevel = \absseclevel
+ \fi
+ \else
+ % Check for appendix sections:
+ \ifnum \absseclevel = 0
+ \edef\chapheadtype{\headtype}%
+ \else
+ \if \headtype A\if \chapheadtype N%
+ \errmessage{@appendix... within a non-appendix chapter}%
+ \fi\fi
+ \fi
+ % Check for numbered within unnumbered:
+ \ifnum \absseclevel > \unmlevel
+ \def\headtype{U}%
+ \else
+ \chardef\unmlevel = 3
+ \fi
+ \fi
+ % Now print the heading:
+ \if \headtype U%
+ \ifcase\absseclevel
+ \unnumberedzzz{#3}%
+ \or \unnumberedseczzz{#3}%
+ \or \unnumberedsubseczzz{#3}%
+ \or \unnumberedsubsubseczzz{#3}%
+ \fi
+ \else
+ \if \headtype A%
+ \ifcase\absseclevel
+ \appendixzzz{#3}%
+ \or \appendixsectionzzz{#3}%
+ \or \appendixsubseczzz{#3}%
+ \or \appendixsubsubseczzz{#3}%
+ \fi
+ \else
+ \ifcase\absseclevel
+ \chapterzzz{#3}%
+ \or \seczzz{#3}%
+ \or \numberedsubseczzz{#3}%
+ \or \numberedsubsubseczzz{#3}%
+ \fi
+ \fi
+ \fi
+ \suppressfirstparagraphindent
+}
+
+% an interface:
+\def\numhead{\genhead N}
+\def\apphead{\genhead A}
+\def\unnmhead{\genhead U}
+
+% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
+% all lower-level sectioning counters to zero.
+%
+% Also set \chaplevelprefix, which we prepend to @float sequence numbers
+% (e.g., figures), q.v. By default (before any chapter), that is empty.
+\let\chaplevelprefix = \empty
+%
+\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz#1{%
+ % section resetting is \global in case the chapter is in a group, such
+ % as an @include file.
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\chapno by 1
+ %
+ % Used for \float.
+ \gdef\chaplevelprefix{\the\chapno.}%
+ \resetallfloatnos
+ %
+ \message{\putwordChapter\space \the\chapno}%
+ %
+ % Write the actual heading.
+ \chapmacro{#1}{Ynumbered}{\the\chapno}%
+ %
+ % So @section and the like are numbered underneath this chapter.
+ \global\let\section = \numberedsec
+ \global\let\subsection = \numberedsubsec
+ \global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\appendixno by 1
+ \gdef\chaplevelprefix{\appendixletter.}%
+ \resetallfloatnos
+ %
+ \def\appendixnum{\putwordAppendix\space \appendixletter}%
+ \message{\appendixnum}%
+ %
+ \chapmacro{#1}{Yappendix}{\appendixletter}%
+ %
+ \global\let\section = \appendixsec
+ \global\let\subsection = \appendixsubsec
+ \global\let\subsubsection = \appendixsubsubsec
+}
+
+\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\unnumberedno by 1
+ %
+ % Since an unnumbered has no number, no prefix for figures.
+ \global\let\chaplevelprefix = \empty
+ \resetallfloatnos
+ %
+ % This used to be simply \message{#1}, but TeX fully expands the
+ % argument to \message. Therefore, if #1 contained @-commands, TeX
+ % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+ % expanded @cite (which turns out to cause errors because \cite is meant
+ % to be executed, not expanded).
+ %
+ % Anyway, we don't want the fully-expanded definition of @cite to appear
+ % as a result of the \message, we just want `@cite' itself. We use
+ % \the<toks register> to achieve this: TeX expands \the<toks> only once,
+ % simply yielding the contents of <toks register>. (We also do this for
+ % the toc entries.)
+ \toks0 = {#1}%
+ \message{(\the\toks0)}%
+ %
+ \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
+ %
+ \global\let\section = \unnumberedsec
+ \global\let\subsection = \unnumberedsubsec
+ \global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\parseargdef\centerchap{%
+ % Well, we could do the following in a group, but that would break
+ % an assumption that \chapmacro is called at the outermost level.
+ % Thus we are safer this way: --kasal, 24feb04
+ \let\centerparametersmaybe = \centerparameters
+ \unnmhead0{#1}%
+ \let\centerparametersmaybe = \relax
+}
+
+% @top is like @unnumbered.
+\let\top\unnumbered
+
+% Sections.
+\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
+\def\seczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
+}
+
+\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
+}
+\let\appendixsec\appendixsection
+
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
+}
+
+% Subsections.
+\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
+}
+
+\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno}%
+}
+
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno}%
+}
+
+% Subsubsections.
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynumbered}%
+ {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\let\section = \numberedsec
+\let\subsection = \numberedsubsec
+\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+% NOTE on use of \vbox for chapter headings, section headings, and such:
+% 1) We use \vbox rather than the earlier \line to permit
+% overlong headings to fold.
+% 2) \hyphenpenalty is set to 10000 because hyphenation in a
+% heading is obnoxious; this forbids it.
+% 3) Likewise, headings look best if no \parindent is used, and
+% if justification is not attempted. Hence \raggedright.
+
+\def\majorheading{%
+ {\advance\chapheadingskip by 10pt \chapbreak }%
+ \parsearg\chapheadingzzz
+}
+
+\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
+\def\chapheadingzzz#1{%
+ {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rmisbold #1\hfill}}%
+ \bigskip \par\penalty 200\relax
+ \suppressfirstparagraphindent
+}
+
+% @heading, @subheading, @subsubheading.
+\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+%%% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+%%% Define plain chapter starts, and page on/off switching for it
+% Parameter controlling skip before chapter headings (if needed)
+
+\newskip\chapheadingskip
+
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+% Because \domark is called before \chapoddpage, the filler page will
+% get the headings for the next chapter, which is wrong. But we don't
+% care -- we just disable all headings on the filler page.
+\def\chapoddpage{%
+ \chappager
+ \ifodd\pageno \else
+ \begingroup
+ \evenheadline={\hfil}\evenfootline={\hfil}%
+ \oddheadline={\hfil}\oddfootline={\hfil}%
+ \hbox to 0pt{}%
+ \chappager
+ \endgroup
+ \fi
+}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{%
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+% Chapter opening.
+%
+% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
+% Yappendix, Yomitfromtoc), #3 the chapter number.
+%
+% To test against our argument.
+\def\Ynothingkeyword{Ynothing}
+\def\Yomitfromtockeyword{Yomitfromtoc}
+\def\Yappendixkeyword{Yappendix}
+%
+\def\chapmacro#1#2#3{%
+ % Insert the first mark before the heading break (see notes for \domark).
+ \let\prevchapterdefs=\lastchapterdefs
+ \let\prevsectiondefs=\lastsectiondefs
+ \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
+ \gdef\thissection{}}%
+ %
+ \def\temptype{#2}%
+ \ifx\temptype\Ynothingkeyword
+ \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\thischapter{\thischaptername}}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\thischapter{}}%
+ \else\ifx\temptype\Yappendixkeyword
+ \toks0={#1}%
+ \xdef\lastchapterdefs{%
+ \gdef\noexpand\thischaptername{\the\toks0}%
+ \gdef\noexpand\thischapternum{\appendixletter}%
+ \gdef\noexpand\thischapter{\putwordAppendix{} \noexpand\thischapternum:
+ \noexpand\thischaptername}%
+ }%
+ \else
+ \toks0={#1}%
+ \xdef\lastchapterdefs{%
+ \gdef\noexpand\thischaptername{\the\toks0}%
+ \gdef\noexpand\thischapternum{\the\chapno}%
+ \gdef\noexpand\thischapter{\putwordChapter{} \noexpand\thischapternum:
+ \noexpand\thischaptername}%
+ }%
+ \fi\fi\fi
+ %
+ % Output the mark. Pass it through \safewhatsit, to take care of
+ % the preceding space.
+ \safewhatsit\domark
+ %
+ % Insert the chapter heading break.
+ \pchapsepmacro
+ %
+ % Now the second mark, after the heading break. No break points
+ % between here and the heading.
+ \let\prevchapterdefs=\lastchapterdefs
+ \let\prevsectiondefs=\lastsectiondefs
+ \domark
+ %
+ {%
+ \chapfonts \rmisbold
+ %
+ % Have to define \lastsection before calling \donoderef, because the
+ % xref code eventually uses it. On the other hand, it has to be called
+ % after \pchapsepmacro, or the headline will change too soon.
+ \gdef\lastsection{#1}%
+ %
+ % Only insert the separating space if we have a chapter/appendix
+ % number, and don't print the unnumbered ``number''.
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unnchap}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
+ \def\toctype{omit}%
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
+ \def\toctype{app}%
+ \else
+ \setbox0 = \hbox{#3\enspace}%
+ \def\toctype{numchap}%
+ \fi\fi\fi
+ %
+ % Write the toc entry for this chapter. Must come before the
+ % \donoderef, because we include the current node name in the toc
+ % entry, and \donoderef resets it to empty.
+ \writetocentry{\toctype}{#1}{#3}%
+ %
+ % For pdftex, we have to write out the node definition (aka, make
+ % the pdfdest) after any page break, but before the actual text has
+ % been typeset. If the destination for the pdf outline is after the
+ % text, then jumping from the outline may wind up with the text not
+ % being visible, for instance under high magnification.
+ \donoderef{#2}%
+ %
+ % Typeset the actual heading.
+ \nobreak % Avoid page breaks at the interline glue.
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent=\wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerparameters{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+}
+
+
+% I don't think this chapter style is supported any more, so I'm not
+% updating it with the new noderef stuff. We'll see. --karl, 11aug03.
+%
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+%
+\def\unnchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rmisbold #1\hfill}}\bigskip \par\nobreak
+}
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+\def\centerchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt
+ \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
+}
+\def\CHAPFopen{%
+ \global\let\chapmacro=\chfopen
+ \global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles. These macros combine the section number parts and
+% call the generic \sectionheading to do the printing.
+%
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
+
+% Subsection titles.
+\newskip\subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
+
+% Subsubsection titles.
+\def\subsubsecheadingskip{\subsecheadingskip}
+\def\subsubsecheadingbreak{\subsecheadingbreak}
+
+
+% Print any size, any type, section title.
+%
+% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
+% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
+% section number.
+%
+\def\seckeyword{sec}
+%
+\def\sectionheading#1#2#3#4{%
+ {%
+ % Switch to the right set of fonts.
+ \csname #2fonts\endcsname \rmisbold
+ %
+ \def\sectionlevel{#2}%
+ \def\temptype{#3}%
+ %
+ % Insert first mark before the heading break (see notes for \domark).
+ \let\prevsectiondefs=\lastsectiondefs
+ \ifx\temptype\Ynothingkeyword
+ \ifx\sectionlevel\seckeyword
+ \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
+ \gdef\thissection{\thissectionname}}%
+ \fi
+ \else\ifx\temptype\Yomitfromtockeyword
+ % Don't redefine \thissection.
+ \else\ifx\temptype\Yappendixkeyword
+ \ifx\sectionlevel\seckeyword
+ \toks0={#1}%
+ \xdef\lastsectiondefs{%
+ \gdef\noexpand\thissectionname{\the\toks0}%
+ \gdef\noexpand\thissectionnum{#4}%
+ \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum:
+ \noexpand\thissectionname}%
+ }%
+ \fi
+ \else
+ \ifx\sectionlevel\seckeyword
+ \toks0={#1}%
+ \xdef\lastsectiondefs{%
+ \gdef\noexpand\thissectionname{\the\toks0}%
+ \gdef\noexpand\thissectionnum{#4}%
+ \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum:
+ \noexpand\thissectionname}%
+ }%
+ \fi
+ \fi\fi\fi
+ %
+ % Output the mark. Pass it through \safewhatsit, to take care of
+ % the preceding space.
+ \safewhatsit\domark
+ %
+ % Insert space above the heading.
+ \csname #2headingbreak\endcsname
+ %
+ % Now the second mark, after the heading break. No break points
+ % between here and the heading.
+ \let\prevsectiondefs=\lastsectiondefs
+ \domark
+ %
+ % Only insert the space after the number if we have a section number.
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unn}%
+ \gdef\lastsection{#1}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ % for @headings -- no section number, don't include in toc,
+ % and don't redefine \lastsection.
+ \setbox0 = \hbox{}%
+ \def\toctype{omit}%
+ \let\sectionlevel=\empty
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{app}%
+ \gdef\lastsection{#1}%
+ \else
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{num}%
+ \gdef\lastsection{#1}%
+ \fi\fi\fi
+ %
+ % Write the toc entry (before \donoderef). See comments in \chapmacro.
+ \writetocentry{\toctype\sectionlevel}{#1}{#4}%
+ %
+ % Write the node reference (= pdf destination for pdftex).
+ % Again, see comments in \chapmacro.
+ \donoderef{#3}%
+ %
+ % Interline glue will be inserted when the vbox is completed.
+ % That glue will be a valid breakpoint for the page, since it'll be
+ % preceded by a whatsit (usually from the \donoderef, or from the
+ % \writetocentry if there was no node). We don't want to allow that
+ % break, since then the whatsits could end up on page n while the
+ % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
+ \nobreak
+ %
+ % Output the actual section heading.
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent=\wd0 % zero if no section number
+ \unhbox0 #1}%
+ }%
+ % Add extra space after the heading -- half of whatever came above it.
+ % Don't allow stretch, though.
+ \kern .5 \csname #2headingskip\endcsname
+ %
+ % Do not let the kern be a potential breakpoint, as it would be if it
+ % was followed by glue.
+ \nobreak
+ %
+ % We'll almost certainly start a paragraph next, so don't let that
+ % glue accumulate. (Not a breakpoint because it's preceded by a
+ % discardable item.)
+ \vskip-\parskip
+ %
+ % This is purely so the last item on the list is a known \penalty >
+ % 10000. This is so \startdefun can avoid allowing breakpoints after
+ % section headings. Otherwise, it would insert a valid breakpoint between:
+ %
+ % @section sec-whatever
+ % @deffn def-whatever
+ \penalty 10001
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc.
+%
+% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
+% We append the current node name (if any) and page number as additional
+% arguments for the \{chap,sec,...}entry macros which will eventually
+% read this. The node name is used in the pdf outlines as the
+% destination to jump to.
+%
+% We open the .toc file for writing here instead of at @setfilename (or
+% any other fixed time) so that @contents can be anywhere in the document.
+% But if #1 is `omit', then we don't do anything. This is used for the
+% table of contents chapter openings themselves.
+%
+\newif\iftocfileopened
+\def\omitkeyword{omit}%
+%
+\def\writetocentry#1#2#3{%
+ \edef\writetoctype{#1}%
+ \ifx\writetoctype\omitkeyword \else
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ %
+ \iflinks
+ {\atdummies
+ \edef\temp{%
+ \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
+ \temp
+ }%
+ \fi
+ \fi
+ %
+ % Tell \shipout to create a pdf destination on each page, if we're
+ % writing pdf. These are used in the table of contents. We can't
+ % just write one on every page because the title pages are numbered
+ % 1 and 2 (the page numbers aren't printed), and so are the first
+ % two pages of the document. Thus, we'd have two destinations named
+ % `1', and two named `2'.
+ \ifpdf \global\pdfmakepagedesttrue \fi
+}
+
+
+% These characters do not print properly in the Computer Modern roman
+% fonts, so we must take special care. This is more or less redundant
+% with the Texinfo input format setup at the end of this file.
+%
+\def\activecatcodes{%
+ \catcode`\"=\active
+ \catcode`\$=\active
+ \catcode`\<=\active
+ \catcode`\>=\active
+ \catcode`\\=\active
+ \catcode`\^=\active
+ \catcode`\_=\active
+ \catcode`\|=\active
+ \catcode`\~=\active
+}
+
+
+% Read the toc file, which is essentially Texinfo input.
+\def\readtocfile{%
+ \setupdatafile
+ \activecatcodes
+ \input \tocreadfilename
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Prepare to read what we've written to \tocfile.
+%
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \chapmacro{#1}{Yomitfromtoc}{}%
+ %
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+}
+
+% redefined for the two-volume lispref. We always output on
+% \jobname.toc even if this is redefined.
+%
+\def\tocreadfilename{\jobname.toc}
+
+% Normal (long) toc.
+%
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \tocreadfilename\space
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \ifeof 1 \else
+ \pdfmakeoutlines
+ \fi
+ \closein 1
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
+ %
+ \let\numchapentry = \shortchapentry
+ \let\appentry = \shortchapentry
+ \let\unnchapentry = \shortunnchapentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf
+ \let\sl=\shortcontsl \let\tt=\shortconttt
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\numsecentry##1##2##3##4{}
+ \let\appsecentry = \numsecentry
+ \let\unnsecentry = \numsecentry
+ \let\numsubsecentry = \numsecentry
+ \let\appsubsecentry = \numsecentry
+ \let\unnsubsecentry = \numsecentry
+ \let\numsubsubsecentry = \numsecentry
+ \let\appsubsubsecentry = \numsecentry
+ \let\unnsubsubsecentry = \numsecentry
+ \openin 1 \tocreadfilename\space
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \closein 1
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
+%
+\def\shortchaplabel#1{%
+ % This space should be enough, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % But use \hss just in case.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ %
+ % We'd like to right-justify chapter numbers, but that looks strange
+ % with appendix letters. And right-justifying numbers and
+ % left-justifying letters looks strange when there is less than 10
+ % chapters. Have to read the whole toc once to know how many chapters
+ % there are before deciding ...
+ \hbox to 1em{#1\hss}%
+}
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Chapters, in the main contents.
+\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
+%
+% Chapters, in the short toc.
+% See comments in \dochapentry re vbox and related settings.
+\def\shortchapentry#1#2#3#4{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
+}
+
+% Appendices, in the main contents.
+% Need the word Appendix, and a fixed-size box.
+%
+\def\appendixbox#1{%
+ % We use M since it's probably the widest letter.
+ \setbox0 = \hbox{\putwordAppendix{} M}%
+ \hbox to \wd0{\putwordAppendix{} #1\hss}}
+%
+\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
+
+% Unnumbered chapters.
+\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
+\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
+
+% Sections.
+\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
+\let\appsecentry=\numsecentry
+\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
+
+% Subsections.
+\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsecentry=\numsubsecentry
+\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
+
+% And subsubsections.
+\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsubsecentry=\numsubsubsecentry
+\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
+
+% This parameter controls the indentation of the various levels.
+% Same as \defaultparindent.
+\newdimen\tocindent \tocindent = 15pt
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ \chapentryfonts
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% We use the same \entry macro as for the index entries.
+\let\tocentry = \entry
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\def\subsecentryfonts{\textfonts}
+\def\subsubsecentryfonts{\textfonts}
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
+% define and register \INITMACRO to be called on markup style changes.
+% \INITMACRO can check \currentmarkupstyle for the innermost
+% style and the set of \ifmarkupSTYLE switches for all styles
+% currently in effect.
+\newif\ifmarkupvar
+\newif\ifmarkupsamp
+\newif\ifmarkupkey
+%\newif\ifmarkupfile % @file == @samp.
+%\newif\ifmarkupoption % @option == @samp.
+\newif\ifmarkupcode
+\newif\ifmarkupkbd
+%\newif\ifmarkupenv % @env == @code.
+%\newif\ifmarkupcommand % @command == @code.
+\newif\ifmarkuptex % @tex (and part of @math, for now).
+\newif\ifmarkupexample
+\newif\ifmarkupverb
+\newif\ifmarkupverbatim
+
+\let\currentmarkupstyle\empty
+
+\def\setupmarkupstyle#1{%
+ \csname markup#1true\endcsname
+ \def\currentmarkupstyle{#1}%
+ \markupstylesetup
+}
+
+\let\markupstylesetup\empty
+
+\def\defmarkupstylesetup#1{%
+ \expandafter\def\expandafter\markupstylesetup
+ \expandafter{\markupstylesetup #1}%
+ \def#1%
+}
+
+% Markup style setup for left and right quotes.
+\defmarkupstylesetup\markupsetuplq{%
+ \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname
+ \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
+}
+
+\defmarkupstylesetup\markupsetuprq{%
+ \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname
+ \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
+}
+
+{
+\catcode`\'=\active
+\catcode`\`=\active
+
+\gdef\markupsetuplqdefault{\let`\lq}
+\gdef\markupsetuprqdefault{\let'\rq}
+
+\gdef\markupsetcodequoteleft{\let`\codequoteleft}
+\gdef\markupsetcodequoteright{\let'\codequoteright}
+
+\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
+}
+
+\let\markupsetuplqcode \markupsetcodequoteleft
+\let\markupsetuprqcode \markupsetcodequoteright
+\let\markupsetuplqexample \markupsetcodequoteleft
+\let\markupsetuprqexample \markupsetcodequoteright
+\let\markupsetuplqverb \markupsetcodequoteleft
+\let\markupsetuprqverb \markupsetcodequoteright
+\let\markupsetuplqverbatim \markupsetcodequoteleft
+\let\markupsetuprqverbatim \markupsetcodequoteright
+
+\let\markupsetuplqsamp \markupsetnoligaturesquoteleft
+\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
+
+% Allow an option to not replace quotes with a regular directed right
+% quote/apostrophe (char 0x27), but instead use the undirected quote
+% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it
+% the default, but it works for pasting with more pdf viewers (at least
+% evince), the lilypond developers report. xpdf does work with the
+% regular 0x27.
+%
+\def\codequoteright{%
+ \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
+ \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+ '%
+ \else \char'15 \fi
+ \else \char'15 \fi
+}
+%
+% and a similar option for the left quote char vs. a grave accent.
+% Modern fonts display ASCII 0x60 as a grave accent, so some people like
+% the code environments to do likewise.
+%
+\def\codequoteleft{%
+ \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
+ \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+ % [Knuth] pp. 380,381,391
+ % \relax disables Spanish ligatures ?` and !` of \tt font.
+ \relax`%
+ \else \char'22 \fi
+ \else \char'22 \fi
+}
+
+% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
+\def\noligaturesquoteleft{\relax\lq}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+%
+% Since these characters are used in examples, they should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+%
+\def\point{$\star$}
+\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
+\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% The @error{} command.
+% Adapted from the TeXbook's \boxit.
+%
+\newbox\errorbox
+%
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
+%
+\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{%
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+%
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @tex ... @end tex escapes into raw Tex temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain tex @ character.
+
+\envdef\tex{%
+ \setupmarkupstyle{tex}%
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
+ \catcode `\%=14
+ \catcode `\+=\other
+ \catcode `\"=\other
+ \catcode `\|=\other
+ \catcode `\<=\other
+ \catcode `\>=\other
+ \catcode`\`=\other
+ \catcode`\'=\other
+ \escapechar=`\\
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\/=\ptexslash
+ \let\*=\ptexstar
+ \let\t=\ptext
+ \expandafter \let\csname top\endcsname=\ptextop % outer
+ \let\frenchspacing=\plainfrenchspacing
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
+}
+% There is no need to define \Etex.
+
+% Define @lisp ... @end lisp.
+% @lisp environment forms a group so it can rebind things,
+% including the definition of @end lisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip.
+%
+\def\aboveenvbreak{{%
+ % =10000 instead of <10000 because of a special case in \itemzzz and
+ % \sectionheading, q.v.
+ \ifnum \lastpenalty=10000 \else
+ \advance\envskipamount by \parskip
+ \endgraf
+ \ifdim\lastskip<\envskipamount
+ \removelastskip
+ % it's not a good place to break if the last penalty was \nobreak
+ % or better ...
+ \ifnum\lastpenalty<10000 \penalty-50 \fi
+ \vskip\envskipamount
+ \fi
+ \fi
+}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
+% also clear it, so that its embedded environments do the narrowing again.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\envdef\cartouche{%
+ \ifhmode\par\fi % can't be in the midst of a paragraph.
+ \startsavinginserts
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt % we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+ % side, and for 6pt waste from
+ % each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing = t%
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \kern3pt
+ \hsize=\cartinner
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+ \comment % For explanation, see the end of \def\group.
+}
+\def\Ecartouche{%
+ \ifhmode\par\fi
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+ \checkinserts
+}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\def\nonfillstart{%
+ \aboveenvbreak
+ \hfuzz = 12pt % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ \parindent = 0pt
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+ \let\exdent=\nofillexdent
+}
+
+% If you want all examples etc. small: @set dispenvsize small.
+% If you want even small examples the full size: @set dispenvsize nosmall.
+% This affects the following displayed environments:
+% @example, @display, @format, @lisp
+%
+\def\smallword{small}
+\def\nosmallword{nosmall}
+\let\SETdispenvsize\relax
+\def\setnormaldispenv{%
+ \ifx\SETdispenvsize\smallword
+ % end paragraph for sake of leading, in case document has no blank
+ % line. This is redundant with what happens in \aboveenvbreak, but
+ % we need to do it before changing the fonts, and it's inconvenient
+ % to change the fonts afterward.
+ \ifnum \lastpenalty=10000 \else \endgraf \fi
+ \smallexamplefonts \rm
+ \fi
+}
+\def\setsmalldispenv{%
+ \ifx\SETdispenvsize\nosmallword
+ \else
+ \ifnum \lastpenalty=10000 \else \endgraf \fi
+ \smallexamplefonts \rm
+ \fi
+}
+
+% We often define two environments, @foo and @smallfoo.
+% Let's do it by one command:
+\def\makedispenv #1#2{
+ \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
+ \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
+ \expandafter\let\csname E#1\endcsname \afterenvbreak
+ \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
+}
+
+% Define two synonyms:
+\def\maketwodispenvs #1#2#3{
+ \makedispenv{#1}{#3}
+ \makedispenv{#2}{#3}
+}
+
+% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
+%
+% @smallexample and @smalllisp: use smaller fonts.
+% Originally contributed by Pavel@xerox.
+%
+\maketwodispenvs {lisp}{example}{%
+ \nonfillstart
+ \tt\setupmarkupstyle{example}%
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
+}
+% @display/@smalldisplay: same as @lisp except keep current font.
+%
+\makedispenv {display}{%
+ \nonfillstart
+ \gobble
+}
+
+% @format/@smallformat: same as @display except don't narrow margins.
+%
+\makedispenv{format}{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+
+% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
+\envdef\flushleft{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+\let\Eflushleft = \afterenvbreak
+
+% @flushright.
+%
+\envdef\flushright{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \advance\leftskip by 0pt plus 1fill
+ \gobble
+}
+\let\Eflushright = \afterenvbreak
+
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins. We keep \parskip nonzero in general, since
+% we're doing normal filling. So, when using \aboveenvbreak and
+% \afterenvbreak, temporarily make \parskip 0.
+%
+\def\quotationstart{%
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \parindent=0pt
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \advance\rightskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+ \parsearg\quotationlabel
+}
+
+\envdef\quotation{%
+ \setnormaldispenv
+ \quotationstart
+}
+
+\envdef\smallquotation{%
+ \setsmalldispenv
+ \quotationstart
+}
+\let\Esmallquotation = \Equotation
+
+% We have retained a nonzero parskip for the environment, since we're
+% doing normal filling.
+%
+\def\Equotation{%
+ \par
+ \ifx\quotationauthor\undefined\else
+ % indent a bit.
+ \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
+ \fi
+ {\parskip=0pt \afterenvbreak}%
+}
+
+% If we're given an argument, typeset it in bold with a colon after.
+\def\quotationlabel#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty \else
+ {\bf #1: }%
+ \fi
+}
+
+
+% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
+%
+% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
+%
+% [Knuth] p.344; only we need to do the other characters Texinfo sets
+% active too. Otherwise, they get lost as the first character on a
+% verbatim line.
+\def\dospecials{%
+ \do\ \do\\\do\{\do\}\do\$\do\&%
+ \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
+ \do\<\do\>\do\|\do\@\do+\do\"%
+ % Don't do the quotes -- if we do, @set txicodequoteundirected and
+ % @set txicodequotebacktick will not have effect on @verb and
+ % @verbatim, and ?` and !` ligatures won't get disabled.
+ %\do\`\do\'%
+}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+ \def\do##1{\catcode`##1=\other}\dospecials}
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+ \tt % easiest (and conventionally used) font for verbatim
+ \def\par{\leavevmode\endgraf}%
+ \setupmarkupstyle{verb}%
+ \tabeightspaces
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+\def\starttabbox{\setbox0=\hbox\bgroup}
+%
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabexpand{%
+ \catcode`\^^I=\active
+ \def^^I{\leavevmode\egroup
+ \dimen0=\wd0 % the width so far, or since the previous tab
+ \divide\dimen0 by\tabw
+ \multiply\dimen0 by\tabw % compute previous multiple of \tabw
+ \advance\dimen0 by\tabw % advance to next multiple of \tabw
+ \wd0=\dimen0 \box0 \starttabbox
+ }%
+ }
+\endgroup
+
+% start the verbatim environment.
+\def\setupverbatim{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ % Easiest (and conventionally used) font for verbatim
+ \tt
+ \def\par{\leavevmode\egroup\box0\endgraf}%
+ \tabexpand
+ \setupmarkupstyle{verbatim}%
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+ \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+% \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+ \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
+ \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+% \def\doverbatim#1@end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'.
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%
+\begingroup
+ \catcode`\ =\active
+ \obeylines %
+ % ignore everything up to the first ^^M, that's the newline at the end
+ % of the @verbatim input line itself. Otherwise we get an extra blank
+ % line in the output.
+ \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
+ % We really want {...\end verbatim} in the body of the macro, but
+ % without the active space; thus we have to use \xdef and \gobble.
+\endgroup
+%
+\envdef\verbatim{%
+ \setupverbatim\doverbatim
+}
+\let\Everbatim = \afterenvbreak
+
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
+%
+\def\doverbatiminclude#1{%
+ {%
+ \makevalueexpandable
+ \setupverbatim
+ \indexnofonts % Allow `@@' and other weird things in file names.
+ \input #1
+ \afterenvbreak
+ }%
+}
+
+% @copying ... @end copying.
+% Save the text away for @insertcopying later.
+%
+% We save the uninterpreted tokens, rather than creating a box.
+% Saving the text in a box would be much easier, but then all the
+% typesetting commands (@smallbook, font changes, etc.) have to be done
+% beforehand -- and a) we want @copying to be done first in the source
+% file; b) letting users define the frontmatter in as flexible order as
+% possible is very desirable.
+%
+\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
+\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
+%
+\def\insertcopying{%
+ \begingroup
+ \parindent = 0pt % paragraph indentation looks wrong on title page
+ \scanexp\copyingtext
+ \endgroup
+}
+
+
+\message{defuns,}
+% @defun etc.
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+\newcount\defunpenalty
+
+% Start the processing of @deffn:
+\def\startdefun{%
+ \ifnum\lastpenalty<10000
+ \medbreak
+ \defunpenalty=10003 % Will keep this @deffn together with the
+ % following @def command, see below.
+ \else
+ % If there are two @def commands in a row, we'll have a \nobreak,
+ % which is there to keep the function description together with its
+ % header. But if there's nothing but headers, we need to allow a
+ % break somewhere. Check specifically for penalty 10002, inserted
+ % by \printdefunline, instead of 10000, since the sectioning
+ % commands also insert a nobreak penalty, and we don't want to allow
+ % a break between a section heading and a defun.
+ %
+ % As a minor refinement, we avoid "club" headers by signalling
+ % with penalty of 10003 after the very first @deffn in the
+ % sequence (see above), and penalty of 10002 after any following
+ % @def command.
+ \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
+ %
+ % Similarly, after a section heading, do not allow a break.
+ % But do insert the glue.
+ \medskip % preceded by discardable penalty, so not a breakpoint
+ \fi
+ %
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+}
+
+\def\dodefunx#1{%
+ % First, check whether we are in the right environment:
+ \checkenv#1%
+ %
+ % As above, allow line break if we have multiple x headers in a row.
+ % It's not a great place, though.
+ \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
+ %
+ % And now, it's time to reuse the body of the original defun:
+ \expandafter\gobbledefun#1%
+}
+\def\gobbledefun#1\startdefun{}
+
+% \printdefunline \deffnheader{text}
+%
+\def\printdefunline#1#2{%
+ \begingroup
+ % call \deffnheader:
+ #1#2 \endheader
+ % common ending:
+ \interlinepenalty = 10000
+ \advance\rightskip by 0pt plus 1fil
+ \endgraf
+ \nobreak\vskip -\parskip
+ \penalty\defunpenalty % signal to \startdefun and \dodefunx
+ % Some of the @defun-type tags do not enable magic parentheses,
+ % rendering the following check redundant. But we don't optimize.
+ \checkparencounts
+ \endgroup
+}
+
+\def\Edefun{\endgraf\medbreak}
+
+% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
+% the only thing remaining is to define \deffnheader.
+%
+\def\makedefun#1{%
+ \expandafter\let\csname E#1\endcsname = \Edefun
+ \edef\temp{\noexpand\domakedefun
+ \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
+ \temp
+}
+
+% \domakedefun \deffn \deffnx \deffnheader
+%
+% Define \deffn and \deffnx, without parameters.
+% \deffnheader has to be defined explicitly.
+%
+\def\domakedefun#1#2#3{%
+ \envdef#1{%
+ \startdefun
+ \parseargusing\activeparens{\printdefunline#3}%
+ }%
+ \def#2{\dodefunx#1}%
+ \def#3%
+}
+
+%%% Untyped functions:
+
+% @deffn category name args
+\makedefun{deffn}{\deffngeneral{}}
+
+% @deffn category class name args
+\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
+
+% \defopon {category on}class name args
+\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deffngeneral {subind}category name args
+%
+\def\deffngeneral#1#2 #3 #4\endheader{%
+ % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
+ \dosubind{fn}{\code{#3}}{#1}%
+ \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
+}
+
+%%% Typed functions:
+
+% @deftypefn category type name args
+\makedefun{deftypefn}{\deftypefngeneral{}}
+
+% @deftypeop category class type name args
+\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
+
+% \deftypeopon {category on}class type name args
+\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypefngeneral {subind}category type name args
+%
+\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{fn}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+%%% Typed variables:
+
+% @deftypevr category type var args
+\makedefun{deftypevr}{\deftypecvgeneral{}}
+
+% @deftypecv category class type var args
+\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
+
+% \deftypecvof {category of}class type var args
+\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypecvgeneral {subind}category type var args
+%
+\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{vr}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+%%% Untyped variables:
+
+% @defvr category var args
+\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
+
+% @defcv category class var args
+\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
+
+% \defcvof {category of}class var args
+\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
+
+%%% Type:
+% @deftp category name args
+\makedefun{deftp}#1 #2 #3\endheader{%
+ \doind{tp}{\code{#2}}%
+ \defname{#1}{}{#2}\defunargs{#3\unskip}%
+}
+
+% Remaining @defun-like shortcuts:
+\makedefun{defun}{\deffnheader{\putwordDeffunc} }
+\makedefun{defmac}{\deffnheader{\putwordDefmac} }
+\makedefun{defspec}{\deffnheader{\putwordDefspec} }
+\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
+\makedefun{defvar}{\defvrheader{\putwordDefvar} }
+\makedefun{defopt}{\defvrheader{\putwordDefopt} }
+\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
+\makedefun{defmethod}{\defopon\putwordMethodon}
+\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
+\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
+\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
+
+% \defname, which formats the name of the @def (not the args).
+% #1 is the category, such as "Function".
+% #2 is the return type, if any.
+% #3 is the function name.
+%
+% We are followed by (but not passed) the arguments, if any.
+%
+\def\defname#1#2#3{%
+ % Get the values of \leftskip and \rightskip as they were outside the @def...
+ \advance\leftskip by -\defbodyindent
+ %
+ % How we'll format the type name. Putting it in brackets helps
+ % distinguish it from the body text that may end up on the next line
+ % just below it.
+ \def\temp{#1}%
+ \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
+ %
+ % Figure out line sizes for the paragraph shape.
+ % The first line needs space for \box0; but if \rightskip is nonzero,
+ % we need only space for the part of \box0 which exceeds it:
+ \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
+ % The continuations:
+ \dimen2=\hsize \advance\dimen2 by -\defargsindent
+ % (plain.tex says that \dimen1 should be used only as global.)
+ \parshape 2 0in \dimen0 \defargsindent \dimen2
+ %
+ % Put the type name to the right margin.
+ \noindent
+ \hbox to 0pt{%
+ \hfil\box0 \kern-\hsize
+ % \hsize has to be shortened this way:
+ \kern\leftskip
+ % Intentionally do not respect \rightskip, since we need the space.
+ }%
+ %
+ % Allow all lines to be underfull without complaint:
+ \tolerance=10000 \hbadness=10000
+ \exdentamount=\defbodyindent
+ {%
+ % defun fonts. We use typewriter by default (used to be bold) because:
+ % . we're printing identifiers, they should be in tt in principle.
+ % . in languages with many accents, such as Czech or French, it's
+ % common to leave accents off identifiers. The result looks ok in
+ % tt, but exceedingly strange in rm.
+ % . we don't want -- and --- to be treated as ligatures.
+ % . this still does not fix the ?` and !` ligatures, but so far no
+ % one has made identifiers using them :).
+ \df \tt
+ \def\temp{#2}% return value type
+ \ifx\temp\empty\else \tclose{\temp} \fi
+ #3% output function name
+ }%
+ {\rm\enskip}% hskip 0.5 em of \tenrm
+ %
+ \boldbrax
+ % arguments will be output next, if any.
+}
+
+% Print arguments in slanted roman (not ttsl), inconsistently with using
+% tt for the name. This is because literal text is sometimes needed in
+% the argument list (groff manual), and ttsl and tt are not very
+% distinguishable. Prevent hyphenation at `-' chars.
+%
+\def\defunargs#1{%
+ % use sl by default (not ttsl),
+ % tt for the names.
+ \df \sl \hyphenchar\font=0
+ %
+ % On the other hand, if an argument has two dashes (for instance), we
+ % want a way to get ttsl. Let's try @var for that.
+ \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
+ #1%
+ \sl\hyphenchar\font=45
+}
+
+% We want ()&[] to print specially on the defun line.
+%
+\def\activeparens{%
+ \catcode`\(=\active \catcode`\)=\active
+ \catcode`\[=\active \catcode`\]=\active
+ \catcode`\&=\active
+}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+{
+ \activeparens
+ \global\let(=\lparen \global\let)=\rparen
+ \global\let[=\lbrack \global\let]=\rbrack
+ \global\let& = \&
+
+ \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+ \gdef\magicamp{\let&=\amprm}
+}
+
+\newcount\parencount
+
+% If we encounter &foo, then turn on ()-hacking afterwards
+\newif\ifampseen
+\def\amprm#1 {\ampseentrue{\bf\&#1 }}
+
+\def\parenfont{%
+ \ifampseen
+ % At the first level, print parens in roman,
+ % otherwise use the default font.
+ \ifnum \parencount=1 \rm \fi
+ \else
+ % The \sf parens (in \boldbrax) actually are a little bolder than
+ % the contained text. This is especially needed for [ and ] .
+ \sf
+ \fi
+}
+\def\infirstlevel#1{%
+ \ifampseen
+ \ifnum\parencount=1
+ #1%
+ \fi
+ \fi
+}
+\def\bfafterword#1 {#1 \bf}
+
+\def\opnr{%
+ \global\advance\parencount by 1
+ {\parenfont(}%
+ \infirstlevel \bfafterword
+}
+\def\clnr{%
+ {\parenfont)}%
+ \infirstlevel \sl
+ \global\advance\parencount by -1
+}
+
+\newcount\brackcount
+\def\lbrb{%
+ \global\advance\brackcount by 1
+ {\bf[}%
+}
+\def\rbrb{%
+ {\bf]}%
+ \global\advance\brackcount by -1
+}
+
+\def\checkparencounts{%
+ \ifnum\parencount=0 \else \badparencount \fi
+ \ifnum\brackcount=0 \else \badbrackcount \fi
+}
+% these should not use \errmessage; the glibc manual, at least, actually
+% has such constructs (when documenting function pointers).
+\def\badparencount{%
+ \message{Warning: unbalanced parentheses in @def...}%
+ \global\parencount=0
+}
+\def\badbrackcount{%
+ \message{Warning: unbalanced square brackets in @def...}%
+ \global\brackcount=0
+}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scantokens#1{%
+ \toks0={#1}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \input \jobname.tmp
+ }
+\fi
+
+\def\scanmacro#1{%
+ \begingroup
+ \newlinechar`\^^M
+ \let\xeatspaces\eatspaces
+ % Undo catcode changes of \startcontents and \doprintindex
+ % When called from @insertcopying or (short)caption, we need active
+ % backslash to get it printed correctly. Previously, we had
+ % \catcode`\\=\other instead. We'll see whether a problem appears
+ % with macro expansion. --kasal, 19aug04
+ \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
+ % ... and \example
+ \spaceisspace
+ %
+ % Append \endinput to make sure that TeX does not see the ending newline.
+ % I've verified that it is necessary both for e-TeX and for ordinary TeX
+ % --kasal, 29nov03
+ \scantokens{#1\endinput}%
+ \endgroup
+}
+
+\def\scanexp#1{%
+ \edef\temp{\noexpand\scanmacro{#1}}%
+ \temp
+}
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+
+% List of all defined macros in the form
+% \definedummyword\macro1\definedummyword\macro2...
+% Currently is also contains all @aliases; the list can be split
+% if there is a need.
+\def\macrolist{}
+
+% Add the macro to \macrolist
+\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
+\def\addtomacrolistxxx#1{%
+ \toks0 = \expandafter{\macrolist\definedummyword#1}%
+ \xdef\macrolist{\the\toks0}%
+}
+
+% Utility routines.
+% This does \let #1 = #2, with \csnames; that is,
+% \let \csname#1\endcsname = \csname#2\endcsname
+% (except of course we have to play expansion games).
+%
+\def\cslet#1#2{%
+ \expandafter\let
+ \csname#1\expandafter\endcsname
+ \csname#2\endcsname
+}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=\other \catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% Non-ASCII encodings make 8-bit characters active, so un-activate
+% them to avoid their expansion. Must do this non-globally, to
+% confine the change to the current group.
+
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\scanctxt{%
+ \catcode`\"=\other
+ \catcode`\+=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\@=\other
+ \catcode`\^=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\~=\other
+ \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
+}
+
+\def\scanargctxt{%
+ \scanctxt
+ \catcode`\\=\other
+ \catcode`\^^M=\other
+}
+
+\def\macrobodyctxt{%
+ \scanctxt
+ \catcode`\{=\other
+ \catcode`\}=\other
+ \catcode`\^^M=\other
+ \usembodybackslash
+}
+
+\def\macroargctxt{%
+ \scanctxt
+ \catcode`\\=\other
+}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \argl;%
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{Macro name \the\macname\space already defined}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ \addtomacrolist{\the\macname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\parseargdef\unmacro{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist:
+ \begingroup
+ \expandafter\let\csname#1\endcsname \relax
+ \let\definedummyword\unmacrodo
+ \xdef\macrolist{\macrolist}%
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% Called by \do from \dounmacro on each macro. The idea is to omit any
+% macro definitions that have been changed to \relax.
+%
+\def\unmacrodo#1{%
+ \ifx #1\relax
+ % remove this
+ \else
+ \noexpand\definedummyword \noexpand#1%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+ \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \fi
+ \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \macnamexxx}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Just make them active and then expand them all to nothing.
+\def\alias{\parseargusing\obeyspaces\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{%
+ {%
+ \expandafter\let\obeyedspace=\empty
+ \addtomacrolist{#1}%
+ \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
+ }%
+ \next
+}
+
+
+\message{cross references,}
+
+\newwrite\auxfile
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% @node's only job in TeX is to define \lastnode, which is used in
+% cross-references. The @node line might or might not have commas, and
+% might or might not have spaces before the first comma, like:
+% @node foo , bar , ...
+% We don't want such trailing spaces in the node name.
+%
+\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
+%
+% also remove a trailing comma, in case of something like this:
+% @node Help-Cross, , , Cross-refs
+\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+
+\let\nwnode=\node
+\let\lastnode=\empty
+
+% Write a cross-reference definition for the current node. #1 is the
+% type (Ynumbered, Yappendix, Ynothing).
+%
+\def\donoderef#1{%
+ \ifx\lastnode\empty\else
+ \setref{\lastnode}{#1}%
+ \global\let\lastnode=\empty
+ \fi
+}
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+%
+\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
+% anchor), which consists of three parts:
+% 1) NAME-title - the current sectioning name taken from \lastsection,
+% or the anchor name.
+% 2) NAME-snt - section number and type, passed as the SNT arg, or
+% empty for anchors.
+% 3) NAME-pg - the page number.
+%
+% This is called from \donoderef, \anchor, and \dofloat. In the case of
+% floats, there is an additional part, which is not written here:
+% 4) NAME-lof - the text as it should appear in a @listoffloats.
+%
+\def\setref#1#2{%
+ \pdfmkdest{#1}%
+ \iflinks
+ {%
+ \atdummies % preserve commands, but don't expand them
+ \edef\writexrdef##1##2{%
+ \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
+ ##1}{##2}}% these are parameters of \writexrdef
+ }%
+ \toks0 = \expandafter{\lastsection}%
+ \immediate \writexrdef{title}{\the\toks0 }%
+ \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
+ \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
+ }%
+ \fi
+}
+
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
+ \def\printedmanual{\ignorespaces #5}%
+ \def\printedrefname{\ignorespaces #3}%
+ \setbox1=\hbox{\printedmanual\unskip}%
+ \setbox0=\hbox{\printedrefname\unskip}%
+ \ifdim \wd0 = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
+ % Use the node name inside the square brackets.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ % Use the actual chapter/section title appear inside
+ % the square brackets. Use the real section title if we have it.
+ \ifdim \wd1 > 0pt
+ % It is in another manual, so we don't have it.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We know the real title if we have the xref values.
+ \def\printedrefname{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printedrefname{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % Make link in pdf output.
+ \ifpdf
+ {\indexnofonts
+ \turnoffactive
+ % This expands tokens, so do it after making catcode changes, so _
+ % etc. don't get their TeX definitions.
+ \getfilename{#4}%
+ %
+ % See comments at \activebackslashdouble.
+ {\activebackslashdouble \xdef\pdfxrefdest{#1}%
+ \backslashparens\pdfxrefdest}%
+ %
+ \leavevmode
+ \startlink attr{/Border [0 0 0]}%
+ \ifnum\filenamelength>0
+ goto file{\the\filename.pdf} name{\pdfxrefdest}%
+ \else
+ goto name{\pdfmkpgn{\pdfxrefdest}}%
+ \fi
+ }%
+ \setcolor{\linkcolor}%
+ \fi
+ %
+ % Float references are printed completely differently: "Figure 1.2"
+ % instead of "[somenode], p.3". We distinguish them by the
+ % LABEL-title being set to a magic string.
+ {%
+ % Have to otherify everything special to allow the \csname to
+ % include an _ in the xref name, etc.
+ \indexnofonts
+ \turnoffactive
+ \expandafter\global\expandafter\let\expandafter\Xthisreftitle
+ \csname XR#1-title\endcsname
+ }%
+ \iffloat\Xthisreftitle
+ % If the user specified the print name (third arg) to the ref,
+ % print it instead of our usual "Figure 1.2".
+ \ifdim\wd0 = 0pt
+ \refx{#1-snt}{}%
+ \else
+ \printedrefname
+ \fi
+ %
+ % if the user also gave the printed manual name (fifth arg), append
+ % "in MANUALNAME".
+ \ifdim \wd1 > 0pt
+ \space \putwordin{} \cite{\printedmanual}%
+ \fi
+ \else
+ % node/anchor (non-float) references.
+ %
+ % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+ % insert empty discretionaries after hyphens, which means that it will
+ % not find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens, this
+ % is a loss. Therefore, we give the text of the node name again, so it
+ % is as if TeX is seeing it for the first time.
+ \ifdim \wd1 > 0pt
+ \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
+ \else
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\turnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % output the `[mynode]' via a macro so it can be overridden.
+ \xrefprintnodename\printedrefname
+ %
+ % But we always want a comma and a space:
+ ,\space
+ %
+ % output the `page 3'.
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output. It's a separate macro only so it can be changed more easily,
+% since square brackets don't work well in some documents. Particularly
+% one that Bob is working on :).
+%
+\def\xrefprintnodename#1{[#1]}
+
+% Things referred to by \setref.
+%
+\def\Ynothing{}
+\def\Yomitfromtoc{}
+\def\Ynumbered{%
+ \ifnum\secno=0
+ \putwordChapter@tie \the\chapno
+ \else \ifnum\subsecno=0
+ \putwordSection@tie \the\chapno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+\def\Yappendix{%
+ \ifnum\secno=0
+ \putwordAppendix@tie @char\the\appendixno{}%
+ \else \ifnum\subsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie
+ @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+%
+\def\refx#1#2{%
+ {%
+ \indexnofonts
+ \otherbackslash
+ \expandafter\global\expandafter\let\expandafter\thisrefX
+ \csname XR#1\endcsname
+ }%
+ \ifx\thisrefX\relax
+ % If not defined, say something at least.
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \thisrefX
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file. Usually it's
+% just a \def (we prepend XR to the control sequence name to avoid
+% collisions). But if this is a float type, we have more work to do.
+%
+\def\xrdef#1#2{%
+ {% The node name might contain 8-bit characters, which in our current
+ % implementation are changed to commands like @'e. Don't let these
+ % mess up the control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safexrefname{#1}%
+ }%
+ %
+ \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
+ %
+ % Was that xref control sequence that we just defined for a float?
+ \expandafter\iffloat\csname XR\safexrefname\endcsname
+ % it was a float, and we have the (safe) float type in \iffloattype.
+ \expandafter\let\expandafter\floatlist
+ \csname floatlist\iffloattype\endcsname
+ %
+ % Is this the first time we've seen this float type?
+ \expandafter\ifx\floatlist\relax
+ \toks0 = {\do}% yes, so just \do
+ \else
+ % had it before, so preserve previous elements in list.
+ \toks0 = \expandafter{\floatlist\do}%
+ \fi
+ %
+ % Remember this xref in the control sequence \floatlistFLOATTYPE,
+ % for later use in \listoffloats.
+ \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
+ {\safexrefname}}%
+ \fi
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+%
+\def\tryauxfile{%
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \readdatafile{aux}%
+ \global\havexrefstrue
+ \fi
+ \closein 1
+}
+
+\def\setupdatafile{%
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\^=\other
+ %
+ % Special characters. Should be turned off anyway, but...
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`\%=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ %
+ % This is to support \ in node names and titles, since the \
+ % characters end up in a \csname. It's easier than
+ % leaving it active and making its active definition an actual \
+ % character. What I don't understand is why it works in the *value*
+ % of the xrdef. Seems like it should be a catcode12 \, and that
+ % should not typeset properly. But it works, so I'm moving on for
+ % now. --karl, 15jan04.
+ \catcode`\\=\other
+ %
+ % Make the characters 128-255 be printing characters.
+ {%
+ \count1=128
+ \def\loop{%
+ \catcode\count1=\other
+ \advance\count1 by 1
+ \ifnum \count1<256 \loop \fi
+ }%
+ }%
+ %
+ % @ is our escape character in .aux files, and we need braces.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\@=0
+}
+
+\def\readdatafile#1{%
+\begingroup
+ \setupdatafile
+ \input\jobname.#1
+\endgroup}
+
+
+\message{insertions,}
+% including footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for info output only.
+\let\footnotestyle=\comment
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \dofootnote
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset (and anything else that uses
+% \parseargline) fails inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\gdef\dofootnote{%
+ \insert\footins\bgroup
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \hsize=\pagewidth
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ \smallfonts \rm
+ %
+ % Because we use hanging indentation in footnotes, a @noindent appears
+ % to exdent this text, so make it be a no-op. makeinfo does not use
+ % hanging indentation so @noindent can still be needed within footnote
+ % text after an @example or the like (not that this is good style).
+ \let\noindent = \relax
+ %
+ % Hang the footnote text off the number. Use \everypar in case the
+ % footnote extends for more than one paragraph.
+ \everypar = {\hang}%
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ \futurelet\next\fo@t
+}
+}%end \catcode `\@=11
+
+% In case a @footnote appears in a vbox, save the footnote text and create
+% the real \insert just after the vbox finished. Otherwise, the insertion
+% would be lost.
+% Similarly, if a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is finished.
+% And the same can be done for other insert classes. --kasal, 16nov03.
+
+% Replace the \insert primitive by a cheating macro.
+% Deeper inside, just make sure that the saved insertions are not spilled
+% out prematurely.
+%
+\def\startsavinginserts{%
+ \ifx \insert\ptexinsert
+ \let\insert\saveinsert
+ \else
+ \let\checkinserts\relax
+ \fi
+}
+
+% This \insert replacement works for both \insert\footins{foo} and
+% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
+%
+\def\saveinsert#1{%
+ \edef\next{\noexpand\savetobox \makeSAVEname#1}%
+ \afterassignment\next
+ % swallow the left brace
+ \let\temp =
+}
+\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
+\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
+
+\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
+
+\def\placesaveins#1{%
+ \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
+ {\box#1}%
+}
+
+% eat @SAVE -- beware, all of them have catcode \other:
+{
+ \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
+ \gdef\gobblesave @SAVE{}
+}
+
+% initialization:
+\def\newsaveins #1{%
+ \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
+ \next
+}
+\def\newsaveinsX #1{%
+ \csname newbox\endcsname #1%
+ \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
+ \checksaveins #1}%
+}
+
+% initialize:
+\let\checkinserts\empty
+\newsaveins\footins
+\newsaveins\margin
+
+
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ % Do not bother showing banner with epsf.tex v2.7k (available in
+ % doc/epsf.tex and on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+\closein 1
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\undefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is (ignored optional) html alt text.
+% #5 is (ignored optional) extension.
+% #6 is just the usual extra ignored arg for parsing this stuff.
+\newif\ifimagevmode
+\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ \normalturnoffactive % allow _ et al. in names
+ % If the image is by itself, center it.
+ \ifvmode
+ \imagevmodetrue
+ \nobreak\medskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \fi
+ %
+ % Leave vertical mode so that indentation from an enclosing
+ % environment such as @quotation is respected. On the other hand, if
+ % it's at the top level, we don't want the normal paragraph indentation.
+ \noindent
+ %
+ % Output the image.
+ \ifpdf
+ \dopdfimage{#1}{#2}{#3}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \epsfbox{#1.eps}%
+ \fi
+ %
+ \ifimagevmode \medskip \fi % space after the standalone image
+\endgroup}
+
+
+% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
+% etc. We don't actually implement floating yet, we always include the
+% float "here". But it seemed the best name for the future.
+%
+\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
+
+% There may be a space before second and/or third parameter; delete it.
+\def\eatcommaspace#1, {#1,}
+
+% #1 is the optional FLOATTYPE, the text label for this float, typically
+% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
+% this float will not be numbered and cannot be referred to.
+%
+% #2 is the optional xref label. Also must be present for the float to
+% be referable.
+%
+% #3 is the optional positioning argument; for now, it is ignored. It
+% will somehow specify the positions allowed to float to (here, top, bottom).
+%
+% We keep a separate counter for each FLOATTYPE, which we reset at each
+% chapter-level command.
+\let\resetallfloatnos=\empty
+%
+\def\dofloat#1,#2,#3,#4\finish{%
+ \let\thiscaption=\empty
+ \let\thisshortcaption=\empty
+ %
+ % don't lose footnotes inside @float.
+ %
+ % BEWARE: when the floats start float, we have to issue warning whenever an
+ % insert appears inside a float which could possibly float. --kasal, 26may04
+ %
+ \startsavinginserts
+ %
+ % We can't be used inside a paragraph.
+ \par
+ %
+ \vtop\bgroup
+ \def\floattype{#1}%
+ \def\floatlabel{#2}%
+ \def\floatloc{#3}% we do nothing with this yet.
+ %
+ \ifx\floattype\empty
+ \let\safefloattype=\empty
+ \else
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ \fi
+ %
+ % If label is given but no type, we handle that as the empty type.
+ \ifx\floatlabel\empty \else
+ % We want each FLOATTYPE to be numbered separately (Figure 1,
+ % Table 1, Figure 2, ...). (And if no label, no number.)
+ %
+ \expandafter\getfloatno\csname\safefloattype floatno\endcsname
+ \global\advance\floatno by 1
+ %
+ {%
+ % This magic value for \lastsection is output by \setref as the
+ % XREFLABEL-title value. \xrefX uses it to distinguish float
+ % labels (which have a completely different output format) from
+ % node and anchor labels. And \xrdef uses it to construct the
+ % lists of floats.
+ %
+ \edef\lastsection{\floatmagic=\safefloattype}%
+ \setref{\floatlabel}{Yfloat}%
+ }%
+ \fi
+ %
+ % start with \parskip glue, I guess.
+ \vskip\parskip
+ %
+ % Don't suppress indentation if a float happens to start a section.
+ \restorefirstparagraphindent
+}
+
+% we have these possibilities:
+% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
+% @float Foo,lbl & no caption: Foo 1.1
+% @float Foo & @caption{Cap}: Foo: Cap
+% @float Foo & no caption: Foo
+% @float ,lbl & Caption{Cap}: 1.1: Cap
+% @float ,lbl & no caption: 1.1
+% @float & @caption{Cap}: Cap
+% @float & no caption:
+%
+\def\Efloat{%
+ \let\floatident = \empty
+ %
+ % In all cases, if we have a float type, it comes first.
+ \ifx\floattype\empty \else \def\floatident{\floattype}\fi
+ %
+ % If we have an xref label, the number comes next.
+ \ifx\floatlabel\empty \else
+ \ifx\floattype\empty \else % if also had float type, need tie first.
+ \appendtomacro\floatident{\tie}%
+ \fi
+ % the number.
+ \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
+ \fi
+ %
+ % Start the printed caption with what we've constructed in
+ % \floatident, but keep it separate; we need \floatident again.
+ \let\captionline = \floatident
+ %
+ \ifx\thiscaption\empty \else
+ \ifx\floatident\empty \else
+ \appendtomacro\captionline{: }% had ident, so need a colon between
+ \fi
+ %
+ % caption text.
+ \appendtomacro\captionline{\scanexp\thiscaption}%
+ \fi
+ %
+ % If we have anything to print, print it, with space before.
+ % Eventually this needs to become an \insert.
+ \ifx\captionline\empty \else
+ \vskip.5\parskip
+ \captionline
+ %
+ % Space below caption.
+ \vskip\parskip
+ \fi
+ %
+ % If have an xref label, write the list of floats info. Do this
+ % after the caption, to avoid chance of it being a breakpoint.
+ \ifx\floatlabel\empty \else
+ % Write the text that goes in the lof to the aux file as
+ % \floatlabel-lof. Besides \floatident, we include the short
+ % caption if specified, else the full caption if specified, else nothing.
+ {%
+ \atdummies
+ %
+ % since we read the caption text in the macro world, where ^^M
+ % is turned into a normal character, we have to scan it back, so
+ % we don't write the literal three characters "^^M" into the aux file.
+ \scanexp{%
+ \xdef\noexpand\gtemp{%
+ \ifx\thisshortcaption\empty
+ \thiscaption
+ \else
+ \thisshortcaption
+ \fi
+ }%
+ }%
+ \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
+ \ifx\gtemp\empty \else : \gtemp \fi}}%
+ }%
+ \fi
+ \egroup % end of \vtop
+ %
+ % place the captured inserts
+ %
+ % BEWARE: when the floats start floating, we have to issue warning
+ % whenever an insert appears inside a float which could possibly
+ % float. --kasal, 26may04
+ %
+ \checkinserts
+}
+
+% Append the tokens #2 to the definition of macro #1, not expanding either.
+%
+\def\appendtomacro#1#2{%
+ \expandafter\def\expandafter#1\expandafter{#1#2}%
+}
+
+% @caption, @shortcaption
+%
+\def\caption{\docaption\thiscaption}
+\def\shortcaption{\docaption\thisshortcaption}
+\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
+\def\defcaption#1#2{\egroup \def#1{#2}}
+
+% The parameter is the control sequence identifying the counter we are
+% going to use. Create it if it doesn't exist and assign it to \floatno.
+\def\getfloatno#1{%
+ \ifx#1\relax
+ % Haven't seen this figure type before.
+ \csname newcount\endcsname #1%
+ %
+ % Remember to reset this floatno at the next chap.
+ \expandafter\gdef\expandafter\resetallfloatnos
+ \expandafter{\resetallfloatnos #1=0 }%
+ \fi
+ \let\floatno#1%
+}
+
+% \setref calls this to get the XREFLABEL-snt value. We want an @xref
+% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
+% first read the @float command.
+%
+\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
+
+% Magic string used for the XREFLABEL-title value, so \xrefX can
+% distinguish floats from other xref types.
+\def\floatmagic{!!float!!}
+
+% #1 is the control sequence we are passed; we expand into a conditional
+% which is true if #1 represents a float ref. That is, the magic
+% \lastsection value which we \setref above.
+%
+\def\iffloat#1{\expandafter\doiffloat#1==\finish}
+%
+% #1 is (maybe) the \floatmagic string. If so, #2 will be the
+% (safe) float type for this float. We set \iffloattype to #2.
+%
+\def\doiffloat#1=#2=#3\finish{%
+ \def\temp{#1}%
+ \def\iffloattype{#2}%
+ \ifx\temp\floatmagic
+}
+
+% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
+%
+\parseargdef\listoffloats{%
+ \def\floattype{#1}% floattype
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ %
+ % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
+ \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
+ \ifhavexrefs
+ % if the user said @listoffloats foo but never @float foo.
+ \message{\linenumber No `\safefloattype' floats to list.}%
+ \fi
+ \else
+ \begingroup
+ \leftskip=\tocindent % indent these entries like a toc
+ \let\do=\listoffloatsdo
+ \csname floatlist\safefloattype\endcsname
+ \endgroup
+ \fi
+}
+
+% This is called on each entry in a list of floats. We're passed the
+% xref label, in the form LABEL-title, which is how we save it in the
+% aux file. We strip off the -title and look up \XRLABEL-lof, which
+% has the text we're supposed to typeset here.
+%
+% Figures without xref labels will not be included in the list (since
+% they won't appear in the aux file).
+%
+\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
+\def\listoffloatsdoentry#1-title\finish{{%
+ % Can't fully expand XR#1-lof because it can contain anything. Just
+ % pass the control sequence. On the other hand, XR#1-pg is just the
+ % page number, and we want to fully expand that so we can get a link
+ % in pdf output.
+ \toksA = \expandafter{\csname XR#1-lof\endcsname}%
+ %
+ % use the same \entry macro we use to generate the TOC and index.
+ \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
+ \writeentry
+}}
+
+
+\message{localization,}
+
+% For single-language documents, @documentlanguage is usually given very
+% early, just after @documentencoding. Single argument is the language
+% (de) or locale (de_DE) abbreviation.
+%
+{
+ \catcode`\_ = \active
+ \globaldefs=1
+\parseargdef\documentlanguage{\begingroup
+ \let_=\normalunderscore % normal _ character for filenames
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file by the name they passed if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \documentlanguagetrywithoutunderscore{#1_\finish}%
+ \else
+ \globaldefs = 1 % everything in the txi-LL files needs to persist
+ \input txi-#1.tex
+ \fi
+ \closein 1
+ \endgroup % end raw TeX
+\endgroup}
+}
+%
+% If they passed de_DE, and txi-de_DE.tex doesn't exist,
+% try txi-de.tex.
+%
+\def\documentlanguagetrywithoutunderscore#1_#2\finish{%
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \else
+ \input txi-#1.tex
+ \fi
+ \closein 1
+}
+%
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? Putting it in the current
+directory should work if nowhere else does.}
+
+% This macro is called from txi-??.tex files; the first argument is the
+% \language name to set (without the "\lang@" prefix), the second and
+% third args are \{left,right}hyphenmin.
+%
+% The language names to pass are determined when the format is built.
+% See the etex.log file created at that time, e.g.,
+% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
+%
+% With TeX Live 2008, etex now includes hyphenation patterns for all
+% available languages. This means we can support hyphenation in
+% Texinfo, at least to some extent. (This still doesn't solve the
+% accented characters problem.)
+%
+\catcode`@=11
+\def\txisetlanguage#1#2#3{%
+ % do not set the language if the name is undefined in the current TeX.
+ \expandafter\ifx\csname lang@#1\endcsname \relax
+ \message{no patterns for #1}%
+ \else
+ \global\language = \csname lang@#1\endcsname
+ \fi
+ % but there is no harm in adjusting the hyphenmin values regardless.
+ \global\lefthyphenmin = #2\relax
+ \global\righthyphenmin = #3\relax
+}
+
+% Helpers for encodings.
+% Set the catcode of characters 128 through 255 to the specified number.
+%
+\def\setnonasciicharscatcode#1{%
+ \count255=128
+ \loop\ifnum\count255<256
+ \global\catcode\count255=#1\relax
+ \advance\count255 by 1
+ \repeat
+}
+
+\def\setnonasciicharscatcodenonglobal#1{%
+ \count255=128
+ \loop\ifnum\count255<256
+ \catcode\count255=#1\relax
+ \advance\count255 by 1
+ \repeat
+}
+
+% @documentencoding sets the definition of non-ASCII characters
+% according to the specified encoding.
+%
+\parseargdef\documentencoding{%
+ % Encoding being declared for the document.
+ \def\declaredencoding{\csname #1.enc\endcsname}%
+ %
+ % Supported encodings: names converted to tokens in order to be able
+ % to compare them with \ifx.
+ \def\ascii{\csname US-ASCII.enc\endcsname}%
+ \def\latnine{\csname ISO-8859-15.enc\endcsname}%
+ \def\latone{\csname ISO-8859-1.enc\endcsname}%
+ \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
+ \def\utfeight{\csname UTF-8.enc\endcsname}%
+ %
+ \ifx \declaredencoding \ascii
+ \asciichardefs
+ %
+ \else \ifx \declaredencoding \lattwo
+ \setnonasciicharscatcode\active
+ \lattwochardefs
+ %
+ \else \ifx \declaredencoding \latone
+ \setnonasciicharscatcode\active
+ \latonechardefs
+ %
+ \else \ifx \declaredencoding \latnine
+ \setnonasciicharscatcode\active
+ \latninechardefs
+ %
+ \else \ifx \declaredencoding \utfeight
+ \setnonasciicharscatcode\active
+ \utfeightchardefs
+ %
+ \else
+ \message{Unknown document encoding #1, ignoring.}%
+ %
+ \fi % utfeight
+ \fi % latnine
+ \fi % latone
+ \fi % lattwo
+ \fi % ascii
+}
+
+% A message to be logged when using a character that isn't available
+% the default font encoding (OT1).
+%
+\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
+
+% Take account of \c (plain) vs. \, (Texinfo) difference.
+\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
+
+% First, make active non-ASCII characters in order for them to be
+% correctly categorized when TeX reads the replacement text of
+% macros containing the character definitions.
+\setnonasciicharscatcode\active
+%
+% Latin1 (ISO-8859-1) character definitions.
+\def\latonechardefs{%
+ \gdef^^a0{~}
+ \gdef^^a1{\exclamdown}
+ \gdef^^a2{\missingcharmsg{CENT SIGN}}
+ \gdef^^a3{{\pounds}}
+ \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
+ \gdef^^a5{\missingcharmsg{YEN SIGN}}
+ \gdef^^a6{\missingcharmsg{BROKEN BAR}}
+ \gdef^^a7{\S}
+ \gdef^^a8{\"{}}
+ \gdef^^a9{\copyright}
+ \gdef^^aa{\ordf}
+ \gdef^^ab{\guillemetleft}
+ \gdef^^ac{$\lnot$}
+ \gdef^^ad{\-}
+ \gdef^^ae{\registeredsymbol}
+ \gdef^^af{\={}}
+ %
+ \gdef^^b0{\textdegree}
+ \gdef^^b1{$\pm$}
+ \gdef^^b2{$^2$}
+ \gdef^^b3{$^3$}
+ \gdef^^b4{\'{}}
+ \gdef^^b5{$\mu$}
+ \gdef^^b6{\P}
+ %
+ \gdef^^b7{$^.$}
+ \gdef^^b8{\cedilla\ }
+ \gdef^^b9{$^1$}
+ \gdef^^ba{\ordm}
+ %
+ \gdef^^bb{\guilletright}
+ \gdef^^bc{$1\over4$}
+ \gdef^^bd{$1\over2$}
+ \gdef^^be{$3\over4$}
+ \gdef^^bf{\questiondown}
+ %
+ \gdef^^c0{\`A}
+ \gdef^^c1{\'A}
+ \gdef^^c2{\^A}
+ \gdef^^c3{\~A}
+ \gdef^^c4{\"A}
+ \gdef^^c5{\ringaccent A}
+ \gdef^^c6{\AE}
+ \gdef^^c7{\cedilla C}
+ \gdef^^c8{\`E}
+ \gdef^^c9{\'E}
+ \gdef^^ca{\^E}
+ \gdef^^cb{\"E}
+ \gdef^^cc{\`I}
+ \gdef^^cd{\'I}
+ \gdef^^ce{\^I}
+ \gdef^^cf{\"I}
+ %
+ \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}}
+ \gdef^^d1{\~N}
+ \gdef^^d2{\`O}
+ \gdef^^d3{\'O}
+ \gdef^^d4{\^O}
+ \gdef^^d5{\~O}
+ \gdef^^d6{\"O}
+ \gdef^^d7{$\times$}
+ \gdef^^d8{\O}
+ \gdef^^d9{\`U}
+ \gdef^^da{\'U}
+ \gdef^^db{\^U}
+ \gdef^^dc{\"U}
+ \gdef^^dd{\'Y}
+ \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}}
+ \gdef^^df{\ss}
+ %
+ \gdef^^e0{\`a}
+ \gdef^^e1{\'a}
+ \gdef^^e2{\^a}
+ \gdef^^e3{\~a}
+ \gdef^^e4{\"a}
+ \gdef^^e5{\ringaccent a}
+ \gdef^^e6{\ae}
+ \gdef^^e7{\cedilla c}
+ \gdef^^e8{\`e}
+ \gdef^^e9{\'e}
+ \gdef^^ea{\^e}
+ \gdef^^eb{\"e}
+ \gdef^^ec{\`{\dotless i}}
+ \gdef^^ed{\'{\dotless i}}
+ \gdef^^ee{\^{\dotless i}}
+ \gdef^^ef{\"{\dotless i}}
+ %
+ \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}}
+ \gdef^^f1{\~n}
+ \gdef^^f2{\`o}
+ \gdef^^f3{\'o}
+ \gdef^^f4{\^o}
+ \gdef^^f5{\~o}
+ \gdef^^f6{\"o}
+ \gdef^^f7{$\div$}
+ \gdef^^f8{\o}
+ \gdef^^f9{\`u}
+ \gdef^^fa{\'u}
+ \gdef^^fb{\^u}
+ \gdef^^fc{\"u}
+ \gdef^^fd{\'y}
+ \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}}
+ \gdef^^ff{\"y}
+}
+
+% Latin9 (ISO-8859-15) encoding character definitions.
+\def\latninechardefs{%
+ % Encoding is almost identical to Latin1.
+ \latonechardefs
+ %
+ \gdef^^a4{\euro}
+ \gdef^^a6{\v S}
+ \gdef^^a8{\v s}
+ \gdef^^b4{\v Z}
+ \gdef^^b8{\v z}
+ \gdef^^bc{\OE}
+ \gdef^^bd{\oe}
+ \gdef^^be{\"Y}
+}
+
+% Latin2 (ISO-8859-2) character definitions.
+\def\lattwochardefs{%
+ \gdef^^a0{~}
+ \gdef^^a1{\ogonek{A}}
+ \gdef^^a2{\u{}}
+ \gdef^^a3{\L}
+ \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
+ \gdef^^a5{\v L}
+ \gdef^^a6{\'S}
+ \gdef^^a7{\S}
+ \gdef^^a8{\"{}}
+ \gdef^^a9{\v S}
+ \gdef^^aa{\cedilla S}
+ \gdef^^ab{\v T}
+ \gdef^^ac{\'Z}
+ \gdef^^ad{\-}
+ \gdef^^ae{\v Z}
+ \gdef^^af{\dotaccent Z}
+ %
+ \gdef^^b0{\textdegree}
+ \gdef^^b1{\ogonek{a}}
+ \gdef^^b2{\ogonek{ }}
+ \gdef^^b3{\l}
+ \gdef^^b4{\'{}}
+ \gdef^^b5{\v l}
+ \gdef^^b6{\'s}
+ \gdef^^b7{\v{}}
+ \gdef^^b8{\cedilla\ }
+ \gdef^^b9{\v s}
+ \gdef^^ba{\cedilla s}
+ \gdef^^bb{\v t}
+ \gdef^^bc{\'z}
+ \gdef^^bd{\H{}}
+ \gdef^^be{\v z}
+ \gdef^^bf{\dotaccent z}
+ %
+ \gdef^^c0{\'R}
+ \gdef^^c1{\'A}
+ \gdef^^c2{\^A}
+ \gdef^^c3{\u A}
+ \gdef^^c4{\"A}
+ \gdef^^c5{\'L}
+ \gdef^^c6{\'C}
+ \gdef^^c7{\cedilla C}
+ \gdef^^c8{\v C}
+ \gdef^^c9{\'E}
+ \gdef^^ca{\ogonek{E}}
+ \gdef^^cb{\"E}
+ \gdef^^cc{\v E}
+ \gdef^^cd{\'I}
+ \gdef^^ce{\^I}
+ \gdef^^cf{\v D}
+ %
+ \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}}
+ \gdef^^d1{\'N}
+ \gdef^^d2{\v N}
+ \gdef^^d3{\'O}
+ \gdef^^d4{\^O}
+ \gdef^^d5{\H O}
+ \gdef^^d6{\"O}
+ \gdef^^d7{$\times$}
+ \gdef^^d8{\v R}
+ \gdef^^d9{\ringaccent U}
+ \gdef^^da{\'U}
+ \gdef^^db{\H U}
+ \gdef^^dc{\"U}
+ \gdef^^dd{\'Y}
+ \gdef^^de{\cedilla T}
+ \gdef^^df{\ss}
+ %
+ \gdef^^e0{\'r}
+ \gdef^^e1{\'a}
+ \gdef^^e2{\^a}
+ \gdef^^e3{\u a}
+ \gdef^^e4{\"a}
+ \gdef^^e5{\'l}
+ \gdef^^e6{\'c}
+ \gdef^^e7{\cedilla c}
+ \gdef^^e8{\v c}
+ \gdef^^e9{\'e}
+ \gdef^^ea{\ogonek{e}}
+ \gdef^^eb{\"e}
+ \gdef^^ec{\v e}
+ \gdef^^ed{\'\i}
+ \gdef^^ee{\^\i}
+ \gdef^^ef{\v d}
+ %
+ \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}}
+ \gdef^^f1{\'n}
+ \gdef^^f2{\v n}
+ \gdef^^f3{\'o}
+ \gdef^^f4{\^o}
+ \gdef^^f5{\H o}
+ \gdef^^f6{\"o}
+ \gdef^^f7{$\div$}
+ \gdef^^f8{\v r}
+ \gdef^^f9{\ringaccent u}
+ \gdef^^fa{\'u}
+ \gdef^^fb{\H u}
+ \gdef^^fc{\"u}
+ \gdef^^fd{\'y}
+ \gdef^^fe{\cedilla t}
+ \gdef^^ff{\dotaccent{}}
+}
+
+% UTF-8 character definitions.
+%
+% This code to support UTF-8 is based on LaTeX's utf8.def, with some
+% changes for Texinfo conventions. It is included here under the GPL by
+% permission from Frank Mittelbach and the LaTeX team.
+%
+\newcount\countUTFx
+\newcount\countUTFy
+\newcount\countUTFz
+
+\gdef\UTFviiiTwoOctets#1#2{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\endcsname}
+%
+\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
+%
+\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
+
+\gdef\UTFviiiDefined#1{%
+ \ifx #1\relax
+ \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
+ \else
+ \expandafter #1%
+ \fi
+}
+
+\begingroup
+ \catcode`\~13
+ \catcode`\"12
+
+ \def\UTFviiiLoop{%
+ \global\catcode\countUTFx\active
+ \uccode`\~\countUTFx
+ \uppercase\expandafter{\UTFviiiTmp}%
+ \advance\countUTFx by 1
+ \ifnum\countUTFx < \countUTFy
+ \expandafter\UTFviiiLoop
+ \fi}
+
+ \countUTFx = "C2
+ \countUTFy = "E0
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
+ \UTFviiiLoop
+
+ \countUTFx = "E0
+ \countUTFy = "F0
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
+ \UTFviiiLoop
+
+ \countUTFx = "F0
+ \countUTFy = "F4
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiFourOctets\string~}}
+ \UTFviiiLoop
+\endgroup
+
+\begingroup
+ \catcode`\"=12
+ \catcode`\<=12
+ \catcode`\.=12
+ \catcode`\,=12
+ \catcode`\;=12
+ \catcode`\!=12
+ \catcode`\~=13
+
+ \gdef\DeclareUnicodeCharacter#1#2{%
+ \countUTFz = "#1\relax
+ \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
+ \begingroup
+ \parseXMLCharref
+ \def\UTFviiiTwoOctets##1##2{%
+ \csname u8:##1\string ##2\endcsname}%
+ \def\UTFviiiThreeOctets##1##2##3{%
+ \csname u8:##1\string ##2\string ##3\endcsname}%
+ \def\UTFviiiFourOctets##1##2##3##4{%
+ \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter
+ \gdef\UTFviiiTmp{#2}%
+ \endgroup}
+
+ \gdef\parseXMLCharref{%
+ \ifnum\countUTFz < "A0\relax
+ \errhelp = \EMsimple
+ \errmessage{Cannot define Unicode char value < 00A0}%
+ \else\ifnum\countUTFz < "800\relax
+ \parseUTFviiiA,%
+ \parseUTFviiiB C\UTFviiiTwoOctets.,%
+ \else\ifnum\countUTFz < "10000\relax
+ \parseUTFviiiA;%
+ \parseUTFviiiA,%
+ \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
+ \else
+ \parseUTFviiiA;%
+ \parseUTFviiiA,%
+ \parseUTFviiiA!%
+ \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
+ \fi\fi\fi
+ }
+
+ \gdef\parseUTFviiiA#1{%
+ \countUTFx = \countUTFz
+ \divide\countUTFz by 64
+ \countUTFy = \countUTFz
+ \multiply\countUTFz by 64
+ \advance\countUTFx by -\countUTFz
+ \advance\countUTFx by 128
+ \uccode `#1\countUTFx
+ \countUTFz = \countUTFy}
+
+ \gdef\parseUTFviiiB#1#2#3#4{%
+ \advance\countUTFz by "#10\relax
+ \uccode `#3\countUTFz
+ \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
+\endgroup
+
+\def\utfeightchardefs{%
+ \DeclareUnicodeCharacter{00A0}{\tie}
+ \DeclareUnicodeCharacter{00A1}{\exclamdown}
+ \DeclareUnicodeCharacter{00A3}{\pounds}
+ \DeclareUnicodeCharacter{00A8}{\"{ }}
+ \DeclareUnicodeCharacter{00A9}{\copyright}
+ \DeclareUnicodeCharacter{00AA}{\ordf}
+ \DeclareUnicodeCharacter{00AB}{\guillemetleft}
+ \DeclareUnicodeCharacter{00AD}{\-}
+ \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
+ \DeclareUnicodeCharacter{00AF}{\={ }}
+
+ \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
+ \DeclareUnicodeCharacter{00B4}{\'{ }}
+ \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
+ \DeclareUnicodeCharacter{00BA}{\ordm}
+ \DeclareUnicodeCharacter{00BB}{\guillemetright}
+ \DeclareUnicodeCharacter{00BF}{\questiondown}
+
+ \DeclareUnicodeCharacter{00C0}{\`A}
+ \DeclareUnicodeCharacter{00C1}{\'A}
+ \DeclareUnicodeCharacter{00C2}{\^A}
+ \DeclareUnicodeCharacter{00C3}{\~A}
+ \DeclareUnicodeCharacter{00C4}{\"A}
+ \DeclareUnicodeCharacter{00C5}{\AA}
+ \DeclareUnicodeCharacter{00C6}{\AE}
+ \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
+ \DeclareUnicodeCharacter{00C8}{\`E}
+ \DeclareUnicodeCharacter{00C9}{\'E}
+ \DeclareUnicodeCharacter{00CA}{\^E}
+ \DeclareUnicodeCharacter{00CB}{\"E}
+ \DeclareUnicodeCharacter{00CC}{\`I}
+ \DeclareUnicodeCharacter{00CD}{\'I}
+ \DeclareUnicodeCharacter{00CE}{\^I}
+ \DeclareUnicodeCharacter{00CF}{\"I}
+
+ \DeclareUnicodeCharacter{00D1}{\~N}
+ \DeclareUnicodeCharacter{00D2}{\`O}
+ \DeclareUnicodeCharacter{00D3}{\'O}
+ \DeclareUnicodeCharacter{00D4}{\^O}
+ \DeclareUnicodeCharacter{00D5}{\~O}
+ \DeclareUnicodeCharacter{00D6}{\"O}
+ \DeclareUnicodeCharacter{00D8}{\O}
+ \DeclareUnicodeCharacter{00D9}{\`U}
+ \DeclareUnicodeCharacter{00DA}{\'U}
+ \DeclareUnicodeCharacter{00DB}{\^U}
+ \DeclareUnicodeCharacter{00DC}{\"U}
+ \DeclareUnicodeCharacter{00DD}{\'Y}
+ \DeclareUnicodeCharacter{00DF}{\ss}
+
+ \DeclareUnicodeCharacter{00E0}{\`a}
+ \DeclareUnicodeCharacter{00E1}{\'a}
+ \DeclareUnicodeCharacter{00E2}{\^a}
+ \DeclareUnicodeCharacter{00E3}{\~a}
+ \DeclareUnicodeCharacter{00E4}{\"a}
+ \DeclareUnicodeCharacter{00E5}{\aa}
+ \DeclareUnicodeCharacter{00E6}{\ae}
+ \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
+ \DeclareUnicodeCharacter{00E8}{\`e}
+ \DeclareUnicodeCharacter{00E9}{\'e}
+ \DeclareUnicodeCharacter{00EA}{\^e}
+ \DeclareUnicodeCharacter{00EB}{\"e}
+ \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
+ \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
+ \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
+ \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
+
+ \DeclareUnicodeCharacter{00F1}{\~n}
+ \DeclareUnicodeCharacter{00F2}{\`o}
+ \DeclareUnicodeCharacter{00F3}{\'o}
+ \DeclareUnicodeCharacter{00F4}{\^o}
+ \DeclareUnicodeCharacter{00F5}{\~o}
+ \DeclareUnicodeCharacter{00F6}{\"o}
+ \DeclareUnicodeCharacter{00F8}{\o}
+ \DeclareUnicodeCharacter{00F9}{\`u}
+ \DeclareUnicodeCharacter{00FA}{\'u}
+ \DeclareUnicodeCharacter{00FB}{\^u}
+ \DeclareUnicodeCharacter{00FC}{\"u}
+ \DeclareUnicodeCharacter{00FD}{\'y}
+ \DeclareUnicodeCharacter{00FF}{\"y}
+
+ \DeclareUnicodeCharacter{0100}{\=A}
+ \DeclareUnicodeCharacter{0101}{\=a}
+ \DeclareUnicodeCharacter{0102}{\u{A}}
+ \DeclareUnicodeCharacter{0103}{\u{a}}
+ \DeclareUnicodeCharacter{0104}{\ogonek{A}}
+ \DeclareUnicodeCharacter{0105}{\ogonek{a}}
+ \DeclareUnicodeCharacter{0106}{\'C}
+ \DeclareUnicodeCharacter{0107}{\'c}
+ \DeclareUnicodeCharacter{0108}{\^C}
+ \DeclareUnicodeCharacter{0109}{\^c}
+ \DeclareUnicodeCharacter{0118}{\ogonek{E}}
+ \DeclareUnicodeCharacter{0119}{\ogonek{e}}
+ \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
+ \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
+ \DeclareUnicodeCharacter{010C}{\v{C}}
+ \DeclareUnicodeCharacter{010D}{\v{c}}
+ \DeclareUnicodeCharacter{010E}{\v{D}}
+
+ \DeclareUnicodeCharacter{0112}{\=E}
+ \DeclareUnicodeCharacter{0113}{\=e}
+ \DeclareUnicodeCharacter{0114}{\u{E}}
+ \DeclareUnicodeCharacter{0115}{\u{e}}
+ \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
+ \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
+ \DeclareUnicodeCharacter{011A}{\v{E}}
+ \DeclareUnicodeCharacter{011B}{\v{e}}
+ \DeclareUnicodeCharacter{011C}{\^G}
+ \DeclareUnicodeCharacter{011D}{\^g}
+ \DeclareUnicodeCharacter{011E}{\u{G}}
+ \DeclareUnicodeCharacter{011F}{\u{g}}
+
+ \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
+ \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
+ \DeclareUnicodeCharacter{0124}{\^H}
+ \DeclareUnicodeCharacter{0125}{\^h}
+ \DeclareUnicodeCharacter{0128}{\~I}
+ \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
+ \DeclareUnicodeCharacter{012A}{\=I}
+ \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
+ \DeclareUnicodeCharacter{012C}{\u{I}}
+ \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
+
+ \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
+ \DeclareUnicodeCharacter{0131}{\dotless{i}}
+ \DeclareUnicodeCharacter{0132}{IJ}
+ \DeclareUnicodeCharacter{0133}{ij}
+ \DeclareUnicodeCharacter{0134}{\^J}
+ \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
+ \DeclareUnicodeCharacter{0139}{\'L}
+ \DeclareUnicodeCharacter{013A}{\'l}
+
+ \DeclareUnicodeCharacter{0141}{\L}
+ \DeclareUnicodeCharacter{0142}{\l}
+ \DeclareUnicodeCharacter{0143}{\'N}
+ \DeclareUnicodeCharacter{0144}{\'n}
+ \DeclareUnicodeCharacter{0147}{\v{N}}
+ \DeclareUnicodeCharacter{0148}{\v{n}}
+ \DeclareUnicodeCharacter{014C}{\=O}
+ \DeclareUnicodeCharacter{014D}{\=o}
+ \DeclareUnicodeCharacter{014E}{\u{O}}
+ \DeclareUnicodeCharacter{014F}{\u{o}}
+
+ \DeclareUnicodeCharacter{0150}{\H{O}}
+ \DeclareUnicodeCharacter{0151}{\H{o}}
+ \DeclareUnicodeCharacter{0152}{\OE}
+ \DeclareUnicodeCharacter{0153}{\oe}
+ \DeclareUnicodeCharacter{0154}{\'R}
+ \DeclareUnicodeCharacter{0155}{\'r}
+ \DeclareUnicodeCharacter{0158}{\v{R}}
+ \DeclareUnicodeCharacter{0159}{\v{r}}
+ \DeclareUnicodeCharacter{015A}{\'S}
+ \DeclareUnicodeCharacter{015B}{\'s}
+ \DeclareUnicodeCharacter{015C}{\^S}
+ \DeclareUnicodeCharacter{015D}{\^s}
+ \DeclareUnicodeCharacter{015E}{\cedilla{S}}
+ \DeclareUnicodeCharacter{015F}{\cedilla{s}}
+
+ \DeclareUnicodeCharacter{0160}{\v{S}}
+ \DeclareUnicodeCharacter{0161}{\v{s}}
+ \DeclareUnicodeCharacter{0162}{\cedilla{t}}
+ \DeclareUnicodeCharacter{0163}{\cedilla{T}}
+ \DeclareUnicodeCharacter{0164}{\v{T}}
+
+ \DeclareUnicodeCharacter{0168}{\~U}
+ \DeclareUnicodeCharacter{0169}{\~u}
+ \DeclareUnicodeCharacter{016A}{\=U}
+ \DeclareUnicodeCharacter{016B}{\=u}
+ \DeclareUnicodeCharacter{016C}{\u{U}}
+ \DeclareUnicodeCharacter{016D}{\u{u}}
+ \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
+ \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
+
+ \DeclareUnicodeCharacter{0170}{\H{U}}
+ \DeclareUnicodeCharacter{0171}{\H{u}}
+ \DeclareUnicodeCharacter{0174}{\^W}
+ \DeclareUnicodeCharacter{0175}{\^w}
+ \DeclareUnicodeCharacter{0176}{\^Y}
+ \DeclareUnicodeCharacter{0177}{\^y}
+ \DeclareUnicodeCharacter{0178}{\"Y}
+ \DeclareUnicodeCharacter{0179}{\'Z}
+ \DeclareUnicodeCharacter{017A}{\'z}
+ \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
+ \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
+ \DeclareUnicodeCharacter{017D}{\v{Z}}
+ \DeclareUnicodeCharacter{017E}{\v{z}}
+
+ \DeclareUnicodeCharacter{01C4}{D\v{Z}}
+ \DeclareUnicodeCharacter{01C5}{D\v{z}}
+ \DeclareUnicodeCharacter{01C6}{d\v{z}}
+ \DeclareUnicodeCharacter{01C7}{LJ}
+ \DeclareUnicodeCharacter{01C8}{Lj}
+ \DeclareUnicodeCharacter{01C9}{lj}
+ \DeclareUnicodeCharacter{01CA}{NJ}
+ \DeclareUnicodeCharacter{01CB}{Nj}
+ \DeclareUnicodeCharacter{01CC}{nj}
+ \DeclareUnicodeCharacter{01CD}{\v{A}}
+ \DeclareUnicodeCharacter{01CE}{\v{a}}
+ \DeclareUnicodeCharacter{01CF}{\v{I}}
+
+ \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
+ \DeclareUnicodeCharacter{01D1}{\v{O}}
+ \DeclareUnicodeCharacter{01D2}{\v{o}}
+ \DeclareUnicodeCharacter{01D3}{\v{U}}
+ \DeclareUnicodeCharacter{01D4}{\v{u}}
+
+ \DeclareUnicodeCharacter{01E2}{\={\AE}}
+ \DeclareUnicodeCharacter{01E3}{\={\ae}}
+ \DeclareUnicodeCharacter{01E6}{\v{G}}
+ \DeclareUnicodeCharacter{01E7}{\v{g}}
+ \DeclareUnicodeCharacter{01E8}{\v{K}}
+ \DeclareUnicodeCharacter{01E9}{\v{k}}
+
+ \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
+ \DeclareUnicodeCharacter{01F1}{DZ}
+ \DeclareUnicodeCharacter{01F2}{Dz}
+ \DeclareUnicodeCharacter{01F3}{dz}
+ \DeclareUnicodeCharacter{01F4}{\'G}
+ \DeclareUnicodeCharacter{01F5}{\'g}
+ \DeclareUnicodeCharacter{01F8}{\`N}
+ \DeclareUnicodeCharacter{01F9}{\`n}
+ \DeclareUnicodeCharacter{01FC}{\'{\AE}}
+ \DeclareUnicodeCharacter{01FD}{\'{\ae}}
+ \DeclareUnicodeCharacter{01FE}{\'{\O}}
+ \DeclareUnicodeCharacter{01FF}{\'{\o}}
+
+ \DeclareUnicodeCharacter{021E}{\v{H}}
+ \DeclareUnicodeCharacter{021F}{\v{h}}
+
+ \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
+ \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
+ \DeclareUnicodeCharacter{0228}{\cedilla{E}}
+ \DeclareUnicodeCharacter{0229}{\cedilla{e}}
+ \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
+ \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
+
+ \DeclareUnicodeCharacter{0232}{\=Y}
+ \DeclareUnicodeCharacter{0233}{\=y}
+ \DeclareUnicodeCharacter{0237}{\dotless{j}}
+
+ \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
+
+ \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
+ \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
+ \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
+ \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
+ \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
+ \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
+ \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
+ \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
+ \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
+ \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
+ \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
+ \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
+
+ \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
+ \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
+
+ \DeclareUnicodeCharacter{1E20}{\=G}
+ \DeclareUnicodeCharacter{1E21}{\=g}
+ \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
+ \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
+ \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
+ \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
+ \DeclareUnicodeCharacter{1E26}{\"H}
+ \DeclareUnicodeCharacter{1E27}{\"h}
+
+ \DeclareUnicodeCharacter{1E30}{\'K}
+ \DeclareUnicodeCharacter{1E31}{\'k}
+ \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
+ \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
+ \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
+ \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
+ \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
+ \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
+ \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
+ \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
+ \DeclareUnicodeCharacter{1E3E}{\'M}
+ \DeclareUnicodeCharacter{1E3F}{\'m}
+
+ \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
+ \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
+ \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
+ \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
+ \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
+ \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
+ \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
+ \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
+ \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
+ \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
+
+ \DeclareUnicodeCharacter{1E54}{\'P}
+ \DeclareUnicodeCharacter{1E55}{\'p}
+ \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
+ \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
+ \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
+ \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
+ \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
+ \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
+ \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
+ \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
+
+ \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
+ \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
+ \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
+ \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
+ \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
+ \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
+ \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
+ \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
+ \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
+ \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
+
+ \DeclareUnicodeCharacter{1E7C}{\~V}
+ \DeclareUnicodeCharacter{1E7D}{\~v}
+ \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
+ \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
+
+ \DeclareUnicodeCharacter{1E80}{\`W}
+ \DeclareUnicodeCharacter{1E81}{\`w}
+ \DeclareUnicodeCharacter{1E82}{\'W}
+ \DeclareUnicodeCharacter{1E83}{\'w}
+ \DeclareUnicodeCharacter{1E84}{\"W}
+ \DeclareUnicodeCharacter{1E85}{\"w}
+ \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
+ \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
+ \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
+ \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
+ \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
+ \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
+ \DeclareUnicodeCharacter{1E8C}{\"X}
+ \DeclareUnicodeCharacter{1E8D}{\"x}
+ \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
+ \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
+
+ \DeclareUnicodeCharacter{1E90}{\^Z}
+ \DeclareUnicodeCharacter{1E91}{\^z}
+ \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
+ \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
+ \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
+ \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
+ \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
+ \DeclareUnicodeCharacter{1E97}{\"t}
+ \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
+ \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
+
+ \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
+ \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
+
+ \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
+ \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
+ \DeclareUnicodeCharacter{1EBC}{\~E}
+ \DeclareUnicodeCharacter{1EBD}{\~e}
+
+ \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
+ \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
+ \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
+ \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
+
+ \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
+ \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
+
+ \DeclareUnicodeCharacter{1EF2}{\`Y}
+ \DeclareUnicodeCharacter{1EF3}{\`y}
+ \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
+
+ \DeclareUnicodeCharacter{1EF8}{\~Y}
+ \DeclareUnicodeCharacter{1EF9}{\~y}
+
+ \DeclareUnicodeCharacter{2013}{--}
+ \DeclareUnicodeCharacter{2014}{---}
+ \DeclareUnicodeCharacter{2018}{\quoteleft}
+ \DeclareUnicodeCharacter{2019}{\quoteright}
+ \DeclareUnicodeCharacter{201A}{\quotesinglbase}
+ \DeclareUnicodeCharacter{201C}{\quotedblleft}
+ \DeclareUnicodeCharacter{201D}{\quotedblright}
+ \DeclareUnicodeCharacter{201E}{\quotedblbase}
+ \DeclareUnicodeCharacter{2022}{\bullet}
+ \DeclareUnicodeCharacter{2026}{\dots}
+ \DeclareUnicodeCharacter{2039}{\guilsinglleft}
+ \DeclareUnicodeCharacter{203A}{\guilsinglright}
+ \DeclareUnicodeCharacter{20AC}{\euro}
+
+ \DeclareUnicodeCharacter{2192}{\expansion}
+ \DeclareUnicodeCharacter{21D2}{\result}
+
+ \DeclareUnicodeCharacter{2212}{\minus}
+ \DeclareUnicodeCharacter{2217}{\point}
+ \DeclareUnicodeCharacter{2261}{\equiv}
+}% end of \utfeightchardefs
+
+
+% US-ASCII character definitions.
+\def\asciichardefs{% nothing need be done
+ \relax
+}
+
+% Make non-ASCII characters printable again for compatibility with
+% existing Texinfo documents that may use them, even without declaring a
+% document encoding.
+%
+\setnonasciicharscatcode \other
+
+
+\message{formatting,}
+
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
+
+% Following George Bush, get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth;
+% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
+% 7) physical page height; 8) physical page width.
+%
+% We also call \setleading{\textleading}, so the caller should define
+% \textleading. The caller should also set \parskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6#7#8{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
+ %
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \ifpdf
+ \pdfpageheight #7\relax
+ \pdfpagewidth #8\relax
+ % if we don't reset these, they will remain at "1 true in" of
+ % whatever layout pdftex was dumped with.
+ \pdfhorigin = 1 true in
+ \pdfvorigin = 1 true in
+ \fi
+ %
+ \setleading{\textleading}
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{607.2pt}{6in}% that's 46 lines
+ {\voffset}{.25in}%
+ {\bindingoffset}{36pt}%
+ {11in}{8.5in}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.25 trim size.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.5in}{5in}%
+ {-.2in}{0in}%
+ {\bindingoffset}{16pt}%
+ {9.25in}{7in}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .5cm
+}}
+
+% Use @smallerbook to reset parameters for 6x9 trim size.
+% (Just testing, parameters still in flux.)
+\def\smallerbook{{\globaldefs = 1
+ \parskip = 1.5pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.4in}{4.8in}%
+ {-.2in}{-.4in}%
+ {0pt}{14pt}%
+ {9in}{6in}%
+ %
+ \lispnarrowing = 0.25in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .4cm
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % Double-side printing via postscript on Laserjet 4050
+ % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
+ % To change the settings for a different printer or situation, adjust
+ % \normaloffset until the front-side and back-side texts align. Then
+ % do the same for \bindingoffset. You can set these for testing in
+ % your texinfo source file like this:
+ % @tex
+ % \global\normaloffset = -6mm
+ % \global\bindingoffset = 10mm
+ % @end tex
+ \internalpagesizes{673.2pt}{160mm}% that's 51 lines
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{44pt}%
+ {297mm}{210mm}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 5mm
+}}
+
+% Use @afivepaper to print on European A5 paper.
+% From romildo@urano.iceb.ufop.br, 2 July 2000.
+% He also recommends making @example and @lisp be small.
+\def\afivepaper{{\globaldefs = 1
+ \parskip = 2pt plus 1pt minus 0.1pt
+ \textleading = 12.5pt
+ %
+ \internalpagesizes{160mm}{120mm}%
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{8pt}%
+ {210mm}{148mm}%
+ %
+ \lispnarrowing = 0.2in
+ \tolerance = 800
+ \hfuzz = 1.2pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 2mm
+ \tableindent = 12mm
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper.
+\def\afourlatex{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}%
+ {\voffset}{4.6mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ %
+ % Must explicitly reset to 0 because we call \afourpaper.
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on A4 paper in landscape format.
+\def\afourwide{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{241mm}{165mm}%
+ {\voffset}{-2.95mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ \globaldefs = 0
+}}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{\textleading}%
+ %
+ \dimen0 = #1\relax
+ \advance\dimen0 by \voffset
+ %
+ \dimen2 = \hsize
+ \advance\dimen2 by \normaloffset
+ %
+ \internalpagesizes{#1}{\hsize}%
+ {\voffset}{\normaloffset}%
+ {\bindingoffset}{44pt}%
+ {\dimen0}{\dimen2}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other
+\catcode`\~=\other
+\catcode`\^=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode`\+=\other
+\catcode`\$=\other
+\def\normaldoublequote{"}
+\def\normaltilde{~}
+\def\normalcaret{^}
+\def\normalunderscore{_}
+\def\normalverticalbar{|}
+\def\normalless{<}
+\def\normalgreater{>}
+\def\normalplus{+}
+\def\normaldollar{$}%$ font-lock fix
+
+% This macro is used to make a character print one way in \tt
+% (where it can probably be output as-is), and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+\let\realunder=_
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+% Used sometimes to turn off (effectively) the active characters even after
+% parsing them.
+\def\turnoffactive{%
+ \normalturnoffactive
+ \otherbackslash
+}
+
+\catcode`\@=0
+
+% \backslashcurfont outputs one backslash character in current font,
+% as in \char`\\.
+\global\chardef\backslashcurfont=`\\
+\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
+
+% \realbackslash is an actual character `\' with catcode other, and
+% \doublebackslash is two of them (for the pdf outlines).
+{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
+
+% In texinfo, backslash is an active character; it prints the backslash
+% in fixed width font.
+\catcode`\\=\active
+@def@normalbackslash{{@tt@backslashcurfont}}
+% On startup, @fixbackslash assigns:
+% @let \ = @normalbackslash
+
+% \rawbackslash defines an active \ to do \backslashcurfont.
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other.
+@gdef@rawbackslash{@let\=@backslashcurfont}
+@gdef@otherbackslash{@let\=@realbackslash}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'.
+%
+@def@normalturnoffactive{%
+ @let\=@normalbackslash
+ @let"=@normaldoublequote
+ @let~=@normaltilde
+ @let^=@normalcaret
+ @let_=@normalunderscore
+ @let|=@normalverticalbar
+ @let<=@normalless
+ @let>=@normalgreater
+ @let+=@normalplus
+ @let$=@normaldollar %$ font-lock fix
+ @markupsetuplqdefault
+ @markupsetuprqdefault
+ @unsepspaces
+}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\' in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also turn back on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+
+% These look ok in all fonts, so just make them not special.
+@catcode`@& = @other
+@catcode`@# = @other
+@catcode`@% = @other
+
+@c Finally, make ` and ' active, so that txicodequoteundirected and
+@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
+@c don't make ` and ' active, @code will not get them as active chars.
+@c Do this last of all since we use ` in the previous @catcode assignments.
+@catcode`@'=@active
+@catcode`@`=@active
+@markupsetuplqdefault
+@markupsetuprqdefault
+
+@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
+@c End:
+
+@c vim:sw=2:
+
+@ignore
+ arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
+@end ignore
diff --git a/Build/source/build-aux/ylwrap b/Build/source/build-aux/ylwrap
new file mode 100755
index 00000000000..7278b6a3573
--- /dev/null
+++ b/Build/source/build-aux/ylwrap
@@ -0,0 +1,223 @@
+#! /bin/sh
+# ylwrap - wrapper for lex/yacc invocations.
+
+scriptversion=2007-11-22.22
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005,
+# 2007 Free Software Foundation, Inc.
+#
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# 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.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case "$1" in
+ '')
+ echo "$0: No files given. Try \`$0 --help' for more information." 1>&2
+ exit 1
+ ;;
+ --basedir)
+ basedir=$2
+ shift 2
+ ;;
+ -h|--h*)
+ cat <<\EOF
+Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
+
+Wrapper for lex/yacc invocations, renaming files as desired.
+
+ INPUT is the input file
+ OUTPUT is one file PROG generates
+ DESIRED is the file we actually want instead of OUTPUT
+ PROGRAM is program to run
+ ARGS are passed to PROG
+
+Any number of OUTPUT,DESIRED pairs may be used.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v|--v*)
+ echo "ylwrap $scriptversion"
+ exit $?
+ ;;
+esac
+
+
+# The input.
+input="$1"
+shift
+case "$input" in
+ [\\/]* | ?:[\\/]*)
+ # Absolute path; do nothing.
+ ;;
+ *)
+ # Relative path. Make it absolute.
+ input="`pwd`/$input"
+ ;;
+esac
+
+pairlist=
+while test "$#" -ne 0; do
+ if test "$1" = "--"; then
+ shift
+ break
+ fi
+ pairlist="$pairlist $1"
+ shift
+done
+
+# The program to run.
+prog="$1"
+shift
+# Make any relative path in $prog absolute.
+case "$prog" in
+ [\\/]* | ?:[\\/]*) ;;
+ *[\\/]*) prog="`pwd`/$prog" ;;
+esac
+
+# FIXME: add hostname here for parallel makes that run commands on
+# other machines. But that might take us over the 14-char limit.
+dirname=ylwrap$$
+trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
+mkdir $dirname || exit 1
+
+cd $dirname
+
+case $# in
+ 0) "$prog" "$input" ;;
+ *) "$prog" "$@" "$input" ;;
+esac
+ret=$?
+
+if test $ret -eq 0; then
+ set X $pairlist
+ shift
+ first=yes
+ # Since DOS filename conventions don't allow two dots,
+ # the DOS version of Bison writes out y_tab.c instead of y.tab.c
+ # and y_tab.h instead of y.tab.h. Test to see if this is the case.
+ y_tab_nodot="no"
+ if test -f y_tab.c || test -f y_tab.h; then
+ y_tab_nodot="yes"
+ fi
+
+ # The directory holding the input.
+ input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'`
+ # Quote $INPUT_DIR so we can use it in a regexp.
+ # FIXME: really we should care about more than `.' and `\'.
+ input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'`
+
+ while test "$#" -ne 0; do
+ from="$1"
+ # Handle y_tab.c and y_tab.h output by DOS
+ if test $y_tab_nodot = "yes"; then
+ if test $from = "y.tab.c"; then
+ from="y_tab.c"
+ else
+ if test $from = "y.tab.h"; then
+ from="y_tab.h"
+ fi
+ fi
+ fi
+ if test -f "$from"; then
+ # If $2 is an absolute path name, then just use that,
+ # otherwise prepend `../'.
+ case "$2" in
+ [\\/]* | ?:[\\/]*) target="$2";;
+ *) target="../$2";;
+ esac
+
+ # We do not want to overwrite a header file if it hasn't
+ # changed. This avoid useless recompilations. However the
+ # parser itself (the first file) should always be updated,
+ # because it is the destination of the .y.c rule in the
+ # Makefile. Divert the output of all other files to a temporary
+ # file so we can compare them to existing versions.
+ if test $first = no; then
+ realtarget="$target"
+ target="tmp-`echo $target | sed s/.*[\\/]//g`"
+ fi
+ # Edit out `#line' or `#' directives.
+ #
+ # We don't want the resulting debug information to point at
+ # an absolute srcdir; it is better for it to just mention the
+ # .y file with no path.
+ #
+ # We want to use the real output file name, not yy.lex.c for
+ # instance.
+ #
+ # We want the include guards to be adjusted too.
+ FROM=`echo "$from" | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+ TARGET=`echo "$2" | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
+
+ sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \
+ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
+
+ # Check whether header files must be updated.
+ if test $first = no; then
+ if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
+ echo "$2" is unchanged
+ rm -f "$target"
+ else
+ echo updating "$2"
+ mv -f "$target" "$realtarget"
+ fi
+ fi
+ else
+ # A missing file is only an error for the first file. This
+ # is a blatant hack to let us support using "yacc -d". If -d
+ # is not specified, we don't want an error when the header
+ # file is "missing".
+ if test $first = yes; then
+ ret=1
+ fi
+ fi
+ shift
+ shift
+ first=no
+ done
+else
+ ret=$?
+fi
+
+# Remove the directory.
+cd ..
+rm -rf $dirname
+
+exit $ret
+
+# 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:
diff --git a/Build/source/configure.in.orig b/Build/source/configure.in.orig
new file mode 100644
index 00000000000..35e69aaf613
--- /dev/null
+++ b/Build/source/configure.in.orig
@@ -0,0 +1,287 @@
+dnl Top-level configure for TeX Live build. Public domain.
+
+AC_INIT(texk/make/common.mk)
+
+AC_CONFIG_AUX_DIR(config)
+AC_PROG_MAKE_SET
+AC_PROG_CC
+AC_PROG_CXX
+
+AC_PROG_LEX
+case $LEX in
+ lex)
+ OLDIFS=$IFS; IFS=:
+ foundLEX=false
+ for p in $PATH; do
+ if test -f "$p/lex"; then
+ foundLEX=true
+ break
+ fi
+ done
+ IFS=$OLDIFS
+ ;;
+esac
+if $foundLEX; then :; else
+ AC_MSG_ERROR(no working lexical scanner (lex/flex) found)
+fi
+
+AC_PROG_YACC
+case $YACC in
+ yacc)
+ OLDIFS=$IFS; IFS=:
+ foundYACC=false
+ for p in $PATH; do
+ if test -f "$p/yacc"; then
+ foundYACC=true
+ break
+ fi
+ done
+ IFS=$OLDIFS
+ ;;
+esac
+if $foundYACC; then :; else
+ AC_MSG_ERROR(no working parser generator (yacc/bison) found)
+fi
+
+AC_CANONICAL_SYSTEM
+
+dnl Various compiler directives
+AC_MSG_CHECKING(whether to define additional compiler specific flags)
+case "$target" in
+ alpha*-dec*)
+ if test "$CC" = "cc"; then
+ CFLAGS="$CFLAGS -Olimit 1000 -std1"; export CFLAGS
+ AC_MSG_WARN(Digital Unix's cc)
+ fi
+ ;;
+ hp*hpux*)
+ if test "$CC" = "cc"; then
+ CFLAGS="$CFLAGS -Aa +e -D_HPUX_SOURCE"; export CFLAGS
+ AC_MSG_WARN(HP-UX's cc)
+ fi
+ ;;
+ *-darwin*)
+ : ${INSTALL='/usr/bin/install -c -p'}; export INSTALL
+ : ${NCURSES_CPP_FIX=true}; export NCURSES_CPP_FIX
+ AC_MSG_RESULT([no, but using other fixes for Darwin])
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+esac
+
+dnl We check this here, because otherwise some worse check (from ncurses?)
+dnl is used instead for the cached value.
+AC_HEADER_SYS_WAIT
+
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+AC_FUNC_ALLOCA
+AC_PROG_RANLIB
+AC_PATH_X
+
+dnl These are included for compilation with either teTeX or standalone xdvik
+dnl (tetex will only provide tetex.ac, xdvik only xdvik.ac)
+sinclude(tetex.ac)
+sinclude(texlive.ac)
+sinclude(xdvik.ac)
+sinclude(withenable.ac)
+sinclude(utils/dialog/withenable.ac)
+sinclude(texk/withenable.ac)
+sinclude(texk/kpathsea/xt.ac)
+sinclude(texk/kpathsea/withenable.ac)
+sinclude(texk/web2c/withenable.ac)
+sinclude(texk/web2c/xetexdir/withenable.ac)
+sinclude(texk/xdvik/withenable.ac)
+sinclude(libs/ncurses/withenable.ac)
+sinclude(libs/zlib/withenable.ac)
+sinclude(libs/libpng/withenable.ac)
+sinclude(libs/t1lib/withenable.ac)
+sinclude(libs/freetype/withenable.ac)
+sinclude(libs/freetype2/withenable.ac)
+sinclude(libs/gd/withenable.ac)
+sinclude(libs/icu-xetex/withenable.ac)
+sinclude(libs/teckit/withenable.ac)
+sinclude(libs/graphite-engine/withenable.ac)
+
+NCURSESDIR=libs/ncurses
+LIBT1DIR=libs/t1lib
+LIBTYPE1DIR=libs/type1
+LIBPNGDIR=libs/libpng
+ZLIBDIR=libs/zlib
+LIBXPDFDIR=libs/xpdf
+FREETYPEDIR=libs/freetype
+FREETYPE2DIR=libs/freetype2
+ICUDIR=libs/icu-xetex
+GRAPHITEDIR=libs/graphite-engine
+TECKITDIR=libs/teckit
+GDDIR=libs/gd
+LIBOBSDCOMPATDIR=libs/obsdcompat
+
+test "$no_x" = yes && { with_xdvik=no; with_oxdvik=no; }
+export with_xdvik with_oxdvik
+
+# we need libt1 for dvipng, xdvik, oxdvik
+test ! -d $srcdir/$LIBT1DIR && : ${needs_libt1=no}
+test "$with_dvipng" != no && : ${needs_libt1=yes}
+test "$with_xdvik" != no && : ${needs_libt1=yes}
+test "$with_oxdvik" != no && : ${needs_libt1=yes}
+: ${needs_libt1=no}
+export needs_libt1
+
+# we need ncurses for dialog
+test ! -d $srcdir/$NCURSESDIR && : ${needs_ncurses=no}
+test "$with_dialog" != no && : ${needs_ncurses=yes}
+: ${needs_ncurses=no}
+export needs_ncurses
+
+# we need pnglib for dvipng, pdf[ex]tex, xetex, dvipdfm, dvipdfmx, xdvipdfmx
+test ! -d $srcdir/$LIBPNGDIR && : ${needs_pnglib=no}
+test "$with_dvipng" != no && : ${needs_pnglib=yes}
+test "$with_pdftex" != no && : ${needs_pnglib=yes}
+test "$with_pdfetex" != no && : ${needs_pnglib=yes}
+test "$with_xetex" != no && : ${needs_pnglib=yes}
+test "$with_dvipdfm" != no && : ${needs_pnglib=yes}
+test "$with_dvipdfmx" != no && : ${needs_pnglib=yes}
+test "$with_xdvipdfmx" != no && : ${needs_pnglib=yes}
+: ${needs_pnglib=no}
+export needs_pnglib
+
+# we need zlib for dvipng, pdf[ex]tex, xetex, dvipdfm, etc.
+test ! -d $srcdir/$ZLIBDIR && : ${needs_zlib=no}
+test "$with_dvipng" != no && : ${needs_zlib=yes}
+test "$with_pdftex" != no && : ${needs_zlib=yes}
+test "$with_pdfetex" != no && : ${needs_zlib=yes}
+test "$with_xetex" != no && : ${needs_zlib=yes}
+test "$with_dvipdfm" != no && : ${needs_zlib=yes}
+test "$with_dvipdfmx" != no && : ${needs_zlib=yes}
+test "$with_xdvipdfmx" != no && : ${needs_zlib=yes}
+: ${needs_zlib=no}
+export needs_zlib
+
+# we need libxpdf for pdf[ex]tex, xetex
+test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
+test "$with_pdftex" != no && : ${needs_libxpdf=yes}
+test "$with_pdfetex" != no && : ${needs_libxpdf=yes}
+test "$with_xetex" != no && : ${needs_libxpdf=yes}
+: ${needs_libxpdf=no}
+export needs_libxpdf
+
+# we need libobsdcompat for pdftex
+test ! -d $srcdir/$LIBOBSDCOMPATDIR && : ${needs_obsdcompat=no}
+test "$with_pdftex" != no && : ${needs_obsdcompat=yes}
+test "$with_pdfetex" != no && : ${needs_obsdcompat=yes}
+: ${needs_obsdcompat=no}
+export needs_obsdcompat
+
+# we need gd for dvipng
+test ! -d $srcdir/$GDDIR && : ${needs_gd=no}
+test "$with_dvipng" != no && : ${needs_gd=yes}
+: ${needs_gd=no}
+export needs_gd
+
+# we need freetype for ttf2pk
+test ! -d $srcdir/$FREETYPEDIR && : ${needs_freetype=no}
+test ! -d $srcdir/texk/ttf2pk && : ${needs_freetype=no}
+test "$with_ttf2pk" = no && : ${needs_freetype=no}
+: ${needs_freetype=yes}
+export needs_freetype
+
+# we need freetype2 for xetex, xdvipdfmx, dvipng
+test ! -d $srcdir/$FREETYPE2DIR && : ${needs_freetype2=no}
+test "$with_xetex" != no && : ${needs_freetype2=yes}
+test "$with_xdvipdfmx" != no && : ${needs_freetype2=yes}
+test "$with_dvipng" != no && : ${needs_freetype2=yes}
+: ${needs_freetype2=no}
+export needs_freetype2
+
+# we need icu for xetex
+test ! -d $srcdir/$ICUDIR && : ${needs_icu=no}
+test "$with_xetex" != no && : ${needs_icu=yes}
+: ${needs_icu=no}
+export needs_icu
+
+# we need graphite for xetex, unless specifically disabled
+test ! -d $srcdir/$GRAPHITEDIR && : ${needs_graphite=no}
+test "$with_graphite" = no && : ${needs_graphite=no}
+test "$with_xetex" != no && : ${needs_graphite=yes}
+: ${needs_graphite=no}
+export needs_graphite
+
+# we need teckit for xetex
+test ! -d $srcdir/$TECKITDIR && : ${needs_teckit=no}
+test "$with_xetex" != no && : ${needs_teckit=yes}
+: ${needs_teckit=no}
+export needs_teckit
+
+dnl We cannot use variables (e.g. $LIBPNGDIR) for sinclude, so...
+sinclude(libs/ncurses/ncurses.ac)
+sinclude(libs/zlib/zlib.ac)
+sinclude(libs/libpng/libpng.ac)
+sinclude(libs/xpdf/libxpdf.ac)
+sinclude(libs/t1lib/t1lib.ac)
+sinclude(libs/freetype/freetype.ac)
+sinclude(libs/freetype2/freetype2.ac)
+sinclude(libs/gd/gd.ac)
+sinclude(libs/icu-xetex/icu-xetex.ac)
+sinclude(libs/graphite-engine/graphite-engine.ac)
+sinclude(libs/teckit/teckit.ac)
+sinclude(libs/obsdcompat/libobsd-compat.ac)
+
+LIBSDEP="$CURSESDEP $ZLIBDEP $LIBPNGDEP $LIBXPDFDEP $LIBT1DEP $GDDEP $FREETYPEDEP $FREETYPE2DEP $ICUDEP $GRAPHITEDEP $TECKITDEP $LIBOBSDDEP"
+
+LIBSDIRS=
+test "$needs_ncurses" = yes && test "$using_system_ncurses" != yes \
+ && LIBSDIRS="$LIBSDIRS $NCURSESDIR"
+test "$needs_zlib" = yes && test "$using_system_zlib" != yes \
+ && LIBSDIRS="$LIBSDIRS $ZLIBDIR"
+test "$needs_pnglib" = yes && test "$using_system_pnglib" != yes \
+ && LIBSDIRS="$LIBSDIRS $LIBPNGDIR"
+test "$needs_libxpdf" = yes \
+ && LIBSDIRS="$LIBSDIRS $LIBXPDFDIR"
+test "$needs_libt1" = yes && test "$using_system_t1lib" != yes \
+ && LIBSDIRS="$LIBSDIRS $LIBT1DIR $LIBTYPE1DIR"
+test "$needs_freetype" = yes && test "$using_system_freetype" != yes \
+ && LIBSDIRS="$LIBSDIRS $FREETYPEDIR"
+test "$needs_freetype2" = yes && test "$using_system_freetype2" != yes \
+ && LIBSDIRS="$LIBSDIRS $FREETYPE2DIR"
+test "$needs_gd" = yes && test "$using_system_gd" != yes \
+ && LIBSDIRS="$LIBSDIRS $GDDIR"
+test "$needs_icu" = yes && test "$using_system_icu" != yes \
+ && LIBSDIRS="$LIBSDIRS $ICUDIR"
+test "$needs_teckit" = yes \
+ && LIBSDIRS="$LIBSDIRS $TECKITDIR"
+test "$needs_graphite" = yes \
+ && LIBSDIRS="$LIBSDIRS $GRAPHITEDIR"
+test "$needs_obsdcompat" = yes \
+ && LIBSDIRS="$LIBSDIRS $LIBOBSDCOMPATDIR"
+
+dnl required subdir
+AC_CONFIG_SUBDIRS([libs])
+
+dnl optional subdirs in utils/ => ESUBDIRS
+KPSE_CONFIG_SUBDIRS(kpse_utils_pkglist, [utils])
+
+AC_SUBST(LIBSDEP)
+AC_SUBST(LIBSDIRS)
+
+# initialize texmf tree with fmtutil only for teTeX and TeX Live
+if test ! -d $srcdir/texk/tetex || test -n "$xdvik_standalone" || test "x$cross_compiling" = xyes; then
+ FMU=
+else
+ FMU='# '
+fi
+AC_SUBST(FMU)
+
+# more customizations for standalone xdvik
+if test -z "$xdvik_standalone"; then
+ INSTDIRS='$(ESUBDIRS)'
+else
+ INSTDIRS=texk/xdvik
+fi
+AC_SUBST(INSTDIRS)
+
+AC_CONFIG_SUBDIRS([texk])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/libs/README.orig b/Build/source/libs/README.orig
new file mode 100644
index 00000000000..e1e509b7b7b
--- /dev/null
+++ b/Build/source/libs/README.orig
@@ -0,0 +1,250 @@
+$Id$
+Public domain. Originally created by Karl Berry, 2005.
+
+Libraries we compile for TeX Live.
+See comments in ../texk/README.
+
+expat - ?
+
+freetype - ?
+
+freetype2 - ?
+
+gd - ?
+
+graphite-engine - used by xetex, maintained here+upstream by Jonathan Kew
+
+icu-xetex - as with graphite-engine
+
+jpeg - ?
+
+libpng 1.2.8 - http://www.libpng.org - used by many
+
+libttf - ?
+
+lua* - used by luatex, maintained upstream+here by Taco Hoekwater
+
+md5 - used by pdftex, provenance unknown
+
+ncurses - used only by dialog. So if dialog were changed to use a system
+ ncurses (surely universally available now), we could remove ncurses
+ from our sources, which would be very nice.
+
+obsdcompat - used by pdftex
+
+slnunicode - ?
+
+t1lib - ?
+
+teckit - as with graphite-engine
+
+type1 - ?
+
+unzip - ?
+
+xpdf - used by pdftex
+
+zlib 1.2.3 - http://www.zlib.net/ - used by many
+
+zziplib - used by luatex
+
+
+
+This info used to be in a howto/ subdirectory; it was written a long
+time ago, by Sebastian Rahtz and/or Thomas Esser, maybe?
+
+==> freetype <==
+The following files have been added:
+ freeetype.ac withenable.ac
+
+Modifications:
+ configure.in:
+ disable AM_DISABLE_STATIC
+ add AM_DISABLE_SHARED
+
+==> freetype2 <==
+The freetype2 directory contains Freetype 2.3.7 sources from:
+
+ http://download.savannah.gnu.org/releases/freetype/freetype-2.3.7.tar.bz2
+
+The following files have been added:
+
+ freetype2.ac
+ withenable.ac
+
+Modifications:
+
+ freetype2/builds/unix/configure
+ - edited to ignore the --srcdir argument, as this doesn't work properly
+ in the tex-live build
+
+
+==> icu-xetex <==
+The icu-xetex directory contains a *MODIFIED* copy of ICU release 3.8.1,
+used in building xetex.
+
+The following files have been added:
+
+ icu-xetex.ac
+ withenable.ac
+
+See libs/icu-xetex/README for more information.
+
+==> libpng <==
+Downloading:
+ http://www.libpng.org/
+ http://libpng.sourceforge.net/
+
+libpng is the original distribution, but with added
+ Makefile.in libpng.ac withenable.ac
+
+The directories
+ contrib projects scripts
+are not needed for teTeX and can be removed.
+
+libpng is configured by libs/configure, so the (original)
+libs/libpng/configure is not used by teTeX.
+
+==> libtiff <==
+Downloading:
+ http://www.libtiff.org/
+ http://freshmeat.net/projects/libtiff/
+
+Which files are in libtiff:
+ from the original distribution:
+ COPYRIGHT RELEASE-DATE VERSION libtiff/* dist/tiff.alpha
+
+ added for teTeX:
+ acconfig.h aclocal.m4 configure.in libtiff.ac withenable.ac port.h
+ Makefile.in (replacing the original file)
+ added for fpTeX:
+ win32 win32.mak
+
+Generated files:
+ the commands
+ autoheader -m ../../texk/etc/autoconf
+ autoconf -m ../../texk/etc/autoconf
+ have generated
+ c-auto.in configure
+
+ by make depend:
+ depend.mak
+
+==> ncurses <==
+Downloading:
+ http://www.gnu.org/software/ncurses/ncurses.html
+ ftp://ftp.gnu.org/pub/gnu/ncurses/
+ ftp://dickey.his.com/ncurses/
+
+The ncurses directory contains the original distribution except:
+ Ada95 c++ doc form menu misc panel progs tack test
+
+The following files have been added:
+ ncurses.ac withenable.ac
+
+Modifications:
+ Makefile.in:
+ remove install from the list in the end. Create an empty install::
+ target somewhere earlier in the file.
+
+ protect "test ... || ..." in Makefile.in with -
+
+ aclocal.m4, remove the following lines (thus disabling misc test
+ c++ subdirs):
+ SRC_SUBDIRS="$SRC_SUBDIRS test"
+ test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc"
+ test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++"
+
+ include/Makefile.in
+ add symlink to AUTO_SRC variable
+ add a rule
+ symlink:
+ @test -d ncurses || ln -s . ncurses
+ add the line
+ -rm -f ncurses
+ to the clean:: target
+
+ configure.in:
+ remove that ldconfig stuff
+ remove that cxx stuff
+ remove that ada stuff
+ cf_with_progs=no (instead of yes)
+ remove the line
+ modules_to_build="$modules_to_build panel menu form"
+ with_debug=no (instead of yes)
+ move one line below (after CF_DIRS_TO_MAKE):
+ CF_SRC_MODULES($modules_to_build)
+ remove the line
+ test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in"
+
+Run autoconf with version 2.52.20011227. Patch available at
+ http://invisible-island.net/autoconf/
+
+==> ncurses-fix <==
+#!/bin/sh
+
+mv aclocal.m4 aclocal.m4-$$
+sed \
+ -e "s/: .{BUILD_\(.*\):='\(.*\)'}/: \${BUILD_\1=\`echo '\2'\`}/" \
+ -e "s/\`echo ''\`//" < aclocal.m4-$$ > aclocal.m4
+rm -f aclocal.m4-$$
+
+==> t1lib <==
+Downloading:
+ ftp://sunsite.unc.edu/pub/Linux/libs/graphics/t1lib-5.0.2.tar.gz
+
+==> teckit <==
+The teckit directory contains the source of the TECkit (Text Encoding Conversion
+toolkit) library and tools. See http://scripts.sil.org/teckit.
+
+The TECkit library is needed to build xetex.
+
+The subtrees teckit/source/teckitjni and teckit/perl_binaries have been removed
+as these are not relevant to building xetex or using the basic TECkit library.
+The copy of zlib source code found in the teckit tree has also been removed.
+
+The following files have been added:
+
+ teckit.ac
+ withenable.ac (currently empty)
+
+==> xpdf <==
+Downloading:
+ http://www.foolabs.com/xpdf/download.html
+
+Files in xpdf directory:
+ the files of the xpdf distribution, except
+ ltk misc/hello.pdf
+
+Replaced files:
+ Makefile.in
+ configure.in
+ xpdf/Makefile.in
+ goo/Makefile.in
+
+Added files:
+ libxpdf.ac
+
+==> zlib <==
+Downloading:
+ http://www.gzip.org/zlib/
+
+Files in zlib:
+ From the distribution:
+ everything, except:
+ INDEX Make_vms.com Makefile Makefile.riscos algorithm.txt amiga
+ configure descrip.mms msdos nt os2 zlib.html
+
+ Replaced file:
+ Makefile.in
+
+ Added for teTeX:
+ withenable.ac zlib.ac
+
+ Added for fpTeX:
+ win32.mak
+ contrib/minizip/win32.mak
+ contrib/untgz/win32.mak
+
+ Automatically generated:
+ depend.mak
diff --git a/Build/source/libs/ac/withenable.ac b/Build/source/libs/ac/withenable.ac
new file mode 100644
index 00000000000..a56321ceb75
--- /dev/null
+++ b/Build/source/libs/ac/withenable.ac
@@ -0,0 +1 @@
+## libs/ac/withenable.ac
diff --git a/Build/source/libs/configure.in.orig b/Build/source/libs/configure.in.orig
new file mode 100644
index 00000000000..08d22036d5d
--- /dev/null
+++ b/Build/source/libs/configure.in.orig
@@ -0,0 +1,84 @@
+dnl configure.in for TeX Live source/libs.
+dnl Public domain.
+AC_INIT(zlib/zlib.h)
+
+AC_CONFIG_AUX_DIR(../config)
+AC_PROG_MAKE_SET
+AC_PROG_CC
+AC_CANONICAL_SYSTEM
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+AC_FUNC_ALLOCA
+AC_PROG_RANLIB
+AM_MAINTAINER_MODE
+
+sinclude(../texk/kpathsea/withenable.ac)
+sinclude(ncurses/withenable.ac)
+sinclude(ncurses/ncurses.ac)
+sinclude(zlib/withenable.ac)
+sinclude(zlib/zlib.ac)
+sinclude(libpng/withenable.ac)
+sinclude(libpng/libpng.ac)
+sinclude(t1lib/withenable.ac)
+sinclude(t1lib/t1lib.ac)
+sinclude(freetype/withenable.ac)
+sinclude(freetype/freetype.ac)
+sinclude(freetype2/withenable.ac)
+sinclude(freetype2/freetype2.ac)
+sinclude(gd/withenable.ac)
+sinclude(gd/gd.ac)
+sinclude(icu-xetex/withenable.ac)
+sinclude(icu-xetex/icu-xetex.ac)
+sinclude(teckit/teckit.ac)
+sinclude(graphite-engine/withenable.ac)
+sinclude(graphite-engine/graphite-engine.ac)
+
+# The following line helps, e.g. for ncurses which properly detects the
+# system's terminfo definitions if configured without explicit --prefix.
+# ac_configure_args=`echo "$ac_configure_args" | sed 's@--prefix=[[^ ]]*@@'`
+
+if test "x$needs_ncurses" != xno && test "$using_system_ncurses" != yes; then
+ AC_CONFIG_SUBDIRS([ncurses])
+fi
+if test "x$needs_zlib" != xno && test "$using_system_zlib" != yes; then
+ KPSE_CONFIG_FILES([zlib/Makefile])
+fi
+if test "x$needs_pnglib" != xno && test "$using_system_pnglib" != yes; then
+ KPSE_CONFIG_FILES([libpng/Makefile])
+fi
+if test "x$needs_libxpdf" != xno; then
+ AC_CONFIG_SUBDIRS([xpdf])
+fi
+if test "x$needs_libt1" != xno && test "$using_system_t1lib" != yes; then
+ AC_CONFIG_SUBDIRS([t1lib type1])
+fi
+if test "x$needs_freetype" != xno && test "$using_system_freetype" != yes; then
+ AC_CONFIG_SUBDIRS([freetype])
+fi
+if test "x$needs_freetype2" != xno && test "$using_system_freetype2" != yes; then
+ AC_CONFIG_SUBDIRS([freetype2])
+fi
+if test "x$needs_gd" != xno && test "$using_system_gd" != yes; then
+ AC_CONFIG_SUBDIRS([gd])
+fi
+if test "x$needs_icu" != xno && test "$using_system_icu" != yes; then
+ ac_configure_args="$ac_configure_args --enable-static"
+ AC_CONFIG_SUBDIRS([icu-xetex])
+fi
+if test "x$needs_teckit" != xno; then
+ AC_CONFIG_SUBDIRS([teckit])
+fi
+if test "x$needs_graphite" != xno; then
+ AC_CONFIG_SUBDIRS([graphite-engine])
+fi
+if test "x$needs_obsdcompat" != xno; then
+ AC_CONFIG_SUBDIRS([obsdcompat])
+fi
+
+# create md5 directory when building outside the srcdir:
+if test -d $srcdir/md5; then
+ test -d md5 || mkdir md5
+fi
+
+AC_OUTPUT
diff --git a/Build/source/libs/dummy/Makefile.am b/Build/source/libs/dummy/Makefile.am
new file mode 100644
index 00000000000..257c3fb65a0
--- /dev/null
+++ b/Build/source/libs/dummy/Makefile.am
@@ -0,0 +1,10 @@
+##
+noinst_DATA = ../sublibsdir-configure
+
+DISTCLEANFILES = $(noinst_DATA)
+
+all-local: $(noinst_DATA)
+
+../sublibsdir-configure:
+ echo "${srcdir}/configure" | sed 's,dummy/,SUBLIBSDIR/,' >$@
+
diff --git a/Build/source/libs/dummy/Makefile.in b/Build/source/libs/dummy/Makefile.in
new file mode 100644
index 00000000000..dfeae3a4360
--- /dev/null
+++ b/Build/source/libs/dummy/Makefile.in
@@ -0,0 +1,420 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = .
+DIST_COMMON = $(am__configure_deps) \
+ $(srcdir)/../../build-aux/install-sh \
+ $(srcdir)/../../build-aux/missing $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/configure \
+ ../../build-aux/config.guess ../../build-aux/config.sub \
+ ../../build-aux/depcomp ../../build-aux/install-sh \
+ ../../build-aux/ltmain.sh ../../build-aux/missing \
+ ../../build-aux/texinfo.tex ../../build-aux/ylwrap
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DATA = $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+noinst_DATA = ../sublibsdir-configure
+DISTCLEANFILES = $(noinst_DATA)
+all: all-am
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d $(distdir) || mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA) all-local
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am all-local am--refresh check check-am clean \
+ clean-generic dist dist-all dist-bzip2 dist-gzip dist-lzma \
+ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-generic distcleancheck distdir distuninstallcheck \
+ dvi dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am uninstall uninstall-am
+
+
+all-local: $(noinst_DATA)
+
+../sublibsdir-configure:
+ echo "${srcdir}/configure" | sed 's,dummy/,SUBLIBSDIR/,' >$@
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/libs/dummy/aclocal.m4 b/Build/source/libs/dummy/aclocal.m4
new file mode 100644
index 00000000000..a249a8e6d87
--- /dev/null
+++ b/Build/source/libs/dummy/aclocal.m4
@@ -0,0 +1,618 @@
+# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10.2], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 13
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/Build/source/libs/dummy/configure b/Build/source/libs/dummy/configure
new file mode 100755
index 00000000000..1802132cbeb
--- /dev/null
+++ b/Build/source/libs/dummy/configure
@@ -0,0 +1,3403 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for TeX live libs dummy 2009.
+#
+# Report bugs to <tex-k@tug.org>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ case $as_dir in
+ /*)
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell bug-autoconf@gnu.org about your system,
+ echo including any error possibly output before this message.
+ echo This can help us improve future autoconf versions.
+ echo Configuration will now proceed without shell functions.
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='TeX live libs dummy'
+PACKAGE_TARNAME='tex-live-libs-dummy'
+PACKAGE_VERSION='2009'
+PACKAGE_STRING='TeX live libs dummy 2009'
+PACKAGE_BUGREPORT='tex-k@tug.org'
+
+ac_unique_file="../../build-aux/missing"
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+ { (exit 1); exit 1; }; } ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { $as_echo "$as_me: error: working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures TeX live libs dummy 2009 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root
+ [DATAROOTDIR/doc/tex-live-libs-dummy]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of TeX live libs dummy 2009:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+
+Report bugs to <tex-k@tug.org>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+TeX live libs dummy configure 2009
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by TeX live libs dummy $as_me 2009, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test -r "$ac_site_file"; then
+ { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_aux_dir=
+for ac_dir in ../../build-aux "$srcdir"/../../build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../build-aux \"$srcdir\"/../../build-aux" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in ../../build-aux \"$srcdir\"/../../build-aux" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+am__api_version='1.10'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+done
+IFS=$as_save_IFS
+
+fi
+
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ test -d ./--version && rmdir ./--version
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='tex-live-libs-dummy'
+ VERSION='2009'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+echo "$ac_configure_args" | sed 's,/dummy,/SUBLIBSDIR,g' >../sublibsdir-conf.args
+
+ac_config_files="$ac_config_files Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by TeX live libs dummy $as_me 2009, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+TeX live libs dummy config.status 2009
+configured by $0, generated by GNU Autoconf 2.63,
+ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} ||
+{
+ $as_echo "$as_me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=' '
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+ { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X " :F $CONFIG_FILES "
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ ac_file_inputs="$ac_file_inputs '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+
+
+
+ esac
+
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/Build/source/libs/dummy/configure.ac b/Build/source/libs/dummy/configure.ac
new file mode 100644
index 00000000000..6799dae34b9
--- /dev/null
+++ b/Build/source/libs/dummy/configure.ac
@@ -0,0 +1,21 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+dnl
+dnl This file is free software; the copyright holder
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+AC_INIT([TeX live libs dummy], [2009], [tex-k@tug.org])
+AC_PREREQ([2.63])
+AC_CONFIG_SRCDIR([../../build-aux/missing])
+AC_CONFIG_AUX_DIR([../../build-aux])
+
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+echo "$ac_configure_args" | sed 's,/dummy,/SUBLIBSDIR,g' >../sublibsdir-conf.args
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/Build/source/libs/freetype/ac/freetype.ac b/Build/source/libs/freetype/ac/freetype.ac
new file mode 100644
index 00000000000..90c43ce4ed3
--- /dev/null
+++ b/Build/source/libs/freetype/ac/freetype.ac
@@ -0,0 +1,3 @@
+## libs/freetype/ac/freetype.ac
+## define required functions and headers from system freetype
+KPSE_CHECK_LIB([freetype], [TT_Init_FreeType], [freetype.h])
diff --git a/Build/source/libs/freetype/ac/withenable.ac b/Build/source/libs/freetype/ac/withenable.ac
new file mode 100644
index 00000000000..55cb676e47a
--- /dev/null
+++ b/Build/source/libs/freetype/ac/withenable.ac
@@ -0,0 +1,3 @@
+## libs/freetype/ac/withenable.ac
+## configure options and TL libraries required for freetype
+KPSE_WITH_LIB([freetype])
diff --git a/Build/source/libs/freetype2/ac/freetype2.ac b/Build/source/libs/freetype2/ac/freetype2.ac
new file mode 100644
index 00000000000..c52d0078f42
--- /dev/null
+++ b/Build/source/libs/freetype2/ac/freetype2.ac
@@ -0,0 +1,3 @@
+## libs/freetype2/ac/freetype2.ac
+## define required functions and headers from system freetype2
+KPSE_CHECK_LIB([freetype2], [FT_Init_FreeType], [ft2build.h])
diff --git a/Build/source/libs/freetype2/ac/withenable.ac b/Build/source/libs/freetype2/ac/withenable.ac
new file mode 100644
index 00000000000..97d78f86a29
--- /dev/null
+++ b/Build/source/libs/freetype2/ac/withenable.ac
@@ -0,0 +1,3 @@
+## libs/freetype2/ac/withenable.ac
+## configure options and TL libraries required for freetype2
+KPSE_WITH_LIB([freetype2], [zlib], , , [both -IDIR and -IDIR/freetype2])
diff --git a/Build/source/libs/gd/ac/gd.ac b/Build/source/libs/gd/ac/gd.ac
new file mode 100644
index 00000000000..97242870e1b
--- /dev/null
+++ b/Build/source/libs/gd/ac/gd.ac
@@ -0,0 +1,3 @@
+## libs/gd/ac/gd.ac
+## define required functions and headers from system gd
+KPSE_CHECK_LIB([gd], [gdImageCreate], [gd.h])
diff --git a/Build/source/libs/gd/ac/withenable.ac b/Build/source/libs/gd/ac/withenable.ac
new file mode 100644
index 00000000000..24637010b52
--- /dev/null
+++ b/Build/source/libs/gd/ac/withenable.ac
@@ -0,0 +1,3 @@
+## libs/gd/kpse/withenable.ac
+## configure options and TL libraries required for gd
+KPSE_WITH_LIB([gd], [libpng])
diff --git a/Build/source/libs/graphite/COPYING b/Build/source/libs/graphite/COPYING
new file mode 100644
index 00000000000..2e009b10e5a
--- /dev/null
+++ b/Build/source/libs/graphite/COPYING
@@ -0,0 +1 @@
+see license/LICENSING.txt
diff --git a/Build/source/libs/graphite/INSTALL b/Build/source/libs/graphite/INSTALL
new file mode 100644
index 00000000000..23e5f25d0e5
--- /dev/null
+++ b/Build/source/libs/graphite/INSTALL
@@ -0,0 +1,236 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, 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 only 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. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about. 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=c89 CFLAGS=-O2 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 must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory. After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' 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). Here is a another example:
+
+ /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/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.
+
diff --git a/Build/source/libs/graphite/Makefile.am b/Build/source/libs/graphite/Makefile.am
new file mode 100644
index 00000000000..c819a9a33be
--- /dev/null
+++ b/Build/source/libs/graphite/Makefile.am
@@ -0,0 +1,62 @@
+AUTOMAKE_OPTIONS = 1.6
+
+SUBDIRS = src test
+
+EXTRA_DIST = doc license \
+ build.bat build_d.bat makefile.vc \
+ README
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = silgraphite.pc
+
+$(pkgconfig_DATA): config.status
+
+dist-hook:
+ find $(distdir) -name .svn | xargs rm -rf
+
+# VC_VERSION is the last released version of the software
+VC_VERSION = 2.3
+# D_VERSION gets the number of the current svn revision
+D_VERSION = `svnversion ${top_srcdir}|sed -e "s/[0-9]*\://g"`
+SVNDEB_VERSION = $(VC_VERSION)+0$(D_VERSION)svn
+SVNDEBPACKAGE = silgraphite2.0-$(SVNDEB_VERSION)
+SVNORIGTAR = silgraphite2.0_$(SVNDEB_VERSION).orig.tar.gz
+SVNWITH_EPOCH = 1:$(SVNDEB_VERSION)-1
+
+DEB_VERSION = $(VC_VERSION)
+DEBPACKAGE = silgraphite2.0-$(DEB_VERSION)
+ORIGTAR = silgraphite2.0_$(DEB_VERSION).orig.tar.gz
+WITH_EPOCH = 1:$(DEB_VERSION)-1
+
+DISTRIB_CODENAME ?= ${REL_CODENAME}
+
+showcodename:
+ echo "Codename: ${DISTRIB_CODENAME}"
+
+deb-base: dist
+ rm -rf silgraphite2.0*
+ mkdir -p ${SVNDEBPACKAGE}
+ cp ${PACKAGE}-${VERSION}.tar.gz $(SVNDEBPACKAGE)
+ tar cfz $(SVNORIGTAR) $(SVNDEBPACKAGE)
+ cp -a ${top_srcdir}/debian $(SVNDEBPACKAGE)
+ cd ${SVNDEBPACKAGE} && find . -name .svn | xargs rm -rf
+
+# make deb builds an interim deb from svn source for release
+deb: deb-base
+ dch -D ${DISTRIB_CODENAME} -v ${SVNWITH_EPOCH} -m -c${SVNDEBPACKAGE}/debian/changelog
+ cd ${SVNDEBPACKAGE} && pdebuild
+
+# make deb-binary-only builds a binary only deb from svn source
+deb-binary-only: deb-base
+ dch -D ${DISTRIB_CODENAME} -v ${SVNWITH_EPOCH} -m -c${SVNDEBPACKAGE}/debian/changelog "This is build direct from svn"
+ cd ${SVNDEBPACKAGE} && pdebuild --debbuildopts -i --debbuildopts -b
+
+# make deb-release builds a deb for a released version number
+deb-release: deb-base
+ dch -D ${DISTRIB_CODENAME} -v ${WITH_EPOCH} -c${DEBPACKAGE}/debian/changelog
+ cd ${DEBPACKAGE} && pdebuild
+
+# make deb-local uses debuild to build a deb for local use only
+deb-local: deb-base
+ dch -D ${DISTRIB_CODENAME} -v ${SVNWITH_EPOCH} -m -c${SVNDEBPACKAGE}/debian/changelog "This is a debuild direct from svn"
+ cd ${SVNDEBPACKAGE} && debuild -us -uc
diff --git a/Build/source/libs/graphite/Makefile.in b/Build/source/libs/graphite/Makefile.in
new file mode 100644
index 00000000000..a07fdc70a31
--- /dev/null
+++ b/Build/source/libs/graphite/Makefile.in
@@ -0,0 +1,699 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/installed-top.pc.in \
+ $(srcdir)/silgraphite.pc.in $(srcdir)/uninstalled-top.pc.in \
+ $(top_srcdir)/configure COPYING INSTALL TODO \
+ config/config.guess config/config.sub config/depcomp \
+ config/install-sh config/ltmain.sh config/missing
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES = silgraphite.pc silgraphite-uninstalled.pc
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
+pkgconfigDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(pkgconfig_DATA)
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LSB_RELEASE = @LSB_RELEASE@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+REL_CODENAME = @REL_CODENAME@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZEOF_WCHAR_T = @SIZEOF_WCHAR_T@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+AUTOMAKE_OPTIONS = 1.6
+SUBDIRS = src test
+EXTRA_DIST = doc license \
+ build.bat build_d.bat makefile.vc \
+ README
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = silgraphite.pc
+
+# VC_VERSION is the last released version of the software
+VC_VERSION = 2.2.1
+# D_VERSION gets the number of the current svn revision
+D_VERSION = `svnversion ${top_srcdir}|sed -e "s/[0-9]*\://g"`
+SVNDEB_VERSION = $(VC_VERSION)+0$(D_VERSION)svn
+SVNDEBPACKAGE = silgraphite2.0-$(SVNDEB_VERSION)
+SVNORIGTAR = silgraphite2.0_$(SVNDEB_VERSION).orig.tar.gz
+SVNWITH_EPOCH = 1:$(SVNDEB_VERSION)-1
+DEB_VERSION = $(VC_VERSION)
+DEBPACKAGE = silgraphite2.0-$(DEB_VERSION)
+ORIGTAR = silgraphite2.0_$(DEB_VERSION).orig.tar.gz
+WITH_EPOCH = 1:$(DEB_VERSION)-1
+all: all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+silgraphite.pc: $(top_builddir)/config.status $(srcdir)/installed-top.pc.in $(srcdir)/silgraphite.pc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+silgraphite-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/uninstalled-top.pc.in $(srcdir)/silgraphite.pc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-pkgconfigDATA: $(pkgconfig_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgconfigdir)" || $(mkdir_p) "$(DESTDIR)$(pkgconfigdir)"
+ @list='$(pkgconfig_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+ done
+
+uninstall-pkgconfigDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgconfig_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \
+ done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ mkdir $(distdir)
+ $(mkdir_p) $(distdir)/. $(distdir)/config
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pkgconfigDATA
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkgconfigDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
+ check-am clean clean-generic clean-libtool clean-recursive \
+ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+ dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-generic distclean-libtool distclean-recursive \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-pkgconfigDATA \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am \
+ uninstall-pkgconfigDATA
+
+
+$(pkgconfig_DATA): config.status
+
+dist-hook:
+ find $(distdir) -name .svn | xargs rm -rf
+
+DISTRIB_CODENAME ?= ${REL_CODENAME}
+
+showcodename:
+ echo "Codename: ${DISTRIB_CODENAME}"
+
+deb-base: dist
+ rm -rf silgraphite2.0*
+ mkdir -p ${SVNDEBPACKAGE}
+ cp ${PACKAGE}-${VERSION}.tar.gz $(SVNDEBPACKAGE)
+ tar cfz $(SVNORIGTAR) $(SVNDEBPACKAGE)
+ cp -a ${top_srcdir}/debian $(SVNDEBPACKAGE)
+ cd ${SVNDEBPACKAGE} && find . -name .svn | xargs rm -rf
+
+# make deb builds an interim deb from svn source for release
+deb: deb-base
+ dch -D ${DISTRIB_CODENAME} -v ${SVNWITH_EPOCH} -m -c${SVNDEBPACKAGE}/debian/changelog
+ cd ${SVNDEBPACKAGE} && pdebuild
+
+# make deb-binary-only builds a binary only deb from svn source
+deb-binary-only: deb-base
+ dch -D ${DISTRIB_CODENAME} -v ${SVNWITH_EPOCH} -m -c${SVNDEBPACKAGE}/debian/changelog "This is build direct from svn"
+ cd ${SVNDEBPACKAGE} && pdebuild --debbuildopts -i --debbuildopts -b
+
+# make deb-release builds a deb for a released version number
+deb-release: deb-base
+ dch -D ${DISTRIB_CODENAME} -v ${WITH_EPOCH} -c${DEBPACKAGE}/debian/changelog
+ cd ${DEBPACKAGE} && pdebuild
+
+# make deb-local uses debuild to build a deb for local use only
+deb-local: deb-base
+ dch -D ${DISTRIB_CODENAME} -v ${SVNWITH_EPOCH} -m -c${SVNDEBPACKAGE}/debian/changelog "This is a debuild direct from svn"
+ cd ${SVNDEBPACKAGE} && debuild -us -uc
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/libs/graphite/README b/Build/source/libs/graphite/README
new file mode 100644
index 00000000000..41c9cc02b5e
--- /dev/null
+++ b/Build/source/libs/graphite/README
@@ -0,0 +1,32 @@
+ GRAPHITE ENGINE
+
+The Graphite smart-font engine is the bit that takes a Unicode string, font
+formatting information (features, size, etc.) and a font and returns a set
+of positioned glyphs. Graphite also does more than this, in that it can
+handle cursor tracking and interaction with the application for string
+selection, etc.
+
+In order to interact with the application or system, Graphite is embedded in
+an application. You may want to write a custom font and render backend or use one
+of the provided backends in the wrappers project.
+
+The *nix build system uses autoconf and automake including all the
+conventions of those tools. This includes extended support for debug,
+maintenance mode, etc. See the GNU autotools info pages for the appropriate
+tools for help.
+
+If you have checked this source out of the Graphite Subversion repository or
+a similar version control system you will need to generate the autotools
+scripts and files (configure, Makefile.in etc) to do this run:
+
+ autoreconf --install
+
+Please see INSTALL for information on building
+
+NOTE:
+If you modify any configure.in or Makefile.am file you will need rerun
+autoreconf like so:
+
+ autoreconf
+
+For those changes to affect the configure script and makefiles.
diff --git a/Build/source/libs/graphite/TODO b/Build/source/libs/graphite/TODO
new file mode 100644
index 00000000000..146eff85d26
--- /dev/null
+++ b/Build/source/libs/graphite/TODO
@@ -0,0 +1,4 @@
+
+Unprioritised
+
+ * NFD/NFC Pre-processing
diff --git a/Build/source/libs/graphite/aclocal.m4 b/Build/source/libs/graphite/aclocal.m4
new file mode 100644
index 00000000000..039674bb36f
--- /dev/null
+++ b/Build/source/libs/graphite/aclocal.m4
@@ -0,0 +1,7533 @@
+# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(AC_AUTOCONF_VERSION, [2.61a],,
+[m4_warning([this file was generated for autoconf 2.61a.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+
+# serial 52 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [m4_define([AC_PROVIDE_IFELSE],
+ [m4_ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+ AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [AC_LIBTOOL_CXX],
+ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+ ])])
+dnl And a similar setup for Fortran 77 support
+ AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [AC_LIBTOOL_F77],
+ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [ifdef([AC_PROG_GCJ],
+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([A][M_PROG_GCJ],
+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([LT_AC_PROG_GCJ],
+ [define([LT_AC_PROG_GCJ],
+ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ AC_PATH_MAGIC
+ fi
+ ;;
+esac
+
+_LT_REQUIRED_DARWIN_CHECKS
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+ [AC_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+AC_DEFUN([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# --------------------------
+# Check for some things on darwin
+AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ echo "int foo(void){return 1;}" > conftest.c
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib ${wl}-single_module conftest.c
+ if test -f libconftest.dylib; then
+ lt_cv_apple_cc_single_mod=yes
+ rm -rf libconftest.dylib*
+ fi
+ rm conftest.c
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[0123]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*)
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil="~$DSYMUTIL \$lib || :"
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+[$]*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+ echo_test_string=`eval $cmd` &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+ ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$5], , :, [$5])
+else
+ ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $rm -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$4], , :, [$4])
+else
+ ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+ = "XX$teststring") >/dev/null 2>&1 &&
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# ------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ---------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ exit (status);
+}]
+EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# ----------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_AC_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+m4_if($1,[],[
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`echo $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+ m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
+[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
+[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_ARG_WITH([tags],
+ [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+ [include additional configurations @<:@automatic@:>@])],
+ [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ AC_MSG_WARN([output file `$ofile' does not exist])
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+ else
+ AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+ fi
+ fi
+ if test -z "$LTCFLAGS"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+ "") ;;
+ *) AC_MSG_ERROR([invalid tag name: $tagname])
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ AC_MSG_ERROR([tag name \"$tagname\" already exists])
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_LIBTOOL_LANG_CXX_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+ AC_LIBTOOL_LANG_F77_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+ AC_LIBTOOL_LANG_GCJ_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+ AC_LIBTOOL_LANG_RC_CONFIG
+ ;;
+
+ *)
+ AC_MSG_ERROR([Unsupported tag name: $tagname])
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ AC_MSG_ERROR([unable to update list of available tagged configurations.])
+ fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 DLLs
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+ [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+# set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+ [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+ [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+ [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognize shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="ifelse([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognize a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+ [AC_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+nto-qnx*)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments. Note that
+# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
+# it is assumed to be `libltdl'. LIBLTDL will be prefixed with
+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
+# (note the single quotes!). If your package is not flat and you're not
+# using automake, define top_builddir and top_srcdir appropriately in
+# the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ case $enable_ltdl_convenience in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments. Note that
+# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and top_srcdir
+# appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, lt_dlinit,
+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+ [if test x"$enable_ltdl_install" = xno; then
+ AC_MSG_WARN([libltdl not installed, but installation disabled])
+ else
+ enable_ltdl_install=yes
+ fi
+ ])
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+ LTDLINCL=
+ fi
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+# _LT_AC_PROG_CXXCPP
+# ------------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+fi
+])# _LT_AC_PROG_CXXCPP
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# -------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF
+
+# Report which library types will actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ $as_unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ $as_unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ AC_PROG_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ if test "$GXX" = yes ; then
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ freebsd-elf*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*) ;;
+ *)
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ interix[[3-9]]*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc*)
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd='echo'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+ $rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ # So that behaviour is only enabled if SCOABSPATH is set to a
+ # non-empty value in the environment. Most likely only useful for
+ # creating official distributions of packages.
+ # This is a hack until libtool officially supports absolute path
+ # names for shared libraries.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+ _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+ _LT_AC_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+ _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$rm -f confest.$objext
+
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+# PORTME: override above test on systems where it is broken
+ifelse([$1],[CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_AC_TAGVAR(predep_objects,$1)=
+ _LT_AC_TAGVAR(postdep_objects,$1)=
+ _LT_AC_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ #
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="\
+ program t
+ end
+"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# -------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars. Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ _LT_AC_TAGVAR(compiler, $1) \
+ _LT_AC_TAGVAR(CC, $1) \
+ _LT_AC_TAGVAR(LD, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+ _LT_AC_TAGVAR(old_archive_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+ _LT_AC_TAGVAR(predep_objects, $1) \
+ _LT_AC_TAGVAR(postdep_objects, $1) \
+ _LT_AC_TAGVAR(predeps, $1) \
+ _LT_AC_TAGVAR(postdeps, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
+ _LT_AC_TAGVAR(archive_cmds, $1) \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(postinstall_cmds, $1) \
+ _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+ _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+ _LT_AC_TAGVAR(no_undefined_flag, $1) \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+ _LT_AC_TAGVAR(hardcode_automatic, $1) \
+ _LT_AC_TAGVAR(module_cmds, $1) \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(fix_srcfile_path, $1) \
+ _LT_AC_TAGVAR(exclude_expsyms, $1) \
+ _LT_AC_TAGVAR(include_expsyms, $1); do
+
+ case $var in
+ _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(module_cmds, $1) | \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\[$]0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+ ;;
+ esac
+
+ifelse([$1], [],
+ [cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ AC_MSG_NOTICE([creating $ofile])],
+ [cfgfile="$ofile"])
+
+ cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+])
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([LT_AC_PROG_SED])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+linux* | k*bsd*-gnu)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDGIRSTW]]'
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ icpc* | ecpc*)
+ # Intel C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler.
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+
+ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ icc* | ecc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
+ [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+ _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+],[
+ runpath_var=
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)=
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+ _LT_AC_TAGVAR(module_cmds, $1)=
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_AC_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ _LT_CC_BASENAME([$compiler])
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ interix[[3-9]]*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | k*bsd*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test $supports_anon_versioning = yes; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ # see comment about different semantics on the GNU ld section
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ bsdi[[45]]*)
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_AC_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $rm conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+
+# Cheap backport of AS_EXECUTABLE_P and required macros
+# from Autoconf 2.59; we should not use $as_executable_p directly.
+
+# _AS_TEST_PREPARE
+# ----------------
+m4_ifndef([_AS_TEST_PREPARE],
+[m4_defun([_AS_TEST_PREPARE],
+[if test -x / >/dev/null 2>&1; then
+ as_executable_p='test -x'
+else
+ as_executable_p='test -f'
+fi
+])])# _AS_TEST_PREPARE
+
+# AS_EXECUTABLE_P
+# ---------------
+# Check whether a file is executable.
+m4_ifndef([AS_EXECUTABLE_P],
+[m4_defun([AS_EXECUTABLE_P],
+[AS_REQUIRE([_AS_TEST_PREPARE])dnl
+$as_executable_p $1[]dnl
+])])# AS_EXECUTABLE_P
+
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 13
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/Build/source/libs/graphite/build.bat b/Build/source/libs/graphite/build.bat
new file mode 100644
index 00000000000..4c8f6d93999
--- /dev/null
+++ b/Build/source/libs/graphite/build.bat
@@ -0,0 +1 @@
+nmake -f makefile.vc %1 %2 %3 \ No newline at end of file
diff --git a/Build/source/libs/graphite/build_d.bat b/Build/source/libs/graphite/build_d.bat
new file mode 100644
index 00000000000..1f10fb4a8f7
--- /dev/null
+++ b/Build/source/libs/graphite/build_d.bat
@@ -0,0 +1 @@
+nmake CFG=DEBUG -f makefile.vc %1 %2 %3 \ No newline at end of file
diff --git a/Build/source/libs/graphite/config/config.guess b/Build/source/libs/graphite/config/config.guess
new file mode 100755
index 00000000000..e5716eea733
--- /dev/null
+++ b/Build/source/libs/graphite/config/config.guess
@@ -0,0 +1,1555 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2009-02-03'
+
+# 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, 2006, 2007, 2008 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.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <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:*:[456])
+ 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 | genuineintel)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 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:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ 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 ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ 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 ${UNAME_MACHINE}-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 ;;
+ "")
+ # 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; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.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 ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ 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 ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<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://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+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:
diff --git a/Build/source/libs/graphite/config/config.sub b/Build/source/libs/graphite/config/config.sub
new file mode 100755
index 00000000000..d546a94b951
--- /dev/null
+++ b/Build/source/libs/graphite/config/config.sub
@@ -0,0 +1,1685 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2009-02-03'
+
+# 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, 2006, 2007, 2008 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* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray)
+ 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 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | 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[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k | z80)
+ 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-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | 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[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'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
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ 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
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) 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
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -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* \
+ | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -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
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -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:
diff --git a/Build/source/libs/graphite/config/depcomp b/Build/source/libs/graphite/config/depcomp
new file mode 100755
index 00000000000..04701da536f
--- /dev/null
+++ b/Build/source/libs/graphite/config/depcomp
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 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.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. 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.
+ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+ stat=$?
+
+ if test -f "$tmpdepfile"; then :
+ else
+ stripped=`echo "$stripped" | sed 's,^.*/,,'`
+ tmpdepfile="$stripped.u"
+ fi
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ outname="$stripped.o"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # 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"
+ ;;
+
+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 mecanism 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 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:
diff --git a/Build/source/libs/graphite/config/install-sh b/Build/source/libs/graphite/config/install-sh
new file mode 100755
index 00000000000..a5897de6ea7
--- /dev/null
+++ b/Build/source/libs/graphite/config/install-sh
@@ -0,0 +1,519 @@
+#!/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:
diff --git a/Build/source/libs/graphite/config/ltmain.sh b/Build/source/libs/graphite/config/ltmain.sh
new file mode 100644
index 00000000000..4598ec61ccf
--- /dev/null
+++ b/Build/source/libs/graphite/config/ltmain.sh
@@ -0,0 +1,6930 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.24
+TIMESTAMP=" (1.1220.2.455 2007/06/24 02:13:29)"
+
+# Be Bourne compatible (taken from Autoconf:_AS_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
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit $EXIT_SUCCESS
+fi
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# 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'
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ SP2NL='tr \040 \012'
+ NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ SP2NL='tr \100 \n'
+ NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+for lt_var in LANG 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
+ fi"
+done
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ $echo "$modename: not configured to build any kind of library" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit $EXIT_FAILURE
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+duplicate_deps=no
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# 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 "$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" || {
+ $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
+ exit $EXIT_FAILURE
+ }
+ fi
+
+ $echo "X$my_tmpdir" | $Xsed
+}
+
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 | \
+ $SED -n -e '1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $echo $win32_libid_type
+}
+
+
+# func_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 ()
+{
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ CC_quoted="$CC_quoted $arg"
+ done
+ 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 "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
+ # 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.
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ CC_quoted="$CC_quoted $arg"
+ done
+ case "$@ " in
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit $EXIT_FAILURE
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+
+ $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+ $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+ exit $EXIT_FAILURE
+ fi
+}
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+ my_status=""
+
+ $show "${rm}r $my_gentop"
+ $run ${rm}r "$my_gentop"
+ $show "$mkdir $my_gentop"
+ $run $mkdir "$my_gentop"
+ my_status=$?
+ if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+ exit $my_status
+ fi
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ extracted_serial=`expr $extracted_serial + 1`
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ $show "${rm}r $my_xdir"
+ $run ${rm}r "$my_xdir"
+ $show "$mkdir $my_xdir"
+ $run $mkdir "$my_xdir"
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
+ exit $exit_status
+ fi
+ case $host in
+ *-darwin*)
+ $show "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ if test -z "$run"; then
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+ darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ $show "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ lipo -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ ${rm}r unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd "$darwin_orig_dir"
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ fi # $run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ func_extract_archives_result="$my_oldobjs"
+}
+# End of Shell function definitions
+#####################################
+
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
+
+disable_libs=no
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+ arg="$1"
+ shift
+
+ case $arg in
+ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ execute_dlfiles)
+ execute_dlfiles="$execute_dlfiles $arg"
+ ;;
+ tag)
+ tagname="$arg"
+ preserve_args="${preserve_args}=$arg"
+
+ # Check whether tagname contains only valid characters
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ $echo "$progname: invalid tag name: $tagname" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ case $tagname in
+ CC)
+ # Don't test for the "default" C tag, as we know, it's there, but
+ # not specially marked.
+ ;;
+ *)
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
+ taglist="$taglist $tagname"
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
+ else
+ $echo "$progname: ignoring unknown tag $tagname" 1>&2
+ fi
+ ;;
+ esac
+ ;;
+ *)
+ eval "$prev=\$arg"
+ ;;
+ esac
+
+ prev=
+ prevopt=
+ continue
+ fi
+
+ # Have we seen a non-optional argument yet?
+ case $arg in
+ --help)
+ show_help=yes
+ ;;
+
+ --version)
+ echo "\
+$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
+
+Copyright (C) 2007 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."
+ exit $?
+ ;;
+
+ --config)
+ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+ done
+ exit $?
+ ;;
+
+ --debug)
+ $echo "$progname: enabling shell trace mode"
+ set -x
+ preserve_args="$preserve_args $arg"
+ ;;
+
+ --dry-run | -n)
+ run=:
+ ;;
+
+ --features)
+ $echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ $echo "enable shared libraries"
+ else
+ $echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ $echo "enable static libraries"
+ else
+ $echo "disable static libraries"
+ fi
+ exit $?
+ ;;
+
+ --finish) mode="finish" ;;
+
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
+ --preserve-dup-deps) duplicate_deps="yes" ;;
+
+ --quiet | --silent)
+ show=:
+ preserve_args="$preserve_args $arg"
+ ;;
+
+ --tag)
+ prevopt="--tag"
+ prev=tag
+ preserve_args="$preserve_args --tag"
+ ;;
+ --tag=*)
+ set tag "$optarg" ${1+"$@"}
+ shift
+ prev=tag
+ preserve_args="$preserve_args --tag"
+ ;;
+
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+ ;;
+
+ -*)
+ $echo "$modename: unrecognized option \`$arg'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+
+ *)
+ nonopt="$arg"
+ break
+ ;;
+ esac
+done
+
+if test -n "$prevopt"; then
+ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+fi
+
+case $disable_libs in
+no)
+ ;;
+shared)
+ build_libtool_libs=no
+ build_old_libs=yes
+ ;;
+static)
+ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+ ;;
+esac
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+ # Infer the operation mode.
+ if test -z "$mode"; then
+ $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+ $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
+ case $nonopt in
+ *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+ mode=link
+ for arg
+ do
+ case $arg in
+ -c)
+ mode=compile
+ break
+ ;;
+ esac
+ done
+ ;;
+ *db | *dbx | *strace | *truss)
+ mode=execute
+ ;;
+ *install*|cp|mv)
+ mode=install
+ ;;
+ *rm)
+ mode=uninstall
+ ;;
+ *)
+ # If we have no mode, but dlfiles were specified, then do execute mode.
+ test -n "$execute_dlfiles" && mode=execute
+
+ # Just use the default operation mode.
+ if test -z "$mode"; then
+ if test -n "$nonopt"; then
+ $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+ else
+ $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+ fi
+ fi
+ ;;
+ esac
+ fi
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$modename --help --mode=$mode' for more information."
+
+ # These modes are in order of execution frequency so that they run quickly.
+ case $mode in
+ # libtool compile mode
+ compile)
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ if test -n "$libobj" ; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ arg_mode=target
+ continue
+ ;;
+
+ -static | -prefer-pic | -prefer-non-pic)
+ later="$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,*)
+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ lastarg="$lastarg $arg"
+ done
+ IFS="$save_ifs"
+ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ * )
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ case $lastarg in
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, and some SunOS ksh mistreat backslash-escaping
+ # in scan sets (worked around with variable expansion),
+ # and furthermore cannot handle '|' '&' '(' ')' in scan sets
+ # at all, so we specify them separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ base_compile="$base_compile $lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ $echo "$modename: you must specify an argument for -Xcompile"
+ exit $EXIT_FAILURE
+ ;;
+ target)
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ *)
+ # Get the name of the library object.
+ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ xform='[cCFSifmso]'
+ case $libobj in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
+ *.ii) xform=ii ;;
+ *.class) xform=class ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.[fF][09]?) xform=[fF][09]. ;;
+ *.for) xform=for ;;
+ *.java) xform=java ;;
+ *.obj) xform=obj ;;
+ esac
+
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+ case $libobj in
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+ *)
+ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -static)
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+ case $qlibobj in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qlibobj="\"$qlibobj\"" ;;
+ esac
+ test "X$libobj" != "X$qlibobj" \
+ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir=
+ else
+ xdir=$xdir/
+ fi
+ lobj=${xdir}$objdir/$objname
+
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ $run $rm $removelist
+ trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ removelist="$removelist $output_obj $lockfile"
+ trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $run ln "$progpath" "$lockfile" 2>/dev/null; do
+ $show "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
+ $echo "$srcfile" > "$lockfile"
+ fi
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+ qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+ case $qsrcfile in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qsrcfile="\"$qsrcfile\"" ;;
+ esac
+
+ $run $rm "$libobj" "${libobj}T"
+
+ # Create a libtool object file (analogous to a ".la" file),
+ # but don't create it if we're doing a dry run.
+ test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ if test ! -d "${xdir}$objdir"; then
+ $show "$mkdir ${xdir}$objdir"
+ $run $mkdir ${xdir}$objdir
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
+ exit $exit_status
+ fi
+ fi
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
+ fi
+
+ $run $rm "$lobj" "$output_obj"
+
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ test -n "$output_obj" && $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ $show "$mv $output_obj $lobj"
+ if $run $mv $output_obj $lobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the PIC object to the libtool object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ else
+ # No PIC object so indicate it doesn't exist in the libtool
+ # object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ $run $rm "$obj" "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ $show "$mv $output_obj $obj"
+ if $run $mv $output_obj $obj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+ else
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+ fi
+
+ $run $mv "${libobj}T" "${libobj}"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $run $rm "$lockfile"
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ # libtool link mode
+ link | relink)
+ modename="$modename: link"
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args="$nonopt"
+ base_compile="$nonopt $@"
+ compile_command="$nonopt"
+ finalize_command="$nonopt"
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ notinst_path= # paths that contain not-installed libtool libraries
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+ ;;
+ *) qarg=$arg ;;
+ esac
+ libtool_args="$libtool_args $qarg"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ compile_command="$compile_command @SYMFILE@"
+ finalize_command="$finalize_command @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ if test ! -f "$arg"; then
+ $echo "$modename: symbol file \`$arg' does not exist"
+ exit $EXIT_FAILURE
+ fi
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat $save_arg`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit $EXIT_FAILURE
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ done
+ else
+ $echo "$modename: link input file \`$save_arg' does not exist"
+ exit $EXIT_FAILURE
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ xcompiler)
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ xlinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $wl$qarg"
+ prev=
+ compile_command="$compile_command $wl$qarg"
+ finalize_command="$finalize_command $wl$qarg"
+ continue
+ ;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ darwin_framework|darwin_framework_skip)
+ test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ prev=
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+ continue
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: more than one -exported-symbols argument is not allowed"
+ exit $EXIT_FAILURE
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework|-arch|-isysroot)
+ case " $CC " in
+ *" ${arg} ${1} "* | *" ${arg} ${1} "*)
+ prev=darwin_framework_skip ;;
+ *) compiler_flags="$compiler_flags $arg"
+ prev=darwin_framework ;;
+ esac
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+ absdir="$dir"
+ notinst_path="$notinst_path $dir"
+ fi
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "*) ;;
+ *)
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs -framework System"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ -model)
+ compile_command="$compile_command $arg"
+ compiler_flags="$compiler_flags $arg"
+ finalize_command="$finalize_command $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ compiler_flags="$compiler_flags $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+ # -r[0-9][0-9]* specifies the processor on the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+ # +DA*, +DD* enable 64-bit mode on the HP compiler
+ # -q* pass through compiler args for the IBM compiler
+ # -m* pass through architecture-specific compiler args for GCC
+ # -m*, -t[45]*, -txscale* pass through architecture-specific
+ # compiler args for GCC
+ # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+ # -F/path gives path to uninstalled frameworks, gcc on darwin
+ # @file GCC response files
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ compiler_flags="$compiler_flags $arg"
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+ $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $flag"
+ done
+ IFS="$save_ifs"
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+ ;;
+
+ -Wl,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $wl$flag"
+ linker_flags="$linker_flags $flag"
+ done
+ IFS="$save_ifs"
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit $EXIT_FAILURE
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ deplibs="$deplibs $arg"
+ old_deplibs="$old_deplibs $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ dlfiles="$dlfiles $arg"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ dlprefiles="$dlprefiles $arg"
+ prev=
+ else
+ deplibs="$deplibs $arg"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+ done # argument parsing loop
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$output_objdir" = "X$output"; then
+ output_objdir="$objdir"
+ else
+ output_objdir="$output_objdir/$objdir"
+ fi
+ # Create the object directory.
+ if test ! -d "$output_objdir"; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
+ exit $exit_status
+ fi
+ fi
+
+ # Determine the type of output
+ case $output in
+ "")
+ $echo "$modename: you must specify an output file" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ case $host in
+ *cygwin* | *mingw* | *pw32*)
+ # don't eliminate duplications in $postdeps and $predeps
+ duplicate_compiler_generated_deps=yes
+ ;;
+ *)
+ duplicate_compiler_generated_deps=$duplicate_deps
+ ;;
+ esac
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ libs="$libs $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ case $linkmode in
+ lib)
+ passes="conv link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+ for pass in $passes; do
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags $deplib"
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+ continue
+ fi
+ name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+ for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if (${SED} -e '2q' $lib |
+ grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ library_names=
+ old_library=
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ *)
+ $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method
+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ if eval $echo \"$deplib\" 2>/dev/null \
+ | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ $echo
+ $echo "*** Warning: Trying to link with static lib archive $deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because the file extensions .$libext of this argument makes me believe"
+ $echo "*** that it is just a static archive that I should not used here."
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the"
+ $echo "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $ladir/$objdir/$old_library"
+ old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ $echo "$modename: \`$lib' is not a convenience library" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ if test -z "$linklib"; then
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ $echo "$modename: warning: library \`$lib' was moved." 1>&2
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ fi
+ fi # $installed = yes
+ name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *" $absdir "*) ;;
+ *) temp_rpath="$temp_rpath $absdir" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes ; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on
+ # some systems (darwin)
+ if test "$shouldnotlink" = yes && test "$pass" = link ; then
+ $echo
+ if test "$linkmode" = prog; then
+ $echo "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $echo "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $echo "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+ libname=`eval \\$echo \"$libname_spec\"`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw*)
+ major=`expr $current - $age`
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+ newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ $show "extracting exported symbol list from \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ cmds=$extract_expsyms_cmds
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ $show "generating import library for \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ cmds=$old_archive_from_expsyms_cmds
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a module then we can not link against
+ # it, someone is ignoring the new warnings I added
+ if /usr/bin/file -L $add 2> /dev/null |
+ $EGREP ": [^:]* bundle" >/dev/null ; then
+ $echo "** Warning, lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $echo
+ $echo "** And there doesn't seem to be a static archive available"
+ $echo "** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ $echo "$modename: configuration error: unsupported hardcode properties"
+ exit $EXIT_FAILURE
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes && \
+ test "$hardcode_minus_L" != yes && \
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ $echo
+ $echo "*** Warning: This system can not link to static lib archive $lib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ $echo "*** But as you try to build a module library, libtool will still create "
+ $echo "*** a static module, that should work as long as the dlopening application"
+ $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ *) temp_deplibs="$temp_deplibs $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ newlib_search_path="$newlib_search_path $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$deplib" && dir="."
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if grep "^installed=no" $deplib > /dev/null; then
+ path="$absdir/$objdir"
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ if test "$absdir" != "$libdir"; then
+ $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+ fi
+ path="$absdir"
+ fi
+ depdepl=
+ case $host in
+ *-*-darwin*)
+ # we do not want to link against static libs,
+ # but need to link against shared
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$path/$depdepl" ; then
+ depdepl="$path/$depdepl"
+ fi
+ # do not add paths which are already there
+ case " $newlib_search_path " in
+ *" $path "*) ;;
+ *) newlib_search_path="$newlib_search_path $path";;
+ esac
+ fi
+ path=""
+ ;;
+ *)
+ path="-L$path"
+ ;;
+ esac
+ ;;
+ -l*)
+ case $host in
+ *-*-darwin*)
+ # Again, we only want to link against shared libraries
+ eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+ for tmp in $newlib_search_path ; do
+ if test -f "$tmp/lib$tmp_libs.dylib" ; then
+ eval depdepl="$tmp/lib$tmp_libs.dylib"
+ break
+ fi
+ done
+ path=""
+ ;;
+ *) continue ;;
+ esac
+ ;;
+ *) continue ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ case " $deplibs " in
+ *" $depdepl "*) ;;
+ *) deplibs="$depdepl $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+ fi
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ objs="$objs$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ if test "$module" = no; then
+ $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+ exit $EXIT_FAILURE
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the non-libtool"
+ $echo "*** objects $objs is not portable!"
+ libobjs="$libobjs $objs"
+ fi
+ fi
+
+ if test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+ fi
+
+ set dummy $rpath
+ if test "$#" -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+ fi
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ IFS="$save_ifs"
+
+ if test -n "$8"; then
+ $echo "$modename: too many parameters to \`-version-info'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$2"
+ number_minor="$3"
+ number_revision="$4"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows|none)
+ current=`expr $number_major + $number_minor`
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ current=`expr $number_major + $number_minor`
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$2"
+ revision="$3"
+ age="$4"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ minor_current=`expr $current + 1`
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current";
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ major=`expr $current - $age`
+ else
+ major=`expr $current - $age + 1`
+ fi
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ major=.`expr $current - $age`
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ major=`expr $current - $age`
+ versuffix="-$major"
+ ;;
+
+ *)
+ $echo "$modename: unknown library version type \`$version_type'" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+ fi
+
+ if test "$mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$echo "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ if test -n "$removelist"; then
+ $show "${rm}r $removelist"
+ $run ${rm}r $removelist
+ fi
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+ # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+ # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) dlfiles="$dlfiles $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ deplibs="$deplibs -framework System"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $rm conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $rm conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ name=`expr $i : '-l\(.*\)'`
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which I believe you do not have"
+ $echo "*** because a test_compile did reveal that the linker did not use it for"
+ $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ name=`expr $i : '-l\(.*\)'`
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ $rm conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because a test_compile did reveal that the linker did not use this one"
+ $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning! Library $i is needed by this library but I was not able to"
+ $echo "*** make it link in! You will probably need to install it or some"
+ $echo "*** library that it depends on before this library will be fully"
+ $echo "*** functional. Installing it before continuing would be even better."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method
+ file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ for a_deplib in $deplibs; do
+ name=`expr $a_deplib : '-l\(.*\)'`
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null \
+ | grep " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method
+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ for a_deplib in $deplibs; do
+ name=`expr $a_deplib : '-l\(.*\)'`
+ # If $name is empty we are operating on a -L argument.
+ if test -n "$name" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval $echo \"$potent_lib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+ -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+ done
+ fi
+ if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
+ | grep . >/dev/null; then
+ $echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ $echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ $echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ $echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ $echo
+ $echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $echo "*** dependencies of module $libname. Therefore, libtool will create"
+ $echo "*** a static module, that should work as long as the dlopening"
+ $echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ $echo "*** The inter-library dependencies that have been dropped here will be"
+ $echo "*** automatically added whenever a program is linked with this library"
+ $echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ $echo
+ $echo "*** Since this library must not contain undefined symbols,"
+ $echo "*** because either the platform does not support them or"
+ $echo "*** it was explicitly requested with -no-undefined,"
+ $echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ dep_rpath="$dep_rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ case $archive_cmds in
+ *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
+ *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
+ esac
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ if len=`expr "X$cmd" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ $show "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex"; then
+ $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+ $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+ $run eval '$mv "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ libobjs="$libobjs $func_extract_archives_result"
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linker_flags="$linker_flags $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise.
+ $echo "creating reloadable object files..."
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ output_la=`$echo "X$output" | $Xsed -e "$basename"`
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ delfiles=
+ last_robj=
+ k=1
+ output=$output_objdir/$output_la-${k}.$objext
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+ if test "X$objlist" = X ||
+ { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+ test "$len" -le "$max_cmd_len"; }; then
+ objlist="$objlist $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ k=`expr $k + 1`
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=$obj
+ len=1
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+ if ${skipped_export-false}; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+ fi
+
+ # Set up a command to remove the reloadable object files
+ # after they are used.
+ i=0
+ while test "$i" -lt "$k"
+ do
+ i=`expr $i + 1`
+ delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
+ done
+
+ $echo "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+
+ # Append the command to remove the reloadable object files
+ # to the just-reset $cmds.
+ eval cmds=\"\$cmds~\$rm $delfiles\"
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+ fi
+
+ case $output in
+ *.lo)
+ if test -n "$objs$old_deplibs"; then
+ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ libobj="$output"
+ obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $run $rm $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ cmds=$reload_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $run eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ cmds=$reload_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+ esac
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+ fi
+
+ if test "$preload" = yes; then
+ if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+ test "$dlopen_self_static" = unknown; then
+ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+ fi
+ fi
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ ;;
+ esac
+
+ case $host in
+ *darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ if test "$tagname" = CXX ; then
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ fi
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ compile_command="$compile_command $compile_deplibs"
+ finalize_command="$finalize_command $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ dlsyms=
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ dlsyms="${outputname}S.c"
+ else
+ $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+ fi
+ fi
+
+ if test -n "$dlsyms"; then
+ case $dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${outputname}.nm"
+
+ $show "$rm $nlist ${nlist}S ${nlist}T"
+ $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+ # Parse the name list into a source file.
+ $show "creating $output_objdir/$dlsyms"
+
+ test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ $show "generating symbol list for \`$output'"
+
+ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for arg in $progfiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $run $rm $export_symbols
+ $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* )
+ $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ else
+ $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* )
+ $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ fi
+ fi
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+ name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+ $run eval '$echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -z "$run"; then
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $mv "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if grep -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+ else
+ $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+ fi
+
+ $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+"
+
+ case $host in
+ *cygwin* | *mingw* )
+ $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+ runtime relocations are performed -- see ld's documentation
+ on pseudo-relocs */
+struct {
+"
+ ;;
+ * )
+ $echo >> "$output_objdir/$dlsyms" "\
+const struct {
+"
+ ;;
+ esac
+
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ const char *name;
+ lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ fi
+
+ pic_flag_for_symtable=
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+ $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+ $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+ # Transform the symbol file into the correct name.
+ case $host in
+ *cygwin* | *mingw* )
+ if test -f "$output_objdir/${outputname}.def" ; then
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ else
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ fi
+ ;;
+ * )
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ ;;
+ esac
+ ;;
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+ fi
+
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ $show "$link_command"
+ $run eval "$link_command"
+ exit_status=$?
+
+ # Delete the generated files.
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+ $run $rm "$output_objdir/${outputname}S.${objext}"
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$shlibpath_var"; then
+ # We should set the shlibpath_var
+ rpath=
+ for dir in $temp_rpath; do
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*)
+ # Absolute path.
+ rpath="$rpath$dir:"
+ ;;
+ *)
+ # Relative path: add a thisdir entry.
+ rpath="$rpath\$thisdir/$dir:"
+ ;;
+ esac
+ done
+ temp_rpath="$rpath"
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $run $rm $output
+ # Link the executable and exit
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+ $echo "$modename: \`$output' will be relinked during installation" 1>&2
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+
+ # Now create the wrapper script.
+ $show "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+ fi
+
+ # Quote $echo for shipping.
+ if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
+ case $progpath in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+ esac
+ qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if our run command is non-null.
+ if test -z "$run"; then
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ output_name=`basename $output`
+ output_path=`dirname $output`
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $rm $cwrappersource $cwrapper
+ trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "/bin/sh $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+/* -DDEBUG is fairly common in CFLAGS. */
+#undef DEBUG
+#if defined DEBUGWRAPPER
+# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
+#else
+# define DEBUG(format, ...)
+#endif
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+const char * base_name (const char *name);
+char * find_executable(const char *wrapper);
+int check_executable(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ DEBUG("(main) argv[0] : %s\n",argv[0]);
+ DEBUG("(main) program_name : %s\n",program_name);
+ newargz = XMALLOC(char *, argc+2);
+EOF
+
+ cat >> $cwrappersource <<EOF
+ newargz[0] = (char *) xstrdup("$SHELL");
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+ newargz[1] = find_executable(argv[0]);
+ if (newargz[1] == NULL)
+ lt_fatal("Couldn't find %s", argv[0]);
+ DEBUG("(main) found exe at : %s\n",newargz[1]);
+ /* we know the script has the same name, without the .exe */
+ /* so make sure newargz[1] doesn't end in .exe */
+ strendzap(newargz[1],".exe");
+ for (i = 1; i < argc; i++)
+ newargz[i+1] = xstrdup(argv[i]);
+ newargz[argc+1] = NULL;
+
+ for (i=0; i<argc+1; i++)
+ {
+ DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
+ ;
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",(char const **)newargz);
+EOF
+ ;;
+ *)
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",newargz);
+EOF
+ ;;
+ esac
+
+ cat >> $cwrappersource <<"EOF"
+ return 127;
+}
+
+void *
+xmalloc (size_t num)
+{
+ void * p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char)name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable(const char * path)
+{
+ struct stat st;
+
+ DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0) &&
+ (
+ /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
+#if defined (S_IXOTH)
+ ((st.st_mode & S_IXOTH) == S_IXOTH) ||
+#endif
+#if defined (S_IXGRP)
+ ((st.st_mode & S_IXGRP) == S_IXGRP) ||
+#endif
+ ((st.st_mode & S_IXUSR) == S_IXUSR))
+ )
+ return 1;
+ else
+ return 0;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise */
+char *
+find_executable (const char* wrapper)
+{
+ int has_slash = 0;
+ const char* p;
+ const char* p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char* concat_name;
+
+ DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char* path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char* q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR(*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen(tmp);
+ concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen(tmp);
+ concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ return NULL;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert(str != NULL);
+ assert(pat != NULL);
+
+ len = strlen(str);
+ patlen = strlen(pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp(str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+ const char * message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+EOF
+ # we should really use a build-platform specific compiler
+ # here, but OTOH, the wrappers (shell script and this C one)
+ # are only useful if you want to execute the "real" binary.
+ # Since the "real" binary is built for $host, then this
+ # wrapper might as well be built for $host, too.
+ $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
+ ;;
+ esac
+ $rm $output
+ trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+
+ $echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variable:
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$echo are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ echo=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$echo will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $echo >> $output "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $echo >> $output "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $mkdir \"\$progdir\"
+ else
+ $rm \"\$progdir/\$file\"
+ fi"
+
+ $echo >> $output "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $echo \"\$relink_command_output\" >&2
+ $rm \"\$progdir/\$file\"
+ exit $EXIT_FAILURE
+ fi
+ fi
+
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $rm \"\$progdir/\$program\";
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $rm \"\$progdir/\$file\"
+ fi"
+ else
+ $echo >> $output "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $echo >> $output "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $echo >> $output "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $echo >> $output "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $echo >> $output "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2*)
+ $echo >> $output "\
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $echo >> $output "\
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $echo >> $output "\
+ \$echo \"\$0: cannot exec \$program \$*\"
+ exit $EXIT_FAILURE
+ fi
+ else
+ # The program doesn't exist.
+ \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$echo \"This script is just a wrapper for \$program.\" 1>&2
+ $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit $EXIT_FAILURE
+ fi
+fi\
+"
+ chmod +x $output
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $addlibs
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ $echo "X$obj" | $Xsed -e 's%^.*/%%'
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "copying selected object files to avoid basename conflicts..."
+
+ if test -z "$gentop"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
+ exit $exit_status
+ fi
+ fi
+
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ counter=`expr $counter + 1`
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ $run ln "$obj" "$gentop/$newobj" ||
+ $run cp "$obj" "$gentop/$newobj"
+ oldobjs="$oldobjs $gentop/$newobj"
+ ;;
+ *) oldobjs="$oldobjs $obj" ;;
+ esac
+ done
+ fi
+
+ eval cmds=\"$old_archive_cmds\"
+
+ if len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ $echo "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ for obj in $save_oldobjs
+ do
+ oldobjs="$objlist $obj"
+ objlist="$objlist $obj"
+ eval test_cmds=\"$old_archive_cmds\"
+ if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+ test "$len" -le "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ eval cmd=\"$cmd\"
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$generated"; then
+ $show "${rm}r$generated"
+ $run ${rm}r$generated
+ fi
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ $show "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+
+ # Only create the output if not a dry run.
+ if test -z "$run"; then
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ newdependency_libs="$newdependency_libs $libdir/$name"
+ ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+ for lib in $dlfiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ newdlfiles="$newdlfiles $libdir/$name"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlfiles="$newdlfiles $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlprefiles="$newdlprefiles $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $rm $output
+ # place dlname in correct position for cygwin
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ esac
+ $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $echo >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ fi
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+ ;;
+
+ # libtool install mode
+ install)
+ modename="$modename: install"
+
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ $echo "X$nonopt" | grep shtool > /dev/null; then
+ # Aesthetically quote it.
+ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$arg "
+ arg="$1"
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog$arg"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ case " $install_prog " in
+ *[\\\ /]cp\ *) ;;
+ *) prev=$arg ;;
+ esac
+ ;;
+ -g | -m | -o) prev=$arg ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog $arg"
+ done
+
+ if test -z "$install_prog"; then
+ $echo "$modename: you must specify an install program" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prev' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ $echo "$modename: no file or destination specified" 1>&2
+ else
+ $echo "$modename: you must specify a destination" 1>&2
+ fi
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Strip any trailing slash from the destination.
+ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$destdir" = "X$dest" && destdir=.
+ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+ if test "$#" -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ library_names=
+ old_library=
+ relink_command=
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+ test "X$dir" = "X$file/" && dir=
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ if test "$inst_prefix_dir" = "$destdir"; then
+ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
+ else
+ relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
+ fi
+
+ $echo "$modename: warning: relinking \`$file'" 1>&2
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names
+ if test -n "$2"; then
+ realname="$2"
+ shift
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ $show "$install_prog $dir/$srcname $destdir/$realname"
+ $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+ if test -n "$stripme" && test -n "$striplib"; then
+ $show "$striplib $destdir/$realname"
+ $run eval "$striplib $destdir/$realname" || exit $?
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ if test "$linkname" != "$realname"; then
+ $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+ $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+ fi
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ cmds=$postinstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Install the pseudo-library for information purposes.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ instname="$dir/$name"i
+ $show "$install_prog $instname $destdir/$name"
+ $run eval "$install_prog $instname $destdir/$name" || exit $?
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ if test -n "$destfile"; then
+ $show "$install_prog $file $destfile"
+ $run eval "$install_prog $file $destfile" || exit $?
+ fi
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+ $show "$install_prog $staticobj $staticdest"
+ $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin*|*mingw*)
+ wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+ notinst_deplibs=
+ relink_command=
+
+ # Note that it is not necessary on cygwin/mingw to append a dot to
+ # foo even if both foo 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.
+ #
+ # If there is no directory component, then add one.
+ case $wrapper in
+ */* | *\\*) . ${wrapper} ;;
+ *) . ./${wrapper} ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$notinst_deplibs"; then
+ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ # If there is no directory component, then add one.
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ fi
+ libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ # Note that it is not necessary on cygwin/mingw to append a dot to
+ # foo even if both foo 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.
+ #
+ # If there is no directory component, then add one.
+ case $wrapper in
+ */* | *\\*) . ${wrapper} ;;
+ *) . ./${wrapper} ;;
+ esac
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ if test "$finalize" = yes && test -z "$run"; then
+ tmpdir=`func_mktempdir`
+ file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
+
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ ${rm}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ $echo "$modename: warning: cannot relink \`$file'" 1>&2
+ fi
+ else
+ # Install the binary that we compiled earlier.
+ file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+ ;;
+ esac
+ ;;
+ esac
+ $show "$install_prog$stripme $file $destfile"
+ $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+ test -n "$outputname" && ${rm}r "$tmpdir"
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ $show "$install_prog $file $oldlib"
+ $run eval "$install_prog \$file \$oldlib" || exit $?
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ $show "$old_striplib $oldlib"
+ $run eval "$old_striplib $oldlib" || exit $?
+ fi
+
+ # Do each command in the postinstall commands.
+ cmds=$old_postinstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$future_libdirs"; then
+ $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+ fi
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+ ;;
+
+ # libtool finish mode
+ finish)
+ modename="$modename: finish"
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ cmds=$finish_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || admincmds="$admincmds
+ $cmd"
+ done
+ IFS="$save_ifs"
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $run eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ test "$show" = : && exit $EXIT_SUCCESS
+
+ $echo "X----------------------------------------------------------------------" | $Xsed
+ $echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $echo " $libdir"
+ done
+ $echo
+ $echo "If you ever happen to want to link against installed libraries"
+ $echo "in a given directory, LIBDIR, you must either use libtool, and"
+ $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ $echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ $echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ $echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ $echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $echo " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $echo " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ $echo
+ $echo "See any operating system documentation about shared libraries for"
+ $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ $echo "X----------------------------------------------------------------------" | $Xsed
+ exit $EXIT_SUCCESS
+ ;;
+
+ # libtool execute mode
+ execute)
+ modename="$modename: execute"
+
+ # The first argument is the command name.
+ cmd="$nonopt"
+ if test -z "$cmd"; then
+ $echo "$modename: you must specify a COMMAND" 1>&2
+ $echo "$help"
+ exit $EXIT_FAILURE
+ fi
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ if test ! -f "$file"; then
+ $echo "$modename: \`$file' is not a file" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ ;;
+
+ *)
+ $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+ args="$args \"$file\""
+ done
+
+ if test -z "$run"; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ fi
+ $echo "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+ ;;
+
+ # libtool clean and uninstall mode
+ clean | uninstall)
+ modename="$modename: $mode"
+ rm="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) rm="$rm $arg"; rmforce=yes ;;
+ -*) rm="$rm $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ if test -z "$rm"; then
+ $echo "$modename: you must specify an RM program" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ rmdirs=
+
+ origobjdir="$objdir"
+ for file in $files; do
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$file"; then
+ dir=.
+ objdir="$origobjdir"
+ else
+ objdir="$dir/$origobjdir"
+ fi
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ test "$mode" = uninstall && objdir="$dir"
+
+ # Remember objdir for removal later, being careful to avoid duplicates
+ if test "$mode" = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if (test -L "$file") >/dev/null 2>&1 \
+ || (test -h "$file") >/dev/null 2>&1 \
+ || test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+ case "$mode" in
+ clean)
+ case " $library_names " in
+ # " " in the beginning catches empty $dlname
+ *" $dlname "*) ;;
+ *) rmfiles="$rmfiles $objdir/$dlname" ;;
+ esac
+ test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ cmds=$postuninstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ cmds=$old_postuninstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+ # Read the .lo file
+ . $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" \
+ && test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" \
+ && test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ noexename=`$echo $name|${SED} 's,.exe$,,'`
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$noexename
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles || exit_status=1
+ done
+ objdir="$origobjdir"
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ $show "rmdir $dir"
+ $run rmdir $dir >/dev/null 2>&1
+ fi
+ done
+
+ exit $exit_status
+ ;;
+
+ "")
+ $echo "$modename: you must specify a MODE" 1>&2
+ $echo "$generic_help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ if test -z "$exec_cmd"; then
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$generic_help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+ eval exec $exec_cmd
+ exit $EXIT_FAILURE
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+-n, --dry-run display commands without modifying any files
+ --features display basic configuration information and exit
+ --finish same as \`--mode=finish'
+ --help display this help message and exit
+ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
+ --quiet same as \`--silent'
+ --silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
+ --version print version information
+
+MODE must be one of the following:
+
+ clean remove files from the build directory
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+ exit $EXIT_SUCCESS
+ ;;
+
+clean)
+ $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+compile)
+ $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -prefer-pic try to building PIC objects only
+ -prefer-non-pic try to building non-PIC objects only
+ -static always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+execute)
+ $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+finish)
+ $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+install)
+ $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+link)
+ $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+uninstall)
+ $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+*)
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit $?
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+disable_libs=shared
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+disable_libs=static
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/Build/source/libs/graphite/config/missing b/Build/source/libs/graphite/config/missing
new file mode 100755
index 00000000000..f359dae7a87
--- /dev/null
+++ b/Build/source/libs/graphite/config/missing
@@ -0,0 +1,375 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2008-12-21.33
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program). This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+ lex*|yacc*)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar*)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case $f in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te*)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison*|yacc*)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f y.tab.h; then
+ echo >y.tab.h
+ fi
+ if test ! -f y.tab.c; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex*|flex*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if test $# -ne 1; then
+ eval LASTARG="\${$#}"
+ case $LASTARG in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if test -f "$SRCFILE"; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if test ! -f lex.yy.c; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit $?
+ fi
+ ;;
+
+ makeinfo*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar*)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case $firstarg in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case $firstarg in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/Build/source/libs/graphite/configure b/Build/source/libs/graphite/configure
new file mode 100755
index 00000000000..8a7063533cc
--- /dev/null
+++ b/Build/source/libs/graphite/configure
@@ -0,0 +1,22334 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61a for silgraphite 2.3.
+#
+# Report bugs to <silgraphite-devel@lists.sourceforge.net>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ case $as_dir in
+ /*)
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell autoconf@gnu.org about your system,
+ echo including any error possibly output before this
+ echo message
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+ echo_test_string=`eval $cmd` &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='silgraphite'
+PACKAGE_TARNAME='silgraphite'
+PACKAGE_VERSION='2.3'
+PACKAGE_STRING='silgraphite 2.3'
+PACKAGE_BUGREPORT='silgraphite-devel@lists.sourceforge.net'
+
+ac_unique_file="src/segment/GrEngine.cpp"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+am__isrc
+CYGPATH_W
+PACKAGE
+VERSION
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+MAINTAINER_MODE_TRUE
+MAINTAINER_MODE_FALSE
+MAINT
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+DEPDIR
+am__include
+am__quote
+AMDEP_TRUE
+AMDEP_FALSE
+AMDEPBACKSLASH
+CCDEPMODE
+am__fastdepCC_TRUE
+am__fastdepCC_FALSE
+CPP
+GREP
+EGREP
+SED
+LN_S
+ECHO
+AR
+RANLIB
+DSYMUTIL
+NMEDIT
+CXX
+CXXFLAGS
+ac_ct_CXX
+CXXDEPMODE
+am__fastdepCXX_TRUE
+am__fastdepCXX_FALSE
+CXXCPP
+F77
+FFLAGS
+ac_ct_F77
+LIBTOOL
+LSB_RELEASE
+SIZEOF_WCHAR_T
+REL_CODENAME
+LIBOBJS
+LTLIBOBJS'
+ac_subst_files=''
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+CXXCPP
+F77
+FFLAGS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-.]/_/g'`
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-.]/_/g'`
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-.]/_/g'`
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-.]/_/g'`
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute directory names.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { $as_echo "$as_me: error: Working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures silgraphite 2.3 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/silgraphite]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of silgraphite 2.3:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --disable-tracing build without support for trace Graphite logs
+ --enable-debug build with debugging. (default=no)
+ --disable-final build without optimizations and no debugging.
+ --enable-strict treat warnings as errors, check for as much as we
+ can
+ --enable-profile allow profiling (default=no)
+ --enable-profilefn allow functioncheck profiling (default=no)
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-tags[=TAGS] include additional configurations [automatic]
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ CXXCPP C++ preprocessor
+ F77 Fortran 77 compiler command
+ FFLAGS Fortran 77 compiler flags
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <silgraphite-devel@lists.sourceforge.net>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" || continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+silgraphite configure 2.3
+generated by GNU Autoconf 2.61a
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by silgraphite $as_me 2.3, which was
+generated by GNU Autoconf 2.61a. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -n "$CONFIG_SITE"; then
+ set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+ set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+ set x "$ac_default_prefix/share/config.site" \
+ "$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+do
+ if test -r "$ac_site_file"; then
+ { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { $as_echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+$as_echo "$as_me: former value: $ac_old_val" >&2;}
+ { $as_echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+$as_echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+ac_aux_dir=
+for ac_dir in config "$srcdir"/config; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+# setup automake
+am__api_version='1.10'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+done
+IFS=$as_save_IFS
+
+fi
+
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ test -d ./--version && rmdir ./--version
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='silgraphite'
+ VERSION='2.3'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+# System checks.
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort. b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions. Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c89=$ac_arg
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+ # Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+ $ac_path_GREP_found && break 3
+ done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+ # Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+ $ac_path_EGREP_found && break 3
+ done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # See if sys/param.h defines the BYTE_ORDER macro.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
+ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
+ bogus endian macros
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_c_bigendian=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_c_bigendian=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # It does not; compile a test program.
+if test "$cross_compiling" = yes; then
+ # try to guess the endianness by grepping values into an object file
+ ac_cv_c_bigendian=unknown
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
+short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
+int
+main ()
+{
+ _ascii (); _ebcdic ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
+ ac_cv_c_bigendian=yes
+fi
+if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_bigendian=no
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+case $ac_cv_c_bigendian in
+ yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+ ;;
+ no)
+ ;;
+ *)
+ { { $as_echo "$as_me:$LINENO: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+$as_echo "$as_me: error: unknown endianness
+presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+ { (exit 1); exit 1; }; } ;;
+esac
+
+
+# Optional features
+# Check whether --enable-tracing was given.
+if test "${enable_tracing+set}" = set; then
+ enableval=$enable_tracing;
+fi
+
+ test "x$enable_tracing" != xno && enable_tracing=yes
+
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then
+ enableval=$enable_debug;
+fi
+
+# Check whether --enable-final was given.
+if test "${enable_final+set}" = set; then
+ enableval=$enable_final;
+fi
+
+ test "x$enable_final" != xno && enable_final=yes
+# Check whether --enable-strict was given.
+if test "${enable_strict+set}" = set; then
+ enableval=$enable_strict;
+fi
+
+
+# Check whether --enable-profile was given.
+if test "${enable_profile+set}" = set; then
+ enableval=$enable_profile;
+fi
+
+# Check whether --enable-profilefn was given.
+if test "${enable_profilefn+set}" = set; then
+ enableval=$enable_profilefn;
+fi
+
+
+# Checks for programs.
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+# Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${lt_cv_path_SED+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+
+fi
+
+SED=$lt_cv_path_SED
+
+{ $as_echo "$as_me:$LINENO: result: $SED" >&5
+$as_echo "$SED" >&6; }
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+$as_echo_n "checking for BSD-compatible nm... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+NM="$lt_cv_path_NM"
+
+{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+nto-qnx*)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 5245 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ lt_cv_cc_needs_belf=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ lt_cv_cc_needs_belf=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_header_compiler=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ ac_header_preproc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ ( cat <<\_ASBOX
+## ------------------------------------------------------ ##
+## Report this to silgraphite-devel@lists.sourceforge.net ##
+## ------------------------------------------------------ ##
+_ASBOX
+ ) | sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+ if test -n "$CCC"; then
+ CXX=$CCC
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CXX" && break
+done
+
+ if test "x$ac_ct_CXX" = x; then
+ CXX="g++"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CXX=$ac_ct_CXX
+ fi
+fi
+
+ fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+ ac_cxx_werror_flag=yes
+ ac_cv_prog_cxx_g=no
+ CXXFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cxx_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ CXXFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+ CXXFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cxx_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+depcc="$CXX" am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+ if test "${ac_cv_prog_CXXCPP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$F77"; then
+ ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+ { $as_echo "$as_me:$LINENO: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$F77" && break
+ done
+fi
+if test -z "$F77"; then
+ ac_ct_F77=$F77
+ for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_F77"; then
+ ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_F77="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_F77" && break
+done
+
+ if test "x$ac_ct_F77" = x; then
+ F77=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ F77=$ac_ct_F77
+ fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file. (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+#ifndef __GNUC__
+ choke me
+#endif
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if test "${ac_cv_prog_f77_g+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_f77_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_prog_f77_g=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+ FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-g -O2"
+ else
+ FFLAGS="-g"
+ fi
+else
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-O2"
+ else
+ FFLAGS=
+ fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+ G77=yes
+else
+ G77=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+ = "XX$teststring") >/dev/null 2>&1 &&
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: none" >&5
+$as_echo "none" >&6; }
+fi
+
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+linux* | k*bsd*-gnu)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDGIRSTW]'
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="ar"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:$LINENO: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+
+ { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ echo "int foo(void){return 1;}" > conftest.c
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib ${wl}-single_module conftest.c
+ if test -f libconftest.dylib; then
+ lt_cv_apple_cc_single_mod=yes
+ rm -rf libconftest.dylib*
+ fi
+ rm conftest.c
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ lt_cv_ld_exported_symbols_list=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ lt_cv_ld_exported_symbols_list=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[0123])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*)
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil="~$DSYMUTIL \$lib || :"
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+ withval=$with_pic; pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm -r conftest*
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:7861: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:7865: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic='-qnocommon'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ esac
+ ;;
+
+ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ icc* | ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:8151: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:8155: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $rm -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:8255: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:8259: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ enable_shared_with_static_runtimes=no
+ archive_cmds=
+ archive_expsym_cmds=
+ old_archive_From_new_cmds=
+ old_archive_from_expsyms_cmds=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ thread_safe_flag_spec=
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_direct=no
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ link_all_deplibs=unknown
+ hardcode_automatic=no
+ module_cmds=
+ module_expsym_cmds=
+ always_export_symbols=no
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | k*bsd*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ darwin* | rhapsody*)
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec=''
+ link_all_deplibs=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
+ module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ hardcode_direct=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $rm conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc=no
+ else
+ archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+$as_echo "$archive_cmds_need_lc" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`echo $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+ test -n "$runpath_var" || \
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+ ;;
+ *)
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
+$as_echo_n "checking for shl_load... " >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_func_shl_load=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+$as_echo "$ac_cv_func_shl_load" >&6; }
+if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dld_shl_load=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_func_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
+if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dl_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_svld_dlopen=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dld_dld_link=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 10628 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 10728 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+# Report which library types will actually be built
+{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler \
+ CC \
+ LD \
+ lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
+ lt_prog_compiler_static \
+ lt_prog_compiler_no_builtin_flag \
+ export_dynamic_flag_spec \
+ thread_safe_flag_spec \
+ whole_archive_flag_spec \
+ enable_shared_with_static_runtimes \
+ old_archive_cmds \
+ old_archive_from_new_cmds \
+ predep_objects \
+ postdep_objects \
+ predeps \
+ postdeps \
+ compiler_lib_search_path \
+ compiler_lib_search_dirs \
+ archive_cmds \
+ archive_expsym_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ old_archive_from_expsyms_cmds \
+ allow_undefined_flag \
+ no_undefined_flag \
+ export_symbols_cmds \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+ hardcode_automatic \
+ module_cmds \
+ module_expsym_cmds \
+ lt_cv_prog_compiler_c_o \
+ fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms; do
+
+ case $var in
+ old_archive_cmds | \
+ old_archive_from_new_cmds | \
+ archive_cmds | \
+ archive_expsym_cmds | \
+ module_cmds | \
+ module_expsym_cmds | \
+ old_archive_from_expsyms_cmds | \
+ export_symbols_cmds | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ { $as_echo "$as_me:$LINENO: creating $ofile" >&5
+$as_echo "$as_me: creating $ofile" >&6;}
+
+ cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags was given.
+if test "${with_tags+set}" = set; then
+ withval=$with_tags; tagnames="$withval"
+fi
+
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+$as_echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ { $as_echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+$as_echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+ else
+ { $as_echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+$as_echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+ fi
+ fi
+ if test -z "$LTCFLAGS"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+ "") ;;
+ *) { { $as_echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+$as_echo "$as_me: error: invalid tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ { { $as_echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+$as_echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+compiler_lib_search_dirs_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm -r conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ $as_unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ $as_unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+ lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ld_shlibs_CXX=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_CXX=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_CXX=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' ${wl}-bernotok'
+ allow_undefined_flag_CXX=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX='$convenience'
+ archive_cmds_need_lc_CXX=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_CXX=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ archive_cmds_need_lc_CXX=no
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ whole_archive_flag_spec_CXX=''
+ link_all_deplibs_CXX=yes
+ allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+ if test "$GXX" = yes ; then
+ output_verbose_link_cmd='echo'
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
+ module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ ld_shlibs_CXX=no
+ ;;
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ case $host_cpu in
+ hppa*64*|ia64*) ;;
+ *)
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ interix[3-9]*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc*)
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ ld_shlibs_CXX=no
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd='echo'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+ $rm $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ archive_cmds_need_lc_CXX=yes
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
+
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_CXX='${wl}-z,text'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ # So that behaviour is only enabled if SCOABSPATH is set to a
+ # non-empty value in the environment. Most likely only useful for
+ # creating official distributions of packages.
+ # This is a hack until libtool officially supports absolute path
+ # names for shared libraries.
+ no_undefined_flag_CXX='${wl}-z,text'
+ allow_undefined_flag_CXX='${wl}-z,nodefs'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ export_dynamic_flag_spec_CXX='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX="${prev}${p}"
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX="${prev}${p}"
+ else
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX="$p"
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX="$p"
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+compiler_lib_search_dirs_CXX=
+if test -n "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ predep_objects_CXX=
+ postdep_objects_CXX=
+ postdeps_CXX=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ #
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[4-9]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic_CXX='-qnocommon'
+ lt_prog_compiler_wl_CXX='-Wl,'
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ icpc* | ecpc*)
+ # Intel C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:13131: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:13135: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_CXX=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $rm -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:13235: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:13239: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix[4-9]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $rm conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ pic_flag=$lt_prog_compiler_pic_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_CXX=no
+ else
+ archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+$as_echo "$archive_cmds_need_lc_CXX" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+ test -n "$runpath_var_CXX" || \
+ test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_CXX" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+ test "$hardcode_minus_L_CXX" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_CXX \
+ CC_CXX \
+ LD_CXX \
+ lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_pic_CXX \
+ lt_prog_compiler_static_CXX \
+ lt_prog_compiler_no_builtin_flag_CXX \
+ export_dynamic_flag_spec_CXX \
+ thread_safe_flag_spec_CXX \
+ whole_archive_flag_spec_CXX \
+ enable_shared_with_static_runtimes_CXX \
+ old_archive_cmds_CXX \
+ old_archive_from_new_cmds_CXX \
+ predep_objects_CXX \
+ postdep_objects_CXX \
+ predeps_CXX \
+ postdeps_CXX \
+ compiler_lib_search_path_CXX \
+ compiler_lib_search_dirs_CXX \
+ archive_cmds_CXX \
+ archive_expsym_cmds_CXX \
+ postinstall_cmds_CXX \
+ postuninstall_cmds_CXX \
+ old_archive_from_expsyms_cmds_CXX \
+ allow_undefined_flag_CXX \
+ no_undefined_flag_CXX \
+ export_symbols_cmds_CXX \
+ hardcode_libdir_flag_spec_CXX \
+ hardcode_libdir_flag_spec_ld_CXX \
+ hardcode_libdir_separator_CXX \
+ hardcode_automatic_CXX \
+ module_cmds_CXX \
+ module_expsym_cmds_CXX \
+ lt_cv_prog_compiler_c_o_CXX \
+ fix_srcfile_path_CXX \
+ exclude_expsyms_CXX \
+ include_expsyms_CXX; do
+
+ case $var in
+ old_archive_cmds_CXX | \
+ old_archive_from_new_cmds_CXX | \
+ archive_cmds_CXX | \
+ archive_expsym_cmds_CXX | \
+ module_cmds_CXX | \
+ module_expsym_cmds_CXX | \
+ old_archive_from_expsyms_cmds_CXX | \
+ export_symbols_cmds_CXX | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="\
+ program t
+ end
+"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm -r conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+{ $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+{ $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_static_F77='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_F77='-fno-common'
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_F77=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_F77=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ else
+ lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic_F77='-qnocommon'
+ lt_prog_compiler_wl_F77='-Wl,'
+ ;;
+ esac
+ ;;
+
+ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ icc* | ecc*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-fpic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl_F77='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl_F77='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_F77='-Qoption ld '
+ lt_prog_compiler_pic_F77='-PIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_F77='-Kconform_pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_can_build_shared_F77=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_F77='-pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_F77=no
+ ;;
+ esac
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+$as_echo "$lt_prog_compiler_pic_F77" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works_F77=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_F77"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:14818: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:14822: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_F77=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_F77" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
+ case $lt_prog_compiler_pic_F77 in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+ esac
+else
+ lt_prog_compiler_pic_F77=
+ lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_F77=
+ ;;
+ *)
+ lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+ ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_F77=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_F77=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_F77=yes
+ fi
+ fi
+ $rm -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_F77" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then
+ :
+else
+ lt_prog_compiler_static_F77=
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_F77=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:14922: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:14926: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_F77=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag_F77=
+ enable_shared_with_static_runtimes_F77=no
+ archive_cmds_F77=
+ archive_expsym_cmds_F77=
+ old_archive_From_new_cmds_F77=
+ old_archive_from_expsyms_cmds_F77=
+ export_dynamic_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ thread_safe_flag_spec_F77=
+ hardcode_libdir_flag_spec_F77=
+ hardcode_libdir_flag_spec_ld_F77=
+ hardcode_libdir_separator_F77=
+ hardcode_direct_F77=no
+ hardcode_minus_L_F77=no
+ hardcode_shlibpath_var_F77=unsupported
+ link_all_deplibs_F77=unknown
+ hardcode_automatic_F77=no
+ module_cmds_F77=
+ module_expsym_cmds_F77=
+ always_export_symbols_F77=no
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_F77=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_F77=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_F77=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs_F77=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_F77=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=no
+ enable_shared_with_static_runtimes_F77=yes
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | k*bsd*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_F77=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs_F77=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_F77" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec_F77=
+ export_dynamic_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=yes
+ archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_F77=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_F77=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_F77=''
+ hardcode_direct_F77=yes
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_F77=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_F77=yes
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_libdir_separator_F77=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_F77=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_F77='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_F77="-z nodefs"
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_f77_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_F77=' ${wl}-bernotok'
+ allow_undefined_flag_F77=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_F77='$convenience'
+ archive_cmds_need_lc_F77=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs_F77=no
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec_F77=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_F77=' '
+ allow_undefined_flag_F77=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds_F77='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_F77=yes
+ ;;
+
+ darwin* | rhapsody*)
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc_F77=no
+ hardcode_direct_F77=no
+ hardcode_automatic_F77=yes
+ hardcode_shlibpath_var_F77=unsupported
+ whole_archive_flag_spec_F77=''
+ link_all_deplibs_F77=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
+ module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs_F77=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_F77=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+
+ hardcode_direct_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+ ;;
+ *)
+ hardcode_direct_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ link_all_deplibs_F77=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ newsos6)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ allow_undefined_flag_F77=unsupported
+ archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_F77='-rpath $libdir'
+ fi
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ solaris*)
+ no_undefined_flag_F77=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_shlibpath_var_F77=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs_F77=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_F77='$CC -r -o $output$reload_objs'
+ hardcode_direct_F77=no
+ ;;
+ motorola)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ export_dynamic_flag_spec_F77='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_F77=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_F77='${wl}-z,text'
+ archive_cmds_need_lc_F77=no
+ hardcode_shlibpath_var_F77=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_F77='${wl}-z,text'
+ allow_undefined_flag_F77='${wl}-z,nodefs'
+ archive_cmds_need_lc_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ ld_shlibs_F77=no
+ ;;
+ esac
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+$as_echo "$ld_shlibs_F77" >&6; }
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_F77=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_F77 in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $rm conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_F77
+ pic_flag=$lt_prog_compiler_pic_F77
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+ allow_undefined_flag_F77=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_F77=no
+ else
+ archive_cmds_need_lc_F77=yes
+ fi
+ allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+$as_echo "$archive_cmds_need_lc_F77" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+ test -n "$runpath_var_F77" || \
+ test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_F77" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+ test "$hardcode_minus_L_F77" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_F77=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_F77=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_F77=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+$as_echo "$hardcode_action_F77" >&6; }
+
+if test "$hardcode_action_F77" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_F77 \
+ CC_F77 \
+ LD_F77 \
+ lt_prog_compiler_wl_F77 \
+ lt_prog_compiler_pic_F77 \
+ lt_prog_compiler_static_F77 \
+ lt_prog_compiler_no_builtin_flag_F77 \
+ export_dynamic_flag_spec_F77 \
+ thread_safe_flag_spec_F77 \
+ whole_archive_flag_spec_F77 \
+ enable_shared_with_static_runtimes_F77 \
+ old_archive_cmds_F77 \
+ old_archive_from_new_cmds_F77 \
+ predep_objects_F77 \
+ postdep_objects_F77 \
+ predeps_F77 \
+ postdeps_F77 \
+ compiler_lib_search_path_F77 \
+ compiler_lib_search_dirs_F77 \
+ archive_cmds_F77 \
+ archive_expsym_cmds_F77 \
+ postinstall_cmds_F77 \
+ postuninstall_cmds_F77 \
+ old_archive_from_expsyms_cmds_F77 \
+ allow_undefined_flag_F77 \
+ no_undefined_flag_F77 \
+ export_symbols_cmds_F77 \
+ hardcode_libdir_flag_spec_F77 \
+ hardcode_libdir_flag_spec_ld_F77 \
+ hardcode_libdir_separator_F77 \
+ hardcode_automatic_F77 \
+ module_cmds_F77 \
+ module_expsym_cmds_F77 \
+ lt_cv_prog_compiler_c_o_F77 \
+ fix_srcfile_path_F77 \
+ exclude_expsyms_F77 \
+ include_expsyms_F77; do
+
+ case $var in
+ old_archive_cmds_F77 | \
+ old_archive_from_new_cmds_F77 | \
+ archive_cmds_F77 | \
+ archive_expsym_cmds_F77 | \
+ module_cmds_F77 | \
+ module_expsym_cmds_F77 | \
+ old_archive_from_expsyms_cmds_F77 | \
+ export_symbols_cmds_F77 | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm -r conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+old_archive_cmds_GCJ=$old_archive_cmds
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:17131: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:17135: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_static_GCJ='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_GCJ='-fno-common'
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_GCJ=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_GCJ=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic_GCJ='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ else
+ lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic_GCJ='-qnocommon'
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ ;;
+ esac
+ ;;
+
+ mingw* | cygwin* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ icc* | ecc*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-fpic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ lt_prog_compiler_wl_GCJ=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl_GCJ='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_GCJ='-Qoption ld '
+ lt_prog_compiler_pic_GCJ='-PIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_GCJ='-Kconform_pic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_can_build_shared_GCJ=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_GCJ='-pic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_GCJ=no
+ ;;
+ esac
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+$as_echo "$lt_prog_compiler_pic_GCJ" >&6; }
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works_GCJ=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:17421: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:17425: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_GCJ=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_GCJ" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then
+ case $lt_prog_compiler_pic_GCJ in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+ esac
+else
+ lt_prog_compiler_pic_GCJ=
+ lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_GCJ=
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+ ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_GCJ=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_GCJ=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_GCJ=yes
+ fi
+ fi
+ $rm -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_GCJ" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then
+ :
+else
+ lt_prog_compiler_static_GCJ=
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_GCJ=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:17525: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:17529: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_GCJ=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_GCJ" >&6; }
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag_GCJ=
+ enable_shared_with_static_runtimes_GCJ=no
+ archive_cmds_GCJ=
+ archive_expsym_cmds_GCJ=
+ old_archive_From_new_cmds_GCJ=
+ old_archive_from_expsyms_cmds_GCJ=
+ export_dynamic_flag_spec_GCJ=
+ whole_archive_flag_spec_GCJ=
+ thread_safe_flag_spec_GCJ=
+ hardcode_libdir_flag_spec_GCJ=
+ hardcode_libdir_flag_spec_ld_GCJ=
+ hardcode_libdir_separator_GCJ=
+ hardcode_direct_GCJ=no
+ hardcode_minus_L_GCJ=no
+ hardcode_shlibpath_var_GCJ=unsupported
+ link_all_deplibs_GCJ=unknown
+ hardcode_automatic_GCJ=no
+ module_cmds_GCJ=
+ module_expsym_cmds_GCJ=
+ always_export_symbols_GCJ=no
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_GCJ=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_GCJ=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_GCJ=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_GCJ=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs_GCJ=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_GCJ=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ allow_undefined_flag_GCJ=unsupported
+ always_export_symbols_GCJ=no
+ enable_shared_with_static_runtimes_GCJ=yes
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | k*bsd*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_GCJ=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs_GCJ=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_GCJ" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec_GCJ=
+ export_dynamic_flag_spec_GCJ=
+ whole_archive_flag_spec_GCJ=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_GCJ=unsupported
+ always_export_symbols_GCJ=yes
+ archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_GCJ=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_GCJ=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_GCJ=''
+ hardcode_direct_GCJ=yes
+ hardcode_libdir_separator_GCJ=':'
+ link_all_deplibs_GCJ=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_GCJ=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_GCJ=yes
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_libdir_separator_GCJ=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_GCJ=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_GCJ='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_GCJ="-z nodefs"
+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_GCJ=' ${wl}-bernotok'
+ allow_undefined_flag_GCJ=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_GCJ='$convenience'
+ archive_cmds_need_lc_GCJ=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs_GCJ=no
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec_GCJ=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_GCJ=' '
+ allow_undefined_flag_GCJ=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds_GCJ='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_GCJ=yes
+ ;;
+
+ darwin* | rhapsody*)
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc_GCJ=no
+ hardcode_direct_GCJ=no
+ hardcode_automatic_GCJ=yes
+ hardcode_shlibpath_var_GCJ=unsupported
+ whole_archive_flag_spec_GCJ=''
+ link_all_deplibs_GCJ=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
+ module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs_GCJ=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_GCJ=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+
+ hardcode_direct_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ *)
+ hardcode_direct_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ link_all_deplibs_GCJ=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ newsos6)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+ allow_undefined_flag_GCJ=unsupported
+ archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_GCJ=' -expect_unresolved \*'
+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_GCJ=' -expect_unresolved \*'
+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+ fi
+ hardcode_libdir_separator_GCJ=:
+ ;;
+
+ solaris*)
+ no_undefined_flag_GCJ=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs_GCJ=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+ hardcode_direct_GCJ=no
+ ;;
+ motorola)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ export_dynamic_flag_spec_GCJ='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_GCJ=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_GCJ='${wl}-z,text'
+ archive_cmds_need_lc_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_GCJ='${wl}-z,text'
+ allow_undefined_flag_GCJ='${wl}-z,nodefs'
+ archive_cmds_need_lc_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator_GCJ=':'
+ link_all_deplibs_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ *)
+ ld_shlibs_GCJ=no
+ ;;
+ esac
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+$as_echo "$ld_shlibs_GCJ" >&6; }
+test "$ld_shlibs_GCJ" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_GCJ=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_GCJ in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $rm conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_GCJ
+ pic_flag=$lt_prog_compiler_pic_GCJ
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+ allow_undefined_flag_GCJ=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_GCJ=no
+ else
+ archive_cmds_need_lc_GCJ=yes
+ fi
+ allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+$as_echo "$archive_cmds_need_lc_GCJ" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+{ $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+{ $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+ test -n "$runpath_var_GCJ" || \
+ test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_GCJ" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+ test "$hardcode_minus_L_GCJ" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_GCJ=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_GCJ=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_GCJ=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+$as_echo "$hardcode_action_GCJ" >&6; }
+
+if test "$hardcode_action_GCJ" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_GCJ \
+ CC_GCJ \
+ LD_GCJ \
+ lt_prog_compiler_wl_GCJ \
+ lt_prog_compiler_pic_GCJ \
+ lt_prog_compiler_static_GCJ \
+ lt_prog_compiler_no_builtin_flag_GCJ \
+ export_dynamic_flag_spec_GCJ \
+ thread_safe_flag_spec_GCJ \
+ whole_archive_flag_spec_GCJ \
+ enable_shared_with_static_runtimes_GCJ \
+ old_archive_cmds_GCJ \
+ old_archive_from_new_cmds_GCJ \
+ predep_objects_GCJ \
+ postdep_objects_GCJ \
+ predeps_GCJ \
+ postdeps_GCJ \
+ compiler_lib_search_path_GCJ \
+ compiler_lib_search_dirs_GCJ \
+ archive_cmds_GCJ \
+ archive_expsym_cmds_GCJ \
+ postinstall_cmds_GCJ \
+ postuninstall_cmds_GCJ \
+ old_archive_from_expsyms_cmds_GCJ \
+ allow_undefined_flag_GCJ \
+ no_undefined_flag_GCJ \
+ export_symbols_cmds_GCJ \
+ hardcode_libdir_flag_spec_GCJ \
+ hardcode_libdir_flag_spec_ld_GCJ \
+ hardcode_libdir_separator_GCJ \
+ hardcode_automatic_GCJ \
+ module_cmds_GCJ \
+ module_expsym_cmds_GCJ \
+ lt_cv_prog_compiler_c_o_GCJ \
+ fix_srcfile_path_GCJ \
+ exclude_expsyms_GCJ \
+ include_expsyms_GCJ; do
+
+ case $var in
+ old_archive_cmds_GCJ | \
+ old_archive_from_new_cmds_GCJ | \
+ archive_cmds_GCJ | \
+ archive_expsym_cmds_GCJ | \
+ module_cmds_GCJ | \
+ module_expsym_cmds_GCJ | \
+ old_archive_from_expsyms_cmds_GCJ | \
+ export_symbols_cmds_GCJ | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm -r conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_RC \
+ CC_RC \
+ LD_RC \
+ lt_prog_compiler_wl_RC \
+ lt_prog_compiler_pic_RC \
+ lt_prog_compiler_static_RC \
+ lt_prog_compiler_no_builtin_flag_RC \
+ export_dynamic_flag_spec_RC \
+ thread_safe_flag_spec_RC \
+ whole_archive_flag_spec_RC \
+ enable_shared_with_static_runtimes_RC \
+ old_archive_cmds_RC \
+ old_archive_from_new_cmds_RC \
+ predep_objects_RC \
+ postdep_objects_RC \
+ predeps_RC \
+ postdeps_RC \
+ compiler_lib_search_path_RC \
+ compiler_lib_search_dirs_RC \
+ archive_cmds_RC \
+ archive_expsym_cmds_RC \
+ postinstall_cmds_RC \
+ postuninstall_cmds_RC \
+ old_archive_from_expsyms_cmds_RC \
+ allow_undefined_flag_RC \
+ no_undefined_flag_RC \
+ export_symbols_cmds_RC \
+ hardcode_libdir_flag_spec_RC \
+ hardcode_libdir_flag_spec_ld_RC \
+ hardcode_libdir_separator_RC \
+ hardcode_automatic_RC \
+ module_cmds_RC \
+ module_expsym_cmds_RC \
+ lt_cv_prog_compiler_c_o_RC \
+ fix_srcfile_path_RC \
+ exclude_expsyms_RC \
+ include_expsyms_RC; do
+
+ case $var in
+ old_archive_cmds_RC | \
+ old_archive_from_new_cmds_RC | \
+ archive_cmds_RC | \
+ archive_expsym_cmds_RC | \
+ module_cmds_RC | \
+ module_expsym_cmds_RC | \
+ old_archive_from_expsyms_cmds_RC | \
+ export_symbols_cmds_RC | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ ;;
+
+ *)
+ { { $as_echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+$as_echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ { { $as_echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+$as_echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+# Extract the first word of "lsb_release", so it can be a program name with args.
+set dummy lsb_release; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_LSB_RELEASE+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $LSB_RELEASE in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_LSB_RELEASE="$LSB_RELEASE" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_LSB_RELEASE="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_LSB_RELEASE" && ac_cv_path_LSB_RELEASE="no"
+ ;;
+esac
+fi
+LSB_RELEASE=$ac_cv_path_LSB_RELEASE
+if test -n "$LSB_RELEASE"; then
+ { $as_echo "$as_me:$LINENO: result: $LSB_RELEASE" >&5
+$as_echo "$LSB_RELEASE" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Checks for libraries.
+
+# Checks for header files.
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
+$as_echo_n "checking for size_t... " >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef size_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_size_t=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_size_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+$as_echo "$ac_cv_type_size_t" >&6; }
+if test $ac_cv_type_size_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for wchar_t" >&5
+$as_echo_n "checking for wchar_t... " >&6; }
+if test "${ac_cv_type_wchar_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+typedef wchar_t ac__type_new_;
+int
+main ()
+{
+if ((ac__type_new_ *) 0)
+ return 0;
+if (sizeof (ac__type_new_))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_wchar_t=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_type_wchar_t=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5
+$as_echo "$ac_cv_type_wchar_t" >&6; }
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:$LINENO: checking size of wchar_t" >&5
+$as_echo_n "checking size of wchar_t... " >&6; }
+if test "${ac_cv_sizeof_wchar_t+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef wchar_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef wchar_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr $ac_mid + 1`
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef wchar_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef wchar_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_lo=$ac_mid; break
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_hi=`expr '(' $ac_mid ')' - 1`
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef wchar_t ac__type_sizeof_;
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_hi=$ac_mid
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_wchar_t=$ac_lo;;
+'') if test "$ac_cv_type_wchar_t" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (wchar_t)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_wchar_t=0
+ fi ;;
+esac
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+ typedef wchar_t ac__type_sizeof_;
+static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+ {
+ long int i = longval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ((long int) (sizeof (ac__type_sizeof_))))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sizeof_wchar_t=`cat conftest.val`
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_wchar_t" = yes; then
+ { { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (wchar_t)
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+ else
+ ac_cv_sizeof_wchar_t=0
+ fi
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5
+$as_echo "$ac_cv_sizeof_wchar_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t
+_ACEOF
+
+
+
+
+
+for ac_func in fabsf
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_var'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+# Checks for library functions.
+
+# Setup the build compiler flags and linker flags.
+# Enable debug
+# (note: the flags here are gcc-specific and may fail with other compilers)
+build_flags=""
+if test "$enable_debug" = yes; then
+ build_flags="$build_flags -O0 -g -Wall -Wno-unknown-pragmas -Wparentheses -Werror"
+elif test "$enable_strict" = yes; then
+ build_flags="$build_flags -DNDEBUG -Wall -Wno-unknown-pragmas -Wparentheses -Werror"
+else
+ build_flags="$build_flags -DNDEBUG"
+fi
+
+# Enable Graphite Trace logs - these are only used if a
+# LayoutEnvironment has a valid ostream pointer
+if test "$enable_tracing" = yes; then
+ build_flags="$build_flags -DTRACING"
+fi
+
+# Enable final
+if test "$enable_final" = yes; then
+ build_flags="$build_flags -O3 -DNDEBUG"
+fi
+
+# Enable profile
+if test "$enable_profile" = yes; then
+ build_flags="$build_flags -pg "
+fi
+if test "$enable_profilefn" = yes; then
+ build_flags="$build_flags -g -finstrument-functions "
+ LIBS="$LIBS -g -finstrument-functions -lfnccheck "
+fi
+
+# Find distrib codename
+
+{ $as_echo "$as_me:$LINENO: checking if already have REL_CODENAME" >&5
+$as_echo_n "checking if already have REL_CODENAME... " >&6; }
+if test -z "${REL_CODENAME}"; then
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ { $as_echo "$as_me:$LINENO: checking if have lsb_release" >&5
+$as_echo_n "checking if have lsb_release... " >&6; }
+ if test "${LSB_RELEASE}" = "no"; then
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ REL_CODENAME="unstable"
+ else
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ { $as_echo "$as_me:$LINENO: checking if LSB_RELEASE is empty" >&5
+$as_echo_n "checking if LSB_RELEASE is empty... " >&6; }
+ if test -z ${LSB_RELEASE}; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ REL_CODENAME="unstable"
+ else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ CODENAME=`${LSB_RELEASE} -c | sed -e 's/^\S*\s*//'`
+ { $as_echo "$as_me:$LINENO: checking if release is sid" >&5
+$as_echo_n "checking if release is sid... " >&6; }
+ if test ${CODENAME} = 'sid'; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ REL_CODENAME="unstable"
+ else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ REL_CODENAME=${CODENAME}
+ fi
+ fi
+ fi
+else
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+
+
+
+CFLAGS="$CFLAGS $build_flags"
+CXXFLAGS="$CXXFLAGS $build_flags"
+
+ac_config_files="$ac_config_files Makefile silgraphite.pc:installed-top.pc.in:silgraphite.pc.in silgraphite-uninstalled.pc:uninstalled-top.pc.in:silgraphite.pc.in src/Makefile test/Makefile test/RegressionTest/Makefile test/ProfileHarness/Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+$as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+t clear
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by silgraphite $as_me 2.3, which was
+generated by GNU Autoconf 2.61a. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+silgraphite config.status 2.3
+configured by $0, generated by GNU Autoconf 2.61a,
+ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0'$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "silgraphite.pc") CONFIG_FILES="$CONFIG_FILES silgraphite.pc:installed-top.pc.in:silgraphite.pc.in" ;;
+ "silgraphite-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES silgraphite-uninstalled.pc:uninstalled-top.pc.in:silgraphite.pc.in" ;;
+ "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
+ "test/RegressionTest/Makefile") CONFIG_FILES="$CONFIG_FILES test/RegressionTest/Makefile" ;;
+ "test/ProfileHarness/Makefile") CONFIG_FILES="$CONFIG_FILES test/ProfileHarness/Makefile" ;;
+
+ *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} ||
+{
+ $as_echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+echo 'BEGIN {' >"$tmp/subs.awk"
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF"
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/'
+ echo "_ACEOF"
+} >conf$$subs.sh
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >>"\$tmp/subs.awk" <<\CEOF
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^"]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF
+cat >>"\$tmp/subs.awk" <<CEOF
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+CEOF
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+$as_echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ ac_file_inputs="$ac_file_inputs $ac_f"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin";;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | $AWK -f "$tmp/subs.awk" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out"; rm -f "$tmp/out";;
+ *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+ esac
+ ;;
+
+
+ :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir=$dirpart/$fdir
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+
+ esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/Build/source/libs/graphite/configure.ac b/Build/source/libs/graphite/configure.ac
new file mode 100644
index 00000000000..de30af569dc
--- /dev/null
+++ b/Build/source/libs/graphite/configure.ac
@@ -0,0 +1,137 @@
+AC_PREREQ(2.54)
+
+AC_INIT(silgraphite, 2.3, silgraphite-devel@lists.sourceforge.net)
+AC_CONFIG_SRCDIR(src/segment/GrEngine.cpp)
+AC_CONFIG_AUX_DIR(config)
+
+# setup automake
+AM_INIT_AUTOMAKE(foreign)
+AM_MAINTAINER_MODE
+
+# System checks.
+AC_CANONICAL_HOST
+AC_C_BIGENDIAN
+
+# Optional features
+AC_ARG_ENABLE(tracing,
+ AC_HELP_STRING([--disable-tracing],
+ [build without support for trace Graphite logs]))
+ test "x$enable_tracing" != xno && enable_tracing=yes
+
+AC_ARG_ENABLE(debug,
+ AC_HELP_STRING([--enable-debug],
+ [build with debugging. (default=no)]))
+AC_ARG_ENABLE(final,
+ AC_HELP_STRING([--disable-final],
+ [build without optimizations and no debugging.]))
+ test "x$enable_final" != xno && enable_final=yes
+AC_ARG_ENABLE(strict,
+ AC_HELP_STRING([--enable-strict],
+ [treat warnings as errors, check for as much as we can]))
+
+AC_ARG_ENABLE(profile,
+ AC_HELP_STRING([--enable-profile],
+ [allow profiling (default=no)]))
+AC_ARG_ENABLE(profilefn,
+ AC_HELP_STRING([--enable-profilefn],
+ [allow functioncheck profiling (default=no)]))
+
+# Checks for programs.
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+AC_LANG_CPLUSPLUS
+
+AC_PATH_PROG(LSB_RELEASE, lsb_release, no)
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_STDC
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_SIZE_T
+AC_CHECK_SIZEOF(wchar_t)
+AC_SUBST(SIZEOF_WCHAR_T)
+
+AC_CHECK_FUNCS(fabsf)
+
+# Checks for library functions.
+
+# Setup the build compiler flags and linker flags.
+# Enable debug
+# (note: the flags here are gcc-specific and may fail with other compilers)
+build_flags=""
+if test "$enable_debug" = yes; then
+ build_flags="$build_flags -O0 -g -Wall -Wno-unknown-pragmas -Wparentheses -Werror"
+elif test "$enable_strict" = yes; then
+ build_flags="$build_flags -DNDEBUG -Wall -Wno-unknown-pragmas -Wparentheses -Werror"
+else
+ build_flags="$build_flags -DNDEBUG"
+fi
+
+# Enable Graphite Trace logs - these are only used if a
+# LayoutEnvironment has a valid ostream pointer
+if test "$enable_tracing" = yes; then
+ build_flags="$build_flags -DTRACING"
+fi
+
+# Enable final
+if test "$enable_final" = yes; then
+ build_flags="$build_flags -O3 -DNDEBUG"
+fi
+
+# Enable profile
+if test "$enable_profile" = yes; then
+ build_flags="$build_flags -pg "
+fi
+if test "$enable_profilefn" = yes; then
+ build_flags="$build_flags -g -finstrument-functions "
+ LIBS="$LIBS -g -finstrument-functions -lfnccheck "
+fi
+
+# Find distrib codename
+
+AC_MSG_CHECKING(if already have REL_CODENAME)
+if test -z "${REL_CODENAME}"; then
+ AC_MSG_RESULT(no)
+ AC_MSG_CHECKING(if have lsb_release)
+ if test "${LSB_RELEASE}" = "no"; then
+ AC_MSG_RESULT(no)
+ REL_CODENAME="unstable"
+ else
+ AC_MSG_RESULT(yes)
+ AC_MSG_CHECKING(if LSB_RELEASE is empty)
+ if test -z ${LSB_RELEASE}; then
+ AC_MSG_RESULT(yes)
+ REL_CODENAME="unstable"
+ else
+ AC_MSG_RESULT(no)
+ CODENAME=`${LSB_RELEASE} -c | sed -e 's/^\S*\s*//'`
+ AC_MSG_CHECKING(if release is sid)
+ if test ${CODENAME} = 'sid'; then
+ AC_MSG_RESULT(yes)
+ REL_CODENAME="unstable"
+ else
+ AC_MSG_RESULT(no, ${CODENAME})
+ REL_CODENAME=${CODENAME}
+ fi
+ fi
+ fi
+else
+ AC_MSG_RESULT(yes)
+fi
+
+AC_SUBST(REL_CODENAME)
+
+CFLAGS="$CFLAGS $build_flags"
+CXXFLAGS="$CXXFLAGS $build_flags"
+
+AC_CONFIG_FILES(Makefile \
+ silgraphite.pc:installed-top.pc.in:silgraphite.pc.in \
+ silgraphite-uninstalled.pc:uninstalled-top.pc.in:silgraphite.pc.in \
+ src/Makefile \
+ test/Makefile \
+ test/RegressionTest/Makefile \
+ test/ProfileHarness/Makefile)
+
+AC_OUTPUT
diff --git a/Build/source/libs/graphite/debian/changelog b/Build/source/libs/graphite/debian/changelog
new file mode 100644
index 00000000000..e77c628ef90
--- /dev/null
+++ b/Build/source/libs/graphite/debian/changelog
@@ -0,0 +1,174 @@
+silgraphite2.0 (1:2.3-1) gutsy; urgency=low
+
+ * Smaller segment and glyphinfo foot prints
+ * bug fixes
+
+ -- Martin Hosken <martin_hosken@sil.org> Wed, 16 Jan 2008 16:54:26 +0700
+
+silgraphite2.0 (1:2.2.1-1) feisty; urgency=low
+
+ * 30% speedup
+ * various bug fixes
+
+ -- Martin Hosken <martin_hosken@sil.org> Mon, 27 Aug 2007 16:47:26 +0100
+
+silgraphite2.0 (1:2.2.0-1.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Fix the broken graphite.pc file (Closes: #433225):
+ - debian/rules:
+ Added an include of cdbs's simple-patchsys.mk.
+ - debian/patches/fix_cflags_in_graphite.pc.diff
+ Added this patch to fix the graphite.pc file by appending the missing
+ ``graphite'' directory to the Cflags in graphite.pc.in.
+
+ -- Cyril Brulebois <cyril.brulebois@enst-bretagne.fr> Mon, 20 Aug 2007 01:20:35 +0000
+
+silgraphite2.0 (1:2.2.0-1) unstable; urgency=low
+
+ * Release 2.2.0
+
+ -- Daniel Glassey <wdg@debian.org> Thu, 28 Jun 2007 10:56:17 +0100
+
+silgraphite2.0 (1:2.1+0447svn-1) unstable; urgency=low
+
+ * Update svn
+ * Keep engine separate from wrappers
+ * debian/control So don't need build dep on fontconfig or freetype
+ * debian/docs Docs are not in odf format not rtf
+
+ -- Daniel Glassey <wdg@debian.org> Fri, 25 May 2007 13:33:06 +0100
+
+silgraphite2.0 (1:2.1+0361svn-1) unstable; urgency=low
+
+ * Build freetype wrapper
+ * Update svn
+ * depend on libfreetype6-dev instead of X and Xft dependencies
+ * binary package is now libgraphite3 since library version has
+ changed
+ * so rename the debian/libgraphite2.* to libgraphite3.*
+ * libgraphite-dev.install: install libgraphite-ft.a
+
+ -- Daniel Glassey <wdg@debian.org> Mon, 12 Mar 2007 20:25:30 +0000
+
+silgraphite2.0 (1:2.1+0347svn-1) unstable; urgency=low
+
+ * Package preparation for min-deps reorganisation
+ * allow build from svn
+ * debian/rules: not using tarball anymore
+ * debian/control standards version 3.7.2 (no changes)
+ * remove unneeded misc:Depends subsitution variable
+
+ -- Daniel Glassey <wdg@debian.org> Fri, 9 Mar 2007 17:20:52 +0000
+
+silgraphite2.0 (1:2.1-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/rules: fix shlibs
+ * Use an epoch as 2.1 < 221svn
+ if further svn releases are made they will be
+ e.g. 1:2.1+0250svn-1
+
+ -- Daniel Glassey <wdg@debian.org> Mon, 15 May 2006 19:48:23 -0500
+
+silgraphite2.0 (221svn-3) unstable; urgency=low
+
+ * er, try that again
+
+ -- Daniel Glassey <wdg@debian.org> Mon, 17 Apr 2006 15:51:32 +0100
+
+silgraphite2.0 (221svn-2) unstable; urgency=low
+
+ * debian/libgraphite2.shlibs refer to new package name
+
+ -- Daniel Glassey <wdg@debian.org> Mon, 17 Apr 2006 15:36:48 +0100
+
+silgraphite2.0 (221svn-1) unstable; urgency=low
+
+ [ Daniel Glassey ]
+ * update to current svn
+ * include fix to build with gcc 4.1, Closes: #357711
+ Thanks to Martin Michlmayr <tbm@cyrius.com> for the report
+ and Michael Peters <mpeters@mac.com> for the initial one
+ * fix shlibs to refer to libgraphite
+ * rename the lib packages because lib is now libgraphite
+ * now lintian and linda clean
+ * debian/copyright: get location of public svn repo right
+ * conflict with the old packages
+ * don't compress the rtf docs
+
+ [ Martin Hosken ]
+ * build for dapper from trunk
+ * build for dapper from trunk - with right email
+
+ -- Martin Hosken <martin_hosken@sil.org> Fri, 16 Jun 2006 10:48:22 +0700
+
+silgraphite2.0 (190svn-2) unstable; urgency=low
+
+ * fix shlibs
+ * debian/copyright: update location of svn repo
+
+ -- Daniel Glassey <wdg@debian.org> Fri, 10 Mar 2006 09:35:21 +0000
+
+silgraphite2.0 (190svn-1) unstable; urgency=low
+
+ * update to current svn - 2.1.0 prerelease snapshot
+ * not a native package - build it as such, Closes: #345154
+ * Don't assume size_t is unsigned, Closes: #345155
+ Thanks to Bastian Blank <waldi@debian.org> for the report and patch
+ * Take more care with void*, Closes: #345369
+ * debian/libsilgraphite-dev.docs: new file GTF_3_0.rtf
+ build dir is now silgraphite-2.1.0
+ * debian/control: compiler is grcompiler not gdlcomp
+
+ -- Daniel Glassey <wdg@debian.org> Thu, 9 Mar 2006 12:49:53 +0000
+
+silgraphite2.0 (102svn-1) unstable; urgency=low
+
+ * update to current svn
+ * fix the build-deps line (rejection)
+
+ -- Daniel Glassey <wdg@debian.org> Mon, 12 Dec 2005 09:39:31 +0000
+
+silgraphite2.0 (87svn-1) unstable; urgency=low
+
+ * update to more recent svn
+ * new naming scheme using svn revision
+ * Don't autogenerate debian/control using cdbs (rejection)
+ * Add section for source to debian/control
+
+ -- Daniel Glassey <wdg@debian.org> Thu, 1 Dec 2005 11:24:13 +0000
+
+silgraphite2.0 (20051010svn-1) unstable; urgency=low
+
+ * new upstream v2 API
+ * this doesn't depend on libfont-ttf-perl as perl bindings are
+ separate now
+ * GDL font compiler will be a separate package
+
+ -- Daniel Glassey <wdg@debian.org> Mon, 10 Oct 2005 05:32:32 +0100
+
+silgraphite1.0 (20050813cvs-1) unstable; urgency=low
+
+ * New sync with cvs
+ * Ready to upload to unstable
+ * not sure which arch #279655 is for (guessing amd64), so uploading
+ in case it has been fixed in cvs
+ * let cdbs control its build deps in control.in
+
+ -- Daniel Glassey <wdg@debian.org> Sat, 13 Aug 2005 00:12:12 +0100
+
+silgraphite1.0 (20041025cvs-1) experimental; urgency=low
+
+ * update to current CVS
+ * remember to sign this time :/
+ * name package libsilgraphite-1.2 as that is the upcoming version
+ * ITP completed, Closes: #205565
+
+ -- Daniel Glassey <wdg@debian.org> Mon, 25 Oct 2004 20:53:50 +0100
+
+silgraphite1.0 (20041022cvs-1) experimental; urgency=low
+
+ * Initial Release using current CVS.
+
+ -- Daniel Glassey <wdg@debian.org> Fri, 22 Oct 2004 14:24:35 +0100
diff --git a/Build/source/libs/graphite/debian/compat b/Build/source/libs/graphite/debian/compat
new file mode 100644
index 00000000000..b8626c4cff2
--- /dev/null
+++ b/Build/source/libs/graphite/debian/compat
@@ -0,0 +1 @@
+4
diff --git a/Build/source/libs/graphite/debian/control b/Build/source/libs/graphite/debian/control
new file mode 100644
index 00000000000..fbcdb63a66a
--- /dev/null
+++ b/Build/source/libs/graphite/debian/control
@@ -0,0 +1,83 @@
+Source: silgraphite2.0
+Priority: optional
+Section: libs
+Maintainer: Daniel Glassey <wdg@debian.org>
+Build-Depends: cdbs (>= 0.4.23-1.1), autotools-dev, debhelper (>= 4.1.0)
+Standards-Version: 3.7.2
+
+Package: libgraphite-dev
+Section: libdevel
+Architecture: any
+Depends: libgraphite3 (= ${Source-Version})
+Conflicts: libsilgraphite-dev, libsilgraphite-2.0
+Description: Development files for SILGraphite
+ SILGraphite is a system that can be used to create and use "smart fonts"
+ capable of displaying writing systems with various complex behaviors, such
+ as: contextual shaping, ligatures, reordering, split glyphs,
+ bidirectionality, stacking diacritics and complex positioning.
+ .
+ This library was designed and developed by the NRSI (Non-Roman Script
+ Initiative) within SIL International (www.sil.org) to act as a complement to
+ other smart font rendering technologies with limited practical local
+ extensability. Its purpose is to help meet the needs of a very large number
+ of "minority language" communities for local extensibility of complex script
+ behaviors.
+ .
+ The behavior of the SILGraphite rendering engine for a given writing system is
+ specified through extra tables added to a TrueType font. These tables are
+ generated by compiling a GDL (Graphite Description Language) source file into
+ a font using grcompiler.
+ .
+ This package contains the headers and development libraries.
+
+Package: libgraphite3
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}
+Conflicts: libsilgraphite-dev, libsilgraphite-2.0
+Description: SILGraphite - a "smart font" rendering engine
+ SILGraphite is a system that can be used to create and use "smart fonts"
+ capable of displaying writing systems with various complex behaviors, such
+ as: contextual shaping, ligatures, reordering, split glyphs,
+ bidirectionality, stacking diacritics and complex positioning.
+ .
+ This library was designed and developed by the NRSI (Non-Roman Script
+ Initiative) within SIL International (www.sil.org) to act as a complement to
+ other smart font rendering technologies with limited practical local
+ extensability. Its purpose is to help meet the needs of a very large number
+ of "minority language" communities for local extensibility of complex script
+ behaviors.
+ .
+ The behavior of the SILGraphite rendering engine for a given writing system is
+ specified through extra tables added to a TrueType font. These tables are
+ generated by compiling a GDL (Graphite Description Language) source file into
+ a font using grcompiler.
+ .
+ This package contains the shared library.
+
+Package: libgraphite3-dbg
+Priority: extra
+Section: libdevel
+Architecture: any
+Depends: libgraphite3 (= ${Source-Version})
+Conflicts: libsilgraphite-dev, libsilgraphite-2.0
+Description: debugging symbols for SILGraphite
+ SILGraphite is a system that can be used to create and use "smart fonts"
+ capable of displaying writing systems with various complex behaviors, such
+ as: contextual shaping, ligatures, reordering, split glyphs,
+ bidirectionality, stacking diacritics and complex positioning.
+ .
+ This library was designed and developed by the NRSI (Non-Roman Script
+ Initiative) within SIL International (www.sil.org) to act as a complement to
+ other smart font rendering technologies with limited practical local
+ extensability. Its purpose is to help meet the needs of a very large number
+ of "minority language" communities for local extensibility of complex script
+ behaviors.
+ .
+ The behavior of the SILGraphite rendering engine for a given writing system is
+ specified through extra tables added to a TrueType font. These tables are
+ generated by compiling a GDL (Graphite Description Language) source file into
+ a font using grcompiler.
+ .
+ This package contains the debug library.
+
diff --git a/Build/source/libs/graphite/debian/copyright b/Build/source/libs/graphite/debian/copyright
new file mode 100644
index 00000000000..b1fe8899e1d
--- /dev/null
+++ b/Build/source/libs/graphite/debian/copyright
@@ -0,0 +1,259 @@
+This package was debianized by Daniel Glassey <wdg@debian.org> on
+Fri, 22 Oct 2004 14:24:35 +0100.
+
+It was oringally downloaded from http://www.sourceforge.net/projects/silgraphite
+ SILGraphite cvs on sourceforge
+It is now in the subversion repository at
+ http://scripts.sil.org/svn-public/graphite/graphite/trunk
+
+Upstream Authors:
+ SIL International <silgraphite-devel@lists.sourceforge.net>
+ http://www.sil.org
+
+Copyright:
+Copyright 1999-2006 SIL International
+
+Graphite is copyrighted under the SIL Dual License
+This can be found on http://fieldworks.sil.org/License/SIL_open_source_license_frame.htm
+
+Graphite, Version .9 Copyright 2001, SIL International, Inc. All rights reserved.
+This software is free; you can redistribute it and/or modify it under the terms of either:
+a) the GNU "GNU Lesser General Public License version 2.1" as published by the Free Software
+Foundation, or b) the "Common Public License Version 0.5".
+
+This software 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 either the GNU Lesser General Public License or the Common Public License for more details.
+
+ On Debian systems, the complete text of the GNU Lesser General Public
+ License, version 2.1, can be found in /usr/share/common-licenses/LGPL-2.1
+
+The IBM Common Public License follows:
+Common Public License Version 0.5
+
+Common Public License Version 0.5
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE
+("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S
+ACCEPTANCE OF THIS AGREEMENT.
+
+
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+ a) in the case of the initial Contributor, the initial code and documentation distributed
+under this Agreement, and
+
+ b) in the case of each subsequent Contributor:
+
+ i) changes to the Program, and
+
+ ii) additions to the Program;
+
+ where such changes and/or additions to the Program originate from and are distributed by
+that particular Contributor. A Contribution 'originates' from a Contributor if it was added to
+the Program by such Contributor itself or anyone acting on such Contributor's behalf.
+Contributions do not include additions to the Program which: (i) are separate modules of
+software distributed in conjunction with the Program under their own license agreement, and
+(ii) are not derivative works of the Program.
+
+
+
+"Contributor" means any person or entity that distributes the Program.
+
+
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily
+infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+
+
+"Recipient" means anyone who receives the Program under this Agreement, including all
+Contributors.
+
+
+
+2. GRANT OF RIGHTS
+
+ a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a
+non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works
+of, publicly display, publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and object code form.
+
+ b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a
+non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use,
+sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if
+any, in source code and object code form. This patent license shall apply to the combination of
+the Contribution and the Program if, at the time the Contribution is added by the Contributor,
+such addition of the Contribution causes such combination to be covered by the Licensed
+Patents. The patent license shall not apply to any other combinations which include the
+Contribution. No hardware per se is licensed hereunder.
+
+ c) Recipient understands that although each Contributor grants the licenses to its
+Contributions set forth herein, no assurances are provided by any Contributor that the Program
+does not infringe the patent or other intellectual property rights of any other entity. Each
+Contributor disclaims any liability to Recipient for claims brought by any other entity based
+on infringement of intellectual property rights or otherwise. As a condition to exercising the
+rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to
+secure any other intellectual property rights needed, if any. For example, if a third party
+patent license is required to allow Recipient to distribute the Program, it is Recipient's
+responsibility to acquire that license before distributing the Program.
+
+ d) Each Contributor represents that to its knowledge it has sufficient copyright rights
+in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license
+agreement, provided that:
+
+ a) it complies with the terms and conditions of this Agreement; and
+
+ b) its license agreement:
+
+ i) effectively disclaims on behalf of all Contributors all warranties and conditions,
+express and implied, including warranties or conditions of title and non-infringement, and
+implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ ii) effectively excludes on behalf of all Contributors all liability for damages,
+including direct, indirect, special, incidental and consequential damages, such as lost
+profits;
+
+ iii) states that any provisions which differ from this Agreement are offered by that
+Contributor alone and not by any other party; and
+
+ iv) states that source code for the Program is available from such Contributor, and
+informs licensees how to obtain it in a reasonable manner on or through a medium customarily
+used for software exchange.
+
+When the Program is made available in source code form:
+
+ a) it must be made available under this Agreement; and
+
+ b) a copy of this Agreement must be included with each copy of the Program.
+
+
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+
+
+
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a
+manner that reasonably allows subsequent Recipients to identify the originator of the
+Contribution.
+
+
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end
+users, business partners and the like. While this license is intended to facilitate the
+commercial use of the Program, the Contributor who includes the Program in a commercial product
+offering should do so in a manner which does not create potential liability for other
+Contributors. Therefore, if a Contributor includes the Program in a commercial product
+offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any losses, damages and costs
+(collectively "Losses") arising from claims, lawsuits and other legal actions brought by a
+third party against the Indemnified Contributor to the extent caused by the acts or omissions
+of such Commercial Contributor in connection with its distribution of the Program in a
+commercial product offering. The obligations in this section do not apply to any claims or
+Losses relating to any actual or alleged intellectual property infringement. In order to
+qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in
+writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with
+the Commercial Contributor in, the defense and any related settlement negotiations. The
+Indemnified Contributor may participate in any such claim at its own expense.
+
+
+
+For example, a Contributor might include the Program in a commercial product offering, Product
+X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes
+performance claims, or offers warranties related to Product X, those performance claims and
+warranties are such Commercial Contributor's responsibility alone. Under this section, the
+Commercial Contributor would have to defend claims against the other Contributors related to
+those performance claims and warranties, and if a court requires any other Contributor to pay
+any damages as a result, the Commercial Contributor must pay those damages.
+
+
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED 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. Each Recipient is solely responsible for determining the
+appropriateness of using and distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement, including but not limited to the risks and costs of
+program errors, compliance with applicable laws, damage to or loss of data, programs or
+equipment, and unavailability or interruption of operations.
+
+
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL
+HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall
+not affect the validity or enforceability of the remainder of the terms of this Agreement, and
+without further action by the parties hereto, such provision shall be reformed to the minimum
+extent necessary to make such provision valid and enforceable.
+
+
+
+If Recipient institutes patent litigation against a Contributor with respect to a patent
+applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent
+licenses granted by that Contributor to such Recipient under this Agreement shall terminate as
+of the date such litigation is filed. In addition, If Recipient institutes patent litigation
+against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the
+Program itself (excluding combinations of the Program with other software or hardware)
+infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b)
+shall terminate as of the date such litigation is filed.
+
+
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of
+the material terms or conditions of this Agreement and does not cure such failure in a
+reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights
+under this Agreement terminate, Recipient agrees to cease use and distribution of the Program
+as soon as reasonably practicable. However, Recipient's obligations under this Agreement and
+any licenses granted by Recipient relating to the Program shall continue and survive.
+
+
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid
+inconsistency the Agreement is copyrighted and may only be modified in the following manner.
+The Agreement Steward reserves the right to publish new versions (including revisions) of this
+Agreement from time to time. No one other than the Agreement Steward has the right to modify
+this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to
+serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement
+will be given a distinguishing version number. The Program (including Contributions) may always
+be distributed subject to the version of the Agreement under which it was received. In
+addition, after a new version of the Agreement is published, Contributor may elect to
+distribute the Program (including its Contributions) under the new version. Except as expressly
+stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the
+intellectual property of any Contributor under this Agreement, whether expressly, by
+implication, estoppel or otherwise. All rights in the Program not expressly granted under this
+Agreement are reserved.
+
+
+
+This Agreement is governed by the laws of the State of New York and the intellectual property
+laws of the United States of America. No party to this Agreement will bring a legal action
+under this Agreement more than one year after the cause of action arose. Each party waives its
+rights to a jury trial in any resulting litigation.
diff --git a/Build/source/libs/graphite/debian/libgraphite-dev.dirs b/Build/source/libs/graphite/debian/libgraphite-dev.dirs
new file mode 100644
index 00000000000..c08dc81a2ef
--- /dev/null
+++ b/Build/source/libs/graphite/debian/libgraphite-dev.dirs
@@ -0,0 +1,4 @@
+usr/lib
+usr/lib/pkgconfig
+usr/include/silgraphite
+
diff --git a/Build/source/libs/graphite/debian/libgraphite-dev.docs b/Build/source/libs/graphite/debian/libgraphite-dev.docs
new file mode 100644
index 00000000000..2a85e0b4b5b
--- /dev/null
+++ b/Build/source/libs/graphite/debian/libgraphite-dev.docs
@@ -0,0 +1,5 @@
+build-tree/silgraphite-2.2.1/doc/GTF_3_0.odt
+build-tree/silgraphite-2.2.1/doc/V2_Engine_Interface.odt
+build-tree/silgraphite-2.2.1/doc/V2_Segment_Interface.odt
+build-tree/silgraphite-2.2.1/doc/V2_TextSource_Interface.odt
+
diff --git a/Build/source/libs/graphite/debian/libgraphite-dev.install b/Build/source/libs/graphite/debian/libgraphite-dev.install
new file mode 100644
index 00000000000..e1c2c58c292
--- /dev/null
+++ b/Build/source/libs/graphite/debian/libgraphite-dev.install
@@ -0,0 +1,4 @@
+debian/tmp/usr/include
+debian/tmp/usr/lib/libgraphite.a
+debian/tmp/usr/lib/lib*.so
+debian/tmp/usr/lib/pkgconfig
diff --git a/Build/source/libs/graphite/debian/libgraphite3.dirs b/Build/source/libs/graphite/debian/libgraphite3.dirs
new file mode 100644
index 00000000000..68457717bd8
--- /dev/null
+++ b/Build/source/libs/graphite/debian/libgraphite3.dirs
@@ -0,0 +1 @@
+usr/lib
diff --git a/Build/source/libs/graphite/debian/libgraphite3.install b/Build/source/libs/graphite/debian/libgraphite3.install
new file mode 100644
index 00000000000..c45ebcf2a34
--- /dev/null
+++ b/Build/source/libs/graphite/debian/libgraphite3.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/lib*.so.*
diff --git a/Build/source/libs/graphite/debian/libgraphite3.shlibs b/Build/source/libs/graphite/debian/libgraphite3.shlibs
new file mode 100644
index 00000000000..6c6ca9f718e
--- /dev/null
+++ b/Build/source/libs/graphite/debian/libgraphite3.shlibs
@@ -0,0 +1 @@
+libgraphite 3 libgraphite3 (>= 1:2.1+0361svn-1)
diff --git a/Build/source/libs/graphite/debian/rules b/Build/source/libs/graphite/debian/rules
new file mode 100755
index 00000000000..7e5c672aad5
--- /dev/null
+++ b/Build/source/libs/graphite/debian/rules
@@ -0,0 +1,12 @@
+#!/usr/bin/make -f
+#DEB_AUTO_UPDATE_DEBIAN_CONTROL:=yes
+
+DEB_TAR_SRCDIR := silgraphite-2.3
+include /usr/share/cdbs/1/rules/tarball.mk
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/autotools.mk
+#DEB_CONFIGURE_EXTRA_FLAGS := --enable-final
+DEB_DH_MAKESHLIBS_ARGS_libgraphite3 := -V"libgraphite3 (>= 2.1+0449svn-1)"
+DEB_COMPRESS_EXCLUDE := .rtf
+DEB_DH_STRIP_ARGS := --dbg-package=libgraphite3
diff --git a/Build/source/libs/graphite/doc/GTF_3_0.odt b/Build/source/libs/graphite/doc/GTF_3_0.odt
new file mode 100644
index 00000000000..36b3e136dd9
--- /dev/null
+++ b/Build/source/libs/graphite/doc/GTF_3_0.odt
Binary files differ
diff --git a/Build/source/libs/graphite/doc/V2_Engine_Interface.odt b/Build/source/libs/graphite/doc/V2_Engine_Interface.odt
new file mode 100644
index 00000000000..c69511535a6
--- /dev/null
+++ b/Build/source/libs/graphite/doc/V2_Engine_Interface.odt
Binary files differ
diff --git a/Build/source/libs/graphite/doc/V2_Segment_Interface.odt b/Build/source/libs/graphite/doc/V2_Segment_Interface.odt
new file mode 100644
index 00000000000..b9028cfb379
--- /dev/null
+++ b/Build/source/libs/graphite/doc/V2_Segment_Interface.odt
Binary files differ
diff --git a/Build/source/libs/graphite/doc/V2_TextSource_Interface.odt b/Build/source/libs/graphite/doc/V2_TextSource_Interface.odt
new file mode 100644
index 00000000000..c2f183a1629
--- /dev/null
+++ b/Build/source/libs/graphite/doc/V2_TextSource_Interface.odt
Binary files differ
diff --git a/Build/source/libs/graphite/doc/hungarian.txt b/Build/source/libs/graphite/doc/hungarian.txt
new file mode 100644
index 00000000000..946c9a4bc97
--- /dev/null
+++ b/Build/source/libs/graphite/doc/hungarian.txt
@@ -0,0 +1,126 @@
+GRAPHITE HUNGARIAN NOTATION
+
+General rules for variable names:
+
+* Syntax is:
+ scope indicator (if any)
+ combining prefix (zero or more)
+ type/class indicator (required)
+ usage labels (optional)
+
+* The only places underscores are used are after the scoping prefixes. Uppercase is used to separate the prefixes from the main label, if any; eg: strName, m_psegNew.
+
+* If you are creating a new class, make up a short indicator for it and use it consistently. Class indicators should be 3-6 characters long.
+
+* An appropriate way to indicate method arguments where necessary is with an "Arg" usage label, eg: nValueArg. Generally method arguments have no special indication.
+
+* Usage labels can be made up arbitrarily, but the ones listed below should be used if they apply.
+
+
+*** Scope indicators:
+
+m_ member variable
+s_ static (global) variable
+
+
+*** Combining prefixes:
+
+i index
+c counter
+p pointer
+pp double pointer
+rg range (array, especially stack-allocated)
+prg pointer to the start of an array (often used for method arguments)
+v vector
+d delta or difference
+k constant (combines with an enumeration identifier: eg, klb, kest, kgmet, etc)
+
+
+*** Basic type indicators:
+
+f boolean (flag)
+n integer (simple numerical value--not a counter, index, glyph id, char, measurement, etc.)
+b byte
+l long integer (whatever that means)
+ch character (width irrelevant)
+chs short character (8-bit)
+chw wide character (16-bit)
+chl long (32-bit) character
+str string (char-width irrelevant)
+sta ANSI string (8-bit)
+stu Unicode string (16-bit)
+fxd fixed-field integer
+v void (yes, this duplicates vector)
+
+Graphite specific integer types:
+
+gid glyph id
+m em-units
+xs logical units, x-coordinates (source)
+ys logical units, y-coordinates (source)
+xys logical units, x- or y-coordinates (source)
+xd display units, x-coordinates
+yd display units, y-coordinates
+xyd display units, x- or y-coordinates
+
+
+*** Common Graphite-specific class prefixes (not a complete list)
+
+seg Segment
+font Font
+txsrc TextSource
+fface FontFace
+pass GrPass
+greng GrEngine
+tman GrTableManager
+sstrm GrSlotStream
+slot GrSlotState
+slout GrSlotOutput
+chstrm GrCharStream
+gbb glyph bounding box
+
+
+*** Enumeration prefixes (see the GrConstants.h and GrData.h files for a more complete list)
+
+lb line break (breakweight)
+twsh trailing whitespace handling
+est end-segment type (why the segment was terminated)
+dm draw mode (for insertion points)
+dirc directionality code
+slat slot attribute name
+clr color
+op operator in Graphite's stack machine
+
+
+*** Usage labels (somewhat optional, depending on context)
+
+Min first in a sequence or array (used with Lim); minimum (used with Max)
+Lim 1 + last in a sequence or array
+Max maximum
+First first in a sequence (used with Last)
+Last last in a sequence
+Prev previous
+Next next
+Ret return value
+In input
+Out output
+New newly created object
+Arg method argument
+
+-----------------
+
+EXAMPLES
+
+pf pointer to boolean
+cch character count
+ipassPrev index of previous pass
+pppass pointer to a pointer to a pass
+iislot index to an index to a GrSlotState
+vich vector of character indices
+prgchw pointer to the start of a wide-char buffer
+dislot delta to apply to an index of a GrSlotState
+m_ipass index of pass (member variable)
+ppassNew pointer to a newly created pass
+clrBack background color
+m_igbbFirst index to the first glyph bounding box (member variable)
+islotLim 1 + index of the last slot \ No newline at end of file
diff --git a/Build/source/libs/graphite/doc/policy.txt b/Build/source/libs/graphite/doc/policy.txt
new file mode 100644
index 00000000000..e3acbb4bcec
--- /dev/null
+++ b/Build/source/libs/graphite/doc/policy.txt
@@ -0,0 +1,19 @@
+POLICIES
+
+This document keeps a dated list of policy changes that we may come up with
+or recind or generally do whatever we want with. There's no carefully worked
+out framework in which these policies sit, they are just rules we intend
+to keep and break when we need to!
+
+2007-04-02
+
+API Changes Policy
+
+Any changes to the public API will be documented on the developers' list along
+with a branch into which the corresponding code changes will be placed.
+Following the announcement, the branch will not be merged into the trunk for
+at least 1 week. After which, depending on how the development has gone and
+the comments or otherwise, the merge may: take place unannounced, be delayed
+unannounced or be dropped and not take place, in which case an announcement
+will be made on the developers' list.
+
diff --git a/Build/source/libs/graphite/graphite-engine.ac b/Build/source/libs/graphite/graphite-engine.ac
new file mode 100644
index 00000000000..dddbe63cb82
--- /dev/null
+++ b/Build/source/libs/graphite/graphite-engine.ac
@@ -0,0 +1,13 @@
+if test "$needs_graphite" = no; then
+ GRAPHITECPPFLAGS=
+ LDGRAPHITE=
+ GRAPHITEDEP=
+else
+ GRAPHITECPPFLAGS='-I$(GRAPHITESRCDIR)/include'
+ LDGRAPHITE='$(GRAPHITEDIR)/src/.libs/libgraphite.a'
+ GRAPHITEDEP='$(GRAPHITEDIR)/src/.libs/libgraphite.a'
+fi
+
+AC_SUBST(GRAPHITECPPFLAGS)
+AC_SUBST(LDGRAPHITE)
+AC_SUBST(GRAPHITEDEP)
diff --git a/Build/source/libs/graphite/include/Makefile.am b/Build/source/libs/graphite/include/Makefile.am
new file mode 100644
index 00000000000..83286118d8d
--- /dev/null
+++ b/Build/source/libs/graphite/include/Makefile.am
@@ -0,0 +1,29 @@
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/FileFont.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/Font.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GraphiteProcess.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrAppData.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrClient.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrCommon.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrConstants.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrData.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrDebug.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrExt.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrFeature.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrMstypes.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrPlatform.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrResult.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrStructs.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/GrWrappers.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/IGraphiteProcess.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/IGrEngine.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/IGrJustifier.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/ITextSource.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/MemoryUsage.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/SegmentAux.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/Segment.h
+graphiteinclude_HEADERS += $(top_srcdir)/include/graphite/SegmentPainter.h
+
+EXTRA_DIST += $(top_srcdir)/include/graphite/BinTree.h
+EXTRA_DIST += $(top_srcdir)/include/graphite/GenericResource.h
+EXTRA_DIST += $(top_srcdir)/include/graphite/HashMap.h
+
diff --git a/Build/source/libs/graphite/include/graphite/BinTree.h b/Build/source/libs/graphite/include/graphite/BinTree.h
new file mode 100644
index 00000000000..a487df03770
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/BinTree.h
@@ -0,0 +1,71 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: BinTree.h
+Responsibility: Darrell Zook
+Last reviewed: 9/8/99
+
+Description:
+ This file provides declarations of binary tree class(es).
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef BINTREE_H_INCLUDED
+#define BINTREE_H_INCLUDED
+
+/*----------------------------------------------------------------------------------------------
+ This template class implements a balanced tree, which is a binary tree where the height of
+ the two children of any node in the tree can only be different by +/- 1 or 0.
+
+ The class of objects to be stored in the tree should be derived from BalTreeBase, because
+ the constructor of BalTreeBase adds an object to the tree in sorted order without
+ allocating any memory.
+
+ Classes that derive from BalTreeBase must have a CompareKey member function that compares
+ a given key with this->key to determine which should be first when sorting the tree.
+ The declaration of CompareKey should be as follows:
+ int CompareKey(const Key & key);
+ and it should return:
+ <0 if key is less than the key in the current node (this->key)
+ 0 if key is equal to the key in the current node (this->key)
+ >0 if key is greater than the key in the current node (this->key)
+
+ CAUTION: Classes that use this template should never be dynamically instantiated (by using
+ local variables or new/NewObj). This class is meant to be used only for global
+ instances of a class. The reason for this restriction is that the tree is never
+ destroyed, so using dynamic instantiations of objects would result in stale pointers
+ in the tree.
+
+ Hungarian: btb
+----------------------------------------------------------------------------------------------*/
+
+template<typename Obj, typename Key> class BalTreeBase
+{
+protected:
+ // Pointers to the left and right subtrees.
+ Obj * m_rgpobj[2];
+
+ // The difference between the height of the right sub tree and the height of the left
+ // sub tree. This should be -1, 0, or +1. Insert may temporarily set it to -2 or +2.
+ short m_dht;
+
+ // Which way we went from this node when inserting the new node.
+ short m_ipobj;
+
+ // Inserts this in the balanced tree.
+ BalTreeBase(Obj ** ppobjRoot, const Key & key);
+
+ // Returns a node with the given key from the tree rooted at pobjRoot.
+ static Obj * Find(Obj * pobjRoot, const Key & key);
+
+private:
+ // Inserts a node in the tree rooted at *ppobjRoot, sorting it based on key.
+ void Insert(Obj ** ppobjRoot, const Key & key);
+};
+
+#endif // !BINTREE_H_INCLUDED
+
diff --git a/Build/source/libs/graphite/include/graphite/FileFont.h b/Build/source/libs/graphite/include/graphite/FileFont.h
new file mode 100644
index 00000000000..bbb26266c71
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/FileFont.h
@@ -0,0 +1,260 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001, 2005 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: XftFont.h
+Responsibility: Keith Stribley
+Last reviewed: Not yet.
+
+Description:
+ A Font is an object that represents a font-family + bold + italic setting, that contains
+ Graphite tables.
+----------------------------------------------------------------------------------------------*/
+#ifndef FILEFONT_INCLUDED
+#define FILEFONT_INCLUDED
+#include "Font.h"
+
+
+//:End Ignore
+
+
+namespace gr
+{
+
+class FontTableCache;
+class GrEngine;
+/*-----------------------------------------------------------------------------
+ Stock implementation of an Xft font class.
+------------------------------------------------------------------------------*/
+/**
+* An implementation of the Graphite gr::Font class for Xft fonts for use on
+* systems using X. Freetype is used to retrieve font information.
+* If you are using Freetype directly, without Xft, you can pass in a FT_Face
+* directly.
+*/
+class FileFont : public Font
+{
+public:
+ /**
+ * The main user constructor. Constructs the font from the supplied FILE pointer.
+ * @param file the FILE pointer to initialise from (must not be null)
+ */
+ FileFont(FILE * file, float pointSize, unsigned int DPIx, unsigned int DPIy = 0);
+
+ /**
+ * Alternative user constructor. Constructs the font from the supplied filename.
+ * @param filename character array
+ */
+ FileFont(char * filename, float pointSize, unsigned int DPIx, unsigned int DPIy = 0);
+
+ /**
+ * Alternative user constructor. Constructs the font from the supplied filename.
+ * @param filename as a string
+ */
+ FileFont(std::string filename, float pointSize,
+ unsigned int DPIx, unsigned int DPIy = 0);
+
+
+ /**
+ * Destructor - cleans up the tables that it has allocated if all other copies
+ * of this font have been deleted.
+ */
+ virtual ~FileFont();
+
+ /**
+ * Returns a copy of the recipient. Specifically needed to store the Font
+ * in a segment.
+ * @internal
+ */
+ virtual Font * copyThis();
+
+ /**
+ * Copy constructor - note the tables are shared between the copy and the
+ * original font for efficiency reasons.
+ * The last copy to be deleted will delete the tables.
+ * @param font the XftGrFont object to copy from.
+ * @internal
+ */
+ FileFont(const FileFont & font, float pointSize = 0, unsigned int DPIx = 0, unsigned int DPIy = 0);
+
+ //virtual FontErrorCode isValidForGraphite(int * pnVersion = NULL, int * pnSubVersion = NULL);
+ /**
+ * Returns a pointer to the start of a table in the font. The ftblid32 type
+ * is a 32-bit unsigned integer.
+ * If the Font class cannot easily determine the length of the table, it may
+ * set 0 as the length (while returning a non-NULL pointer to the table). This
+ * means that certain kinds of error checking cannot be done by the Graphite
+ * engine.
+ * Throws an exception if there is some other error in reading the table, or if
+ * the table asked for is not one of the expected ones (cmap, head, name, Sile,
+ * Silf, Feat, Gloc, Glat). [If we want to be able to read “non-standardâ€
+ * tables, then the caller needs to be responsible for freeing the memory.]
+ */
+ virtual const void * getTable(fontTableId32 tableID, size_t * pcbSize);
+
+ /**
+ * Returns the basic metrics of the font. It corresponds to the current
+ * GrGraphics::get_FontAscent, get_FontDescent and GetFontEmSquare methods.
+ * @param pAscent pointer to hold font ascent
+ * @param pDescent pointer to hold font descent
+ * @param pEmSquare pointer to hold font EM square
+ */
+ virtual void getFontMetrics(float * pAscent, float * pDescent = NULL,
+ float * pEmSquare = NULL);
+
+ /**
+ * Returns true if the given arguments specify a font that contains Graphite
+ * tables—specfically a “Silf†table.
+ * @param xftFont XftFont pointer
+ * @return true if this font has the silf table
+ */
+ bool fontHasGraphiteTables();
+
+ /**
+ * Returns true if the given arguments specify a font that contains Graphite
+ * tables—specfically a “Silf†table.
+ * @param xftFont XftFont pointer
+ * @return true if this font has the silf table
+ */
+ static bool FontHasGraphiteTables(FILE * file);
+
+ /**
+ * Returns true if the given arguments specify a font that contains Graphite
+ * tables—specfically a “Silf†table.
+ * @param face FT_Face handle
+ * @return true if this font has the silf table
+ */
+ static bool FontHasGraphiteTables(char * filename);
+
+ // Temporary, until interface gets thoroughly reworked:
+ GrEngine * GraphiteEngine();
+
+ /**
+ * Returns the font ascent in pixels. Using floating point allows us to
+ * avoid rounding errors.
+ * Value is the same as that returned by getFontMetrics()
+ * @return the font ascent
+ */
+ virtual float ascent()
+ {
+ float pixAscent;
+ getFontMetrics(&pixAscent);
+ return pixAscent;
+ }
+ /**
+ * Returns the font descent in pixels with a positive sign.
+ * Value is the same as that returned by getFontMetrics()
+ * @return the font descent in pixels.
+ */
+ virtual float descent()
+ {
+ float pixDescent;
+ getFontMetrics(NULL, &pixDescent);
+ return pixDescent;
+ }
+ /**
+ * Returns the total height of the font.
+ * Equivalent to ascent() + descent().
+ * @return font height
+ */
+ virtual float height()
+ {
+ float pixAscent;
+ float pixDescent;
+ getFontMetrics(&pixAscent, &pixDescent);
+ return (pixAscent + pixDescent);
+ }
+ /**
+ * @return true if the font is a bold styled one.
+ */
+ virtual bool bold()
+ {
+ return m_fBold;
+ }
+ /**
+ * @return true if the font is italic
+ */
+ virtual bool italic()
+ {
+ return m_fItalic;
+ }
+ /** @return the DPI for the x-axis.
+ */
+ virtual unsigned int getDPIx()
+ {
+ return m_dpiX;
+ }
+ /** @return Returns the DPI for the y-axis.
+ */
+ virtual unsigned int getDPIy()
+ {
+ return m_dpiY;
+ }
+ // Specific to XftGrFont:
+
+ /** @return set the DPI for the x-axis.
+ */
+ virtual void setDPIx(unsigned int dpi)
+ {
+ m_dpiX = dpi;
+ m_xScale = scaleFromDpi(dpi);
+ }
+ /** @return set the DPI for the y-axis.
+ */
+ virtual void setDPIy(unsigned int dpi)
+ {
+ m_dpiY = dpi;
+ m_yScale = scaleFromDpi(dpi);
+ }
+
+ bool isValid() { return m_fIsValid; };
+protected:
+ /** Default constructor is not used */
+ FileFont();
+ /**
+ * Common initialisation between the XftFont and FT_Face constructors.
+ */
+ void initializeFromFace(void);
+ // this uses an int to avoid having to include TtfUtil.h in the include
+ // directory
+ byte * readTable(int /*TableId*/ tableId, size_t & size);
+
+ // pixels-per-em = dpi * point-size / 72
+ // pixel-coord = design-coord * pixels-per-em / font-em-square
+ float scaleFromDpi(int dpi)
+ {
+ return (dpi * m_pointSize) / (72.0f * m_mEmSquare);
+ }
+
+ // Member variables:
+ FILE * m_pfile;
+
+ unsigned long m_clrFore;
+ unsigned long m_clrBack;
+ bool m_fBold;
+ bool m_fItalic;
+ // font table caches:
+ FontTableCache * m_pTableCache;
+
+ // KRS: I think these should be cached otherwise Segment::LineContextSegment doesn't work
+ float m_mAscent;
+ float m_mDescent;
+ float m_mEmSquare;
+ float m_pointSize;
+ int m_dpiX;
+ int m_dpiY;
+ bool m_fIsValid;
+ std::wstring m_stuFaceName;
+ byte * m_pHeader;
+ byte * m_pTableDir;
+ float m_xScale;
+ float m_yScale;
+};
+
+
+} // namespace gr
+
+#endif
+
diff --git a/Build/source/libs/graphite/include/graphite/Font.h b/Build/source/libs/graphite/include/graphite/Font.h
new file mode 100644
index 00000000000..64f62b3ff62
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/Font.h
@@ -0,0 +1,416 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: Font.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ A Font is an object that represents a font-family + bold + italic setting, that contains
+ Graphite tables. This file also includes related iterators: FeatureIterator,
+ FeatureSettingIterator, FeatLabelLangIterator, LanguageIterator.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef FONT_INCLUDED
+#define FONT_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+class Font;
+class FontFace;
+class FeatureSettingIterator;
+class Segment;
+class LayoutEnvironment;
+class ITextSource;
+class FontMemoryUsage;
+
+typedef struct tagFontProps
+{
+ unsigned long clrFore;
+ unsigned long clrBack;
+ bool fBold;
+ bool fItalic;
+ float pixHeight;
+ wchar_t szFaceName[ 32 ];
+} FontProps;
+
+
+/*----------------------------------------------------------------------------------------------
+ A FontError object is an exception that is thrown when there is an error in initializing
+ a Graphite font.
+----------------------------------------------------------------------------------------------*/
+struct FontException
+{
+ FontErrorCode errorCode;
+ int version;
+ int subVersion;
+};
+
+/*----------------------------------------------------------------------------------------------
+ Iterator to provide access to a font's features.
+----------------------------------------------------------------------------------------------*/
+class FeatureIterator
+{
+ friend class Font;
+ friend class FeatureSettingIterator;
+
+public:
+ FeatureIterator() // needed for creating std::pair of these, and for default FSI
+ {
+ m_pfont = NULL;
+ m_ifeat = 0;
+ m_cfeat = 0;
+ }
+
+protected:
+ FeatureIterator(Font * pfont, int ifeat, size_t cfeat)
+ {
+ m_pfont = pfont;
+ m_ifeat = ifeat;
+ m_cfeat = cfeat;
+ }
+public:
+ featid operator*();
+ FeatureIterator operator++();
+ FeatureIterator operator+=(int n);
+ bool operator==(FeatureIterator &);
+ bool operator!=(FeatureIterator &);
+ int operator-(FeatureIterator &);
+
+protected:
+ Font * m_pfont;
+ size_t m_ifeat; // feature being pointed at
+ size_t m_cfeat; // number of features for this font
+
+ FeatureSettingIterator BeginSetting();
+ FeatureSettingIterator EndSetting();
+};
+
+/*----------------------------------------------------------------------------------------------
+ Iterator to provide access to the defined values for a single font feature.
+----------------------------------------------------------------------------------------------*/
+class FeatureSettingIterator
+{
+ friend class Font;
+ friend class FeatureIterator;
+
+public:
+ FeatureSettingIterator() // needed for creating std::pair of these, I think
+ {
+ m_ifset = 0;
+ m_cfset = 0;
+ }
+protected:
+ FeatureSettingIterator(FeatureIterator fit, int ifset, size_t cfset)
+ {
+ m_fit = fit;
+ m_ifset = ifset;
+ m_cfset = cfset;
+ }
+public:
+ int operator*();
+ FeatureSettingIterator operator++();
+ FeatureSettingIterator operator +=(int n);
+ bool operator==(FeatureSettingIterator &);
+ bool operator!=(FeatureSettingIterator &);
+ int operator-(FeatureSettingIterator);
+
+protected:
+ FeatureIterator m_fit;
+ size_t m_ifset; // which setting being pointed at
+ size_t m_cfset; // number of settings for this feature
+};
+
+/*----------------------------------------------------------------------------------------------
+ Iterator to provide access to the languages available for the feature label strings.
+----------------------------------------------------------------------------------------------*/
+class FeatLabelLangIterator
+{
+ friend class Font;
+
+public:
+ FeatLabelLangIterator() // needed for creating std::pair of these, and for default FSI
+ {
+ m_pfont = NULL;
+ m_ilang = 0;
+ m_clang = 0;
+ }
+
+protected:
+ FeatLabelLangIterator(Font * pfont, int ilang, size_t clang)
+ {
+ m_pfont = pfont;
+ m_ilang = ilang;
+ m_clang = clang;
+ }
+public:
+ data16 operator*();
+ FeatLabelLangIterator operator++();
+ FeatLabelLangIterator operator+=(int n);
+ bool operator==(FeatLabelLangIterator &);
+ bool operator!=(FeatLabelLangIterator &);
+ int operator-(FeatLabelLangIterator &);
+
+protected:
+ Font * m_pfont;
+ size_t m_ilang; // language being pointed at
+ size_t m_clang; // number of languages for this font
+};
+
+/*----------------------------------------------------------------------------------------------
+ Iterator to provide access to a font's defined languages--ie, those that have feature
+ settings associated with them.
+----------------------------------------------------------------------------------------------*/
+class LanguageIterator
+{
+ friend class Font;
+
+public:
+ LanguageIterator() // needed for creating std::pair of these, and for default FSI
+ {
+ m_pfont = NULL;
+ m_ilang = 0;
+ m_clang = 0;
+ }
+
+protected:
+ LanguageIterator(Font * pfont, int ilang, size_t clang)
+ {
+ m_pfont = pfont;
+ m_ilang = ilang;
+ m_clang = clang;
+ }
+public:
+ isocode operator*(); // returns a 4-char array
+ LanguageIterator operator++();
+ LanguageIterator operator+=(int n);
+ bool operator==(LanguageIterator &);
+ bool operator!=(LanguageIterator &);
+ int operator-(LanguageIterator &);
+
+protected:
+ Font * m_pfont;
+ size_t m_ilang; // language being pointed at
+ size_t m_clang; // number of languages for this font
+};
+
+/*----------------------------------------------------------------------------------------------
+ Abstract superclass for Graphite fonts. A font represents a face name, size, and bold and
+ italic styles.
+----------------------------------------------------------------------------------------------*/
+class Font {
+
+ friend class FeatureIterator;
+ friend class FeatureSettingIterator;
+ friend class FeatLabelLangIterator;
+ friend class LanguageIterator;
+ friend class FontMemoryUsage;
+
+public:
+ virtual ~Font();
+
+ /**
+ * Returns a copy of the recipient. Specifically needed to store the
+ * Font in a segment.
+ * @internal
+ * @return pointer to copy
+ */
+ virtual Font * copyThis() = 0;
+
+ /**
+ * Return wether the font is bold.
+ * @return true when bold
+ */
+ virtual bool bold() = 0;
+ /**
+ * Return wether the font is italic.
+ * @return true when italic
+ */
+ virtual bool italic() = 0;
+
+ /**
+ * Returns the slope of the italic (if the font is italic)
+ * @return ratio of slope from the vertical
+ */
+ virtual float fakeItalicRatio() { return 0; } // no support for fake italic
+
+ /**
+ * Returns the font ascent.
+ * Value is the same as that returned by getFontMetrics()
+ * @return the font ascent in device co-ordinates
+ */
+ virtual float ascent() = 0;
+
+ /**
+ * Returns the font descent.
+ * Value is the same as that returned by getFontMetrics()
+ * @return the font descent in device co-ordinates
+ */
+ virtual float descent() = 0;
+
+ /**
+ * Returns the total height of the font.
+ * @return font height in device co-ordinates
+ */
+ virtual float height() = 0;
+
+ /**
+ * Returns the x and y resolution of the device co-ordinate space.
+ */
+ virtual unsigned int getDPIx() = 0;
+ virtual unsigned int getDPIy() = 0;
+
+ /**
+ * Returns a pointer to the start of a table in the font.
+ * If the Font class cannot easily determine the length of the table,
+ * it may set 0 as the length (while returning a non-NULL pointer to
+ * the table). This means that certain kinds of error checking cannot
+ * be done by the Graphite engine.
+ * Throws an exception if there is some other error in reading the
+ * table, or if the table asked for is not in the font.
+ * @param tableID the TTF ID of the table as a 32-bit long in native machine byte order
+ * @param pcbSize pointer to a size_t to hold the table size.
+ * @return address of the buffer containing the table or 0
+ */
+ virtual const void * getTable(fontTableId32 tableID, size_t * pcbSize) = 0;
+ /**
+ * Fetches the basic metrics of the font in device co-ordinates
+ * (normaly pixels).
+ * @param pAscent pointer to hold font ascent.
+ * @param pDescent pointer to hold font descent.
+ * @param pEmSquare pointer to hold font EM square.
+ */
+ virtual void getFontMetrics(float * pAscent, float * pDescent = NULL,
+ float * pEmSquare = NULL) = 0;
+ /**
+ * Converts the point number of a glyph’s on-curve point to a pair of
+ * x/y coordinates in pixels. The default implementation will read the
+ * curve information directly from the font and perform a simple
+ * transformation to pixels. Some subclasses (e.g., WinFont) will use
+ * a system-level API call to return hinted metrics.
+ * Note that the coordinates returned are floating point values in the
+ * device co-ordinate space (normaly pixels).
+ * @param gid glyph id
+ * @param pointNum within glyph
+ * @param xyReturn reference to a Point object to hold the x,y result
+ */
+ virtual void getGlyphPoint(gid16 glyphID, unsigned int pointNum, gr::Point & pointReturn);
+
+ /**
+ * Returns the metrics of a glyph in the font. The default
+ * implementation will read the information directly from the font and
+ * perform a simple transformation to pixels. Some subclasses (e.g.,
+ * WinFont) will use a system-level API call to return hinted metrics.
+ * Note that the coordinates returned are floating point values in the
+ * device co-ordinate space (normaly pixels).
+ * @param glyphID
+ * @param boundingBox reference to gr::Rect to hold bounding box of glyph
+ * @param advances refererence to gr::Point to hold the horizontal / vertical advances
+ */
+ virtual void getGlyphMetrics(gid16 glyphID, gr::Rect & boundingBox, gr::Point & advances);
+
+ static void SetFlushMode(int);
+ static int GetFlushMode();
+
+ // obsolete:
+ //virtual FontErrorCode isValidForGraphite(int * pnVersion = NULL, int * pnSubVersion = NULL) = 0;
+
+ // Features:
+ std::pair<FeatureIterator, FeatureIterator> getFeatures();
+ FeatureIterator featureWithID(featid id);
+ bool getFeatureLabel(FeatureIterator, lgid language, utf16 * label);
+ FeatureSettingIterator getDefaultFeatureValue(FeatureIterator);
+ std::pair<FeatureSettingIterator, FeatureSettingIterator> getFeatureSettings(FeatureIterator);
+ bool getFeatureSettingLabel(FeatureSettingIterator, lgid language, utf16 * label);
+
+ std::pair<FeatLabelLangIterator, FeatLabelLangIterator> getFeatureLabelLanguages();
+
+ // Languages:
+ std::pair<LanguageIterator, LanguageIterator> getSupportedLanguages();
+
+ // Script directions, Verticle, LTR, RTL etc see enum ScriptDirCode
+ // the posibilities. This returns a bit set where more than one scripts may
+ // be set, it's up to the app to decide which is the prefered direction to use.
+ ScriptDirCode getSupportedScriptDirections() const throw();
+
+ // Debugging:
+ //static bool DbgCheckFontCache();
+
+ static FontMemoryUsage calculateMemoryUsage();
+ ///FontMemoryUsage calculateMemoryUsage(bool fBold = false, bool fItalic = false);
+
+public:
+ // For use in segment creation:
+ void RenderLineFillSegment(Segment * pseg, ITextSource * pts, LayoutEnvironment & layout,
+ toffset ichStart, toffset ichStop, float xsMaxWidth, bool fBacktracking);
+ void RenderRangeSegment(Segment * pseg, ITextSource * pts, LayoutEnvironment & layout,
+ toffset ichStart, toffset ichEnd);
+ void RenderJustifiedSegment(Segment * pseg, ITextSource * pts, LayoutEnvironment & layout,
+ toffset ichStart, toffset ichEnd, float xsCurrentWidth, float xsDesiredWidth);
+
+protected:
+ Font();
+ Font(const Font &);
+
+ FontFace & fontFace(bool fDumbFallback = false);
+
+ // Feature access:
+ FeatureIterator BeginFeature();
+ FeatureIterator EndFeature();
+
+ size_t NumberOfFeatures();
+ featid FeatureID(size_t ifeat);
+ size_t FeatureWithID(featid id);
+ bool GetFeatureLabel(size_t ifeat, lgid language, utf16 * label);
+ int GetFeatureDefault(size_t ifeat);
+ size_t NumberOfSettings(size_t ifeat);
+ int GetFeatureSettingValue(size_t ifeat, size_t ifset);
+ bool GetFeatureSettingLabel(size_t ifeat, size_t ifset, lgid language, utf16 * label);
+
+ // Feature-label languages:
+ FeatLabelLangIterator BeginFeatLang();
+ FeatLabelLangIterator EndFeatLang();
+
+ size_t NumberOfFeatLangs();
+ short FeatLabelLang(size_t ilang);
+
+ // Language access:
+ LanguageIterator BeginLanguage();
+ LanguageIterator EndLanguage();
+
+ size_t NumberOfLanguages();
+ isocode LanguageCode(size_t ilang);
+
+ virtual void UniqueCacheInfo(std::wstring & stuFace, bool & fBold, bool & fItalic);
+
+private:
+ FontFace * m_pfface; // set up with Graphite tables
+
+ // Cache of common tables:
+ const void * m_pHead;
+ const void * m_pHmtx;
+ const void * m_pLoca;
+ const void * m_pGlyf;
+ size_t m_cbHmtxSize;
+ size_t m_cbLocaSize;
+ bool m_fTablesCached;
+
+ void initialiseFontFace(bool fDumbFallback);
+ void EnsureTablesCached();
+};
+
+inline Font::Font() : m_pfface(0), m_fTablesCached(false)
+{ }
+
+} // namespace gr
+
+
+#endif // !FONT_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/GenericResource.h b/Build/source/libs/graphite/include/graphite/GenericResource.h
new file mode 100644
index 00000000000..119c6317bcd
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GenericResource.h
@@ -0,0 +1,86 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GenericResource.h
+Responsibility: John Thomson
+Last reviewed:
+
+ Resources needed by certain generic components (but must be created in app's or AppCore's
+ resource file).
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GenericResource_H
+#define GenericResource_H 1
+// Create suitable resources for these if your app uses StackDumper.
+// For example
+// STRINGTABLE DISCARDABLE
+// BEGIN
+// "A programming error (%s) has been detected in module %s.\n Please report this to the developers", kstidInternalError
+// "Out of memory. To attempt Save, close other apps and click OK. To quit without saving click Cancel", kstidOutOfMemory
+// END
+
+
+// Date qualifier string IDs:
+#define kstidDateQualBefore 24200
+#define kstidDateQualOn 24201
+#define kstidDateQualAbout 24202
+#define kstidDateQualAfter 24203
+#define kstidDateQualAbt 24204
+#define kstidDateQualBC 24205
+#define kstidDateQualAD 24206
+#define kstidDateBlank 24207
+#define kstidDateBlankM 24208
+#define kstidDateBlankD 24209
+
+
+#define kstidInternalError 25900
+#define khcidHelpOutOfMemory 25901
+#define khcidNoHelpAvailable 25902 // default help module when there is no specific one.
+#define kstidOutOfMemory 25903
+#define kstidUndoFrame 25904
+#define kstidRedoFrame 25905
+
+#define kstidFileErrUnknown 25920
+#define kstidFileErrNotFound 25921
+#define kstidFileErrPathNotFound 25922
+#define kstidFileErrTooManyFiles 25923
+#define kstidFileErrAccDenied 25924
+#define kstidFileErrBadHandle 25925
+#define kstidFileErrBadDrive 25926
+#define kstidFileErrWriteProtect 25927
+#define kstidFileErrBadUnit 25928
+#define kstidFileErrNotReady 25929
+#define kstidFileErrSeek 25930
+#define kstidFileErrNotDosDisk 25931
+#define kstidFileErrBadSector 25932
+#define kstidFileErrWriteFault 25933
+#define kstidFileErrReadFault 25934
+#define kstidFileErrGeneral 25935
+#define kstidFileErrSharing 25936
+#define kstidFileErrLock 25937
+#define kstidFileErrEof 25938
+#define kstidFileErrHandleDiskFull 25939
+#define kstidFileErrBadNetPath 25940
+#define kstidFileErrNetworkBusy 25941
+#define kstidFileErrNoDevice 25942
+#define kstidFileErrNoNetAccess 25943
+#define kstidFileErrBadDevice 25944
+#define kstidFileErrBadNetName 25945
+#define kstidFileErrExists 25946
+#define kstidFileErrCantMake 25947
+#define kstidFileErrBadPassword 25948
+#define kstidFileErrNetWriteFault 25949
+#define kstidFileErrDriveLocked 25950
+#define kstidFileErrOpenFailed 25951
+#define kstidFileErrBufOverflow 25952
+#define kstidFileErrDiskFull 25953
+#define kstidFileErrBadName 25954
+#define kstidFileErrNoVolLabel 25955
+#define kstidFileErrAlreadyExists 25956
+
+#endif // !GenericResource_H
diff --git a/Build/source/libs/graphite/include/graphite/GrAppData.h b/Build/source/libs/graphite/include/graphite/GrAppData.h
new file mode 100644
index 00000000000..3a2024b8a10
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrAppData.h
@@ -0,0 +1,39 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrAppData.h
+Responsibility: Sharon Correll
+Last reviewed: not yet
+
+Description:
+ Data structures need by applications that use the Graphite engine.
+----------------------------------------------------------------------------------------------*/
+
+
+#ifndef GRAPPDATA_INCLUDED
+#define GRAPPDATA_INCLUDED
+
+#include "GrData.h"
+
+namespace gr
+{
+
+typedef unsigned int featid; // font feature IDs
+typedef unsigned int lgid; // language ID (for access feature UI strings)
+typedef unsigned int toffset; // text-source index
+
+typedef struct { // ISO-639-3 language code (for mapping onto features)
+ char rgch[4];
+} isocode;
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // GRAPPDATA_INCLUDED
+
diff --git a/Build/source/libs/graphite/include/graphite/GrClient.h b/Build/source/libs/graphite/include/graphite/GrClient.h
new file mode 100644
index 00000000000..0ef5127c81a
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrClient.h
@@ -0,0 +1,39 @@
+#ifndef GR_CLIENT_H
+#define GR_CLIENT_H
+
+#include "GrCommon.h"
+#include "GrConstants.h"
+
+#define __RPC_FAR
+
+namespace gr
+{
+
+// These are internal classes, whose forward declarations are needed to allow the public interfaces
+// to compile but are not intended for client use.
+class GrSlotState;
+class GrSlotStream;
+class GrGlyphTable;
+class GrClassTable;
+class GrTableManager;
+class GrPseudoMap;
+class GrFileIStream;
+class GrSlotOutput;
+class GrCharStream;
+class GrIStream;
+
+// Forward declarations of client APIs and classes.
+class Segment;
+}
+
+#include "GrAppData.h"
+#include "GrResult.h"
+#include "GrFeature.h"
+
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif //GR_CLIENT_H
+
diff --git a/Build/source/libs/graphite/include/graphite/GrCommon.h b/Build/source/libs/graphite/include/graphite/GrCommon.h
new file mode 100644
index 00000000000..8bb5728ecb3
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrCommon.h
@@ -0,0 +1,145 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001, 2003 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrCommon.h
+Responsibility: Sharon Correll
+Last reviewed:
+
+ Common generic header file.
+
+ This header file checks for the following compile time switches:
+
+ USING_MFC
+----------------------------------------------------------------------------------------------*/
+
+#ifndef GRCOMMON_INCLUDED
+#define GRCOMMON_INCLUDED
+
+
+// Standard Headers.
+
+#include <cstdlib>
+#include <cstdio>
+#include <cstdarg>
+#include <climits>
+//#include <exception>
+#include <new>
+
+#include <fstream>
+#include <iostream>
+#include <vector>
+#include <algorithm>
+#include <string>
+
+// Uncomment this to allow multiple versions of gr to coexist
+// in the same program e.g. pangographite with gtk uses namespace gr
+// mozilla graphite defines this to gr2moz incase the 2 libraries are
+// incompatible.
+// Provided the client includes GrClient.h first this #define is
+// picked up by all files.
+
+//#define gr gr2
+
+// Project headers
+#include "GrPlatform.h"
+
+#ifndef GrAssert
+#include <cassert>
+#define GrAssert(exp) assert(exp)
+#endif
+
+using std::max;
+using std::min;
+
+namespace gr
+{
+
+
+/***********************************************************************************************
+ Simple types.
+***********************************************************************************************/
+typedef char schar;
+
+// TODO ShonK: Make generic use these where appropriate.
+#ifdef UNICODE
+typedef utf16 achar;
+#else // !UNICODE
+typedef schar achar;
+#endif // UNICODE
+
+typedef achar *Psz;
+//typedef const achar * Pcsz;
+
+
+
+// This is to make a signed isizeof operator, otherwise we get tons of warnings about
+// signed / unsigned mismatches.
+#define isizeof(T) (sizeof(T))
+
+#define SizeOfArray(rgt) (isizeof(rgt) / isizeof(rgt[0]))
+
+
+/***********************************************************************************************
+ Tests for valid strings and pointers.
+***********************************************************************************************/
+inline bool ValidPsz(const data16 *pszw)
+{
+ // TODO ShonK: Determine if IsBadStringPtrW is implemented on Win9x.
+ return pszw != 0 && !GrIsBadStringPtrW(pszw, 0x10000000);
+}
+
+inline bool ValidPsz(const schar *pszs)
+{
+ return pszs != 0 && !GrIsBadStringPtrA(pszs, 0x10000000);
+}
+
+template<typename T> inline bool ValidReadPtr(T *pt)
+{
+ return pt != 0 && !GrIsBadReadPtr(pt, isizeof(T));
+}
+
+template<typename T> inline bool ValidWritePtr(T *pt)
+{
+ return pt != 0 && !GrIsBadWritePtr(pt, isizeof(T));
+}
+
+inline bool ValidReadPtrSize(const void *pv, int cb)
+{
+ if (cb < 0) return false;
+ if (cb == 0) return true;
+
+ return pv != 0 && !GrIsBadReadPtr(pv, cb);
+}
+
+inline bool ValidWritePtrSize(void *pv, int cb)
+{
+// if (!bstr || ::IsBadReadPtr((byte *)bstr - isizeof(int), isizeof(int) + isizeof(OLECHAR)))
+// return false;
+// int cb = ((int *)bstr)[-1];
+// if (::IsBadReadPtr((byte *)bstr - isizeof(int), isizeof(int) + isizeof(OLECHAR) + cb))
+// return false;
+ if (cb < 0) return false;
+ if (cb == 0) return true;
+
+ return pv != 0 && !GrIsBadWritePtr(pv, cb);
+}
+
+
+} // namespace gr
+
+
+// TODO Remove these as soon as they are no longer needed by GrCompiler:
+//#include "UtilMem.h"
+//#include "UtilRect.h"
+//#include "UtilString.h"
+//#include "UtilVector.h"
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !GRCOMMON_INCLUDED
+
diff --git a/Build/source/libs/graphite/include/graphite/GrConstants.h b/Build/source/libs/graphite/include/graphite/GrConstants.h
new file mode 100644
index 00000000000..61f79b88022
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrConstants.h
@@ -0,0 +1,268 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999 - 2008 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: constants.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Various global constants.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GRCONSTANTS_INCLUDED
+#define GRCONSTANTS_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+// Maximum table versions handled by this engine:
+enum {
+
+ kSilfVersion = 0x00030000,
+ kRuleVersion = 0x00030000,
+ kGlatVersion = 0x00010000,
+ kGlocVersion = 0x00010000,
+ kFeatVersion = 0x00020000,
+ kSileVersion = 0x00010000,
+ kSillVersion = 0x00010000
+
+};
+
+enum {
+
+ kMaxFeatures = 64,
+ kMaxComponentsPerGlyph = 32,
+ kFieldsPerComponent = 4,
+ kMaxSlotsPerRule = 64,
+ kMaxSubTablesInFont = 256,
+ kMaxUserDefinableSlotAttrs = 64,
+ kMaxJLevels = 4
+
+};
+
+// Maxima permitted by the binary format of the TrueType tables.
+enum {
+
+ kMaxSubTables = 256,
+ kMaxRenderingBehavior = 65536, // ie, the maximum value allowed for an ID
+ kMaxGlyphAttrs = 65536, // Gloc table
+ kMinGlyphAttrValue =-32768,
+ kMaxGlyphAttrValue = 32768,
+ kMaxPasses = 128, // Sil_sub table allows 256
+ kMaxPseudos = 65536,
+ kMaxRendBehaviors = 256,
+ kMaxReplcmtClasses = 65536, // Class map
+ kMaxReplcmtClassesV1_2 = 256,
+ kMaxComponents = 16383
+
+};
+
+
+enum {
+
+ kPosInfinity = 0x3FFFFFF,
+ kNegInfinity = kPosInfinity * -1,
+
+ kInvalid = kNegInfinity
+
+};
+
+#define kPosInfFloat (float)kPosInfinity
+#define kNegInfFloat (float)kNegInfinity
+
+
+enum {
+ kGpointZero = -2
+};
+
+
+// for stream processing
+enum {
+ kBacktrack = -2,
+ kNextPass = -1
+};
+
+
+// internal justification modes
+enum {
+ kjmodiNormal = 0,
+ kjmodiMeasure,
+ kjmodiJustify,
+ kjmodiCanShrink // like normal, but shrinking is possible
+};
+
+
+enum DirCode { // Hungarian: dirc
+
+ kdircUnknown = -1,
+ kdircNeutral = 0, // other neutrals (default) - ON
+ kdircL = 1, // left-to-right, strong - L
+ kdircR = 2, // right-to-left, strong - R
+ kdircRArab = 3, // Arabic letter, right-to-left, strong, AR
+ kdircEuroNum = 4, // European number, left-to-right, weak - EN
+ kdircEuroSep = 5, // European separator, left-to-right, weak - ES
+ kdircEuroTerm = 6, // European number terminator, left-to-right, weak - ET
+ kdircArabNum = 7, // Arabic number, left-to-right, weak - AN
+ kdircComSep = 8, // Common number separator, left-to-right, weak - CS
+ kdircWhiteSpace = 9, // white space, neutral - WS
+ kdircBndNeutral = 10, // boundary neutral - BN
+
+ kdircLRO = 11, // LTR override
+ kdircRLO = 12, // RTL override
+ kdircLRE = 13, // LTR embedding
+ kdircRLE = 14, // RTL embedding
+ kdircPDF = 15, // pop directional format
+
+ // I think we need this too:
+ kdircNSM = 16, // non-space mark
+
+ // Special values for internal use:
+ kdircLlb = 32, // left-to-right line-break
+ kdircRlb = 33, // right-to-left line-break
+ kdircPdfL = 34, // PDF marker matching an LRO or LRE
+ kdircPdfR = 35 // PDF marker matching an RLO or RLE
+
+};
+
+
+bool StrongDir(DirCode dirc);
+bool WeakDir(DirCode dirc);
+bool NeutralDir(DirCode dirc);
+bool RightToLeftDir(DirCode dirc);
+
+
+// Unicode characters with special treatments
+enum DefinedChars {
+
+ knSpace = 0x0020, // space
+ knHyphen = 0x002D, // hyphen
+
+ knTab = 0x0009, // tab (horizontal)
+ knLF = 0x000A, // line feed
+ knCR = 0x000D, // carriage return
+ knLineSep = 0x2028, // line separator (soft return)
+ knParaSep = 0x2029, // paragraph separator
+
+ knLRM = 0x200E, // left-to-right mark
+ knRLM = 0x200F, // right-to-left mark
+ knLRE = 0x202A, // left-to-right embedding
+ knRLE = 0x202B, // right-to-left embedding
+ knPDF = 0x202C, // pop directional format
+ knLRO = 0x202D, // left-to-right override
+ knRLO = 0x202E, // right-to-left override
+
+ knORC = 0xFFFC // Object Replacement Character
+};
+
+bool BidiCode(int nUnicode);
+
+
+typedef enum SpecialSlots {
+
+ kspslNone = 0,
+
+ kspslLbInitial = 1,
+ kspslLbFinal = 2,
+
+ kspslLRM = 3,
+ kspslRLM = 4,
+ kspslLRO = 5,
+ kspslRLO = 6,
+ kspslLRE = 7,
+ kspslRLE = 8,
+ kspslPDF = 9
+
+} SpecialSlots;
+
+
+// version 1.0 breakweights
+enum BreakWeightsV1
+{
+ klbv1WordBreak = 1,
+ klbv1HyphenBreak = 2,
+ klbv1LetterBreak = 3,
+ klbv1ClipBreak = 4
+};
+
+
+typedef enum SlotAttrName {
+
+ kslatAdvX = 0, kslatAdvY,
+ kslatAttTo,
+ kslatAttAtX, kslatAttAtY, kslatAttAtGpt,
+ kslatAttAtXoff, kslatAttAtYoff,
+ kslatAttWithX, kslatAttWithY, kslatAttWithGpt,
+ kslatAttWithXoff, kslatAttWithYoff,
+ kslatAttLevel,
+ kslatBreak,
+ kslatCompRef,
+ kslatDir,
+ kslatInsert,
+ kslatPosX, kslatPosY,
+ kslatShiftX, kslatShiftY,
+ kslatUserDefnV1, // version 1.0 of the font tables
+ kslatMeasureSol, kslatMeasureEol,
+ kslatJStretch, kslatJShrink, kslatJStep, kslatJWeight, kslatJWidth,
+ // this must be last:
+ kslatUserDefn = kslatJStretch + 30,
+ // I think 30 is somewhat arbitrary. We at least need to save 15 slots for more levels of
+ // justification attributes.
+
+ kslatMax,
+
+ kslatNoEffect = kslatMax + 1 // for internal use
+} SlotAttrName;
+
+
+typedef enum GlyphMetric {
+ kgmetLsb = 0, kgmetRsb,
+ kgmetBbTop, kgmetBbBottom, kgmetBbLeft, kgmetBbRight,
+ kgmetBbHeight, kgmetBbWidth,
+ kgmetAdvWidth, kgmetAdvHeight,
+ kgmetAscent, kgmetDescent
+} GlyphMetric;
+
+
+enum ProcessStates
+{
+ kpstatJustifyMode = 1,
+ kpstatJustifyLevel = 2
+};
+
+// user justification modes: these must match the values in stddef.gdh
+enum JustifyModes
+{
+ kjmoduNormal = 0,
+ kjmoduMeasure = 1,
+ kjmoduJustify = 2
+};
+
+enum TruetypeTableId {
+ kttiCmap = 0x636D6170,
+ kttiFeat = 0x46656174,
+ kttiGlat = 0x476C6174,
+ kttiGloc = 0x476C6F63,
+ kttiGlyf = 0x676C7966,
+ kttiHead = 0x68656164,
+ kttiHhea = 0x68686561,
+ kttiHmtx = 0x686D7478,
+ kttiLoca = 0x6C6F6361,
+ kttiMaxp = 0x6D617870,
+ kttiName = 0x6E616D65,
+ kttiOs2 = 0x4F532F32,
+ kttiPost = 0x706F7374,
+ kttiSile = 0x53696C65,
+ kttiSilf = 0x53696C66,
+ kttiSill = 0x53696C6C
+};
+
+} // namespace gr
+
+#endif // CONSTANTS_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/GrData.h b/Build/source/libs/graphite/include/graphite/GrData.h
new file mode 100644
index 00000000000..3624ca9c271
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrData.h
@@ -0,0 +1,226 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrData.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Data structures needed by the Graphite engine, particularly for argument passing.
+ NOT to be used within FieldWorks.
+
+Special Note:
+ This file needs to be used by C files. Please do not use C++ style comments; use
+ ONLY C style comments in this file to make the C compiler happy.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GRDATA_INCLUDED
+#define GRDATA_INCLUDED
+
+#include "GrCommon.h"
+
+/*
+//:End Ignore
+ */
+
+#include "GrStructs.h"
+
+namespace gr
+{
+
+struct Point
+{
+ float x;
+ float y;
+
+ Point()
+ {
+ x = y = 0;
+ }
+
+#if defined(_WIN32)
+ Point(POINT & p)
+ {
+ x = (float)p.x;
+ y = (float)p.y;
+ }
+#endif
+};
+
+
+struct Rect
+{
+ float top;
+ float bottom;
+ float left;
+ float right;
+
+ Rect()
+ {
+ top = bottom = left = right = 0;
+ };
+
+#if defined(_WIN32)
+ Rect(RECT & r)
+ {
+ top = (float)r.top;
+ bottom = (float)r.bottom;
+ left = (float)r.left;
+ right = (float)r.right;
+ };
+#endif
+};
+
+enum {
+ kttvOff = 0,
+ kttvForceOn = 1,
+ kttvInvert = 2
+};
+
+//typedef struct tagLgParaRenderProps
+//{
+// int dummy;
+//} LgParaRenderProps;
+
+typedef enum tagSegEnd
+{ kestNoMore = 0,
+ kestMoreLines = kestNoMore + 1,
+ kestHardBreak = kestMoreLines + 1,
+ kestBadBreak = kestHardBreak + 1,
+ kestOkayBreak = kestBadBreak + 1,
+ kestWsBreak = kestOkayBreak + 1,
+ kestMoreWhtsp = kestWsBreak + 1,
+ kestNothingFit = kestMoreWhtsp + 1
+} SegEnd;
+
+typedef enum tagLgIPDrawMode // TODO: remove
+{ kdmNormal = 0,
+ kdmSplitPrimary = kdmNormal + 1,
+ kdmSplitSecondary = kdmSplitPrimary + 1
+} LgIPDrawMode;
+
+typedef enum tagLgIpValidResult
+{ kipvrOK = 0,
+ kipvrBad = kipvrOK + 1,
+ kipvrUnknown = kipvrBad + 1
+} LgIpValidResult;
+
+typedef enum tagLineBrk
+{ klbNoBreak = 0,
+ klbWsBreak = 10,
+ klbWordBreak = 15,
+ klbHyphenBreak = 20,
+ klbLetterBreak = 30,
+ klbClipBreak = 40
+} LineBrk;
+
+typedef enum tagTrWsHandling
+{ ktwshAll = 0,
+ ktwshNoWs = ktwshAll + 1,
+ ktwshOnlyWs = ktwshNoWs + 1
+} TrWsHandling;
+
+typedef enum tagUtfType
+{
+ kutf8 = 0,
+ kutf16 = kutf8 + 1,
+ kutf32 = kutf16 + 1
+} UtfType;
+
+enum tagFlushMode
+{
+ kflushAuto = 0,
+ kflushManual = kflushAuto + 1
+};
+
+typedef enum ScriptDirCode
+{ kfsdcNone = 0,
+ kfsdcHorizLtr = 1,
+ kfsdcHorizRtl = 2,
+ kfsdcVertFromLeft = 4,
+ kfsdcVertFromRight = 8
+} ScriptDirCode;
+
+typedef enum tagFwTextColor
+{ kclrWhite = 0xffffff,
+ kclrBlack = 0,
+ kclrRed = 0x0000ff,
+ kclrGreen = 0x00ff00,
+ kclrBlue = 0xff0000,
+/*
+// kclrYellow = 0x00ffff,
+// kclrMagenta = 0xff00ff,
+// kclrCyan = 0xffff00,
+ */
+ kclrReserved1 = 0x80000000,
+ kclrReserved2 = 0x80000001,
+ kclrTransparent = 0xc0000000
+} FwTextColor;
+
+
+typedef enum FwSuperscriptVal
+{ kssvOff = 0,
+ kssvSuper = 1,
+ kssvSub = 2
+} FwSuperscriptVal;
+
+
+// Glyph attributes for justification
+typedef enum tagJustGlyphAttr
+{
+ kjgatStretch = 1,
+ kjgatShrink,
+ kjgatWeight,
+ kjgatStep,
+ kjgatChunk,
+ kjgatWidth,
+ kjgatBreak,
+ // pseudo-attributes for handling steps:
+ kjgatStretchInSteps,
+ kjgatWidthInSteps,
+ // also metrics:
+ kjgatAdvWidth,
+ kjgatAdvHeight,
+ kjgatBbLeft,
+ kjgatBbRight,
+ kjgatBbTop,
+ kjgatBbBottom
+} JustGlyphAttr; // Hungarian: jgat
+
+class GrSlotState;
+typedef union {
+ int nValue;
+ GrSlotState *pslot;
+} u_intslot;
+
+/*****
+#undef ATTACH_GUID_TO_CLASS
+#if defined(__cplusplus)
+#define ATTACH_GUID_TO_CLASS(type, guid, cls) \
+ type __declspec(uuid(#guid)) cls;
+#else // !defined(__cplusplus)
+#define ATTACH_GUID_TO_CLASS(type, guid, cls)
+#endif // !defined(__cplusplus)
+
+#ifndef DEFINE_COM_PTR
+#define DEFINE_COM_PTR(cls)
+#endif
+
+#undef GENERIC_DECLARE_SMART_INTERFACE_PTR
+#define GENERIC_DECLARE_SMART_INTERFACE_PTR(cls, iid) \
+ ATTACH_GUID_TO_CLASS(interface, iid, cls); \
+ DEFINE_COM_PTR(cls);
+*****/
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif /* !GRDATA_INCLUDED */
diff --git a/Build/source/libs/graphite/include/graphite/GrDebug.h b/Build/source/libs/graphite/include/graphite/GrDebug.h
new file mode 100644
index 00000000000..dc02fac0134
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrDebug.h
@@ -0,0 +1,200 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: debug.h
+Responsibility:
+Last reviewed:
+
+Description:
+ Assert and debug definitions.
+----------------------------------------------------------------------------------------------*/
+
+#ifndef __DEBUG_H__
+#define __DEBUG_H__
+
+#include <cassert>
+
+namespace gr
+{
+
+#ifdef _DEBUG
+ #undef DEBUG
+ #define DEBUG 1
+ #undef NDEBUG
+ #define DEFINE_THIS_FILE static char THIS_FILE[] = __FILE__;
+ #undef THIS_FILE
+ #define THIS_FILE __FILE__
+#else //!_DEBUG
+ #undef DEBUG
+ #define DEFINE_THIS_FILE
+
+ //#define Debug(foo)
+#endif //!_DEBUG
+
+#if 0
+//#ifdef DEBUG
+
+//#include <windows.h>
+
+ typedef void (WINAPI * Pfn_Assert)(const char * pszExp, const char * pszFile, int nLine,
+ HMODULE hmod);
+ typedef Pfn_Assert Pfn_Warn;
+
+ /*__declspec(dllimport)*/ void WINAPI WarnProc(const char * pszExp, const char * pszFile,
+ int nLine, bool fCritical, HMODULE hmod);
+ /*__declspec(dllimport)*/ void WINAPI AssertProc(const char * pszExp, const char * pszFile,
+ int nLine, bool fCritical, HMODULE hmod);
+
+ __declspec(dllimport) Pfn_Assert WINAPI SetAssertProc(Pfn_Assert pfnAssert);
+ __declspec(dllimport) Pfn_Warn WINAPI SetWarnProc(Pfn_Warn pfnWarn);
+ __declspec(dllimport) int WINAPI HideWarnings(bool f);
+ __declspec(dllimport) int WINAPI HideAsserts(bool f);
+ __declspec(dllimport) int WINAPI HideErrors(bool f);
+
+ void WINAPI WarnHrProc(HRESULT hr, const char * pszFile, int nLine, bool fCritical);
+ void WINAPI WarnProcLocal(const char * pszExp, const char * pszFile, int nLine,
+ bool fCritical);
+ void WINAPI AssertProcLocal(const char * pszExp, const char * pszFile, int nLine,
+ bool fCritical);
+
+ #define Assert(exp) ((exp) || (AssertProcLocal(#exp, THIS_FILE, __LINE__, false), 0))
+ #define AssertC(exp) ((exp) || (AssertProcLocal(#exp, THIS_FILE, __LINE__, true), 0))
+ #define AssertMsg(exp, msg) ((exp) || (AssertProcLocal(msg, THIS_FILE, __LINE__, false), 0))
+ #define AssertMsgC(exp, msg) ((exp) || (AssertProcLocal(msg, THIS_FILE, __LINE__, true), 0))
+
+ #undef Warn
+ #define Warn(psz) (void)(WarnProcLocal(psz, THIS_FILE, __LINE__, false))
+ #define WarnC(psz) (void)(WarnProcLocal(psz, THIS_FILE, __LINE__, true))
+
+ #undef WarnIf
+ #define WarnIf(exp) (void)(!(exp) || (WarnProcLocal("(" #exp ") is true", THIS_FILE, \
+ __LINE__, false), 0))
+ #define WarnIfC(exp) (void)(!(exp) || (WarnProcLocal("(" #exp ") is true", THIS_FILE, \
+ __LINE__, true), 0))
+
+ #undef WarnUnless
+ #define WarnUnless(exp) (void)((exp) || (WarnProcLocal("(" #exp ") is false", \
+ THIS_FILE, __LINE__, false), 0))
+ #define WarnUnlessC(exp) (void)((exp) || (WarnProcLocal("(" #exp ") is false", \
+ THIS_FILE, __LINE__, true), 0))
+
+ #undef WarnHr
+ #define WarnHr(hr) ((SUCCEEDED(hr) || (WarnHrProc(hr, THIS_FILE, __LINE__, false), 0)), \
+ (hr))
+ #define WarnHrC(hr) ((SUCCEEDED(hr) || (WarnHrProc(hr, THIS_FILE, __LINE__, true), 0)), \
+ (hr))
+
+ class IgnoreWarnings
+ {
+ public:
+ IgnoreWarnings()
+ { HideWarnings(true); }
+ ~IgnoreWarnings()
+ { HideWarnings(false); }
+ };
+
+ class IgnoreAsserts
+ {
+ public:
+ IgnoreAsserts()
+ { HideAsserts(true); }
+ ~IgnoreAsserts()
+ { HideAsserts(false); }
+ };
+
+ class IgnoreErrors
+ {
+ private:
+ IgnoreWarnings iw;
+ IgnoreAsserts ia;
+ };
+
+ #define Debug(exp) exp
+ #define DoAssert(exp) Assert(exp)
+ #define DoAssertC(exp) AssertC(exp)
+ #define DoAssertHr(hr) Assert(SUCCEEDED(hr))
+ #define DoAssertHrC(hr) AssertC(SUCCEEDED(hr))
+#else
+ #define Assert(exp) assert(exp)
+ #define AssertC(exp)
+ #define AssertMsg(exp, msg)
+ #define AssertMsgC(exp, msg)
+ #define Warn(psz)
+ #define WarnC(psz)
+ #define WarnIf(exp)
+ #define WarnIfC(exp)
+ #define WarnUnless(exp)
+ #define WarnUnlessC(exp)
+ #define WarnHr(hr) (hr)
+ #define WarnHrC(hr) (hr)
+ #define Debug(exp)
+ #define DoAssert(exp) (exp)
+ #define DoAssertC(exp) (exp)
+ #define DoAssertHr(hr) (hr)
+ #define DoAssertHrC(hr) (hr)
+#endif //DEBUG
+
+#define AssertPtr(pv) Assert(ValidReadPtr(pv))
+#define AssertPtrN(pv) Assert(!(pv) || ValidReadPtr(pv))
+#define AssertArray(pv, cv) Assert((cv) >= 0 && ValidReadPtrSize((pv), isizeof(*(pv)) * (cv)))
+#define AssertArrayN(pv, cv) Assert((cv) >= 0 && (!(pv) || ValidReadPtrSize((pv), isizeof(*(pv)) * (cv))))
+#define AssertPtrSize(pv, cb) Assert((cb) >= 0 && ValidReadPtrSize((pv), cb))
+
+#define AssertPfn(pfn) Assert(!IsBadCodePtr((FARPROC)(pfn)))
+#define AssertPfnN(pfn) Assert(!(pfn) || !IsBadCodePtr((FARPROC)(pfn)))
+
+#define AssertPsz(psz) Assert(ValidPsz(psz))
+#define AssertPszN(psz) Assert(!(psz) || ValidPsz(psz))
+
+#define AssertBstr(bstr) Assert(ValidBstr(bstr))
+#define AssertBstrN(bstr) Assert(!(bstr) || ValidBstr(bstr))
+
+#define AssertObj(pv) Assert(ValidReadPtr(pv) && (pv)->AssertValid())
+#define AssertObjN(pv) Assert(!(pv) || ValidReadPtr(pv) && (pv)->AssertValid())
+
+/*----------------------------------------------------------------------------------------------
+ This class implements custom output to the debugger. The results of Watch() can be
+ viewed on a line in the Watch window. Output() writes to the Debugger Output window.
+ Calls to Output() should be included in the Watch() function as needed. Watch()
+ is executed every time the debugger displays this class in the Watch window.
+ To use it:
+
+ 1) Put the following line in:
+ \program files\Microsoft Visual Studio\Common\MSDev98\bin\AutoExp.dat
+ in the [AutoExpand] section:
+ DebugWatch=<WatchNV(),su>
+
+ 2) In the class from which you want custom debug output, add the equivalent of:
+ #ifdef DEBUG
+ class Dbw1 : public DebugWatch { virtual OLECHAR * Watch(); ... };
+ Dbw1 m_dbw1;
+ #endif //DEBUG
+
+ 3) Implement the Watch() function to display the data you want to see, bracketed by
+ #ifdef DEBUG / #endif. Note that Output() is LIMITED to 10 pointer-sized arguments.
+ If you must have more, then call _CrtDbgReport() directly. Note also that
+ _CrtDbgReport() is not implemented for wide characters, so neither is Output().
+----------------------------------------------------------------------------------------------*/
+#if 0
+//#ifdef DEBUG
+class DebugWatch
+{
+public:
+ int m_nSerial; // increment and display this for positive affirmation of refresh
+ DebugWatch() { m_nSerial = 0; }
+ OLECHAR * WatchNV(); // debugger won't find it if it is virtual or inline.
+ virtual OLECHAR * Watch() { return L"No DebugWatch string implemented"; }
+ void Output (char *fmt, ...); // LIMITED to 10 pointer-sized arguments
+};
+#endif //DEBUG
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif
diff --git a/Build/source/libs/graphite/include/graphite/GrExt.h b/Build/source/libs/graphite/include/graphite/GrExt.h
new file mode 100644
index 00000000000..518683db29e
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrExt.h
@@ -0,0 +1,13 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001, 2003 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrHelperClases.h
+Responsibility: Sharon Correll
+Last reviewed:
+
+ External helper classes to be included in the open-source version of the Graphite DLL.
+ Currently there are none.
+----------------------------------------------------------------------------------------------*/
diff --git a/Build/source/libs/graphite/include/graphite/GrFeature.h b/Build/source/libs/graphite/include/graphite/GrFeature.h
new file mode 100644
index 00000000000..4cc396a11d9
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrFeature.h
@@ -0,0 +1,203 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrFeature.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+
+Note:
+ The body of methods not complete contained in this file are located in GrEngine.cpp.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GR_FEATURE_INCLUDED
+#define GR_FEATURE_INCLUDED
+
+//:End Ignore
+
+#include "GrAppData.h"
+
+namespace gr
+{
+
+
+/*----------------------------------------------------------------------------------------------
+ A valid setting and its UI labels in potentially various languages.
+
+ Hungarian: fset
+----------------------------------------------------------------------------------------------*/
+/****
+class GrFeatureSetting
+{
+ friend class GrFeature;
+public:
+ GrFeatureSetting()
+ {
+ m_hmnstuLabels.Clear();
+ }
+ GrFeatureSetting(GrFeatureSetting & fset)
+ {
+ m_hmnstuLabels.Clear();
+ }
+protected:
+ int m_nVal;
+ HashMap<int, std::wstring> m_hmnstuLabels;
+};
+****/
+
+class GrEngine;
+
+/*----------------------------------------------------------------------------------------------
+ Each Graphite feature defines a way to customize or parameterize the rendering processs.
+
+ Hungarian: feat
+----------------------------------------------------------------------------------------------*/
+class GrFeature
+{
+ //friend class GrFeatureSetting;
+public:
+ enum {
+ knLangFeatV2 = 1
+ };
+
+ GrFeature()
+ {
+ m_vnVal.clear();
+ m_vnNameId.clear();
+ }
+
+ void Initialize(featid nID, int nNameId, int cfset, int nDefault = 0);
+
+ featid ID()
+ {
+ return m_nID;
+ }
+
+ int DefaultValue()
+ {
+ return m_nDefault;
+ }
+
+ void SetDefault(int nDefault)
+ {
+ m_nDefault = nDefault;
+ }
+
+ int NameId()
+ {
+ return m_nNameId;
+ }
+
+ void SetNameId(int n)
+ {
+ m_nNameId = n;
+ }
+
+ int NumberOfSettings()
+ {
+ return (int)m_vnVal.size();
+ }
+
+ int Settings(int cMax, int * prgnVal);
+ void AddSetting(int nVal, int nNameId);
+ bool IsValidSetting(int nVal);
+ std::wstring Label(GrEngine * pgreng, int nLang);
+ std::wstring SettingLabel(GrEngine * pgreng, int nVal, int nLang);
+ int NthSetting(int ifset);
+ std::wstring NthSettingLabel(GrEngine * pgreng, int ifset, int nLang);
+// void SetSettingLabel(int nVal, std::wstring stuLabel, int nLang);
+
+protected:
+ featid m_nID;
+ int m_nDefault;
+ int m_nNameId;
+// HashMap<int, std::wstrng> m_hmnstuLabels;
+
+ // These are parallel arrays. The first gives the setting value for a given feature,
+ // the second gives the index into the name table that is used to read UI strings.
+ std::vector<int> m_vnVal;
+ std::vector<int> m_vnNameId;
+};
+
+
+/*----------------------------------------------------------------------------------------------
+ GrLangTable handles looking up language information.
+ GrEngine has one instance of this class.
+ Hungarian: langtbl
+----------------------------------------------------------------------------------------------*/
+class GrIStream;
+
+class GrLangTable
+{
+ friend class FontMemoryUsage;
+
+public:
+ GrLangTable()
+ {
+ m_prglang = NULL;
+ m_clang = 0;
+ m_prgfset = NULL;
+ }
+ ~GrLangTable()
+ {
+ delete[] m_prglang;
+ delete[] m_prgfset;
+ }
+
+ bool ReadFromFont(GrIStream * pgrstrm, int fxdVersion);
+ void CreateEmpty();
+
+ size_t NumberOfLanguages()
+ {
+ return m_clang;
+ }
+ void LanguageFeatureSettings(isocode lgcode,
+ std::vector<featid> & vnFeatId, std::vector<int> & vnValues);
+ isocode LanguageCode(size_t ilang);
+
+protected:
+ size_t m_clang;
+ // constants for fast binary search of language list
+ data16 m_dilangInit; // (max power of 2 <= m_clang);
+ // size of initial range to consider
+ data16 m_cLoop; // log2(max power of 2 <= m_clang);
+ // indicates how many iterations are necessary
+ data16 m_ilangStart; // m_clang - m_dilangInit;
+ // where to start search
+
+ struct LangEntry
+ {
+ char rgchCode[4];
+ data16 cFeaturesBIG; // big endian
+ data16 cbOffsetBIG; // big endian
+ };
+ LangEntry * m_prglang;
+ int m_cbOffset0; // offset of first entry
+
+ struct FeatSet
+ {
+ featid featidBIG; // big endian
+ data16 valueBIG; // big endian
+ data16 padBIG;
+ };
+ FeatSet * m_prgfset;
+ int m_cfset; // needed for memory instrumentation only
+
+ int FindIndex(isocode lgcode);
+};
+
+} // namespace gr
+
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+
+#endif // !GR_FEATURE_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/GrMstypes.h b/Build/source/libs/graphite/include/graphite/GrMstypes.h
new file mode 100644
index 00000000000..2fc9f108009
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrMstypes.h
@@ -0,0 +1,40 @@
+#ifndef _MSTYPES_H
+#define _MSTYPES_H
+/********
+This header contains the MS Win32 specific types that are still used
+throughout the Graphite code.
+
+It is intended to allow Graphite to build on non-Win32 platforms.
+
+ **Do NOT include this when building against WIN32**
+
+ TSE - 15/07/2003
+********/
+
+#if defined(_WIN32)
+ #error Do not include this header when building against Win32 APIs
+#else
+
+#if defined(GR_NAMESPACE)
+namespace gr
+{
+#endif
+
+typedef wchar_t OLECHAR;
+
+typedef signed long HRESULT;
+
+inline const long InterlockedIncrement(long *const intr_lck) {
+ return ++*intr_lck;
+}
+
+inline const long InterlockedDecrement(long *const intr_lck) {
+ return --*intr_lck;
+}
+
+#if defined(GR_NAMESPACE)
+}
+#endif
+
+#endif // defined(_WIN32)
+#endif // include guard
diff --git a/Build/source/libs/graphite/include/graphite/GrPlatform.h b/Build/source/libs/graphite/include/graphite/GrPlatform.h
new file mode 100644
index 00000000000..d72abbc6412
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrPlatform.h
@@ -0,0 +1,189 @@
+#ifndef _GR_PLATFORM_H
+#define _GR_PLATFORM_H
+
+/***********************************************************************************************
+ Turn off the goofy warnings for MS VisualStudio.
+***********************************************************************************************/
+#ifdef _MSC_VER
+#pragma warning(disable: 4065) // Switch statement contains default but no case.
+#pragma warning(disable: 4097) // typedef-name 'xxx' used as synonym for class-name 'yyy'.
+#pragma warning(disable: 4100) // unreferenced formal parameter.
+#pragma warning(disable: 4127) // conditional expression is constant
+#pragma warning(disable: 4192) // automatically excluding while importing.
+#pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union.
+#pragma warning(disable: 4290) // exception specification ignored.
+#pragma warning(disable: 4310) // cast truncates constant value.
+#pragma warning(disable: 4355) // 'this' used in base member initializer list.
+#pragma warning(disable: 4505) // unreferenced local function has been removed.
+#pragma warning(disable: 4510) // default constructor could not be generated - caused by
+ // applying ComSmartPtr to a non-interface class.
+#pragma warning(disable: 4511) // copy constructor could not be generated.
+#pragma warning(disable: 4512) // assignment operator could not be generated.
+#pragma warning(disable: 4610) // class 'xxx' can never be instantiated - user defined
+ // constructor required - caused by applying ComSmartPtr to a non-interface class.
+#pragma warning(disable: 4660) // template-class specialization is already instantiated.
+#pragma warning(disable: 4701) // local variable 'xxx' may be used without being initialized.
+ // We would like to keep this warning (4701) enabled but the compiler applies it in
+ // places that are obviously OK.
+#pragma warning(disable: 4702) // unreachable code. We would like to keep this warning (4702)
+ // enabled but the compiler applies it in places that are obviously OK.
+#pragma warning(disable: 4706) // assignment in conditional expression
+#pragma warning(disable: 4710) // not inlined.
+#pragma warning(disable: 4786) // identifier truncated in debug info.
+#pragma warning(disable: 4800) // forcing value to bool 'true' or 'false' (performance warning).
+#endif
+
+
+// Standard headers
+#include <stddef.h>
+
+// Platform headers
+//
+#if defined(_WIN32)
+#include <windows.h>
+#include <tchar.h>
+
+#ifdef SIZEOF_WCHAR_T
+#define SIZEOF_WCHAR_T 2
+#endif
+
+#endif
+
+// Project headers
+#if defined(_WIN32)
+#include <algorithm>
+#endif
+#include <iostream>
+
+
+#if defined(_WIN32)
+// TSE: We need to define std::max and std::min, because VC6.0 seems to omit
+// these from their version of <algorithm> and rely on the macro versions
+// to silently take their place. This breaks the use of the name max in any
+// other scope e.g. as in std::numeric_limits<..>::max().
+
+#undef min
+#undef max
+
+// SJC: Only do this for version 6, otherwise the definitions conflict with the
+// built-in STL definitions, and the compiler really struggles.
+#if _MSC_VER == 1200 // VC version 6
+namespace std
+{
+ template<typename T> inline T max(const T a, const T b) { return a < b ? b : a; }
+ template<typename T> inline T min(const T a, const T b) { return a > b ? b : a; }
+}
+#endif // _MSC_VER == 1200
+//////using std::max; // SJC moved to GrCommon.h
+//////using std::min;
+#endif // _WIN32
+
+
+namespace gr
+{
+
+// Typedefs
+// These are correct for the x86_64 architecture too.
+typedef unsigned char byte;
+typedef unsigned int utf32; // UTF32 encoded Unicode codepoints
+typedef unsigned short int utf16; // UTF16 encoded Unicode codepoints
+typedef unsigned char utf8; // UTF-8 encoded Unicode codepoints
+typedef unsigned short int gid16; // glyph ID
+typedef unsigned int fontTableId32; // ID to pass to getTable()
+
+typedef unsigned char data8;
+typedef unsigned short int data16; // generic 16-bit data
+typedef unsigned int data32; // generic 32-bit data
+typedef signed char sdata8;
+typedef signed short int sdata16; // generic 16-bit data
+typedef signed int sdata32; // generic 32-bit data
+
+#ifndef NO_ASM
+#define NO_ASM
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+// std::_Ios_Openmode isn't defined in the Windows compiler
+#if !defined(_WIN32)
+ typedef std::ios_base::openmode openmode_t;
+#else
+ typedef int openmode_t;
+#endif
+
+/*************************************************************************************
+ Offsets and addresses. AddrOf is useful for taking the address of an object
+ that overloads the & operator.
+*************************************************************************************/
+#if defined(_WIN32)
+#undef offsetof
+#define offsetof(cls,fld) ((int)&((cls *)0)->fld)
+#endif
+
+// #ifndef NO_ASM
+// #define addrsafe_offsetof(cls,fld) reinterpret_cast<int>(AddrOf(((cls *)0)->fld))
+//
+// template<typename T> inline T * AddrOf(T & x) {
+// T * pt;
+// __asm
+// {
+// mov eax,x
+// mov pt,eax
+// }
+// return pt;
+// }
+// #endif
+
+
+inline bool GrIsBadStringPtrW(const utf16 *const pszw, const long)
+{
+ return !pszw;
+}
+
+inline bool GrIsBadStringPtrA(const char *const psza, const long)
+{
+ return !psza;
+}
+
+inline bool GrIsBadReadPtr(const void *const, const unsigned int)
+{
+ return false;
+}
+
+inline bool GrIsBadWritePtr(const void *const, const unsigned int)
+{
+ return false;
+}
+
+
+size_t Platform_UnicodeToANSI(const utf16 * prgchwSrc, size_t cchwSrc, char * prgchsDst, size_t cchsDst);
+size_t Platform_AnsiToUnicode(const char * prgchsSrc, size_t cchsSrc, utf16 * prgchwDst, size_t cchwDst);
+//size_t Platform_UnicodeToANSI(const wchar * prgchwSrc, size_t cchwSrc, char * prgchsDst, size_t cchsDst);
+//size_t Platform_AnsiToUnicode(const char * prgchsSrc, size_t cchsSrc, wchar * prgchwDst, size_t cchwDst);
+size_t Platform_8bitToUnicode(int nCodePage, const char * prgchsSrc, int cchsSrc, utf16 * prgchwDst, int cchwDst);
+
+utf16 *utf16cpy(utf16 *dest, const utf16 *src);
+utf16 *utf16cpy(utf16 *dest, const char *src);
+utf16 *utf16cpy(utf16 *dest, const utf32 *src);
+
+utf16 *utf16ncpy(utf16 *dest, const utf16 *src, size_t n);
+utf16 *utf16ncpy(utf16 *dest, const char *src, size_t n);
+
+#ifdef UTF16DEBUG
+void utf16Output(const utf16 *input);
+#endif
+
+size_t utf16len(const utf16 *s);
+
+int utf16cmp(const utf16 *s1, const utf16 *s2);
+int utf16ncmp(const utf16 *s1, const utf16 *s2, size_t n);
+int utf16cmp(const utf16 *s1, const char *s2);
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif
diff --git a/Build/source/libs/graphite/include/graphite/GrResult.h b/Build/source/libs/graphite/include/graphite/GrResult.h
new file mode 100644
index 00000000000..d2c418dc9df
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrResult.h
@@ -0,0 +1,171 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrResult.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Support for the GrResult and error handling in the Graphite engine. Also argument
+ checking. Much of this is set up to parallel standard COM behavior.
+
+Special Note:
+ This file needs to be used by C files. Please do not use C++ style comments; use
+ ONLY C style comments in this file to make the C compiler happy.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GRRESULT_INCLUDED
+#define GRRESULT_INCLUDED
+
+/*
+//:End Ignore
+ */
+
+
+namespace gr
+{
+
+
+
+/*:>********************************************************************************************/
+/*:> Result flags */
+/*:>********************************************************************************************/
+
+/* These are return values for the main interface methods to indicate various kinds of */
+/* error conditions. To facilitate COM compatibiliy, they match the standard COM HRESULT codes. */
+enum GrResult
+{
+ kresOk = 0, // S_OK
+ kresFalse = 1, // S_FALSE
+ kresFail = 0x80004005L, // E_FAIL
+ kresOutOfMemory = 0x8007000EL, // E_OUTOFMEMORY
+ kresInvalidArg = 0x80000002L, // E_INVALIDARG
+ kresReadFault = 0x80000001L, // STG_E_READFAULT
+ kresUnexpected = 0x80000003L, // E_UNEXPECTED
+ kresNotImpl = 0x80000004L, // E_NOTIMPL
+ kresPointer = 0x80004003L//, // E_POINTER
+};
+
+#define ResultFailed(res) (res != kresOk) /* && res != kresFalse */
+
+#define ResultSucceeded(res) (res == kresOk) /* || res == kresFalse */
+
+enum FontErrorCode
+{
+ kferrOkay,
+ kferrUninitialized,
+ kferrUnknown,
+ kferrFindHeadTable,
+ kferrReadDesignUnits,
+ kferrFindCmapTable,
+ kferrLoadCmapSubtable,
+ kferrCheckCmapSubtable,
+ kferrFindNameTable,
+ kferrLoadSilfTable,
+ kferrLoadFeatTable,
+ kferrLoadGlatTable,
+ kferrLoadGlocTable,
+ kferrReadSilfTable,
+ kferrReadGlocGlatTable,
+ kferrReadFeatTable,
+ kferrBadVersion,
+ kferrSileTableMismatch,
+ kferrReadSillTable
+};
+
+/*:>********************************************************************************************/
+/*:> Error handling */
+/*:>********************************************************************************************/
+/* These are set up as #defines so we can easily adjust them once we know how errors should */
+/* be handled. */
+
+#define ReturnResult(res) return res
+
+#ifdef GR_FW
+#define THROW(res) ThrowInternalError(res)
+#else
+#define THROW(res) throw res
+#endif /* GR_FW */
+
+
+// #if !defined(NDEBUG)
+
+#if (0) // can't get E_POINTER to work so no debugging this way for now
+
+} // namespace gr
+
+#include <iostream>
+
+namespace gr
+{
+
+#define WARN(warning) (std::cerr << __FILE__ << ':' << __LINE__ << ": WARN: " << #warning, warning)
+
+/*:>********************************************************************************************/
+/*:> Argument checking */
+/*:>********************************************************************************************/
+
+#define ChkGrArgPtr(p) \
+{ \
+ AssertPtrN(p); \
+ if (!p) \
+ THROW(E_POINTER); \
+} \
+
+#define ChkGrOutPtr(p) \
+{ \
+ AssertPtrN(p); \
+ if (!p) \
+ THROW(E_POINTER); \
+} \
+
+#define ChkGrArgPtrN(p) \
+ AssertPtrN(p); \
+
+#define ChkGrArrayArg(prgv, cv) \
+{ \
+ AssertArray(prgv, cv); \
+ if (cv && !prgv) \
+ THROW(E_POINTER); \
+} \
+
+#define ChkGrBstrArg(bstr) \
+ AssertBstr(bstr); \
+
+#define ChkGrBstrArgN(bstr) \
+ AssertBstrN(bstr); \
+
+#else // debugging is off
+
+#define WARN(warning) (warning)
+
+/*:>********************************************************************************************/
+/*:> Argument checking */
+/*:>********************************************************************************************/
+
+#define ChkGrArgPtr(p) (static_cast<void>(0))
+
+#define ChkGrOutPtr(p) (static_cast<void>(0))
+
+#define ChkGrArgPtrN(p) (static_cast<void>(0))
+
+#define ChkGrArrayArg(prgv, cv) (static_cast<void>(0))
+
+#define ChkGrBstrArg(bstr) (static_cast<void>(0))
+
+#define ChkGrBstrArgN(bstr) (static_cast<void>(0))
+
+#endif // !defined(NDEBUG)
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif /* !GRRESULT_INCLUDED */
diff --git a/Build/source/libs/graphite/include/graphite/GrStructs.h b/Build/source/libs/graphite/include/graphite/GrStructs.h
new file mode 100644
index 00000000000..a1c9debe238
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrStructs.h
@@ -0,0 +1,97 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrStructs.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Copyright (C) 1999 by SIL International. All rights reserved.
+
+Description:
+ Cross-platform structure definitions.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GRSTRUCTS_INCLUDED
+#define GRSTRUCTS_INCLUDED
+#include "GrPlatform.h"
+
+namespace gr
+{
+
+//:End Ignore
+
+typedef struct tagGrCharProps
+{
+ unsigned long clrFore;
+ unsigned long clrBack;
+ int dympOffset;
+ int ws;
+ int ows;
+ byte fWsRtl;
+ int nDirDepth;
+ byte ssv;
+ byte ttvBold;
+ byte ttvItalic;
+ int dympHeight;
+ wchar_t szFaceName[ 32 ];
+ wchar_t szFontVar[ 64 ];
+} GrCharProps;
+
+// Used to pass feature information among the Graphite engine and the application.
+typedef struct tagFeatureSetting
+{
+ int id;
+ int value;
+} FeatureSetting;
+
+/*****
+struct Point
+{
+ float x;
+ float y;
+
+ Point()
+ {
+ x = y = 0;
+ }
+
+ Point(POINT & p)
+ {
+ x = (float)p.x;
+ y = (float)p.y;
+ }
+};
+
+
+struct Rect
+{
+ float top;
+ float bottom;
+ float left;
+ float right;
+
+ Rect()
+ {
+ top = bottom = left = right = 0;
+ };
+
+ Rect(RECT & r)
+ {
+ top = (float)r.top;
+ bottom = (float)r.bottom;
+ left = (float)r.left;
+ right = (float)r.right;
+ };
+};
+****/
+
+} // namespace gr
+
+
+#endif // !STRUCTS_INCLUDED
+
diff --git a/Build/source/libs/graphite/include/graphite/GrWrappers.h b/Build/source/libs/graphite/include/graphite/GrWrappers.h
new file mode 100644
index 00000000000..077b4695d80
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GrWrappers.h
@@ -0,0 +1,13 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001, 2003 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrWrapperClases.h
+Responsibility: Sharon Correll
+Last reviewed:
+
+ Wrapper classes to be included in the open-source version of the Graphite DLL.
+ Currently there are none.
+----------------------------------------------------------------------------------------------*/
diff --git a/Build/source/libs/graphite/include/graphite/GraphiteProcess.h b/Build/source/libs/graphite/include/graphite/GraphiteProcess.h
new file mode 100644
index 00000000000..60f81860c2e
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/GraphiteProcess.h
@@ -0,0 +1,45 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GraphiteProcess.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ The interface that is needed for the Justifier object to call back to the Graphite engine.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GRAPHITEPROCESS_INCLUDED
+#define GRAPHITEPROCESS_INCLUDED
+
+#include "GrResult.h"
+//:End Ignore
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+
+ Hungarian: fgje
+----------------------------------------------------------------------------------------------*/
+class GraphiteProcess
+{
+public:
+ virtual ~GraphiteProcess() {};
+ virtual GrResult getGlyphAttribute(int iGlyph, int jgat, int nLevel, float * pValueRet) = 0;
+ virtual GrResult getGlyphAttribute(int iGlyph, int jgat, int nLevel, int * pValueRet) = 0;
+ virtual GrResult setGlyphAttribute(int iGlyph, int jgat, int nLevel, float value) = 0;
+ virtual GrResult setGlyphAttribute(int iGlyph, int jgat, int nLevel, int value) = 0;
+};
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !IGR_JENGINE_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/HashMap.h b/Build/source/libs/graphite/include/graphite/HashMap.h
new file mode 100644
index 00000000000..aa925ac608d
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/HashMap.h
@@ -0,0 +1,328 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: HashMap.h
+Responsibility: Steve McConnel
+Last reviewed: Not yet.
+
+Description:
+ This provides a set of template collection classes to replace std::map. Their primary
+ reason to exist is to allow explicit checking for internal memory allocation failures.
+----------------------------------------------------------------------------------------------*/
+#pragma once
+#ifndef HASHMAP_H_INCLUDED
+#define HASHMAP_H_INCLUDED
+//:End Ignore
+
+/*----------------------------------------------------------------------------------------------
+ Functor class for computing a hash value from an arbitrary object.
+
+ Hungarian: hsho
+----------------------------------------------------------------------------------------------*/
+class HashObj
+{
+public:
+ int operator () (void * pKey, int cbKey);
+};
+
+/*----------------------------------------------------------------------------------------------
+ Functor class for comparing two arbitrary objects (of the same class) for equality.
+
+ Hungarian: eqlo
+----------------------------------------------------------------------------------------------*/
+class EqlObj
+{
+public:
+ bool operator () (void * pKey1, void * pKey2, int cbKey);
+};
+
+/*----------------------------------------------------------------------------------------------
+ Hash map template collection class whose keys are objects of an arbitrary class.
+
+ Hungarian: hm[K][T]
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H = HashObj, class Eq = EqlObj> class HashMap
+{
+public:
+ //:> Member classes
+
+ /*------------------------------------------------------------------------------------------
+ This is the basic data structure for storing one key-value pair in a hash map. In
+ order to handle hash collisions, this structure is a member of a linked list.
+ Hungarian: hsnd
+ ------------------------------------------------------------------------------------------*/
+ class HashNode
+ {
+ public:
+ //:> Constructors/destructors/etc.
+
+ HashNode(void)
+ : m_key(K()), m_value(T()), m_nHash(0), m_ihsndNext(0)
+ {
+ }
+ HashNode(K & key, T & value, int nHash, int ihsndNext = -1)
+ : m_key(key), m_value(value), m_nHash(nHash), m_ihsndNext(ihsndNext)
+ {
+ }
+ ~HashNode()
+ {
+ }
+
+ //:> Member variable access
+
+ void PutKey(K & key)
+ {
+ m_key = key;
+ }
+ K & GetKey()
+ {
+ return m_key;
+ }
+ void PutValue(T & value)
+ {
+ m_value = value;
+ }
+ T & GetValue()
+ {
+ return m_value;
+ }
+ void PutHash(int nHash)
+ {
+ m_nHash = nHash;
+ }
+ int GetHash()
+ {
+ return m_nHash;
+ }
+ void PutNext(int ihsndNext)
+ {
+ m_ihsndNext = ihsndNext;
+ }
+ int GetNext()
+ {
+ return m_ihsndNext;
+ }
+
+ /*--------------------------------------------------------------------------------------
+ Check whether the given HashNode is being used.
+ --------------------------------------------------------------------------------------*/
+ bool InUse()
+ {
+ return m_ihsndNext >= -1;
+ }
+
+ protected:
+ //:> Member variables
+
+ K m_key;
+ T m_value;
+ int m_nHash;
+ int m_ihsndNext; // -1 means end of list, -(ihsnd + 3) for free list members
+ };
+
+ /*------------------------------------------------------------------------------------------
+ This provides an iterator for stepping through all HashNodes stored in the hash map.
+ This is useful primarily for saving the contents of a hash map to a file.
+
+ Hungarian: ithm[K][T]
+ ------------------------------------------------------------------------------------------*/
+ class iterator
+ {
+ public:
+ // Constructors/destructors/etc.
+
+ iterator() : m_phmParent(0), m_ihsnd(0)
+ {
+ }
+ iterator(HashMap<K,T,H,Eq> * phm, int ihsnd) : m_phmParent(phm), m_ihsnd(ihsnd)
+ {
+ }
+ iterator(const iterator & v) : m_phmParent(v.m_phmParent), m_ihsnd(v.m_ihsnd)
+ {
+ }
+ ~iterator()
+ {
+ }
+
+ // Other public methods
+
+ iterator & operator = (const iterator & ithm)
+ {
+ m_phmParent = ithm.m_phmParent;
+ m_ihsnd = ithm.m_ihsnd;
+ return *this;
+ }
+ T & operator * (void)
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ return m_phmParent->m_prghsnd[m_ihsnd].GetValue();
+ }
+ HashNode * operator -> (void)
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ return &m_phmParent->m_prghsnd[m_ihsnd];
+ }
+ iterator & operator ++ (void)
+ {
+ Assert(m_phmParent);
+ ++m_ihsnd;
+ // make sure that this new HashNode is actually in use
+ while (m_ihsnd < m_phmParent->m_ihsndLim)
+ {
+ if (m_phmParent->m_prghsnd[m_ihsnd].InUse())
+ return *this;
+ // skip to the next one and check it
+ ++m_ihsnd;
+ }
+ if (m_ihsnd > m_phmParent->m_ihsndLim)
+ m_ihsnd = m_phmParent->m_ihsndLim;
+ return *this;
+ }
+ bool operator == (const iterator & ithm)
+ {
+ return (m_phmParent == ithm.m_phmParent) && (m_ihsnd == ithm.m_ihsnd);
+ }
+ bool operator != (const iterator & ithm)
+ {
+ return (m_phmParent != ithm.m_phmParent) || (m_ihsnd != ithm.m_ihsnd);
+ }
+ T & GetValue(void)
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ Assert(m_phmParent->m_prghsnd[m_ihsnd].InUse());
+ return m_phmParent->m_prghsnd[m_ihsnd].GetValue();
+ }
+ K & GetKey(void)
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ Assert(m_phmParent->m_prghsnd[m_ihsnd].InUse());
+ return m_phmParent->m_prghsnd[m_ihsnd].GetKey();
+ }
+ int GetHash()
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ Assert(m_phmParent->m_prghsnd[m_ihsnd].InUse());
+ return m_phmParent->m_prghsnd[m_ihsnd].GetHash();
+ }
+ int GetIndex()
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ Assert(m_phmParent->m_prghsnd[m_ihsnd].InUse());
+ return m_ihsnd;
+ }
+
+ protected:
+ //:> Member variables
+
+ HashMap<K,T,H,Eq> * m_phmParent;
+ int m_ihsnd;
+ };
+ friend class iterator;
+
+ //:> Constructors/destructors/etc.
+
+ HashMap();
+ ~HashMap();
+ HashMap(HashMap<K,T,H,Eq> & hm);
+
+ //:> Other public methods
+
+ iterator Begin();
+ iterator End();
+ void Insert(K & key, T & value, bool fOverwrite = false, int * pihsndOut = 0);
+ bool Retrieve(K & key, T * pvalueRet);
+ bool Delete(K & key);
+ void Clear();
+ void CopyTo(HashMap<K,T,H,Eq> & hmKT);
+ void CopyTo(HashMap<K,T,H,Eq> * phmKT);
+
+ bool GetIndex(K & key, int * pihsndRet);
+ bool IndexKey(int ihsnd, K * pkeyRet);
+ bool IndexValue(int ihsnd, T * pvalueRet);
+
+ int Size();
+
+ /*------------------------------------------------------------------------------------------
+ The assignment operator allows an entire hashmap to be assigned as the value of another
+ hashmap. It throws an error if it runs out of memory.
+
+ @return a reference to this hashmap. (That is how the assignment operator is defined!)
+
+ @param hm is a reference to the other hashmap.
+ ------------------------------------------------------------------------------------------*/
+ HashMap<K,T,H,Eq> & operator = (HashMap<K,T,H,Eq> & hm)
+ {
+ hm.CopyTo(this);
+ return *this;
+ }
+
+ //:Ignore
+#ifdef DEBUG
+ int _BucketCount();
+ int _EmptyBuckets();
+ int _BucketsUsed();
+ int _FullestBucket();
+ bool AssertValid()
+ {
+ AssertPtrN(m_prgihsndBuckets);
+ Assert(m_prgihsndBuckets || !m_cBuckets);
+ Assert(!m_prgihsndBuckets || m_cBuckets);
+ AssertArray(m_prgihsndBuckets, m_cBuckets);
+ AssertPtrN(m_prghsnd);
+ Assert(m_prghsnd || !m_ihsndMax);
+ Assert(!m_prghsnd || m_ihsndMax);
+ AssertArray(m_prghsnd, m_ihsndMax);
+ Assert(0 <= m_ihsndLim && m_ihsndLim <= m_ihsndMax);
+ Assert(-1 <= FreeListIdx(m_ihsndFirstFree));
+ Assert(FreeListIdx(m_ihsndFirstFree) < m_ihsndLim);
+ return true;
+ }
+#endif
+ //:End Ignore
+
+protected:
+ //:> Member variables
+
+ int * m_prgihsndBuckets;
+ int m_cBuckets;
+ HashNode * m_prghsnd;
+ int m_ihsndLim;
+ int m_ihsndMax;
+ int m_ihsndFirstFree; // stores -(ihsnd + 3)
+
+ //:> Protected methods
+ //:Ignore
+
+ /*------------------------------------------------------------------------------------------
+ Map between real index and "free list" index. Note that this mapping is bidirectional.
+ ------------------------------------------------------------------------------------------*/
+ int FreeListIdx(int ihsnd)
+ {
+ return -(ihsnd + 3);
+ }
+ //:End Ignore
+};
+
+
+// Local Variables:
+// mode:C++
+// c-file-style:"cellar"
+// tab-width:4
+// End:
+
+#endif /*HASHMAP_H_INCLUDED*/
diff --git a/Build/source/libs/graphite/include/graphite/IGrEngine.h b/Build/source/libs/graphite/include/graphite/IGrEngine.h
new file mode 100644
index 00000000000..481cb534b46
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/IGrEngine.h
@@ -0,0 +1,36 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2003 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+NU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: IGrEngine.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ A very minimal interface representing the Graphite engine, for passing to the
+ GrJustifier.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef IGRENG_INCLUDED
+#define IGRENG_INCLUDED
+
+namespace gr
+{
+/*----------------------------------------------------------------------------------------------
+ Class: IGrEngine
+----------------------------------------------------------------------------------------------*/
+class IGrEngine
+{
+};
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !IGRENG_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/IGrJustifier.h b/Build/source/libs/graphite/include/graphite/IGrJustifier.h
new file mode 100644
index 00000000000..a9ba6e51c07
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/IGrJustifier.h
@@ -0,0 +1,58 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2003 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: IGrJustifier.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ An interface for a justification agent that is used by the Graphite engine.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef IGRJUSTIFIER_INCLUDED
+#define IGRJUSTIFIER_INCLUDED
+
+#include "GrResult.h"
+
+namespace gr
+{
+
+class GraphiteProcess;
+
+/*----------------------------------------------------------------------------------------------
+ Class: IGrJustifier
+ This class provides an interface for a justification agent for the Graphite engine.
+----------------------------------------------------------------------------------------------*/
+class IGrJustifier
+{
+public:
+ virtual ~IGrJustifier() {};
+ virtual GrResult adjustGlyphWidths(GraphiteProcess * pgje, int iGlyphMin, int iGlyphLim,
+ float dxCurrWidth, float dxDesiredWidth) = 0;
+
+ //virtual GrResult suggestShrinkAndBreak(GraphiteProcess * pfgjwe,
+ // int iGlyphMin, int iGlyphLim, float dxsWidth, LgLineBreak lbPref, LgLineBreak lbMax,
+ // float * pdxShrink, LgLineBreak * plbToTry) = 0;
+
+ // Return a Graphite-compatible justifier that can be stored in a Graphite segment.
+ // TODO: remove
+ //virtual void JustifierObject(IGrJustifier ** ppgjus) = 0;
+
+ // When a segment is being destroyed, delete this object, which is the wrapper for the
+ // text source inside of it.
+ // TODO: remove
+ //virtual void DeleteJustifierPtr() = 0;
+};
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !IGRJUSTIFIER_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/IGraphiteProcess.h b/Build/source/libs/graphite/include/graphite/IGraphiteProcess.h
new file mode 100644
index 00000000000..ee84a94cdb1
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/IGraphiteProcess.h
@@ -0,0 +1,44 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GraphiteProcess.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ The interface that is needed for the Justifier object to call back to the Graphite engine.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef IGRAPHITEPROCESS_INCLUDED
+#define IGRAPHITEPROCESS_INCLUDED
+
+#include "GrResult.h"
+//:End Ignore
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+
+ Hungarian: fgje
+----------------------------------------------------------------------------------------------*/
+class GraphiteProcess
+{
+public:
+ virtual GrResult GetGlyphAttribute(int iGlyph, int jgat, int nLevel, float * pValueRet) = 0;
+ virtual GrResult GetGlyphAttribute(int iGlyph, int jgat, int nLevel, int * pValueRet) = 0;
+ virtual GrResult SetGlyphAttribute(int iGlyph, int jgat, int nLevel, float value) = 0;
+ virtual GrResult SetGlyphAttribute(int iGlyph, int jgat, int nLevel, int value) = 0;
+};
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !IGR_JENGINE_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/ITextSource.h b/Build/source/libs/graphite/include/graphite/ITextSource.h
new file mode 100644
index 00000000000..154d80296e3
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/ITextSource.h
@@ -0,0 +1,69 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: ITextSource.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ An interface for a text source that is used by the Graphite engine.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef IGRTXTSRC_INCLUDED
+#define IGRTXTSRC_INCLUDED
+
+
+#include "GrAppData.h"
+#include "GrStructs.h"
+#include "GrResult.h"
+
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+ Class: ITextSource
+ This class provides an interface for a text source for the Graphite engine.
+----------------------------------------------------------------------------------------------*/
+class ITextSource
+{
+public:
+ virtual ~ITextSource() {};
+ virtual UtfType utfEncodingForm() = 0;
+ virtual size_t getLength() = 0;
+ virtual size_t fetch(toffset ichMin, size_t cch, utf32 * prgchBuffer) = 0;
+ virtual size_t fetch(toffset ichMin, size_t cch, utf16 * prgchwBuffer) = 0;
+ virtual size_t fetch(toffset ichMin, size_t cch, utf8 * prgchsBuffer) = 0;
+ virtual bool getRightToLeft(toffset ich) = 0;
+ virtual unsigned int getDirectionDepth(toffset ich) = 0;
+ virtual float getVerticalOffset(toffset ich) = 0;
+ virtual isocode getLanguage(toffset ich) = 0;
+
+ virtual std::pair<toffset, toffset> propertyRange(toffset ich) = 0;
+ virtual size_t getFontFeatures(toffset ich, FeatureSetting * prgfset) = 0;
+ virtual bool sameSegment(toffset ich1, toffset ich2) = 0;
+};
+
+
+/*----------------------------------------------------------------------------------------------
+ Class: IColorTextSource
+ Defines a method to get the color informtion from the text source.
+ It is needed for SegmentPainters that want to handle color.
+----------------------------------------------------------------------------------------------*/
+class IColorTextSource : public ITextSource
+{
+public:
+ virtual void getColors(toffset ich, int * pclrFore, int * pclrBack) = 0;
+};
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !IGRTXTSRC_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/MemoryUsage.h b/Build/source/libs/graphite/include/graphite/MemoryUsage.h
new file mode 100644
index 00000000000..d59ff165f75
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/MemoryUsage.h
@@ -0,0 +1,156 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2007 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: MemoryUsage.h
+Responsibility: Sharon Correll
+Last reviewed: not yet
+
+Description:
+ Data structures to hold the calculations for memory usage.
+----------------------------------------------------------------------------------------------*/
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef MEMORYUSAGE_INCLUDED
+#define MEMORYUSAGE_INCLUDED
+
+//:End Ignore
+
+
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+ A data structure that holds information about the memory usage for font/engine objects
+----------------------------------------------------------------------------------------------*/
+class FontMemoryUsage
+{
+ friend class FontCache;
+ friend class FontFace;
+
+public:
+ FontMemoryUsage()
+ {
+ initialize();
+ }
+ void addEngine(GrEngine * pgreng);
+ void prettyPrint(std::ostream & strm);
+
+protected:
+ // member variables:
+ std::vector<size_t> vFontTotalsReg;
+ std::vector<size_t> vFontTotalsBold;
+ std::vector<size_t> vFontTotalsItalic;
+ std::vector<size_t> vFontTotalsBI;
+ std::vector<std::string> vstrFontNames;
+ std::vector<size_t> vFaceCount;
+
+ size_t font;
+ size_t fontCache;
+ size_t fontFace;
+
+ size_t eng_count;
+ size_t eng_overhead;
+ size_t eng_scalars;
+ size_t eng_strings;
+ size_t eng_pointers;
+ size_t eng_cmap;
+ size_t eng_nameTable;
+
+ size_t pseudoMap;
+
+ size_t clstbl_counters;
+ size_t clstbl_offsets;
+ size_t clstbl_glyphList;
+
+ size_t glftbl_general;
+ size_t glftbl_compDefns;
+ size_t glftbl_attrTable;
+ size_t glftbl_attrOffsets;
+
+ size_t lngtbl_general;
+ size_t lngtbl_entries;
+ size_t lngtbl_featureSets;
+
+ size_t tman_general;
+
+ size_t pass_count;
+ size_t pass_general;
+ size_t pass_fsm;
+ size_t pass_ruleExtras;
+ size_t pass_constraintOffsets;
+ size_t pass_constraintCode;
+ size_t pass_actionOffsets;
+ size_t pass_actionCode;
+
+ size_t engst_general;
+ size_t engst_passState;
+
+ size_t sstrm_count;
+ size_t sstrm_general;
+ size_t sstrm_chunkMapsUsed;
+ size_t sstrm_chunkMapsAlloc;
+ size_t sstrm_reprocBuf;
+
+ size_t slot_count;
+ size_t slot_general;
+ size_t slot_abstract;
+ size_t slot_varLenBuf;
+ size_t slot_assocsUsed;
+ size_t slot_assocsAlloc;
+ size_t slot_attachUsed;
+ size_t slot_attachAlloc;
+
+ // methods:
+ void initialize();
+ int total();
+ void add(FontMemoryUsage & fmu);
+};
+
+/*----------------------------------------------------------------------------------------------
+ A data structure that holds information about the memory usage for segment objects.
+----------------------------------------------------------------------------------------------*/
+class SegmentMemoryUsage
+{
+public:
+ SegmentMemoryUsage()
+ {
+ initialize();
+ }
+ void addSegment(Segment & seg);
+ void prettyPrint(std::ostream & strm);
+
+protected:
+ // member variables:
+ size_t seg_count;
+ size_t overhead;
+ size_t pointers;
+ size_t scalars;
+ size_t strings;
+ size_t metrics;
+ size_t associations;
+ size_t init;
+ size_t obsolete;
+
+ size_t slot_count;
+ size_t slot_abstract;
+ size_t slot_varLenBuf;
+ size_t slot_scalars;
+ size_t slot_clusterMembers;
+
+ size_t glyphInfo_count;
+ size_t glyphInfo;
+
+ size_t wastedVector; // allocated space that is not used in vectors
+
+ // methods:
+ void initialize();
+};
+
+} // namespace gr
+
+#endif // !MEMORYUSAGE_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/Segment.h b/Build/source/libs/graphite/include/graphite/Segment.h
new file mode 100644
index 00000000000..41443c27f53
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/Segment.h
@@ -0,0 +1,627 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: Segment.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Defines the class for a Graphite text segment.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GR_SEGMENT_INCLUDED
+#define GR_SEGMENT_INCLUDED
+
+#include "Font.h"
+#include "GrConstants.h"
+#include "SegmentAux.h"
+
+// undo automagic DrawTextA DrawTextW stuff
+// #undef DrawText
+
+//:End Ignore
+
+namespace gr
+{
+class GrEngine;
+class SegmentMemoryUsage;
+
+class IGrJustifier;
+class GrTableManager;
+class GrSlotStream;
+class GrSlotOutput;
+
+/*----------------------------------------------------------------------------------------------
+ A Graphite segment consists of a sequence of well-positioned glyphs all on one line,
+ Each glyph understands its relationship to the underlying text that was used to generate
+ the segment.
+
+ Hungarian: seg
+----------------------------------------------------------------------------------------------*/
+class Segment
+{
+ friend class GrEngine;
+ friend class SegmentPainter;
+ friend class GlyphInfo;
+ friend class GlyphIterator;
+ friend class GlyphSetIterator;
+ friend class SegmentMemoryUsage;
+
+public:
+ // Static methods
+
+ // Constructors, destructors, etc.
+ Segment();
+// Segment(ITextSource * pgts, int ichMin, int ichLim,
+// LineBrk lbStart, LineBrk lbEnd,
+// bool fStartLine, bool fEndLine, bool fWsRtl);
+
+ virtual ~Segment();
+
+ // Basic copy constructor:
+ Segment(Segment & seg);
+
+ // For making modified copies of segments:
+ static Segment * LineContextSegment(Segment & seg, bool fStartLine, bool fEndLine);
+ static Segment * JustifiedSegment(Segment & seg, float xsNewWidth);
+ static Segment * WhiteSpaceSegment(Segment & seg, int newDirDepth);
+
+ static int GetSegmentCount();
+
+public:
+
+ long IncRefCount();
+ long DecRefCount();
+
+ Font & getFont();
+ ITextSource & getText();
+ float advanceWidth();
+ Rect boundingRect();
+
+ bool rightToLeft();
+ bool paraRightToLeft() { return m_fParaRtl; }
+ int directionDepth(bool * pfWeak = NULL);
+ bool setDirectionDepth(int nNewDepth);
+ int startCharacter();
+ int stopCharacter();
+ bool startOfLine();
+ bool endOfLine();
+ bool hasLineBoundaryContext();
+ SegEnd segmentTermination();
+ LineBrk startBreakWeight();
+ LineBrk endBreakWeight();
+ float stretch();
+ float maxStretch();
+ float maxShrink();
+ void setTextSourceOffset(int ichMin)
+ {
+ m_ichwMin = ichMin;
+ }
+
+ //GrResult changeLineEnds(bool fNewStart, bool fNewEnd);
+
+ std::pair<GlyphIterator, GlyphIterator> glyphs();
+ std::pair<GlyphSetIterator, GlyphSetIterator> charToGlyphs(toffset ich);
+
+ // OBSOLETE:
+ GrResult GetCharData(int cchMax, utf16 * prgch, int * pcchRet);
+ GrResult GlyphToChar(int iginf, bool fFirst, int * pich);
+ GrResult GlyphToAllChars(int iginf, int cichMax, int * prgich, int *pcichRet);
+ GrResult CharToGlyph(int ich, bool fFirst, int * pigbb);
+
+ // Not part of FW interface:
+
+ float getRangeWidth(int ichMin, int ichLim,
+ bool fStartLine = true, bool fEndLine = true, bool fSkipSpace = true);
+ int findNextBreakPoint(int ichStart,
+ LineBrk lbPref, LineBrk lbWorst, float dxMaxWidth,
+ float * pdxBreakWidth, bool fStartLine = true, bool fEndLine = true);
+
+ GrResult getUniscribeClusters(
+ int * prgigbb1stOfCluster, int cchMax, int * pcch,
+ bool * pfClusterStart, int cfMax, int * pcf);
+
+ //GrResult GetGlyphsAndPositions(
+ // Rect rsArg, Rect rdArg, int cgidMax, int * pcgidRet, utf16 * prggid,
+ // float * prgxd, float * prgyd, float * prgdxdAdv);
+ //GrResult GetUniscribePositions(
+ // Rect rs, Rect rd, int cgidMax, int * pcgidRet,
+ // float * prgxd, float * prgyd, float * prgdxdAdv);
+ //GrResult GetUniscribeGlyphsAndPositions(
+ // Rect rsArg, Rect rdArg, int cgidMax, int * pcchRet, utf16 * prgchGlyphs,
+ // float * prgxd, float * prgyd, float * prgdxdAdv);
+
+ // Other public methods:
+
+ void Initialize(ITextSource * pgts, int ichMin, int ichLim,
+ LineBrk lbStart, LineBrk lbEnd, SegEnd est,
+ bool fStartLine, bool fEndLine, bool fWsRtl);
+ void DestroyContents();
+ void SwapWith(Segment * pgrseg);
+ void ClearAltEndLineSeg();
+
+ ITextSource * GetString(); // client is responsible to Release()
+
+ // The following three functions handle storing and retrieving information that
+ // allows us to restart a new segment following a line break. This is necessary
+ // in case there is some sort of contextualization across the line break.
+ void StoreRestartInfo(int cslotRestartBackup, std::vector<int>& vnSkipOffsets)
+ {
+ m_cslotRestartBackup = cslotRestartBackup;
+ m_vnSkipOffsets.resize(vnSkipOffsets.size());
+ for (size_t i = 0; i < vnSkipOffsets.size(); i++)
+ m_vnSkipOffsets[i] = sdata8(vnSkipOffsets[i]);
+ }
+ int NextRestartBackup()
+ {
+ return m_cslotRestartBackup;
+ }
+ int RestartBackup()
+ {
+ //return (m_psegPrev)? m_psegPrev->NextRestartBackup(): 0;
+ return 0;
+ }
+ int SkipOffset(int ipass)
+ {
+ return int(m_vnSkipOffsets[ipass]);
+ }
+ DirCode PreviousStrongDir()
+ {
+ return m_dircPrevStrong;
+ }
+ void SetPreviousStrongDir(DirCode dirc)
+ {
+ m_dircPrevStrong = dirc;
+ }
+ DirCode PreviousTermDir()
+ {
+ return m_dircPrevTerm;
+ }
+ void SetPreviousTermDir(DirCode dirc)
+ {
+ m_dircPrevTerm = dirc;
+ }
+
+ int NextSegInitBuffer(byte ** ppbDat)
+ {
+ *ppbDat = m_prgbNextSegDat;
+ return m_cbNextSegDat;
+ }
+ int ThisSegInitBuffer(byte ** ppbDat)
+ {
+ *ppbDat = m_prgInitDat;
+ return m_cbInitDat;
+ }
+
+// void SetNextSeg(Segment * psegNext)
+// {
+// m_psegNext = psegNext;
+// }
+
+ void SetFaceName(std::wstring stu, std::wstring stuBase)
+ {
+// m_stuFaceName = stu;
+// m_stuBaseFaceName = stuBase;
+// m_fUseSepBase = (m_stuBaseFaceName.size() > 0);
+ }
+
+ void SetEngine(GrEngine * pgreng);
+ void SetFont(Font * pfont);
+ void SwitchFont(Font * pfont);
+ GrEngine * EngineImpl();
+
+ void SetJustifier(IGrJustifier * pgjus);
+ IGrJustifier * Justifier()
+ {
+ return m_pgjus;
+ }
+
+ void SetPreContext(int dich)
+ {
+ m_dichPreContext = dich;
+ }
+
+ //void SetToBaseFont(IGrGraphics * pgg);
+ //void RestoreFont(IGrGraphics * pgg);
+
+ void SetUpOutputArrays(Font * pfont, GrTableManager * ptm,
+ GrSlotStream * psstrmFinal,
+ int cchwUnderlying, int csloutSurface, gid16 chwLB,
+ TrWsHandling twsh, bool fParaRtl, int nDirDepth,
+ bool fEmpty = false);
+ void RecordSurfaceAssoc(int ichw, int islot, int nDir);
+ void RecordLigature(int ichwUnder, int islotSurface, int iComponent);
+ void AdjustForOverlapsWithPrevSeg();
+ void MarkSlotInPrevSeg(int ichw, int islot);
+ void MarkSlotInNextSeg(int ichw, int islot);
+
+ void CleanUpAssocsVectors()
+ {
+ for (int iv = 0; iv < m_ichwAssocsLim - m_ichwAssocsMin; iv++)
+ {
+ std::vector<int> * pvislout = m_prgpvisloutAssocs[iv];
+ if (pvislout->size() <= 1)
+ {
+ delete pvislout;
+ *(m_prgpvisloutAssocs + iv) = NULL;
+ }
+ }
+ }
+
+ GrSlotOutput * OutputSlot(int islout);
+
+ void RecordInitializationForNextSeg(int cbNextSegDat, byte * pbNextSegDat)
+ {
+ m_cbNextSegDat = cbNextSegDat;
+ m_prgbNextSegDat = new byte[m_cbNextSegDat];
+ std::copy(pbNextSegDat, pbNextSegDat + cbNextSegDat, m_prgbNextSegDat);
+ }
+ void RecordInitializationForThisSeg(int cbDat, byte * pbDat)
+ {
+ m_cbInitDat = cbDat;
+ if (cbDat == 0)
+ m_prgInitDat = NULL;
+ else
+ {
+ m_prgInitDat = new byte[m_cbInitDat];
+ std::copy(pbDat, pbDat + cbDat, m_prgInitDat);
+ }
+ }
+
+ void SetWidths(float dxsVisWidth, float dxsTotalWidth)
+ {
+ m_dxsVisibleWidth = dxsVisWidth;
+ m_dxsTotalWidth = dxsTotalWidth;
+ }
+
+ void SetLayout(LayoutEnvironment & layout)
+ {
+ m_layout.setStartOfLine(layout.startOfLine());
+ m_layout.setEndOfLine(layout.endOfLine());
+ m_layout.setBestBreak(layout.bestBreak());
+ m_layout.setWorstBreak(layout.worstBreak());
+ m_layout.setRightToLeft(layout.rightToLeft());
+ m_layout.setTrailingWs(layout.trailingWs());
+ m_layout.setPrevSegment(layout.prevSegment());
+ m_layout.setJustifier(layout.justifier());
+ m_layout.setLoggingStream(layout.loggingStream());
+ m_layout.setDumbFallback(layout.dumbFallback());
+ }
+ LayoutEnvironment & Layout()
+ {
+ return m_layout;
+ }
+
+ bool Erroneous()
+ {
+ return m_fErroneous;
+ }
+ void SetErroneous(bool f)
+ {
+ m_fErroneous = f;
+ }
+
+ void FixTermination(SegEnd est)
+ {
+ m_est = est;
+ }
+
+ // Convert from em-units to logical units.
+ float EmToLogUnits(int m);
+
+ Rect ComponentRect(GrSlotOutput * pslout, int icomp);
+
+ void ClusterMembersForGlyph(int islout, int disloutCluster, std::vector<int> & visloutRet);
+
+ // for transduction logging:
+ // implementations are empty unless TRACING is defined
+ void LogUnderlyingToSurface(GrTableManager * ptman, std::ostream & strmOut,
+ GrCharStream * pchstrm);
+ void LogSurfaceToUnderlying(GrTableManager * ptman, std::ostream & strmOut);
+ void LogXmlUnderlyingToSurface(std::ostream & strmOut, GrTableManager * ptman,
+ GrCharStream * pchstrm, int nIndent);
+ void LogXmlSurfaceToUnderlying(std::ostream & strmOut, GrTableManager * ptman,
+ GrCharStream * pchstrm, int nIndent);
+
+ // calculate memory usage
+ void calculateMemoryUsage(SegmentMemoryUsage & smu);
+
+protected:
+ // Member variables:
+ long m_cref; // standard COM ref count
+
+ ITextSource * m_pgts; // the string we are a segment of
+ int m_dichwLim; // number of characters officially in this segment
+ int m_ichwMin; // first character relative to the text-source
+
+ Font * m_pfont;
+ GrEngine * m_preneng;
+
+ bool m_fErroneous; // an error occurred in generating this segment
+
+ IGrJustifier * m_pgjus;
+
+ LayoutEnvironment m_layout;
+
+ bool m_fWsRtl; // writing system direction
+ bool m_fParaRtl; // paragraph direction; redundant with layout?
+
+ TrWsHandling m_twsh; // // redundant with layout?
+ int m_nDirDepth; // segment direction (white-space-only segments can switch)
+
+ byte * m_prgbNextSegDat; // for initializing the following segment
+ int m_cbNextSegDat; // length of above buffer
+
+ byte * m_prgInitDat; // what was used to initialize this segment
+ int m_cbInitDat;
+
+ int m_dichPreContext; // what part of this segment affects the previous;
+ // not really used for anything right now
+
+// Segment * m_psegPrev; // OBSOLETE
+// Segment * m_psegNext;
+
+ // Font information:
+// std::wstring m_stuFaceName;
+// std::wstring m_stuBaseFaceName;
+// bool m_fUseSepBase;
+
+// float m_pixHeight; // character height of font in pixels (NOT = ascent + descent)
+// bool m_fBold;
+// bool m_fItalic;
+
+ LineBrk m_lbStart;
+ LineBrk m_lbEnd;
+
+ bool m_fStartLine; // redundant with layout?
+ bool m_fEndLine; // redundant with layout?
+
+ SegEnd m_est;
+
+ //Segment * m_psegAltEndLine; // segment having the alternate m_fEndLine value
+
+ int m_mFontEmUnits;
+ float m_dysFontAscent;
+ float m_dysFontDescent;
+ float m_xysEmSquare; // em-square of the font in display units
+// float m_xsDPI; // DPI of device on which segment was measured
+// float m_ysDPI;
+
+ float m_dxsStretch; // difference between actual and natural width
+ float m_dxsWidth; // width in absence of any stretch. -1 if not computed.
+ float m_dysHeight;
+ float m_dysAscent; // distance from common baseline to top of this segment,
+ // including extra ascent
+
+ float m_dysXAscent; // extra for this renderer, beyond what is standard for the font
+ float m_dysXDescent;
+
+ float m_dysAscentOverhang; // extra height above official top of segment; >= 0
+ float m_dysDescentOverhang; // extra height below bottom of segment; <= 0;
+ float m_dxsLeftOverhang; // <= 0
+ float m_dxsRightOverhang;
+
+ float m_dxsVisibleWidth; // not including trailing white space
+ float m_dxsTotalWidth; // including trailing white space
+
+ int m_isloutVisLim; // lim of visible stuff (to handle trailing ws underlines)
+
+ float m_dysOffset;
+
+ // Index of the first item in the before/after arrays and the ligature/component arrays,
+ // relative to the start of the segment. Normally == 0, but will be some negative number
+ // if there are slots "borrowed" from the previous segment (officially located in the
+ // previous segment but rendered in this one).
+ int m_ichwAssocsMin;
+
+ // 1 + index of last item in the before/after arrays and the ligature/component arrays,
+ // relative to the start of the segment. Normally == m_dichwLim, but will be
+ // larger if there are slots "borrowed" from the following segment.
+ int m_ichwAssocsLim;
+
+ // Underlying-to-surface associations:
+ int * m_prgisloutBefore; // logical first
+ int * m_prgisloutAfter; // logical last
+ std::vector<int> ** m_prgpvisloutAssocs; // all; used by range selections
+
+ int * m_prgisloutLigature; // similar to above, index of associated ligature, or kNegInfinity
+
+ sdata8 * m_prgiComponent; // component of the ligature that the corresponding character
+ // represents; only meaningful if corresponding item in
+ // m_prgisloutLigature is set
+
+// GrSlotStream * m_psstrm; // TODO: rework to remove this
+ int m_cslout;
+ GrSlotOutput * m_prgslout; // final output slots
+ u_intslot * m_prgnSlotVarLenBuf; // var-length buffer for slots--one big buffer managed by the
+ // segment, but pointed to by the slots
+
+// int m_cnUserDefn; // this information is not stored in the segment itself
+ int m_cnCompPerLig;
+// int m_cnFeat; // this information is not stored in the segment itself
+
+ int m_cginf;
+ int m_isloutGinf0; // islout index for m_prgginf[0];
+ GlyphInfo * m_prgginf;
+
+ // Data structures to hold glyphs for rendering:
+////#include "GrSegmentPlatform.h"
+
+ // For initializing the following segment:
+ int m_cslotRestartBackup; // the number of slots in the underlying
+ // input that need to be reprocessed when starting
+ // the next segment
+
+ std::vector<sdata8> m_vnSkipOffsets; // skip offset for each pass when restarting
+
+ DirCode m_dircPrevStrong; // previous strong directionality code
+ DirCode m_dircPrevTerm; // previous terminator code, if any
+
+
+ // Other protected methods:
+
+ void InitLineContextSegment(bool fStartLine, bool fEndLine);
+ void InitWhiteSpaceSegment(int nNewDepth);
+
+ void ComputeDimensions();
+
+ void SetUpGlyphInfo(GrTableManager * ptman, GrSlotStream * psstrmFinal,
+ gid16 chwLB, int nDirDepth, int islotMin, int cslot);
+ void SetUpLigInfo(GrTableManager * ptman, GlyphInfo & ginf, GrSlotOutput * pslout);
+
+ void InitBeforeArrayFromPrevSeg(); // obsolete
+ void AdjustBeforeArrayFromPrevSeg();
+ void AdjustAfterArrayFromNextSeg();
+ void EnsureSpaceAtLineBoundaries(int ichwUnder);
+
+ int LogicalSurfaceToUnderlying(int islout,
+ float xsOffset, float ysOffset,
+ float dxsGlyphWidth = 0, float dysGlyphHeight = 0, bool * pfAfter = NULL);
+ int LogicalSurfaceToUnderlying(int islout, bool fBefore);
+ int PhysicalSurfaceToUnderlying(int iginf,
+ float xsOffset, float xyOffset,
+ float dxsGlyphWidth = 0, float dysGlyphHeight = 0, bool * pfAfter = NULL);
+ int PhysicalSurfaceToUnderlying(int iginf, bool fBefore);
+ int UnderlyingToLogicalSurface(int ichw, bool fBefore);
+ int UnderlyingToPhysicalSurface(int ichw, bool fBefore);
+ int LogicalToPhysicalSurface(int islout);
+ void UnderlyingToPhysicalAssocs(int ichw, std::vector<int> & viginf);
+ std::vector<int> UnderlyingToLogicalAssocs(int ichw);
+ int UnderlyingToLogicalInThisSeg(int ichw);
+ bool SameSurfaceGlyphs(int ichw1, int ichw2);
+
+ void ShiftGlyphs(float dxsShift);
+
+ float GlyphLeftEdge(int iginf);
+
+ int DirLevelOfChar(int ichw, bool fBefore);
+ int CharIsRightToLeft(int ichw, bool fBefore);
+ int SlotIsRightToLeft(GrSlotOutput * pslout);
+ int TopDirLevel()
+ {
+ if (m_fWsRtl)
+ return 1;
+ else
+ return 0;
+ }
+
+ void AssertValidClusters(GrSlotStream * psstrm);
+
+ void MergeUniscribeCluster(
+ std::vector<int> & visloutBefore, std::vector<int> & visloutAfter,
+ int ich1, int ich2);
+
+ int GlyphHit(float xsClick, float ysClick);
+ int SelectBb(std::vector<int> & viginf, bool fRTL);
+
+ int RightMostGlyph();
+ int LeftMostGlyph();
+
+ void ComputeOverhangs(float * pdysVisAscent, float * pdysNegVisDescent,
+ float * pdxsVisLeft, float * pdxsVisRight);
+
+public:
+ LineBrk getBreakWeight(int ich, bool fBreakBefore = false);
+
+ // Platform-specific routines:
+protected:
+ //void ShiftGlyphsPlatform(float dxsShift);
+ //bool SetDirectionDepthPlatform(int nNewDepth);
+
+ //void InitializePlatform();
+ //void DestroyContentsPlatform();
+ //GrResult GetGlyphsAndPositionsPlatform(float xs, float ys,
+ // Rect rsArg, Rect rdArg,
+ // utf16 * prgchGlyphs, float * prgxd, float * prgyd, float * prgdxdAdv);
+ //void SetUpOutputArraysPlatform(GrTableManager * ptman, gid16 chwLB, int nDirDepth,
+ // int islotMin, int cslot);
+
+ // Temporary - for WinSegmentPainter
+public:
+ int CSlout()
+ {
+ return m_cslout;
+ }
+ gid16 LBGlyphID();
+ float AscentOffset()
+ {
+ if (m_dysAscent == -1)
+ ComputeDimensions();
+ return m_dysAscent - m_dysFontAscent;
+ }
+};
+
+
+//:>********************************************************************************************
+//:> The purpose of these subclasses is simply to provide meaningful names for the
+//:> constructors. Instances of these classes are in every way equivalent to Segment.
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Creating a LineFillSegment fits as much of the text on the line as possible,
+ finding a reasonable break point if necessary.
+----------------------------------------------------------------------------------------------*/
+class LineFillSegment : public Segment
+{
+public:
+ LineFillSegment(
+ Font * pfont,
+ ITextSource * pts,
+ LayoutEnvironment * playout,
+ toffset ichStart,
+ toffset ichStop,
+ float maxWidth,
+ bool fBacktracking = false);
+protected:
+ // Default constructor:
+ LineFillSegment() : Segment()
+ {
+ }
+};
+
+/*----------------------------------------------------------------------------------------------
+ Creating a RangeSegment makes a segment representing the given range of characters, or
+ the entire text-source.
+----------------------------------------------------------------------------------------------*/
+class RangeSegment : public Segment
+{
+public:
+ RangeSegment(
+ Font * pfont,
+ ITextSource * pts,
+ LayoutEnvironment * playout,
+ toffset ichStart = 0,
+ toffset ichStop = kPosInfinity,
+ Segment * psegInitLike = NULL);
+};
+
+/*----------------------------------------------------------------------------------------------
+ The JustSegmentAux class is used by the factory method that creates a justified segment.
+ It is called JustSegmentAux to avoid conflicting with the factory method.
+----------------------------------------------------------------------------------------------*/
+class JustSegmentAux : public Segment
+{
+public:
+ JustSegmentAux(
+ Font * pfont,
+ ITextSource * pts,
+ LayoutEnvironment * playout,
+ toffset ichStart,
+ toffset ichStop,
+ float xsNaturalWidth,
+ float xsJustifiedWidth,
+ Segment * psegInitLike = NULL);
+};
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !GR_SEGMENT_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/SegmentAux.h b/Build/source/libs/graphite/include/graphite/SegmentAux.h
new file mode 100644
index 00000000000..293ba291436
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/SegmentAux.h
@@ -0,0 +1,392 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2005 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: SegmentAux.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Auxiliary classes for the Segment class:
+ - GlyphInfo
+ - GlyphIterator
+ - LayoutEnvironment
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef SEGMENTAUX_INCLUDED
+#define SEGMENTAUX_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+class Segment;
+class GrSlotOutput;
+class IGrJustifier;
+class GlyphInfo;
+class GlyphIterator;
+class GlyphSetIterator;
+
+
+/*----------------------------------------------------------------------------------------------
+ The GlyphInfo class provides access to details about a single glyph within a segment.
+----------------------------------------------------------------------------------------------*/
+class GlyphInfo // hungarian: ginf
+{
+ friend class Segment;
+
+public:
+ // Default constructor:
+ GlyphInfo()
+ {
+ m_pseg = NULL;
+ m_pslout = NULL;
+ m_islout = kInvalid;
+ }
+
+ gid16 glyphID();
+ gid16 pseudoGlyphID();
+
+ // Index of this glyph in the logical sequence; zero-based.
+ size_t logicalIndex();
+
+ // glyph's position relative to the left of the segment
+ float origin();
+ float advanceWidth(); // logical units
+ float advanceHeight(); // logical units; zero for horizontal fonts
+ float yOffset();
+ gr::Rect bb(); // logical units
+ bool isSpace();
+
+ // first char associated with this glyph, relative to start of seg
+ toffset firstChar();
+ // last char associated with this glyph, relative to start of seg
+ toffset lastChar();
+
+ // Unicode bidi value
+ unsigned int directionality();
+ // Embedding depth
+ unsigned int directionLevel();
+ bool insertBefore();
+ int breakweight();
+
+ bool isAttached() const throw();
+ gr::GlyphIterator attachedClusterBase() const throw();
+ float attachedClusterAdvance() const throw();
+ std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> attachedClusterGlyphs() const;
+
+ float maxStretch(size_t level);
+ float maxShrink(size_t level);
+ float stretchStep(size_t level);
+ byte justWeight(size_t level);
+ float justWidth(size_t level);
+ float measureStartOfLine();
+ float measureEndOfLine();
+
+ size_t numberOfComponents();
+ gr::Rect componentBox(size_t icomp);
+ toffset componentFirstChar(size_t icomp);
+ toffset componentLastChar(size_t icomp);
+
+ bool erroneous();
+
+ const Segment & segment() const throw();
+ Segment & segment() throw();
+
+protected:
+ Segment * m_pseg;
+ GrSlotOutput * m_pslout;
+ int m_islout; // signed, so it can return kInvalid
+};
+
+inline Segment & GlyphInfo::segment() throw () {
+ return * m_pseg;
+}
+
+inline const Segment & GlyphInfo::segment() const throw () {
+ return * m_pseg;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ The GlyphIterator class allows the Graphite client to iterate over a contiguous
+ range of glyphs for the segment.
+----------------------------------------------------------------------------------------------*/
+class GlyphIterator
+: public std::iterator<std::random_access_iterator_tag, gr::GlyphInfo>
+{
+ friend class GlyphInfo;
+ friend class Segment;
+
+ // Pointers into the glyph info store
+ GlyphInfo * m_pginf;
+
+protected:
+ // Constructor
+ GlyphIterator(Segment & seg, size_t iginf);
+
+public:
+ // Default constructor.
+ GlyphIterator() throw (): m_pginf(0) {}
+
+ explicit GlyphIterator(const GlyphSetIterator &);
+
+ // Forward iterator requirements.
+ reference operator*() const { assert(m_pginf != 0); return *m_pginf; }
+ pointer operator->() const { return m_pginf; }
+ GlyphIterator & operator++() throw() { ++m_pginf; return *this; }
+ GlyphIterator operator++(int) throw() { GlyphIterator tmp = *this; operator++(); return tmp; }
+
+ // Bidirectional iterator requirements
+ GlyphIterator & operator--() throw() { --m_pginf; return *this; }
+ GlyphIterator operator--(int) throw() { GlyphIterator tmp = *this; operator--(); return tmp; }
+
+ // Random access iterator requirements
+ reference operator[](difference_type n) const { return m_pginf[n]; }
+ GlyphIterator & operator+=(difference_type n) throw() { m_pginf += n; return *this; }
+ GlyphIterator operator+(difference_type n) const throw() { GlyphIterator r = *this; return r += n; }
+ GlyphIterator & operator-=(difference_type n) throw() { m_pginf -= n; return *this; }
+ GlyphIterator operator-(difference_type n) const throw() { GlyphIterator r = *this; return r += -n; }
+
+ // Relational operators.
+ // Forward iterator requirements
+ bool operator==(const GlyphIterator & rhs) const throw() { return m_pginf == rhs.m_pginf; }
+ bool operator!=(const GlyphIterator & rhs) const throw() { return !(*this == rhs); }
+
+ // Random access iterator requirements
+ bool operator<(const GlyphIterator & rhs) const throw() { return m_pginf < rhs.m_pginf; }
+ bool operator>(const GlyphIterator & rhs) const throw() { return m_pginf > rhs.m_pginf; }
+ bool operator<=(const GlyphIterator & rhs) const throw() { return !(*this > rhs); }
+ bool operator>=(const GlyphIterator & rhs) const throw() { return !(*this < rhs); }
+
+ difference_type operator-(const GlyphIterator & rhs) const throw() { return m_pginf - rhs.m_pginf; }
+};
+
+inline GlyphIterator operator+(const GlyphIterator::difference_type n, const GlyphIterator & rhs)
+{
+ return rhs + n;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ This reference-counted vector is used as the basis of GlyphSetIterator. This is because
+ multiple iterators are based on the same vector, so it needs to hang around appropriately.
+----------------------------------------------------------------------------------------------*/
+class RcVector
+{
+ friend class GlyphSetIterator;
+
+public:
+ RcVector(std::vector<int> & vn)
+ {
+ m_vn = vn;
+ m_cref = 0;
+ }
+
+protected:
+ void IncRefCount() const
+ {
+ m_cref++;
+ }
+ void DecRefCount() const
+ {
+ m_cref--;
+ if (m_cref <= 0)
+ delete this;
+ }
+
+ const std::vector<int> & Vector() const { return m_vn; };
+
+ // member variables:
+ mutable int m_cref;
+ std::vector<int> m_vn;
+};
+
+/*----------------------------------------------------------------------------------------------
+ The GlyphSetIterator class allows the Graphite client to iterate over a non-contiguous
+ set of glyphs for the segment, this is almost always the set of glyphs for a character.
+----------------------------------------------------------------------------------------------*/
+class GlyphSetIterator
+: public std::iterator<std::random_access_iterator_tag, gr::GlyphInfo>
+{
+ friend class GlyphInfo;
+ friend class Segment;
+
+ // Segment containing the glyphs being iterated over.
+ const Segment * m_pseg;
+
+ // Sometimes, in the case of character-to-glyph look-ups or attached
+ // children, we need to represent a non-contiguous list; in these cases
+ // we first map through a vector of output-slot objects into the actual
+ // glyph-info store.
+ std::vector<int>::const_iterator m_vit;
+
+ // Store a reliable copy of the vector we are iterating over:
+ const RcVector * m_qvislout;
+
+protected:
+ // Constructor that includes output-slot mapping list, used for non-contiguous lists:
+ GlyphSetIterator(Segment & seg, size_t islout, RcVector * qvislout)
+ : m_pseg(&seg), m_vit(qvislout->Vector().begin() + islout)
+ {
+ m_qvislout = qvislout;
+ m_qvislout->IncRefCount();
+ }
+public:
+ // Default constructor--no output-slot mapping:
+ GlyphSetIterator() throw() : m_pseg(0), m_vit(std::vector<int>::const_iterator())
+ {
+ m_qvislout = NULL;
+ }
+
+ // Copy constructor:
+ GlyphSetIterator(const GlyphSetIterator & sit) throw()
+ {
+ m_pseg = sit.m_pseg;
+ m_vit = sit.m_vit;
+ m_qvislout = sit.m_qvislout;
+ if (m_qvislout)
+ m_qvislout->IncRefCount();
+ }
+ // Assignment operator:
+ GlyphSetIterator & operator=(const GlyphSetIterator & sit) throw()
+ {
+ m_pseg = sit.m_pseg;
+ m_vit = sit.m_vit;
+ m_qvislout = sit.m_qvislout;
+ if (m_qvislout)
+ m_qvislout->IncRefCount();
+ return *this;
+ }
+ // Destructor:
+ ~GlyphSetIterator()
+ {
+ if (m_qvislout)
+ m_qvislout->DecRefCount();
+ }
+
+ // Forward iterator requirements.
+ reference operator*() const;
+ pointer operator->() const { return &(operator*()); }
+ GlyphSetIterator & operator++() throw() { ++m_vit; return *this; }
+ GlyphSetIterator operator++(int) throw() { GlyphSetIterator tmp = *this; operator++(); return tmp; }
+
+ // Bidirectional iterator requirements
+ GlyphSetIterator & operator--() throw() { --m_vit; return *this; }
+ GlyphSetIterator operator--(int) throw() { GlyphSetIterator tmp = *this; operator--(); return tmp; }
+
+ // Random access iterator requirements
+ reference operator[](difference_type n) const { return *operator+(n); }
+ GlyphSetIterator & operator+=(difference_type n) throw() { m_vit += n; return *this; }
+ GlyphSetIterator operator+(difference_type n) const throw() { GlyphSetIterator r = *this; return r += n; }
+ GlyphSetIterator & operator-=(difference_type n) throw() { operator+=(-n); return *this; }
+ GlyphSetIterator operator-(difference_type n) const throw() { GlyphSetIterator r = *this; return r += -n; }
+
+ // Relational operators.
+ // Forward iterator requirements
+ bool operator==(const GlyphSetIterator & rhs) const throw() { return m_vit == rhs.m_vit; }
+ bool operator!=(const GlyphSetIterator & rhs) const throw() { return !(*this == rhs); }
+
+ // Random access iterator requirements
+ bool operator<(const GlyphSetIterator & rhs) const throw() { return m_vit < rhs.m_vit; }
+ bool operator>(const GlyphSetIterator & rhs) const throw() { return m_vit > rhs.m_vit; }
+ bool operator<=(const GlyphSetIterator & rhs) const throw() { return !(*this > rhs); }
+ bool operator>=(const GlyphSetIterator & rhs) const throw() { return !(*this < rhs); }
+
+ difference_type operator-(const GlyphSetIterator & rhs) const throw() { return m_vit - rhs.m_vit; }
+};
+
+inline GlyphSetIterator operator+(const GlyphSetIterator::difference_type n, const GlyphSetIterator & rhs)
+{
+ return rhs + n;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ The GlyphInfo class provides access to details about a single glyph within a segment.
+----------------------------------------------------------------------------------------------*/
+class LayoutEnvironment
+{
+public:
+ LayoutEnvironment()
+ {
+ // Defaults:
+ m_fStartOfLine = true;
+ m_fEndOfLine = true;
+ m_lbBest = klbWordBreak;
+ m_lbWorst = klbClipBreak;
+ m_fRightToLeft = false;
+ m_twsh = ktwshAll;
+ m_pstrmLog = NULL;
+ m_fDumbFallback = false;
+ m_psegPrev = NULL;
+ m_psegInit = NULL;
+ m_pjust = NULL;
+ }
+ LayoutEnvironment(LayoutEnvironment & layout)
+ {
+ m_fStartOfLine = layout.m_fStartOfLine;
+ m_fEndOfLine = layout.m_fEndOfLine;
+ m_lbBest = layout.m_lbBest;
+ m_lbWorst = layout.m_lbWorst;
+ m_fRightToLeft = layout.m_fRightToLeft;
+ m_twsh = layout.m_twsh;
+ m_pstrmLog = layout.m_pstrmLog;
+ m_fDumbFallback = layout.m_fDumbFallback;
+ m_psegPrev = layout.m_psegPrev;
+ m_psegInit = layout.m_psegInit;
+ m_pjust = layout.m_pjust;
+ }
+
+ // Setters:
+ inline void setStartOfLine(bool f) { m_fStartOfLine = f; }
+ inline void setEndOfLine(bool f) { m_fEndOfLine = f; }
+ inline void setBestBreak(LineBrk lb) { m_lbBest = lb; }
+ inline void setWorstBreak(LineBrk lb) { m_lbWorst = lb; }
+ inline void setRightToLeft(bool f) { m_fRightToLeft = f; }
+ inline void setTrailingWs(TrWsHandling twsh) { m_twsh = twsh; }
+ inline void setLoggingStream(std::ostream * pstrm) { m_pstrmLog = pstrm; }
+ inline void setDumbFallback(bool f) { m_fDumbFallback = f; }
+ inline void setPrevSegment(Segment * pseg) { m_psegPrev = pseg; }
+ inline void setSegmentForInit(Segment * pseg) { m_psegInit = pseg; }
+ inline void setJustifier(IGrJustifier * pjust) { m_pjust = pjust; }
+
+ // Getters:
+ inline bool startOfLine() { return m_fStartOfLine; }
+ inline bool endOfLine() { return m_fEndOfLine; }
+ inline LineBrk bestBreak() { return m_lbBest; }
+ inline LineBrk worstBreak() { return m_lbWorst; }
+ inline bool rightToLeft() { return m_fRightToLeft; }
+ inline TrWsHandling trailingWs() { return m_twsh; }
+ inline std::ostream * loggingStream() { return m_pstrmLog; }
+ inline bool dumbFallback() { return m_fDumbFallback; }
+ inline Segment * prevSegment() { return m_psegPrev; }
+ inline Segment * segmentForInit() { return m_psegInit; }
+ inline IGrJustifier * justifier() { return m_pjust; }
+
+protected:
+ bool m_fStartOfLine;
+ bool m_fEndOfLine;
+ LineBrk m_lbBest;
+ LineBrk m_lbWorst;
+ bool m_fRightToLeft;
+ TrWsHandling m_twsh;
+ std::ostream * m_pstrmLog;
+ bool m_fDumbFallback;
+ Segment * m_psegPrev;
+ Segment * m_psegInit;
+ IGrJustifier * m_pjust;
+};
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !SEGMENTAUX_INCLUDED
diff --git a/Build/source/libs/graphite/include/graphite/SegmentPainter.h b/Build/source/libs/graphite/include/graphite/SegmentPainter.h
new file mode 100644
index 00000000000..29564a6c63d
--- /dev/null
+++ b/Build/source/libs/graphite/include/graphite/SegmentPainter.h
@@ -0,0 +1,234 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: SegmentPainter.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Defines the class for a Graphite text segment.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GR_SEGPAINTER_INCLUDED
+#define GR_SEGPAINTER_INCLUDED
+
+// undo automagic DrawTextA DrawTextW stuff
+// #undef DrawText
+
+//:End Ignore
+
+
+namespace gr
+{
+
+class Segment;
+
+/*----------------------------------------------------------------------------------------------
+ A SegmentPainter handles the UI-related operations on for segment.
+
+ This superclass does not know how to do any actual drawing, because it has no access
+ to a device. Subclasses are needed to handle drawing on the various platforms. In addition,
+ it is legitimate to make a subclass to override the behavior of a specific piece of
+ functionality.
+
+ Hungarian: segp
+----------------------------------------------------------------------------------------------*/
+class SegmentPainter
+{
+public:
+ // Static methods
+
+ // Constructors/destructors/etc.
+ SegmentPainter(Segment * pseg, float xOrigin = 0, float yOrigin = 0);
+ //SegmentPainter(Segment * pseg, float xOrigin, float yOrigin);
+
+ virtual ~SegmentPainter();
+
+ virtual void setOrigin(float xsOrigin, float ysOrigin);
+ virtual void setPosition(float xdPosition, float ydPosition);
+ virtual void setScalingFactors(float xFactor, float yFactor);
+
+ virtual void setBuggyDisplayFormat(int strategy, long textColor, long backColor,
+ long underlineColor)
+ {
+ // Currently not implemented to do anything useful.
+ }
+
+ // The paint method must be implemented by a concrete subclass:
+ virtual void paint() = 0;
+
+ virtual void drawInsertionPoint(int ichwIP, bool fAssocPrev, bool bOn, bool fForceSplit);
+ virtual void positionsOfIP(int ichwIP, bool fAssocPrev, bool fForceSplit,
+ Rect * prdPrimary, Rect * prdSecondary);
+ virtual bool drawSelectionRange(int ichwMin, int ichwLim,
+ float ydTop, float ydBottom, bool bOn);
+ virtual bool positionsOfRange(int ichwMin, int ichwLim,
+ float ydTop, float ydBottom, Rect * prsBounds);
+ virtual size_t getUnderlinePlacement(int ichwMin, int ichwLim,
+ bool fSkipSpace,
+ size_t crgMax, // number of ranges allowed
+ float * prgxdLefts, float * prgxdRights, float * prgydUnderline);
+
+ virtual void pointToChar(Point zptdClickPosition, int * pichw, bool * pfAssocPrev);
+ virtual LgIpValidResult isValidInsertionPoint(int ichwIP);
+ virtual bool doBoundariesCoincide(bool fBoundaryEnd, bool fBoundaryRight);
+ virtual int arrowKeyPosition(int ichwIP, bool * pfAssocPrev,
+ bool fRight, bool * pfInThisSeg);
+ virtual int extendSelectionPosition(
+ int charIndex, bool assocPrevMatch, bool assocPrevNeeded,
+ int anchorIndex, bool movingRight, bool * inThisSeg);
+
+ // For calculating underlines:
+ struct LineSeg { // hungarian: ls
+ float left;
+ float right;
+ };
+
+ static float ScaleX(float xs, Rect rs, Rect rd);
+ static float ScaleY(float ys, Rect rs, Rect rd);
+
+ float ScaleXToDest(float xs)
+ {
+ float xd = ((xs + m_xsOrigin) * m_xFactor) + m_xdPosition;
+ return xd;
+ }
+ //int ScaleXToDest(int xs)
+ //{
+ // int xd = (((xs + m_xsOriginInt) * m_xFactor64) >> 6) + m_xdPositionInt;
+ // return xd; // >> 6 means div by 64
+ //}
+ float ScaleYToDest(float ys)
+ {
+ float yd = ((ys + m_ysOrigin) * m_yFactor) + m_ydPosition;
+ return yd;
+ }
+
+ float ScaleXToSource(float xd)
+ {
+ float xs = ((xd - m_xdPosition) / m_xFactor) - m_xsOrigin;
+ return xs;
+ }
+ float ScaleYToSource(float yd)
+ {
+ float ys = ((yd - m_ydPosition) / m_yFactor) - m_ysOrigin;
+ return ys;
+ }
+
+protected:
+ // Member variables:
+
+ Segment * m_pseg;
+
+ // transformation factors:
+ float m_xsOrigin;
+ float m_ysOrigin;
+ float m_xdPosition;
+ float m_ydPosition;
+ float m_xFactor; // destination / source
+ float m_yFactor; // destination / source
+
+ // optimizations for when we need integer arithmetic (converting between int and float is
+ // very slow) - DELETE these.
+ //int m_xsOriginInt;
+ //int m_xdPositionInt;
+ //int m_xFactor64;
+
+ //gr::Rect m_rectSrc;
+
+ // Other methods:
+
+ void CalcOrDrawInsertionPoint(
+ int ich, bool fAssocPrev, bool bOn, bool fForceSplit,
+ Rect * prectPrimary, Rect * prectSecondary);
+ void InvertIBeam(float xs, float ysTop, float ysBottom, bool fAssocPrev,
+ Rect * prdRet);
+ void InvertSplitIP(float xs, float ysTop, float ysBottom,
+ bool fTop, bool fAssocRight, bool fSecondary, float ysMinSplitHt,
+ Rect * prdRet);
+ void CalcIP(int ichw, bool fBefore,
+ float * pxs, float * pysTop, float * pysBottom, bool * pfRtl);
+ bool CloseIPPositions(
+ float * pxsBefore, float ysBeforeTop, float ysBeforeBottom,
+ float * pxsAfter, float ysAfterTop, float ysAfterBottom);
+ bool AtEdgeOfCluster(GrSlotOutput * pslout, int islout, bool fBefore);
+ bool AtEdgeOfCluster(GrSlotOutput * psloutBase, int isloutBase,
+ GrSlotOutput * pslout, int islout, bool fBefore);
+ bool CanInsertIntoCluster(GrSlotOutput * pslout, int islout);
+
+ void CalcPartialLigatures(bool * prgfAllSelected,
+ int ichwMinSeg, int ichwLimSeg,
+ int ichwMinSel, int ichwLimSel);
+ void CalcHighlightRect(int ichw,
+ std::vector<Rect> & vrs, std::vector<bool> & vfEntireLineHt,
+ bool fJustComponent, bool * rgfHighlighted, bool fSkipTrSpace);
+ void CalcCompleteCluster(int islout,
+ std::vector<Rect> & vrs, std::vector<bool> & vfEntireLineHt, bool * prgfHighlighted);
+ void AddRectWithoutOverlaps(std::vector<Rect> & vrect, Rect rectToAdd);
+ bool AnyArea(Rect * prect);
+ bool AdjustRectsToNotOverlap(std::vector<Rect> & vrect, int irect, Rect * prect2,
+ std::vector<Rect> & vrectMoreToAdd);
+ void AssertNoOverlaps(std::vector<Rect> & vrect);
+
+ void AddLineSegWithoutOverlaps(std::vector<LineSeg> & vls, LineSeg lsToAdd);
+ bool AnyLength(LineSeg * pls);
+ bool AdjustLineSegsToNotOverlap(std::vector<LineSeg> & vls, int ils, LineSeg * pls2,
+ std::vector<LineSeg> & vlsMoreToAdd);
+ void AssertNoOverlaps(std::vector<LineSeg> & vls);
+
+ GrResult ArrowKeyPositionAux(int * pichwIP, bool * pfAssocPrev,
+ bool fRight, bool fMovingIn,
+ bool fAssocPrevMatch, bool fAssocPrevNeeded,
+ bool * pfResult);
+ bool ArrowKeyPositionInternal(int * pichw, bool * pfAssocPrev,
+ bool fRight, bool fAssocPrevMatch, bool fAssocPrevNeeded, int * nNextOrPrevSeg);
+ bool AdjacentLigComponent(int * pichw, bool * pfAssocPrev, bool fRight, bool fMove);
+
+ int PointToCharAux(float xsTry, float ysTry,
+ float * pxsGlyphOffset, float * pxsGlyphWidth);
+
+ // Platform-specific routines:
+
+ GrResult DrawSegmentPlatform(float xs, float ys);
+
+ // Low-level routines--these must be implemented appropriate by subclasses:
+
+ virtual void InvertRect(float xLeft, float yTop, float xRight, float yBottom)
+ {
+ GrAssert(false); // no device context
+ }
+
+ //void SetFontProps();
+ virtual void SetFontProps(unsigned long clrFore, unsigned long clrBack);
+
+};
+
+/*----------------------------------------------------------------------------------------------
+ This is a subclass of SegmentPainter for which the paint operation is unnecessary.
+----------------------------------------------------------------------------------------------*/
+class SegmentNonPainter : public SegmentPainter
+{
+public:
+ SegmentNonPainter(Segment * pseg)
+ : SegmentPainter(pseg)
+ {
+ }
+
+ void paint()
+ {
+ GrAssert(false);
+ throw;
+ }
+};
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !GR_SEGPAINTER_INCLUDED
diff --git a/Build/source/libs/graphite/installed-top.pc.in b/Build/source/libs/graphite/installed-top.pc.in
new file mode 100644
index 00000000000..7609afda4e4
--- /dev/null
+++ b/Build/source/libs/graphite/installed-top.pc.in
@@ -0,0 +1,5 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+version=@VERSION@
diff --git a/Build/source/libs/graphite/license/LICENSING.txt b/Build/source/libs/graphite/license/LICENSING.txt
new file mode 100644
index 00000000000..33a150a94d6
--- /dev/null
+++ b/Build/source/libs/graphite/license/LICENSING.txt
@@ -0,0 +1,43 @@
+ Graphite 2.1 Licensing
+
+ Copyright 1999-2006, SIL International
+ All rights reserved.
+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of either:
+
+ a) the Common Public License as published by the "Agreement
+ Steward" for that license (currently IBM); either version 0.5
+ of the License, or (at your option) any later version,
+
+ or
+
+ b) the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2.1 of 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 either
+ the Common Public License or the GNU Lesser General Public License
+ for more details.
+
+ You should have received a plain text copy of the Common Public License
+ Version 0.5 with this distribution in the file named "License_CPLv05.txt".
+ That text came from http://www.opensource.org/licenses/cpl.html. The
+ initial "Agreement Steward" for the CPL displays currently the license at
+ http://www-124.ibm.com/developerworks/oss/license-cpl.html.
+
+ You should also have received a copy of the GNU Lesser General Public
+ License along with this library in the file named "License_LGPLv21.txt".
+ If not, write to the Free Software Foundation, Inc., 59 Temple Place,
+ Suite 330, Boston, MA 02111-1307, USA or visit their web page on the
+ internet at http://www.fsf.org/licenses/lgpl.html.
+
+ The GNU General Public License to which the GNU Lesser General Public
+ License refers can be found at http://www.gnu.org/copyleft/gpl.html.
+ For convenient reference, a text version has been included with this
+ distribution in the file named "License_GPLv2.txt". All of the licenses
+ mentioned above can also be found at http://www.opensource.org/licenses/.
+
+--------------------------------------------------------------------------
diff --git a/Build/source/libs/graphite/license/License_CPLv05.txt b/Build/source/libs/graphite/license/License_CPLv05.txt
new file mode 100644
index 00000000000..4cac5dfe069
--- /dev/null
+++ b/Build/source/libs/graphite/license/License_CPLv05.txt
@@ -0,0 +1,86 @@
+Common Public License Version 0.5
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED 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. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
diff --git a/Build/source/libs/graphite/license/License_GPLv2.txt b/Build/source/libs/graphite/license/License_GPLv2.txt
new file mode 100644
index 00000000000..1bcc46f53a6
--- /dev/null
+++ b/Build/source/libs/graphite/license/License_GPLv2.txt
@@ -0,0 +1,342 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
diff --git a/Build/source/libs/graphite/license/License_LGPLv21.txt b/Build/source/libs/graphite/license/License_LGPLv21.txt
new file mode 100644
index 00000000000..807db791666
--- /dev/null
+++ b/Build/source/libs/graphite/license/License_LGPLv21.txt
@@ -0,0 +1,506 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
diff --git a/Build/source/libs/graphite/makefile.vc b/Build/source/libs/graphite/makefile.vc
new file mode 100644
index 00000000000..2c5c5a935ef
--- /dev/null
+++ b/Build/source/libs/graphite/makefile.vc
@@ -0,0 +1,814 @@
+
+TARGET=graphite
+
+CPP=cl.exe
+CPPFLAGS=/nologo /W4 /GR /GX /I "./src/font" /I "./src/painter" /I "./src/segment" /I "./src/textsource" /I "./src/generic" /I "./include/graphite" /I "../wrappers/win32" /D "GR_NAMESPACE" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "TRACING" /Fp"$(INTDIR)\graphite.pch" /YX /Fd"$(INTDIR)\\" /FD /c
+# /Wp62
+
+LINK=link.exe
+LINK_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /pdb:"$(OUTDIR)\\graphite.pdb" /machine:I386 /out:"$(OUTDIR)\\$(TARGET).dll" /implib:"$(OUTDIR)\\$(TARGET).lib"
+
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\\$(TARGET).bsc"
+
+AR=lib
+AR_FLAGS=/OUT:$@
+
+!IF "$(MLIB)" == "MD"
+MLIB=MD
+!ELSE
+MLIB=MT
+!ENDIF
+
+OBJEXT = .obj
+SBREXT = .sbr
+
+!IF "$(CFG)" == "DEBUG"
+CPP_DEBUG=/D "DEBUG" /Gm /GR /ZI /Od /GZ /FR"$(INTDIR)\\" /$(MLIB)d
+# CPP_DEBUG=/D "DEBUG" /Gm /GR /ZI /Od /GZ /FR"$(INTDIR)\\" /MDd
+
+OUTDIR=.\debug
+INTDIR=.\debug_temp
+LINK_DEBUG= MSVCRTD.lib /debug /incremental:yes #/pdbtype:sept
+
+all : lib lib_dll bsc
+
+!ELSE
+CPP_DEBUG=/D "NDEBUG" /O2 /$(MLIB)
+# CPP_DEBUG=/D "NDEBUG" /O2 /MD
+OUTDIR=.\release
+INTDIR=.\release_temp
+LINK_DEBUG= MSVCRT.lib /incremental:no /NODEFAULTLIB:libc
+
+all : lib lib_dll
+
+!ENDIF
+
+!IF "$(TRACING)" == "1"
+CPP_DEBUG=/D "TRACING" $(CPP_DEBUG)
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+clean :
+ @- rd /s/q .\release_temp
+ @- rd /s/q .\debug_temp
+
+realclean : clean
+ @- rd /s/q .\release
+ @- rd /s/q .\debug
+
+LINK_OBJS=\
+# "$(INTDIR)\BinTree_i$(OBJEXT)"\
+# "$(INTDIR)\HashMap_i$(OBJEXT)"\
+ "$(INTDIR)\Debug$(OBJEXT)"\
+ "$(INTDIR)\Util$(OBJEXT)"\
+ "$(INTDIR)\Font$(OBJEXT)"\
+ "$(INTDIR)\FileFont$(OBJEXT)"\
+ "$(INTDIR)\FontCache$(OBJEXT)"\
+ "$(INTDIR)\FontFace$(OBJEXT)"\
+ "$(INTDIR)\FileInput$(OBJEXT)"\
+ "$(INTDIR)\GrCharStream$(OBJEXT)"\
+ "$(INTDIR)\GrClassTable$(OBJEXT)"\
+ "$(INTDIR)\GrEngine$(OBJEXT)"\
+ "$(INTDIR)\GrFeature$(OBJEXT)"\
+ "$(INTDIR)\GrFSM$(OBJEXT)"\
+ "$(INTDIR)\GrGlyphTable$(OBJEXT)"\
+ "$(INTDIR)\GrPass$(OBJEXT)"\
+ "$(INTDIR)\GrPassActionCode$(OBJEXT)"\
+ "$(INTDIR)\GrSlotState$(OBJEXT)"\
+ "$(INTDIR)\GrSlotStream$(OBJEXT)"\
+ "$(INTDIR)\GrTableManager$(OBJEXT)"\
+ "$(INTDIR)\MemoryUsage$(OBJEXT)"\
+ "$(INTDIR)\Segment$(OBJEXT)"\
+ "$(INTDIR)\SegmentAux$(OBJEXT)"\
+ "$(INTDIR)\SegmentPainter$(OBJEXT)"\
+# "$(INTDIR)\TestFSM$(OBJEXT)"\
+# "$(INTDIR)\TestPasses$(OBJEXT)"\
+ "$(INTDIR)\TransductionLog$(OBJEXT)"\
+ "$(INTDIR)\XmlTransductionLog$(OBJEXT)"\
+ "$(INTDIR)\Platform$(OBJEXT)"\
+ "$(INTDIR)\TtfUtil$(OBJEXT)"\
+ "$(INTDIR)\WinFont$(OBJEXT)"\
+ "$(INTDIR)\WinSegmentPainter$(OBJEXT)"
+
+LINK_DLL_OBJS=\
+# "$(INTDIR)\BinTree_i_dll$(OBJEXT)"\
+# "$(INTDIR)\HashMap_i_dll$(OBJEXT)"\
+ "$(INTDIR)\Debug_dll$(OBJEXT)"\
+ "$(INTDIR)\Util_dll$(OBJEXT)"\
+ "$(INTDIR)\Font_dll$(OBJEXT)"\
+ "$(INTDIR)\WinFont_dll$(OBJEXT)"\
+ "$(INTDIR)\FileFont_dll$(OBJEXT)"\
+ "$(INTDIR)\FontCache_dll$(OBJEXT)"\
+ "$(INTDIR)\FontFace_dll$(OBJEXT)"\
+ "$(INTDIR)\FileInput_dll$(OBJEXT)"\
+ "$(INTDIR)\GrCharStream_dll$(OBJEXT)"\
+ "$(INTDIR)\GrClassTable_dll$(OBJEXT)"\
+ "$(INTDIR)\GrEngine_dll$(OBJEXT)"\
+ "$(INTDIR)\GrFeature_dll$(OBJEXT)"\
+ "$(INTDIR)\GrFSM_dll$(OBJEXT)"\
+ "$(INTDIR)\GrGlyphTable_dll$(OBJEXT)"\
+ "$(INTDIR)\GrPass_dll$(OBJEXT)"\
+ "$(INTDIR)\GrPassActionCode_dll$(OBJEXT)"\
+ "$(INTDIR)\GrSlotState_dll$(OBJEXT)"\
+ "$(INTDIR)\GrSlotStream_dll$(OBJEXT)"\
+ "$(INTDIR)\GrTableManager_dll$(OBJEXT)"\
+ "$(INTDIR)\MemoryUsage_dll$(OBJEXT)"\
+ "$(INTDIR)\Segment_dll$(OBJEXT)"\
+ "$(INTDIR)\SegmentAux_dll$(OBJEXT)"\
+ "$(INTDIR)\SegmentPainter_dll$(OBJEXT)"\
+# "$(INTDIR)\TestFSM_dll$(OBJEXT)"\
+# "$(INTDIR)\TestPasses_dll$(OBJEXT)"\
+ "$(INTDIR)\TransductionLog_dll$(OBJEXT)"\
+ "$(INTDIR)\XmlTransductionLog_dll$(OBJEXT)"\
+ "$(INTDIR)\WinSegmentPainter_dll$(OBJEXT)"\
+ "$(INTDIR)\Platform_dll$(OBJEXT)"\
+ "$(INTDIR)\TtfUtil_dll$(OBJEXT)"
+
+DLL_LINK_OBJS=\
+ "$(INTDIR)\win32_dll_dll$(OBJEXT)"
+
+BSC32_SBRS=\
+# "$(INTDIR)\BinTree_i$(SBREXT)"\
+# "$(INTDIR)\HashMap_i$(SBREXT)"\
+ "$(INTDIR)\Debug$(SBREXT)"\
+ "$(INTDIR)\Util$(SBREXT)"\
+ "$(INTDIR)\Font$(SBREXT)"\
+ "$(INTDIR)\WinFont$(SBREXT)"\
+ "$(INTDIR)\FileFont$(SBREXT)"\
+ "$(INTDIR)\FontCache$(SBREXT)"\
+ "$(INTDIR)\FontFace$(SBREXT)"\
+ "$(INTDIR)\FileInput$(SBREXT)"\
+ "$(INTDIR)\GrCharStream$(SBREXT)"\
+ "$(INTDIR)\GrClassTable$(SBREXT)"\
+ "$(INTDIR)\GrEngine$(SBREXT)"\
+ "$(INTDIR)\GrFeature$(SBREXT)"\
+ "$(INTDIR)\GrFSM$(SBREXT)"\
+ "$(INTDIR)\GrGlyphTable$(SBREXT)"\
+ "$(INTDIR)\GrPass$(SBREXT)"\
+ "$(INTDIR)\GrPassActionCode$(SBREXT)"\
+ "$(INTDIR)\GrSlotState$(SBREXT)"\
+ "$(INTDIR)\GrSlotStream$(SBREXT)"\
+ "$(INTDIR)\GrTableManager$(SBREXT)"\
+ "$(INTDIR)\MemoryUsage$(SBREXT)"\
+ "$(INTDIR)\Segment$(SBREXT)"\
+ "$(INTDIR)\SegmentAux$(SBREXT)"\
+ "$(INTDIR)\SegmentPainter$(SBREXT)"\
+# "$(INTDIR)\TestFSM$(SBREXT)"\
+# "$(INTDIR)\TestPasses$(SBREXT)"\
+ "$(INTDIR)\TransductionLog$(SBREXT)"\
+ "$(INTDIR)\XmlTransductionLog$(SBREXT)"\
+ "$(INTDIR)\WinSegmentPainter$(SBREXT)"\
+ "$(INTDIR)\Platform$(SBREXT)"\
+ "$(INTDIR)\TtfUtil$(SBREXT)"\
+ "$(INTDIR)\win32_dll$(SBREXT)"
+
+$(OUTDIR) :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+$(INTDIR) :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+lib : "$(OUTDIR)/$(TARGET).lib"
+
+lib_dll : "$(OUTDIR)/$(TARGET)_dll.lib"
+
+"$(OUTDIR)/$(TARGET).lib" : "$(OUTDIR)" "$(INTDIR)" $(LINK_OBJS)
+ $(AR) @<<
+ $(AR_FLAGS) $(LINK_OBJS)
+<<
+
+"$(OUTDIR)/$(TARGET)_dll.lib" : "$(OUTDIR)" "$(INTDIR)" $(LINK_DLL_OBJS)
+ $(AR) @<<
+ $(AR_FLAGS) $(LINK_DLL_OBJS)
+<<
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\BinTree_i$(OBJEXT)" "$(INTDIR)\BinTree_i$(SBREXT)" : "src/generic/BinTree_i.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\BinTree_i$(OBJEXT)" $?
+
+"$(INTDIR)\BinTree_i_dll$(OBJEXT)" "$(INTDIR)\BinTree_i_dll$(SBREXT)" : "src/generic/BinTree_i.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\BinTree_i_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\BinTree_i$(OBJEXT)" : "src/generic/BinTree_i.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\BinTree_i$(OBJEXT)" $?
+
+"$(INTDIR)\BinTree_i_dll$(OBJEXT)" : "src/generic/BinTree_i.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /D "_DLL" /Fo"$(INTDIR)\BinTree_i_dll$(OBJEXT)" $?
+
+!ENDIF
+
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\Debug$(OBJEXT)" "$(INTDIR)\Debug$(SBREXT)" : "src/generic/Debug.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Debug$(OBJEXT)" $?
+
+"$(INTDIR)\Debug_dll$(OBJEXT)" "$(INTDIR)\Debug_dll$(SBREXT)" : "src/generic/Debug.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\Debug_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\Debug$(OBJEXT)" : "src/generic/Debug.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Debug$(OBJEXT)" $?
+
+"$(INTDIR)\Debug_dll$(OBJEXT)" : "src/generic/Debug.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\Debug_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\HashMap$(OBJEXT)" "$(INTDIR)\HashMap$(SBREXT)" : "src/generic/HashMap.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\HashMap$(OBJEXT)" $?
+
+"$(INTDIR)\HashMap_dll$(OBJEXT)" "$(INTDIR)\HashMap_dll$(SBREXT)" : "src/generic/HashMap.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\HashMap_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\HashMap$(OBJEXT)" : "src/generic/HashMap.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\HashMap$(OBJEXT)" $?
+
+"$(INTDIR)\HashMap_dll$(OBJEXT)" : "src/generic/HashMap.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\HashMap_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\HashMap_i$(OBJEXT)" "$(INTDIR)\HashMap_i$(SBREXT)" : "src/generic/HashMap_i.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\HashMap_i$(OBJEXT)" $?
+
+"$(INTDIR)\HashMap_i_dll$(OBJEXT)" "$(INTDIR)\HashMap_i_dll$(SBREXT)" : "src/generic/HashMap_i.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\HashMap_i_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\HashMap_i$(OBJEXT)" : "src/generic/HashMap_i.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\HashMap_i$(OBJEXT)" $?
+
+"$(INTDIR)\HashMap_i_dll$(OBJEXT)" : "src/generic/HashMap_i.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\HashMap_i_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\Set_i$(OBJEXT)" "$(INTDIR)\Set_i$(SBREXT)" : "src/generic/Set_i.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Set_i$(OBJEXT)" $?
+
+"$(INTDIR)\Set_i_dll$(OBJEXT)" "$(INTDIR)\Set_i_dll$(SBREXT)" : "src/generic/Set_i.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\Set_i_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\Set_i$(OBJEXT)" : "src/generic/Set_i.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Set_i$(OBJEXT)" $?
+
+"$(INTDIR)\Set_i_dll$(OBJEXT)" : "src/generic/Set_i.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\Set_i_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\Util$(OBJEXT)" "$(INTDIR)\Util$(SBREXT)" : "src/generic/Util.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Util$(OBJEXT)" $?
+
+"$(INTDIR)\Util_dll$(OBJEXT)" "$(INTDIR)\Util_dll$(SBREXT)" : "src/generic/Util.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\Util_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\Util$(OBJEXT)" : "src/generic/Util.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Util$(OBJEXT)" $?
+
+"$(INTDIR)\Util_dll$(OBJEXT)" : "src/generic/Util.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\Util_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\UtilString$(OBJEXT)" "$(INTDIR)\UtilString$(SBREXT)" : "src/generic/UtilString.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\UtilString$(OBJEXT)" $?
+
+"$(INTDIR)\UtilString_dll$(OBJEXT)" "$(INTDIR)\UtilString_dll$(SBREXT)" : "src/generic/UtilString.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\UtilString_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\UtilString$(OBJEXT)" : "src/generic/UtilString.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\UtilString$(OBJEXT)" $?
+
+"$(INTDIR)\UtilString_dll$(OBJEXT)" : "src/generic/UtilString.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\UtilString_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\Vector_i$(OBJEXT)" "$(INTDIR)\Vector_i$(SBREXT)" : "src/generic/Vector_i.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Vector_i$(OBJEXT)" $?
+
+"$(INTDIR)\Vector_i_dll$(OBJEXT)" "$(INTDIR)\Vector_i_dll$(SBREXT)" : "src/generic/Vector_i.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\Vector_i_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\Vector_i$(OBJEXT)" : "src/generic/Vector_i.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Vector_i$(OBJEXT)" $?
+
+"$(INTDIR)\Vector_i_dll$(OBJEXT)" : "src/generic/Vector_i.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\Vector_i_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\Font$(OBJEXT)" "$(INTDIR)\Font$(SBREXT)" : "src/font/Font.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Font$(OBJEXT)" $?
+
+"$(INTDIR)\Font_dll$(OBJEXT)" "$(INTDIR)\Font_dll$(SBREXT)" : "src/font/Font.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\Font_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\Font$(OBJEXT)" : "src/font/Font.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Font$(OBJEXT)" $?
+
+"$(INTDIR)\Font_dll$(OBJEXT)" : "src/font/Font.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\Font_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrUtil$(OBJEXT)" "$(INTDIR)\GrUtil$(SBREXT)" : "src/font/GrUtil.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrUtil$(OBJEXT)" $?
+
+"$(INTDIR)\GrUtil_dll$(OBJEXT)" "$(INTDIR)\GrUtil_dll$(SBREXT)" : "src/font/GrUtil.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrUtil_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrUtil$(OBJEXT)" : "src/font/GrUtil.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrUtil$(OBJEXT)" $?
+
+"$(INTDIR)\GrUtil_dll$(OBJEXT)" : "src/font/GrUtil.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrUtil_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\TtfUtil$(OBJEXT)" "$(INTDIR)\TtfUtil$(SBREXT)" : "src/font/TtfUtil.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\TtfUtil$(OBJEXT)" $?
+
+"$(INTDIR)\TtfUtil_dll$(OBJEXT)" "$(INTDIR)\TtfUtil_dll$(SBREXT)" : "src/font/TtfUtil.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\TtfUtil_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\TtfUtil$(OBJEXT)" : "src/font/TtfUtil.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\TtfUtil$(OBJEXT)" $?
+
+"$(INTDIR)\TtfUtil_dll$(OBJEXT)" : "src/font/TtfUtil.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\TtfUtil_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\FontCache$(OBJEXT)" "$(INTDIR)\FontCache$(SBREXT)" : "src/segment/FontCache.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\FontCache$(OBJEXT)" $?
+
+"$(INTDIR)\FontCache_dll$(OBJEXT)" "$(INTDIR)\FontCache_dll$(SBREXT)" : "src/segment/FontCache.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\FontCache_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\FontCache$(OBJEXT)" : "src/segment/FontCache.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\FontCache$(OBJEXT)" $?
+
+"$(INTDIR)\FontCache_dll$(OBJEXT)" : "src/segment/FontCache.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\FontCache_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\FontFace$(OBJEXT)" "$(INTDIR)\FontFace$(SBREXT)" : "src/segment/FontFace.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\FontFace$(OBJEXT)" $?
+
+"$(INTDIR)\FontFace_dll$(OBJEXT)" "$(INTDIR)\FontFace_dll$(SBREXT)" : "src/segment/FontFace.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\FontFace_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\FontFace$(OBJEXT)" : "src/segment/FontFace.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\FontFace$(OBJEXT)" $?
+
+"$(INTDIR)\FontFace_dll$(OBJEXT)" : "src/segment/FontFace.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\FontFace_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\FileInput$(OBJEXT)" "$(INTDIR)\FileInput$(SBREXT)" : "src/segment/FileInput.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\FileInput$(OBJEXT)" $?
+
+"$(INTDIR)\FileInput_dll$(OBJEXT)" "$(INTDIR)\FileInput_dll$(SBREXT)" : "src/segment/FileInput.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\FileInput_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\FileInput$(OBJEXT)" : "src/segment/FileInput.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\FileInput$(OBJEXT)" $?
+
+"$(INTDIR)\FileInput_dll$(OBJEXT)" : "src/segment/FileInput.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\FileInput_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrCharStream$(OBJEXT)" "$(INTDIR)\GrCharStream$(SBREXT)" : "src/segment/GrCharStream.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrCharStream$(OBJEXT)" $?
+
+"$(INTDIR)\GrCharStream_dll$(OBJEXT)" "$(INTDIR)\GrCharStream_dll$(SBREXT)" : "src/segment/GrCharStream.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrCharStream_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrCharStream$(OBJEXT)" : "src/segment/GrCharStream.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrCharStream$(OBJEXT)" $?
+
+"$(INTDIR)\GrCharStream_dll$(OBJEXT)" : "src/segment/GrCharStream.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrCharStream_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrClassTable$(OBJEXT)" "$(INTDIR)\GrClassTable$(SBREXT)" : "src/segment/GrClassTable.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrClassTable$(OBJEXT)" $?
+
+"$(INTDIR)\GrClassTable_dll$(OBJEXT)" "$(INTDIR)\GrClassTable_dll$(SBREXT)" : "src/segment/GrClassTable.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrClassTable_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrClassTable$(OBJEXT)" : "src/segment/GrClassTable.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrClassTable$(OBJEXT)" $?
+
+"$(INTDIR)\GrClassTable_dll$(OBJEXT)" : "src/segment/GrClassTable.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrClassTable_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrEngine$(OBJEXT)" "$(INTDIR)\GrEngine$(SBREXT)" : "src/segment/GrEngine.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrEngine$(OBJEXT)" $?
+
+"$(INTDIR)\GrEngine_dll$(OBJEXT)" "$(INTDIR)\GrEngine_dll$(SBREXT)" : "src/segment/GrEngine.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrEngine_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrEngine$(OBJEXT)" : "src/segment/GrEngine.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrEngine$(OBJEXT)" $?
+
+"$(INTDIR)\GrEngine_dll$(OBJEXT)" : "src/segment/GrEngine.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrEngine_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrFeature$(OBJEXT)" "$(INTDIR)\GrFeature$(SBREXT)" : "src/segment/GrFeature.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrFeature$(OBJEXT)" $?
+
+"$(INTDIR)\GrFeature_dll$(OBJEXT)" "$(INTDIR)\GrFeature_dll$(SBREXT)" : "src/segment/GrFeature.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrFeature_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrFeature$(OBJEXT)" : "src/segment/GrFeature.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrFeature$(OBJEXT)" $?
+
+"$(INTDIR)\GrFeature_dll$(OBJEXT)" : "src/segment/GrFeature.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrFeature_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrFSM$(OBJEXT)" "$(INTDIR)\GrFSM$(SBREXT)" : "src/segment/GrFSM.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrFSM$(OBJEXT)" $?
+
+"$(INTDIR)\GrFSM_dll$(OBJEXT)" "$(INTDIR)\GrFSM_dll$(SBREXT)" : "src/segment/GrFSM.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrFSM_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrFSM$(OBJEXT)" : "src/segment/GrFSM.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrFSM$(OBJEXT)" $?
+
+"$(INTDIR)\GrFSM_dll$(OBJEXT)" : "src/segment/GrFSM.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrFSM_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrGlyphTable$(OBJEXT)" "$(INTDIR)\GrGlyphTable$(SBREXT)" : "src/segment/GrGlyphTable.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrGlyphTable$(OBJEXT)" $?
+
+"$(INTDIR)\GrGlyphTable_dll$(OBJEXT)" "$(INTDIR)\GrGlyphTable_dll$(SBREXT)" : "src/segment/GrGlyphTable.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrGlyphTable_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrGlyphTable$(OBJEXT)" : "src/segment/GrGlyphTable.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrGlyphTable$(OBJEXT)" $?
+
+"$(INTDIR)\GrGlyphTable_dll$(OBJEXT)" : "src/segment/GrGlyphTable.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrGlyphTable_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrPass$(OBJEXT)" "$(INTDIR)\GrPass$(SBREXT)" : "src/segment/GrPass.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrPass$(OBJEXT)" $?
+
+"$(INTDIR)\GrPass_dll$(OBJEXT)" "$(INTDIR)\GrPass_dll$(SBREXT)" : "src/segment/GrPass.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrPass_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrPass$(OBJEXT)" : "src/segment/GrPass.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrPass$(OBJEXT)" $?
+
+"$(INTDIR)\GrPass_dll$(OBJEXT)" : "src/segment/GrPass.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrPass_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrPassActionCode$(OBJEXT)" "$(INTDIR)\GrPassActionCode$(SBREXT)" : "src/segment/GrPassActionCode.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrPassActionCode$(OBJEXT)" $?
+
+"$(INTDIR)\GrPassActionCode_dll$(OBJEXT)" "$(INTDIR)\GrPassActionCode_dll$(SBREXT)" : "src/segment/GrPassActionCode.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrPassActionCode_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrPassActionCode$(OBJEXT)" : "src/segment/GrPassActionCode.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrPassActionCode$(OBJEXT)" $?
+
+"$(INTDIR)\GrPassActionCode_dll$(OBJEXT)" : "src/segment/GrPassActionCode.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrPassActionCode_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrSlotState$(OBJEXT)" "$(INTDIR)\GrSlotState$(SBREXT)" : "src/segment/GrSlotState.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrSlotState$(OBJEXT)" $?
+
+"$(INTDIR)\GrSlotState_dll$(OBJEXT)" "$(INTDIR)\GrSlotState_dll$(SBREXT)" : "src/segment/GrSlotState.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrSlotState_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrSlotState$(OBJEXT)" : "src/segment/GrSlotState.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrSlotState$(OBJEXT)" $?
+
+"$(INTDIR)\GrSlotState_dll$(OBJEXT)" : "src/segment/GrSlotState.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrSlotState_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrSlotStream$(OBJEXT)" "$(INTDIR)\GrSlotStream$(SBREXT)" : "src/segment/GrSlotStream.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrSlotStream$(OBJEXT)" $?
+
+"$(INTDIR)\GrSlotStream_dll$(OBJEXT)" "$(INTDIR)\GrSlotStream_dll$(SBREXT)" : "src/segment/GrSlotStream.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrSlotStream_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrSlotStream$(OBJEXT)" : "src/segment/GrSlotStream.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrSlotStream$(OBJEXT)" $?
+
+"$(INTDIR)\GrSlotStream_dll$(OBJEXT)" : "src/segment/GrSlotStream.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrSlotStream_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\GrTableManager$(OBJEXT)" "$(INTDIR)\GrTableManager$(SBREXT)" : "src/segment/GrTableManager.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrTableManager$(OBJEXT)" $?
+
+"$(INTDIR)\GrTableManager_dll$(OBJEXT)" "$(INTDIR)\GrTableManager_dll$(SBREXT)" : "src/segment/GrTableManager.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\GrTableManager_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\GrTableManager$(OBJEXT)" : "src/segment/GrTableManager.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\GrTableManager$(OBJEXT)" $?
+
+"$(INTDIR)\GrTableManager_dll$(OBJEXT)" : "src/segment/GrTableManager.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\GrTableManager_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\MemoryUsage$(OBJEXT)" "$(INTDIR)\MemoryUsage$(SBREXT)" : "src/segment/MemoryUsage.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\MemoryUsage$(OBJEXT)" $?
+
+"$(INTDIR)\MemoryUsage_dll$(OBJEXT)" "$(INTDIR)\MemoryUsage_dll$(SBREXT)" : "src/segment/MemoryUsage.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\MemoryUsage_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\MemoryUsage$(OBJEXT)" : "src/segment/MemoryUsage.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\MemoryUsage$(OBJEXT)" $?
+
+"$(INTDIR)\MemoryUsage_dll$(OBJEXT)" : "src/segment/MemoryUsage.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\MemoryUsage_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\Segment$(OBJEXT)" "$(INTDIR)\Segment$(SBREXT)" : "src/segment/Segment.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Segment$(OBJEXT)" $?
+
+"$(INTDIR)\Segment_dll$(OBJEXT)" "$(INTDIR)\Segment_dll$(SBREXT)" : "src/segment/Segment.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\Segment_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\Segment$(OBJEXT)" : "src/segment/Segment.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Segment$(OBJEXT)" $?
+
+"$(INTDIR)\Segment_dll$(OBJEXT)" : "src/segment/Segment.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\Segment_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\SegmentAux$(OBJEXT)" "$(INTDIR)\SegmentAux$(SBREXT)" : "src/segment/SegmentAux.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\SegmentAux$(OBJEXT)" $?
+
+"$(INTDIR)\SegmentAux_dll$(OBJEXT)" "$(INTDIR)\SegmentAux_dll$(SBREXT)" : "src/segment/SegmentAux.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\SegmentAux_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\SegmentAux$(OBJEXT)" : "src/segment/SegmentAux.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\SegmentAux$(OBJEXT)" $?
+
+"$(INTDIR)\SegmentAux_dll$(OBJEXT)" : "src/segment/SegmentAux.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\SegmentAux_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\TestFSM$(OBJEXT)" "$(INTDIR)\TestFSM$(SBREXT)" : "src/segment/TestFSM.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\TestFSM$(OBJEXT)" $?
+
+"$(INTDIR)\TestFSM_dll$(OBJEXT)" "$(INTDIR)\TestFSM_dll$(SBREXT)" : "src/segment/TestFSM.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\TestFSM_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\TestFSM$(OBJEXT)" : "src/segment/TestFSM.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\TestFSM$(OBJEXT)" $?
+
+"$(INTDIR)\TestFSM_dll$(OBJEXT)" : "src/segment/TestFSM.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\TestFSM_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\TestPasses$(OBJEXT)" "$(INTDIR)\TestPasses$(SBREXT)" : "src/segment/TestPasses.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\TestPasses$(OBJEXT)" $?
+
+"$(INTDIR)\TestPasses_dll$(OBJEXT)" "$(INTDIR)\TestPasses_dll$(SBREXT)" : "src/segment/TestPasses.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\TestPasses_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\TestPasses$(OBJEXT)" : "src/segment/TestPasses.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\TestPasses$(OBJEXT)" $?
+
+"$(INTDIR)\TestPasses_dll$(OBJEXT)" : "src/segment/TestPasses.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\TestPasses_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\TransductionLog$(OBJEXT)" "$(INTDIR)\TransductionLog$(SBREXT)" : "src/segment/TransductionLog.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\TransductionLog$(OBJEXT)" $?
+
+"$(INTDIR)\TransductionLog_dll$(OBJEXT)" "$(INTDIR)\TransductionLog_dll$(SBREXT)" : "src/segment/TransductionLog.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\TransductionLog_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\TransductionLog$(OBJEXT)" : "src/segment/TransductionLog.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\TransductionLog$(OBJEXT)" $?
+
+"$(INTDIR)\TransductionLog_dll$(OBJEXT)" : "src/segment/TransductionLog.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\TransductionLog_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\XmlTransductionLog$(OBJEXT)" "$(INTDIR)\XmlTransductionLog$(SBREXT)" : "src/segment/XmlTransductionLog.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\XmlTransductionLog$(OBJEXT)" $?
+
+"$(INTDIR)\XmlTransductionLog_dll$(OBJEXT)" "$(INTDIR)\XmlTransductionLog_dll$(SBREXT)" : "src/segment/XmlTransductionLog.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\XmlTransductionLog_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\XmlTransductionLog$(OBJEXT)" : "src/segment/XmlTransductionLog.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\XmlTransductionLog$(OBJEXT)" $?
+
+"$(INTDIR)\XmlTransductionLog_dll$(OBJEXT)" : "src/segment/XmlTransductionLog.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\XmlTransductionLog_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\Platform$(OBJEXT)" "$(INTDIR)\Platform$(SBREXT)" : "src/segment/Platform.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Platform$(OBJEXT)" $?
+
+"$(INTDIR)\Platform_dll$(OBJEXT)" "$(INTDIR)\Platform_dll$(SBREXT)" : "src/segment/Platform.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\Platform_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\Platform$(OBJEXT)" : "src/segment/Platform.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\Platform$(OBJEXT)" $?
+
+"$(INTDIR)\Platform_dll$(OBJEXT)" : "src/segment/Platform.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\Platform_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\SegmentPainter$(OBJEXT)" "$(INTDIR)\SegmentPainter$(SBREXT)" : "src/painter/SegmentPainter.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\SegmentPainter$(OBJEXT)" $?
+
+"$(INTDIR)\SegmentPainter_dll$(OBJEXT)" "$(INTDIR)\SegmentPainter_dll$(SBREXT)" : "src/painter/SegmentPainter.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\SegmentPainter_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\SegmentPainter$(OBJEXT)" : "src/painter/SegmentPainter.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\SegmentPainter$(OBJEXT)" $?
+
+"$(INTDIR)\SegmentPainter_dll$(OBJEXT)" : "src/painter/SegmentPainter.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\SegmentPainter_dll$(OBJEXT)" $?
+
+!ENDIF
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\WinSegmentPainter$(OBJEXT)" "$(INTDIR)\WinSegmentPainter$(SBREXT)" : "..\wrappers\win32\WinSegmentPainter.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\WinSegmentPainter$(OBJEXT)" $?
+
+"$(INTDIR)\WinSegmentPainter_dll$(OBJEXT)" "$(INTDIR)\WinSegmentPainter_dll$(SBREXT)" : "..\wrappers\win32\WinSegmentPainter.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\WinSegmentPainter_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\WinSegmentPainter$(OBJEXT)" : "..\wrappers\win32\WinSegmentPainter.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\WinSegmentPainter$(OBJEXT)" $?
+
+"$(INTDIR)\WinSegmentPainter_dll$(OBJEXT)" : "..\wrappers\win32\WinSegmentPainter.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\WinSegmentPainter_dll$(OBJEXT)" $?
+
+!ENDIF
+
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\WinFont$(OBJEXT)" "$(INTDIR)\WinFont$(SBREXT)" : "../wrappers/win32/WinFont.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\WinFont$(OBJEXT)" $?
+
+"$(INTDIR)\WinFont_dll$(OBJEXT)" "$(INTDIR)\WinFont_dll$(SBREXT)" : "../wrappers/win32/WinFont.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\WinFont_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\WinFont$(OBJEXT)" : "../wrappers/win32/WinFont.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\WinFont$(OBJEXT)" $?
+
+"$(INTDIR)\WinFont_dll$(OBJEXT)" : "../wrappers/win32/WinFont.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\WinFont_dll$(OBJEXT)" $?
+
+!ENDIF
+
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\FileFont$(OBJEXT)" "$(INTDIR)\FileFont$(SBREXT)" : "src/font/FileFont.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\FileFont$(OBJEXT)" $?
+
+"$(INTDIR)\FileFont_dll$(OBJEXT)" "$(INTDIR)\FileFont_dll$(SBREXT)" : "src/font/FileFont.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\FileFont_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\FileFont$(OBJEXT)" : "src/font/FileFont.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\FileFont$(OBJEXT)" $?
+
+"$(INTDIR)\FileFont_dll$(OBJEXT)" : "src/font/FileFont.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\FileFont_dll$(OBJEXT)" $?
+
+!ENDIF
+
+
+!IF "$(CFG)" == "DEBUG"
+"$(INTDIR)\..\wrappers\win32\win32_dll$(OBJEXT)" "$(INTDIR)\win32_dll$(SBREXT)" : "..\wrappers\win32\win32_dll.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\win32_dll$(OBJEXT)" $?
+
+"$(INTDIR)\win32_dll_dll$(OBJEXT)" "$(INTDIR)\win32_dll_dll$(SBREXT)" : "..\wrappers\win32\win32_dll.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" $(CPP_DEBUG) /Fo"$(INTDIR)\win32_dll_dll$(OBJEXT)" $?
+
+!ELSE
+"$(INTDIR)\win32_dll$(OBJEXT)" : "..\wrappers\win32\win32_dll.cpp"
+ @- $(CPP) $(CPPFLAGS) $(CPP_DEBUG) /Fo"$(INTDIR)\win32_dll$(OBJEXT)" $?
+
+"$(INTDIR)\win32_dll_dll$(OBJEXT)" : "..\wrappers\win32\win32_dll.cpp"
+ @- $(CPP) $(CPPFLAGS) /D "_DLL" /Fo"$(INTDIR)\win32_dll_dll$(OBJEXT)" $?
+
+!ENDIF
+
+bsc : "$(OUTDIR)/$(TARGET).bsc"
+
+"$(OUTDIR)/$(TARGET).bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+dll : $(OUTDIR)/$(TARGET).dll
+
+"$(OUTDIR)/$(TARGET).dll" : "$(OUTDIR)" $(DEF_FILE) lib_dll $(DLL_LINK_OBJS)
+ $(LINK) $(LINK_FLAGS) $(LINK_DEBUG) $(OUTDIR)/$(TARGET)_dll.lib $(DLL_LINK_OBJS)
+
diff --git a/Build/source/libs/graphite/silgraphite.pc.in b/Build/source/libs/graphite/silgraphite.pc.in
new file mode 100644
index 00000000000..6a57ab7838b
--- /dev/null
+++ b/Build/source/libs/graphite/silgraphite.pc.in
@@ -0,0 +1,7 @@
+
+Name: SILGraphite
+Description: Script rendering engine
+Version: ${version}
+Libs: -L${libdir} -lgraphite
+Cflags: -I${includedir}
+
diff --git a/Build/source/libs/graphite/src/Makefile.am b/Build/source/libs/graphite/src/Makefile.am
new file mode 100644
index 00000000000..7d55c002a23
--- /dev/null
+++ b/Build/source/libs/graphite/src/Makefile.am
@@ -0,0 +1,22 @@
+AUTOMAKE_OPTIONS = 1.6
+
+AM_CPPFLAGS = -I$(top_srcdir)/include/graphite -I$(top_srcdir)/src/generic
+AM_CPPFLAGS += -I$(top_srcdir)/src/font -I$(top_srcdir)/src/segment
+#AM_CPPFLAGS += $(FT_CFLAGS) $(XFT_CFLAGS)
+#AM_CPPFLAGS += -D_UNICODE -DUNICODE -DNO_ASM
+
+lib_LTLIBRARIES = libgraphite.la
+
+libgraphite_la_LDFLAGS = -version-info 3:0:0
+
+#EXTRA_DIST=textsource
+EXTRA_DIST=
+graphiteinclude_HEADERS =
+graphiteincludedir = $(includedir)/graphite
+include ../include/Makefile.am
+
+libgraphite_la_SOURCES =
+include generic/Makefile.am
+include font/Makefile.am
+include segment/Makefile.am
+include painter/Makefile.am
diff --git a/Build/source/libs/graphite/src/Makefile.in b/Build/source/libs/graphite/src/Makefile.in
new file mode 100644
index 00000000000..e84ac5e7e29
--- /dev/null
+++ b/Build/source/libs/graphite/src/Makefile.in
@@ -0,0 +1,767 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(graphiteinclude_HEADERS) \
+ $(srcdir)/../include/Makefile.am $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/font/Makefile.am \
+ $(srcdir)/generic/Makefile.am $(srcdir)/painter/Makefile.am \
+ $(srcdir)/segment/Makefile.am
+subdir = src
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(libdir)" \
+ "$(DESTDIR)$(graphiteincludedir)"
+libLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(lib_LTLIBRARIES)
+libgraphite_la_LIBADD =
+am_libgraphite_la_OBJECTS = Debug.lo Util.lo Font.lo TtfUtil.lo \
+ FileFont.lo FileInput.lo FontCache.lo FontFace.lo \
+ GrCharStream.lo GrClassTable.lo GrEngine.lo GrFeature.lo \
+ GrFSM.lo GrGlyphTable.lo GrPassActionCode.lo GrPass.lo \
+ GrSlotState.lo GrSlotStream.lo GrTableManager.lo \
+ MemoryUsage.lo Platform.lo SegmentAux.lo Segment.lo TestFSM.lo \
+ TestPasses.lo TransductionLog.lo SegmentPainter.lo
+libgraphite_la_OBJECTS = $(am_libgraphite_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libgraphite_la_SOURCES)
+DIST_SOURCES = $(libgraphite_la_SOURCES)
+graphiteincludeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(graphiteinclude_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LSB_RELEASE = @LSB_RELEASE@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+REL_CODENAME = @REL_CODENAME@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZEOF_WCHAR_T = @SIZEOF_WCHAR_T@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+AUTOMAKE_OPTIONS = 1.6
+AM_CPPFLAGS = -I$(top_srcdir)/include/graphite \
+ -I$(top_srcdir)/src/generic -I$(top_srcdir)/src/font \
+ -I$(top_srcdir)/src/segment
+#AM_CPPFLAGS += $(FT_CFLAGS) $(XFT_CFLAGS)
+#AM_CPPFLAGS += -D_UNICODE -DUNICODE -DNO_ASM
+lib_LTLIBRARIES = libgraphite.la
+libgraphite_la_LDFLAGS = -version-info 3:0:0
+
+#EXTRA_DIST=textsource
+EXTRA_DIST = $(top_srcdir)/include/graphite/BinTree.h \
+ $(top_srcdir)/include/graphite/GenericResource.h \
+ $(top_srcdir)/include/graphite/HashMap.h $(genericdir)/*.h \
+ $(genericdir)/BinTree_i.cpp $(genericdir)/HashMap_i.cpp \
+ $(fontdir)/*.h $(segmentdir)/*.h
+graphiteinclude_HEADERS = $(top_srcdir)/include/graphite/FileFont.h \
+ $(top_srcdir)/include/graphite/Font.h \
+ $(top_srcdir)/include/graphite/GraphiteProcess.h \
+ $(top_srcdir)/include/graphite/GrAppData.h \
+ $(top_srcdir)/include/graphite/GrClient.h \
+ $(top_srcdir)/include/graphite/GrCommon.h \
+ $(top_srcdir)/include/graphite/GrConstants.h \
+ $(top_srcdir)/include/graphite/GrData.h \
+ $(top_srcdir)/include/graphite/GrDebug.h \
+ $(top_srcdir)/include/graphite/GrExt.h \
+ $(top_srcdir)/include/graphite/GrFeature.h \
+ $(top_srcdir)/include/graphite/GrMstypes.h \
+ $(top_srcdir)/include/graphite/GrPlatform.h \
+ $(top_srcdir)/include/graphite/GrResult.h \
+ $(top_srcdir)/include/graphite/GrStructs.h \
+ $(top_srcdir)/include/graphite/GrWrappers.h \
+ $(top_srcdir)/include/graphite/IGraphiteProcess.h \
+ $(top_srcdir)/include/graphite/IGrEngine.h \
+ $(top_srcdir)/include/graphite/IGrJustifier.h \
+ $(top_srcdir)/include/graphite/ITextSource.h \
+ $(top_srcdir)/include/graphite/MemoryUsage.h \
+ $(top_srcdir)/include/graphite/SegmentAux.h \
+ $(top_srcdir)/include/graphite/Segment.h \
+ $(top_srcdir)/include/graphite/SegmentPainter.h
+graphiteincludedir = $(includedir)/graphite
+libgraphite_la_SOURCES = $(genericdir)/Debug.cpp \
+ $(genericdir)/Util.cpp $(fontdir)/Font.cpp \
+ $(fontdir)/TtfUtil.cpp $(fontdir)/FileFont.cpp \
+ $(segmentdir)/FileInput.cpp $(segmentdir)/FontCache.cpp \
+ $(segmentdir)/FontFace.cpp $(segmentdir)/GrCharStream.cpp \
+ $(segmentdir)/GrClassTable.cpp $(segmentdir)/GrEngine.cpp \
+ $(segmentdir)/GrFeature.cpp $(segmentdir)/GrFSM.cpp \
+ $(segmentdir)/GrGlyphTable.cpp \
+ $(segmentdir)/GrPassActionCode.cpp $(segmentdir)/GrPass.cpp \
+ $(segmentdir)/GrSlotState.cpp $(segmentdir)/GrSlotStream.cpp \
+ $(segmentdir)/GrTableManager.cpp $(segmentdir)/MemoryUsage.cpp \
+ $(segmentdir)/Platform.cpp $(segmentdir)/SegmentAux.cpp \
+ $(segmentdir)/Segment.cpp $(segmentdir)/TestFSM.cpp \
+ $(segmentdir)/TestPasses.cpp $(segmentdir)/TransductionLog.cpp \
+ $(painterdir)/SegmentPainter.cpp
+genericdir = $(top_srcdir)/src/generic
+fontdir = $(top_srcdir)/src/font
+segmentdir = $(top_srcdir)/src/segment
+painterdir = $(top_srcdir)/src/painter
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../include/Makefile.am $(srcdir)/generic/Makefile.am $(srcdir)/font/Makefile.am $(srcdir)/segment/Makefile.am $(srcdir)/painter/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @set -x; list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libgraphite.la: $(libgraphite_la_OBJECTS) $(libgraphite_la_DEPENDENCIES)
+ $(CXXLINK) -rpath $(libdir) $(libgraphite_la_LDFLAGS) $(libgraphite_la_OBJECTS) $(libgraphite_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Debug.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FileFont.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FileInput.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Font.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FontCache.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FontFace.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrCharStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrClassTable.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrEngine.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrFSM.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrFeature.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrGlyphTable.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrPass.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrPassActionCode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrSlotState.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrSlotStream.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrTableManager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MemoryUsage.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Platform.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Segment.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SegmentAux.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SegmentPainter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TestFSM.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TestPasses.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TransductionLog.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TtfUtil.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Util.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+Debug.lo: $(genericdir)/Debug.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Debug.lo -MD -MP -MF "$(DEPDIR)/Debug.Tpo" -c -o Debug.lo `test -f '$(genericdir)/Debug.cpp' || echo '$(srcdir)/'`$(genericdir)/Debug.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/Debug.Tpo" "$(DEPDIR)/Debug.Plo"; else rm -f "$(DEPDIR)/Debug.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(genericdir)/Debug.cpp' object='Debug.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Debug.lo `test -f '$(genericdir)/Debug.cpp' || echo '$(srcdir)/'`$(genericdir)/Debug.cpp
+
+Util.lo: $(genericdir)/Util.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Util.lo -MD -MP -MF "$(DEPDIR)/Util.Tpo" -c -o Util.lo `test -f '$(genericdir)/Util.cpp' || echo '$(srcdir)/'`$(genericdir)/Util.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/Util.Tpo" "$(DEPDIR)/Util.Plo"; else rm -f "$(DEPDIR)/Util.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(genericdir)/Util.cpp' object='Util.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Util.lo `test -f '$(genericdir)/Util.cpp' || echo '$(srcdir)/'`$(genericdir)/Util.cpp
+
+Font.lo: $(fontdir)/Font.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Font.lo -MD -MP -MF "$(DEPDIR)/Font.Tpo" -c -o Font.lo `test -f '$(fontdir)/Font.cpp' || echo '$(srcdir)/'`$(fontdir)/Font.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/Font.Tpo" "$(DEPDIR)/Font.Plo"; else rm -f "$(DEPDIR)/Font.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(fontdir)/Font.cpp' object='Font.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Font.lo `test -f '$(fontdir)/Font.cpp' || echo '$(srcdir)/'`$(fontdir)/Font.cpp
+
+TtfUtil.lo: $(fontdir)/TtfUtil.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TtfUtil.lo -MD -MP -MF "$(DEPDIR)/TtfUtil.Tpo" -c -o TtfUtil.lo `test -f '$(fontdir)/TtfUtil.cpp' || echo '$(srcdir)/'`$(fontdir)/TtfUtil.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/TtfUtil.Tpo" "$(DEPDIR)/TtfUtil.Plo"; else rm -f "$(DEPDIR)/TtfUtil.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(fontdir)/TtfUtil.cpp' object='TtfUtil.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TtfUtil.lo `test -f '$(fontdir)/TtfUtil.cpp' || echo '$(srcdir)/'`$(fontdir)/TtfUtil.cpp
+
+FileFont.lo: $(fontdir)/FileFont.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FileFont.lo -MD -MP -MF "$(DEPDIR)/FileFont.Tpo" -c -o FileFont.lo `test -f '$(fontdir)/FileFont.cpp' || echo '$(srcdir)/'`$(fontdir)/FileFont.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/FileFont.Tpo" "$(DEPDIR)/FileFont.Plo"; else rm -f "$(DEPDIR)/FileFont.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(fontdir)/FileFont.cpp' object='FileFont.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FileFont.lo `test -f '$(fontdir)/FileFont.cpp' || echo '$(srcdir)/'`$(fontdir)/FileFont.cpp
+
+FileInput.lo: $(segmentdir)/FileInput.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FileInput.lo -MD -MP -MF "$(DEPDIR)/FileInput.Tpo" -c -o FileInput.lo `test -f '$(segmentdir)/FileInput.cpp' || echo '$(srcdir)/'`$(segmentdir)/FileInput.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/FileInput.Tpo" "$(DEPDIR)/FileInput.Plo"; else rm -f "$(DEPDIR)/FileInput.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/FileInput.cpp' object='FileInput.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FileInput.lo `test -f '$(segmentdir)/FileInput.cpp' || echo '$(srcdir)/'`$(segmentdir)/FileInput.cpp
+
+FontCache.lo: $(segmentdir)/FontCache.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FontCache.lo -MD -MP -MF "$(DEPDIR)/FontCache.Tpo" -c -o FontCache.lo `test -f '$(segmentdir)/FontCache.cpp' || echo '$(srcdir)/'`$(segmentdir)/FontCache.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/FontCache.Tpo" "$(DEPDIR)/FontCache.Plo"; else rm -f "$(DEPDIR)/FontCache.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/FontCache.cpp' object='FontCache.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FontCache.lo `test -f '$(segmentdir)/FontCache.cpp' || echo '$(srcdir)/'`$(segmentdir)/FontCache.cpp
+
+FontFace.lo: $(segmentdir)/FontFace.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT FontFace.lo -MD -MP -MF "$(DEPDIR)/FontFace.Tpo" -c -o FontFace.lo `test -f '$(segmentdir)/FontFace.cpp' || echo '$(srcdir)/'`$(segmentdir)/FontFace.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/FontFace.Tpo" "$(DEPDIR)/FontFace.Plo"; else rm -f "$(DEPDIR)/FontFace.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/FontFace.cpp' object='FontFace.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o FontFace.lo `test -f '$(segmentdir)/FontFace.cpp' || echo '$(srcdir)/'`$(segmentdir)/FontFace.cpp
+
+GrCharStream.lo: $(segmentdir)/GrCharStream.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrCharStream.lo -MD -MP -MF "$(DEPDIR)/GrCharStream.Tpo" -c -o GrCharStream.lo `test -f '$(segmentdir)/GrCharStream.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrCharStream.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrCharStream.Tpo" "$(DEPDIR)/GrCharStream.Plo"; else rm -f "$(DEPDIR)/GrCharStream.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrCharStream.cpp' object='GrCharStream.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrCharStream.lo `test -f '$(segmentdir)/GrCharStream.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrCharStream.cpp
+
+GrClassTable.lo: $(segmentdir)/GrClassTable.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrClassTable.lo -MD -MP -MF "$(DEPDIR)/GrClassTable.Tpo" -c -o GrClassTable.lo `test -f '$(segmentdir)/GrClassTable.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrClassTable.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrClassTable.Tpo" "$(DEPDIR)/GrClassTable.Plo"; else rm -f "$(DEPDIR)/GrClassTable.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrClassTable.cpp' object='GrClassTable.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrClassTable.lo `test -f '$(segmentdir)/GrClassTable.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrClassTable.cpp
+
+GrEngine.lo: $(segmentdir)/GrEngine.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrEngine.lo -MD -MP -MF "$(DEPDIR)/GrEngine.Tpo" -c -o GrEngine.lo `test -f '$(segmentdir)/GrEngine.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrEngine.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrEngine.Tpo" "$(DEPDIR)/GrEngine.Plo"; else rm -f "$(DEPDIR)/GrEngine.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrEngine.cpp' object='GrEngine.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrEngine.lo `test -f '$(segmentdir)/GrEngine.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrEngine.cpp
+
+GrFeature.lo: $(segmentdir)/GrFeature.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrFeature.lo -MD -MP -MF "$(DEPDIR)/GrFeature.Tpo" -c -o GrFeature.lo `test -f '$(segmentdir)/GrFeature.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrFeature.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrFeature.Tpo" "$(DEPDIR)/GrFeature.Plo"; else rm -f "$(DEPDIR)/GrFeature.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrFeature.cpp' object='GrFeature.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrFeature.lo `test -f '$(segmentdir)/GrFeature.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrFeature.cpp
+
+GrFSM.lo: $(segmentdir)/GrFSM.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrFSM.lo -MD -MP -MF "$(DEPDIR)/GrFSM.Tpo" -c -o GrFSM.lo `test -f '$(segmentdir)/GrFSM.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrFSM.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrFSM.Tpo" "$(DEPDIR)/GrFSM.Plo"; else rm -f "$(DEPDIR)/GrFSM.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrFSM.cpp' object='GrFSM.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrFSM.lo `test -f '$(segmentdir)/GrFSM.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrFSM.cpp
+
+GrGlyphTable.lo: $(segmentdir)/GrGlyphTable.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrGlyphTable.lo -MD -MP -MF "$(DEPDIR)/GrGlyphTable.Tpo" -c -o GrGlyphTable.lo `test -f '$(segmentdir)/GrGlyphTable.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrGlyphTable.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrGlyphTable.Tpo" "$(DEPDIR)/GrGlyphTable.Plo"; else rm -f "$(DEPDIR)/GrGlyphTable.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrGlyphTable.cpp' object='GrGlyphTable.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrGlyphTable.lo `test -f '$(segmentdir)/GrGlyphTable.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrGlyphTable.cpp
+
+GrPassActionCode.lo: $(segmentdir)/GrPassActionCode.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrPassActionCode.lo -MD -MP -MF "$(DEPDIR)/GrPassActionCode.Tpo" -c -o GrPassActionCode.lo `test -f '$(segmentdir)/GrPassActionCode.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrPassActionCode.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrPassActionCode.Tpo" "$(DEPDIR)/GrPassActionCode.Plo"; else rm -f "$(DEPDIR)/GrPassActionCode.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrPassActionCode.cpp' object='GrPassActionCode.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrPassActionCode.lo `test -f '$(segmentdir)/GrPassActionCode.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrPassActionCode.cpp
+
+GrPass.lo: $(segmentdir)/GrPass.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrPass.lo -MD -MP -MF "$(DEPDIR)/GrPass.Tpo" -c -o GrPass.lo `test -f '$(segmentdir)/GrPass.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrPass.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrPass.Tpo" "$(DEPDIR)/GrPass.Plo"; else rm -f "$(DEPDIR)/GrPass.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrPass.cpp' object='GrPass.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrPass.lo `test -f '$(segmentdir)/GrPass.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrPass.cpp
+
+GrSlotState.lo: $(segmentdir)/GrSlotState.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrSlotState.lo -MD -MP -MF "$(DEPDIR)/GrSlotState.Tpo" -c -o GrSlotState.lo `test -f '$(segmentdir)/GrSlotState.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrSlotState.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrSlotState.Tpo" "$(DEPDIR)/GrSlotState.Plo"; else rm -f "$(DEPDIR)/GrSlotState.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrSlotState.cpp' object='GrSlotState.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrSlotState.lo `test -f '$(segmentdir)/GrSlotState.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrSlotState.cpp
+
+GrSlotStream.lo: $(segmentdir)/GrSlotStream.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrSlotStream.lo -MD -MP -MF "$(DEPDIR)/GrSlotStream.Tpo" -c -o GrSlotStream.lo `test -f '$(segmentdir)/GrSlotStream.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrSlotStream.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrSlotStream.Tpo" "$(DEPDIR)/GrSlotStream.Plo"; else rm -f "$(DEPDIR)/GrSlotStream.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrSlotStream.cpp' object='GrSlotStream.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrSlotStream.lo `test -f '$(segmentdir)/GrSlotStream.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrSlotStream.cpp
+
+GrTableManager.lo: $(segmentdir)/GrTableManager.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT GrTableManager.lo -MD -MP -MF "$(DEPDIR)/GrTableManager.Tpo" -c -o GrTableManager.lo `test -f '$(segmentdir)/GrTableManager.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrTableManager.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/GrTableManager.Tpo" "$(DEPDIR)/GrTableManager.Plo"; else rm -f "$(DEPDIR)/GrTableManager.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/GrTableManager.cpp' object='GrTableManager.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o GrTableManager.lo `test -f '$(segmentdir)/GrTableManager.cpp' || echo '$(srcdir)/'`$(segmentdir)/GrTableManager.cpp
+
+MemoryUsage.lo: $(segmentdir)/MemoryUsage.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT MemoryUsage.lo -MD -MP -MF "$(DEPDIR)/MemoryUsage.Tpo" -c -o MemoryUsage.lo `test -f '$(segmentdir)/MemoryUsage.cpp' || echo '$(srcdir)/'`$(segmentdir)/MemoryUsage.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/MemoryUsage.Tpo" "$(DEPDIR)/MemoryUsage.Plo"; else rm -f "$(DEPDIR)/MemoryUsage.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/MemoryUsage.cpp' object='MemoryUsage.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o MemoryUsage.lo `test -f '$(segmentdir)/MemoryUsage.cpp' || echo '$(srcdir)/'`$(segmentdir)/MemoryUsage.cpp
+
+Platform.lo: $(segmentdir)/Platform.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Platform.lo -MD -MP -MF "$(DEPDIR)/Platform.Tpo" -c -o Platform.lo `test -f '$(segmentdir)/Platform.cpp' || echo '$(srcdir)/'`$(segmentdir)/Platform.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/Platform.Tpo" "$(DEPDIR)/Platform.Plo"; else rm -f "$(DEPDIR)/Platform.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/Platform.cpp' object='Platform.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Platform.lo `test -f '$(segmentdir)/Platform.cpp' || echo '$(srcdir)/'`$(segmentdir)/Platform.cpp
+
+SegmentAux.lo: $(segmentdir)/SegmentAux.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SegmentAux.lo -MD -MP -MF "$(DEPDIR)/SegmentAux.Tpo" -c -o SegmentAux.lo `test -f '$(segmentdir)/SegmentAux.cpp' || echo '$(srcdir)/'`$(segmentdir)/SegmentAux.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SegmentAux.Tpo" "$(DEPDIR)/SegmentAux.Plo"; else rm -f "$(DEPDIR)/SegmentAux.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/SegmentAux.cpp' object='SegmentAux.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SegmentAux.lo `test -f '$(segmentdir)/SegmentAux.cpp' || echo '$(srcdir)/'`$(segmentdir)/SegmentAux.cpp
+
+Segment.lo: $(segmentdir)/Segment.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT Segment.lo -MD -MP -MF "$(DEPDIR)/Segment.Tpo" -c -o Segment.lo `test -f '$(segmentdir)/Segment.cpp' || echo '$(srcdir)/'`$(segmentdir)/Segment.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/Segment.Tpo" "$(DEPDIR)/Segment.Plo"; else rm -f "$(DEPDIR)/Segment.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/Segment.cpp' object='Segment.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o Segment.lo `test -f '$(segmentdir)/Segment.cpp' || echo '$(srcdir)/'`$(segmentdir)/Segment.cpp
+
+TestFSM.lo: $(segmentdir)/TestFSM.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TestFSM.lo -MD -MP -MF "$(DEPDIR)/TestFSM.Tpo" -c -o TestFSM.lo `test -f '$(segmentdir)/TestFSM.cpp' || echo '$(srcdir)/'`$(segmentdir)/TestFSM.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/TestFSM.Tpo" "$(DEPDIR)/TestFSM.Plo"; else rm -f "$(DEPDIR)/TestFSM.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/TestFSM.cpp' object='TestFSM.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TestFSM.lo `test -f '$(segmentdir)/TestFSM.cpp' || echo '$(srcdir)/'`$(segmentdir)/TestFSM.cpp
+
+TestPasses.lo: $(segmentdir)/TestPasses.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TestPasses.lo -MD -MP -MF "$(DEPDIR)/TestPasses.Tpo" -c -o TestPasses.lo `test -f '$(segmentdir)/TestPasses.cpp' || echo '$(srcdir)/'`$(segmentdir)/TestPasses.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/TestPasses.Tpo" "$(DEPDIR)/TestPasses.Plo"; else rm -f "$(DEPDIR)/TestPasses.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/TestPasses.cpp' object='TestPasses.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TestPasses.lo `test -f '$(segmentdir)/TestPasses.cpp' || echo '$(srcdir)/'`$(segmentdir)/TestPasses.cpp
+
+TransductionLog.lo: $(segmentdir)/TransductionLog.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT TransductionLog.lo -MD -MP -MF "$(DEPDIR)/TransductionLog.Tpo" -c -o TransductionLog.lo `test -f '$(segmentdir)/TransductionLog.cpp' || echo '$(srcdir)/'`$(segmentdir)/TransductionLog.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/TransductionLog.Tpo" "$(DEPDIR)/TransductionLog.Plo"; else rm -f "$(DEPDIR)/TransductionLog.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(segmentdir)/TransductionLog.cpp' object='TransductionLog.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o TransductionLog.lo `test -f '$(segmentdir)/TransductionLog.cpp' || echo '$(srcdir)/'`$(segmentdir)/TransductionLog.cpp
+
+SegmentPainter.lo: $(painterdir)/SegmentPainter.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT SegmentPainter.lo -MD -MP -MF "$(DEPDIR)/SegmentPainter.Tpo" -c -o SegmentPainter.lo `test -f '$(painterdir)/SegmentPainter.cpp' || echo '$(srcdir)/'`$(painterdir)/SegmentPainter.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/SegmentPainter.Tpo" "$(DEPDIR)/SegmentPainter.Plo"; else rm -f "$(DEPDIR)/SegmentPainter.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(painterdir)/SegmentPainter.cpp' object='SegmentPainter.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o SegmentPainter.lo `test -f '$(painterdir)/SegmentPainter.cpp' || echo '$(srcdir)/'`$(painterdir)/SegmentPainter.cpp
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-graphiteincludeHEADERS: $(graphiteinclude_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(graphiteincludedir)" || $(mkdir_p) "$(DESTDIR)$(graphiteincludedir)"
+ @list='$(graphiteinclude_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(graphiteincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(graphiteincludedir)/$$f'"; \
+ $(graphiteincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(graphiteincludedir)/$$f"; \
+ done
+
+uninstall-graphiteincludeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(graphiteinclude_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(graphiteincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(graphiteincludedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(mkdir_p) $(distdir)/$(fontdir) $(distdir)/$(genericdir) $(distdir)/$(segmentdir) $(distdir)/$(top_srcdir)/include/graphite $(distdir)/../include $(distdir)/../include/graphite $(distdir)/font $(distdir)/generic $(distdir)/painter $(distdir)/segment
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(graphiteincludedir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-graphiteincludeHEADERS
+
+install-exec-am: install-libLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-graphiteincludeHEADERS uninstall-info-am \
+ uninstall-libLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-graphiteincludeHEADERS install-info \
+ install-info-am install-libLTLIBRARIES install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-graphiteincludeHEADERS uninstall-info-am \
+ uninstall-libLTLIBRARIES
+
+
+#EXTRA_DIST += $(painterdir)/*.h
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/libs/graphite/src/font/FileFont.cpp b/Build/source/libs/graphite/src/font/FileFont.cpp
new file mode 100644
index 00000000000..4600b788ed2
--- /dev/null
+++ b/Build/source/libs/graphite/src/font/FileFont.cpp
@@ -0,0 +1,429 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999 - 2008 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: FileFont.cpp
+Responsibility: Keith Stribley
+Last reviewed: Not yet.
+
+Description:
+ A Font is an object that represents a font-family + bold + italic setting, that contains
+ Graphite tables.
+----------------------------------------------------------------------------------------------*/
+
+#include "Main.h"
+
+#include "FontTableCache.h"
+#include "FileFont.h"
+#include <stdio.h>
+
+
+// TBD do this properly
+#define FUDGE_FACTOR 72
+#define fix26_6(x) (x >> 6) + (x & 32 ? (x > 0 ? 1 : 0) : (x < 0 ? -1 : 0))
+
+namespace gr
+{
+
+
+FileFont::FileFont()
+ : Font(),
+ m_pfile(NULL),
+ m_pTableCache(NULL),
+ m_mAscent(0),
+ m_mDescent(0),
+ m_mEmSquare(0),
+ m_pointSize(0),
+ m_dpiX(FUDGE_FACTOR),
+ m_dpiY(FUDGE_FACTOR),
+ m_fIsValid(false),
+ m_pHeader(NULL),
+ m_pTableDir(NULL),
+ m_xScale(1.0f),
+ m_yScale(1.0f)
+{
+ m_fItalic = false;
+ m_fBold = false;
+ // colors are not used
+ m_clrFore = (unsigned long)kclrBlack;
+ m_clrBack = (unsigned long)kclrTransparent;
+}
+
+FileFont::FileFont(FILE * pfile, float pointSize,
+ unsigned int dpiX, unsigned int dpiY)
+ : Font(),
+ m_pfile(pfile),
+ m_pTableCache(NULL),
+ m_mAscent(0),
+ m_mDescent(0),
+ m_mEmSquare(0),
+ m_pointSize(pointSize),
+ m_dpiX(dpiX),
+ m_dpiY(dpiY),
+ m_fIsValid(false),
+ m_pHeader(NULL),
+ m_pTableDir(NULL),
+ m_xScale(1.0f),
+ m_yScale(1.0f)
+{
+ Assert(m_pfile); // shouldn't be null
+ initializeFromFace();
+
+}
+
+FileFont::FileFont(char * fileName, float pointSize,
+ unsigned int dpiX, unsigned int dpiY)
+ : Font(),
+ m_pfile(NULL),
+ m_pTableCache(NULL),
+ m_mAscent(0),
+ m_mDescent(0),
+ m_mEmSquare(0),
+ m_pointSize(pointSize),
+ m_dpiX(dpiX),
+ m_dpiY(dpiY),
+ m_fIsValid(false),
+ m_pHeader(NULL),
+ m_pTableDir(NULL),
+ m_xScale(1.0f),
+ m_yScale(1.0f)
+{
+ Assert(fileName); // shouldn't be null but we play safe anyway
+ m_pfile = fopen(fileName, "rb");
+
+ initializeFromFace();
+}
+
+FileFont::FileFont(std::string fileName, float pointSize,
+ unsigned int dpiX, unsigned int dpiY)
+ : Font(),
+ m_pfile(NULL),
+ m_pTableCache(NULL),
+ m_mAscent(0),
+ m_mDescent(0),
+ m_mEmSquare(0),
+ m_pointSize(pointSize),
+ m_dpiX(dpiX),
+ m_dpiY(dpiY),
+ m_fIsValid(false),
+ m_pHeader(NULL),
+ m_pTableDir(NULL),
+ m_xScale(1.0f),
+ m_yScale(1.0f)
+{
+ Assert(fileName.length()); // shouldn't be null but we play safe anyway
+ m_pfile = fopen(fileName.c_str(), "rb");
+
+ initializeFromFace();
+}
+
+
+void
+FileFont::initializeFromFace()
+{
+ if (m_dpiY == 0) m_dpiY = m_dpiX;
+ m_fItalic = false;
+ m_fBold = false;
+ // colors are not used
+ m_clrFore = (unsigned long)kclrBlack;
+ m_clrBack = (unsigned long)kclrTransparent;
+
+ if (m_pfile)
+ {
+ size_t lOffset, lSize;
+ TtfUtil::GetHeaderInfo(lOffset, lSize);
+ m_pHeader = new byte [lSize];
+ m_fIsValid = true;
+ if (!m_pHeader)
+ {
+ m_fIsValid = false;
+ return;
+ }
+ m_fIsValid = (fseek(m_pfile, lOffset, SEEK_SET) == 0);
+ size_t bytesRead = fread(m_pHeader, 1, lSize, m_pfile);
+ Assert(bytesRead == lSize);
+ m_fIsValid = TtfUtil::CheckHeader(m_pHeader);
+
+ if (!m_fIsValid) return;
+ m_fIsValid = TtfUtil::GetTableDirInfo(m_pHeader, lOffset, lSize);
+ m_pTableDir = new byte[lSize];
+ if (!m_pTableDir)
+ {
+ m_fIsValid = false;
+ return;
+ }
+ // if lOffset hasn't changed this isn't needed
+ fseek(m_pfile, lOffset, SEEK_SET);
+ bytesRead = fread(m_pTableDir, 1, lSize, m_pfile);
+ Assert(bytesRead == lSize);
+
+ // now read head tables
+ m_fIsValid = TtfUtil::GetTableInfo(ktiOs2, m_pHeader, m_pTableDir,
+ lOffset, lSize);
+ if (!m_fIsValid)
+ {
+ return;
+ }
+ byte * pTable = readTable(ktiOs2, lSize);
+ // get ascent, descent, style while we have the OS2 table loaded
+ if (!m_fIsValid || !pTable)
+ {
+ return;
+ }
+ m_fIsValid = TtfUtil::FontOs2Style(pTable, m_fBold, m_fItalic);
+ m_mAscent = static_cast<float>(TtfUtil::FontAscent(pTable));
+ m_mDescent = static_cast<float>(TtfUtil::FontDescent(pTable));
+
+ pTable = readTable(ktiName, lSize);
+ if (!m_fIsValid || !pTable)
+ {
+ return;
+ }
+ if (!TtfUtil::Get31EngFamilyInfo(pTable, lOffset, lSize))
+ {
+ // not English name
+ m_fIsValid = false;
+ return;
+ }
+ Assert(lSize %2 == 0);// should be utf16
+ utf16 rgchwFace[128];
+ int cchw = (lSize / isizeof(utf16)) + 1;
+ cchw = min(cchw, 128);
+ utf16 * pTable16 = reinterpret_cast<utf16*>(pTable + lOffset);
+ std::copy(pTable16, pTable16 + cchw - 1, rgchwFace);
+ rgchwFace[cchw - 1] = 0; // zero terminate
+ TtfUtil::SwapWString(rgchwFace, cchw - 1);
+// We could use something like "if (sizeof(std::wstring::value_type) == 4)" here,
+// but a compile-time switch is preferable.
+#if SIZEOF_WCHAR_T == 4
+ for (int cch16 = 0; cch16 < cchw; )
+ {
+ int cch16Used = 0;
+ utf32 ch32 = GrCharStream::Utf16ToUtf32(&(rgchwFace[cch16]),
+ cchw - cch16, &cch16Used);
+ m_stuFaceName.push_back(ch32);
+ cch16 += cch16Used;
+ }
+// }
+#else
+ m_stuFaceName.assign(rgchwFace);
+ // VS 2005 needs this:
+ //for (int cch16 = 0; cch16 < cchw; cch16++)
+ // m_stuFaceName.push_back(rgchwFace[cch16]);
+#endif
+ pTable = readTable(ktiHead, lSize);
+ if (!m_fIsValid || !pTable)
+ {
+ return;
+ }
+ m_mEmSquare = static_cast<float>(TtfUtil::DesignUnits(pTable));
+ // can now set the scale
+ m_xScale = scaleFromDpi(m_dpiX);
+ m_yScale = scaleFromDpi(m_dpiY);
+ }
+ else
+ {
+ m_fIsValid = false;
+ }
+}
+
+byte *
+FileFont::readTable(int /*TableId*/ tid, size_t & size)
+{
+ const TableId tableId = TableId(tid);
+ bool isValid = true;
+ size_t lOffset = 0, lSize = 0;
+ if (!m_pTableCache)
+ {
+ m_pTableCache = new FontTableCache();
+ }
+ if (!m_pTableCache) return NULL;
+
+ byte * pTable = m_pTableCache->getTable(tableId);
+ size = m_pTableCache->getTableSize(tableId);
+ // check whether it is already in the cache
+ if (pTable) return pTable;
+ isValid &= TtfUtil::GetTableInfo(tableId, m_pHeader, m_pTableDir,
+ lOffset, lSize);
+ if (!isValid)
+ return NULL;
+ fseek(m_pfile, lOffset, SEEK_SET);
+ // only allocate if needed
+ pTable = m_pTableCache->allocateTable(tableId, lSize);
+
+ if (!pTable)
+ {
+ isValid = false;
+ return NULL;
+ }
+ size_t bytesRead = fread(pTable, 1, lSize, m_pfile);
+ isValid = bytesRead == lSize;
+ if (isValid)
+ {
+ isValid &= TtfUtil::CheckTable(tableId, pTable, lSize);
+ }
+ if (!isValid)
+ {
+ return 0;
+ }
+ size = lSize;
+ return pTable;
+}
+
+
+FileFont::~FileFont()
+{
+
+ // if this is the last copy of the font sharing these tables
+ // delete them
+ if (m_pTableCache)
+ {
+ m_pTableCache->decrementFontCount();
+ if (m_pTableCache->getFontCount() == 0)
+ {
+ delete [] m_pHeader;
+ delete [] m_pTableDir;
+ delete m_pTableCache;
+ m_pTableCache = NULL;
+ if (m_pfile)
+ fclose(m_pfile);
+ }
+ }
+ else
+ {
+ delete [] m_pHeader;
+ delete [] m_pTableDir;
+ if (m_pfile)
+ fclose(m_pfile);
+ }
+ // note the DecFontCount(); is done in the Font base class
+}
+
+Font * FileFont::copyThis()
+{
+ FileFont * copy = new FileFont(*this);
+ return copy;
+}
+
+/**
+* A copy constructor that allows a change of point size or dpi
+* The underlying table cache will be shared between the fonts, so
+* this should have a low overhead.
+*/
+FileFont::FileFont(const FileFont & font, float pointSize,
+ unsigned int dpiX, unsigned int dpiY)
+: Font(font),
+ m_pfile(font.m_pfile),
+ m_mAscent(font.m_mAscent),
+ m_mDescent(font.m_mDescent),
+ m_mEmSquare(font.m_mEmSquare),
+ m_pointSize(font.m_pointSize),
+ m_dpiX(font.m_dpiX),
+ m_dpiY(font.m_dpiY),
+ m_fIsValid(font.m_fIsValid),
+ m_pHeader(font.m_pHeader),
+ m_pTableDir(font.m_pTableDir),
+ m_xScale(font.m_xScale),
+ m_yScale(font.m_yScale)
+{
+ if (pointSize > 0)
+ {
+ m_pointSize = pointSize;
+ if (dpiX > 0)
+ {
+ m_dpiX = dpiX;
+ if (dpiY > 0) m_dpiY = dpiY;
+ else dpiY = dpiX;
+ }
+ m_xScale = scaleFromDpi(m_dpiX);
+ m_yScale = scaleFromDpi(m_dpiY);
+ }
+ m_fItalic = font.m_fItalic;
+ m_fBold = font.m_fBold;
+ // colors are not used
+ m_clrFore = font.m_clrFore;
+ m_clrBack = font.m_clrBack;
+ m_stuFaceName.assign(font.m_stuFaceName);
+
+ m_pTableCache = font.m_pTableCache;
+ // use the same table cache between instances
+ if (m_pTableCache)
+ m_pTableCache->incrementFontCount();
+
+
+ // I dont' see why we need to reget the face, but WinFont does
+ //m_pfface = FontFace::GetFontFace(this, m_fpropDef.szFaceName,
+ // m_fpropDef.fBold, m_fpropDef.fItalic);
+}
+
+
+
+ //virtual FontErrorCode isValidForGraphite(int * pnVersion = NULL, int * pnSubVersion = NULL);
+
+/*----------------------------------------------------------------------------------------------
+ Read a table from the font.
+----------------------------------------------------------------------------------------------*/
+const void *
+FileFont::getTable(fontTableId32 tableID, size_t * pcbSize)
+{
+ *pcbSize = 0;
+ // use a cache to reduce the number of times tables have to be reloaded
+ if (m_pTableCache == NULL)
+ {
+ // constructor automatically sets the font count to 1
+ m_pTableCache = new FontTableCache();
+ }
+ TableId tid;
+ for (int i = 0; i<ktiLast; i++)
+ {
+ tid = static_cast<TableId>(i);
+ if (tableID == TtfUtil::TableIdTag(tid))
+ {
+ if (m_pTableCache->getTable(tid))
+ {
+ *pcbSize = m_pTableCache->getTableSize(tid);
+ return m_pTableCache->getTable(tid);
+ }
+ break;
+ }
+ }
+ Assert(tid < ktiLast);
+ size_t tableSize = 0;
+ void * pTable = readTable(tid, tableSize);
+ *pcbSize = static_cast<int>(tableSize);
+ return pTable;
+}
+
+
+void FileFont::getFontMetrics(float * pAscent, float * pDescent,
+ float * pEmSquare)
+{
+ if (pEmSquare) *pEmSquare = m_mEmSquare * m_xScale;
+ if (pAscent) *pAscent = m_mAscent * m_yScale;
+ if (pDescent) *pDescent = m_mDescent * m_yScale;
+}
+
+
+bool FileFont::FontHasGraphiteTables(FILE * file)
+{
+ FileFont testFont(file, 1.0f, FUDGE_FACTOR);
+ return testFont.fontHasGraphiteTables();
+}
+
+bool FileFont::FontHasGraphiteTables(char * fileName)
+{
+ FileFont testFont(fileName, 1.0f, FUDGE_FACTOR);
+ return testFont.fontHasGraphiteTables();
+}
+
+bool FileFont::fontHasGraphiteTables()
+{
+ size_t tableSize;
+ bool isGraphiteFont = m_fIsValid;
+ isGraphiteFont &= (readTable(ktiSilf, tableSize) != NULL);
+ return isGraphiteFont;
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/font/Font.cpp b/Build/source/libs/graphite/src/font/Font.cpp
new file mode 100644
index 00000000000..95cf2cefd41
--- /dev/null
+++ b/Build/source/libs/graphite/src/font/Font.cpp
@@ -0,0 +1,950 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999 - 2008 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: Font.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ A font is an object that knows how to read tables from a (platform-specific) font resource.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+// any other headers (not precompiled)
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Font methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Constructor.
+----------------------------------------------------------------------------------------------*/
+Font::Font(const Font & fontSrc) : m_pfface(fontSrc.m_pfface), m_fTablesCached(false)
+{
+ if (m_pfface)
+ m_pfface->IncFontCount();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Destructor.
+----------------------------------------------------------------------------------------------*/
+Font::~Font()
+{
+ if (m_pfface)
+ m_pfface->DecFontCount();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Mark the font-cache as to whether it should be deleted when all the font instances go away.
+----------------------------------------------------------------------------------------------*/
+void Font::SetFlushMode(int flush)
+{
+ FontFace::SetFlushMode(flush);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Cache the common tables if necessary.
+----------------------------------------------------------------------------------------------*/
+void Font::EnsureTablesCached()
+{
+ if (m_fTablesCached)
+ return;
+
+ size_t cbBogus;
+ m_pHead = getTable(TtfUtil::TableIdTag(ktiHead), &cbBogus);
+ m_pHmtx = getTable(TtfUtil::TableIdTag(ktiHmtx), &m_cbHmtxSize);
+ m_pGlyf = getTable(TtfUtil::TableIdTag(ktiGlyf), &cbBogus);
+ m_pLoca = getTable(TtfUtil::TableIdTag(ktiLoca), &m_cbLocaSize);
+
+ // getTable can return 0 for the lengths if it is hard to calculate them, but it should
+ // never do that for hmtx or loca.
+ Assert(m_cbHmtxSize > 0);
+ Assert(m_cbLocaSize > 0);
+
+ m_fTablesCached = true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the flush mode of the font-cache.
+----------------------------------------------------------------------------------------------*/
+int Font::GetFlushMode()
+{
+ return FontFace::GetFlushMode();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the internal object representing the font-face. This is the object that is stored
+ in Graphite's internal cache.
+----------------------------------------------------------------------------------------------*/
+inline FontFace & Font::fontFace(bool fDumbFallback)
+{
+ if (m_pfface == 0)
+ initialiseFontFace(fDumbFallback);
+ return *m_pfface;
+}
+
+void Font::initialiseFontFace(bool fDumbFallback)
+{
+ std::wstring stuFaceName;
+ bool fBold, fItalic;
+
+ UniqueCacheInfo(stuFaceName, fBold, fItalic);
+
+ m_pfface = FontFace::GetFontFace(this, stuFaceName, fBold, fItalic, fDumbFallback);
+
+ Assert(m_pfface != 0);
+
+ m_pfface->IncFontCount();
+
+ FontException fexptn;
+ fexptn.version = -1;
+ fexptn.subVersion = -1;
+ if (m_pfface->BadFont(&fexptn.errorCode)
+ || (!fDumbFallback && m_pfface->DumbFallback(&fexptn.errorCode)))
+ {
+ throw fexptn;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return uniquely identifying information that will be used as the key for this font
+ in the font cache. This includes the font face name and the bold and italic flags.
+----------------------------------------------------------------------------------------------*/
+void Font::UniqueCacheInfo(std::wstring & stuFace, bool & fBold, bool & fItalic)
+{
+ size_t cbSize;
+ const byte * pNameTbl = static_cast<const byte *>(getTable(TtfUtil::TableIdTag(ktiName), &cbSize));
+ size_t lOffset, lSize;
+ if (!TtfUtil::Get31EngFamilyInfo(pNameTbl, lOffset, lSize))
+ {
+ // TODO: try to find any name in any arbitrary language.
+ Assert(false);
+ return;
+ }
+ // byte * pvName = (byte *)pNameTbl + lOffset;
+ utf16 rgchwFace[128];
+ const size_t cchw = min(long(lSize / sizeof(utf16)), long((sizeof(rgchwFace) / sizeof(utf16)) - 1));
+ // NOTE: there is a potential alignment problem in the following two lines, which can causes
+ // crashes on architectures that require alignment to word boundaries.
+ const utf16 * pchwNameStart = reinterpret_cast<const utf16 *>(pNameTbl+ lOffset);
+ std::copy(pchwNameStart, pchwNameStart + cchw, rgchwFace);
+ rgchwFace[cchw] = 0; // zero terminate
+ TtfUtil::SwapWString(rgchwFace, cchw);
+ for (size_t ich16 = 0; ich16 < cchw; ich16++) // equivalent to assign, but works in more situations
+ stuFace.push_back(wchar_t(rgchwFace[ich16])); // where where wchar_t is 4 bytes
+
+ const void * pOs2Tbl = getTable(TtfUtil::TableIdTag(ktiOs2), &cbSize);
+ TtfUtil::FontOs2Style(pOs2Tbl, fBold, fItalic);
+ // Do we need to compare the results from the OS2 table with the italic flag in the
+ // head table? (There is no requirement that they be consistent!)
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ A default unhinted implmentation of getGlyphPoint(..)
+----------------------------------------------------------------------------------------------*/
+void Font::getGlyphPoint(gid16 glyphID, unsigned int pointNum, Point & pointReturn)
+{
+ EnsureTablesCached();
+
+ // Default values
+ pointReturn.x = 0;
+ pointReturn.y = 0;
+
+ if (m_pGlyf == 0) return;
+ if (m_pHead == 0) return;
+ if (m_pLoca == 0) return;
+
+ size_t cContours;
+ size_t cPoints;
+
+ const size_t CONTOUR_BUF_SIZE = 16;
+ const size_t POINT_BUF_SIZE = 64;
+ // Fixed-size buffers that will be used in most cases:
+ bool rgfOnCurveFixedBuf[POINT_BUF_SIZE], *rgfOnCurveHeapBuf=0;
+ int rgnEndPtFixedBuf[CONTOUR_BUF_SIZE], *rgnEndPtHeapBuf=0,
+ rgnXFixedBuf[POINT_BUF_SIZE], *rgnXHeapBuf=0,
+ rgnYFixedBuf[POINT_BUF_SIZE], *rgnYHeapBuf=0;
+
+ if (!TtfUtil::GlyfContourCount(glyphID, m_pGlyf, m_pLoca, m_cbLocaSize, m_pHead, cContours))
+ return; // can't figure it out
+
+ int * prgnEndPt = (cContours > CONTOUR_BUF_SIZE) ?
+ rgnEndPtHeapBuf = new int[cContours] :
+ rgnEndPtFixedBuf;
+
+ if (!TtfUtil::GlyfContourEndPoints(glyphID, m_pGlyf, m_pLoca, m_cbLocaSize, m_pHead,
+ prgnEndPt, cContours))
+ {
+ return; // should have been caught above
+ }
+ cPoints = prgnEndPt[cContours - 1] + 1;
+
+ bool* prgfOnCurve = (cPoints > POINT_BUF_SIZE) ? rgfOnCurveHeapBuf= new bool[cPoints] : rgfOnCurveFixedBuf;
+ int * prgnX = (cPoints > POINT_BUF_SIZE) ? rgnXHeapBuf= new int[cPoints] : rgnXFixedBuf;
+ int * prgnY = (cPoints > POINT_BUF_SIZE) ? rgnYHeapBuf= new int[cPoints] : rgnYFixedBuf;
+
+ if (TtfUtil::GlyfPoints(glyphID, m_pGlyf, m_pLoca, m_cbLocaSize, m_pHead, 0, 0,
+ prgnX, prgnY, prgfOnCurve, cPoints))
+ {
+ float nPixEmSquare;
+ getFontMetrics(0, 0, &nPixEmSquare);
+
+ const float nDesignUnitsPerPixel = float(TtfUtil::DesignUnits(m_pHead)) / nPixEmSquare;
+ pointReturn.x = prgnX[pointNum] / nDesignUnitsPerPixel;
+ pointReturn.y = prgnY[pointNum] / nDesignUnitsPerPixel;
+ }
+
+ delete[] rgnEndPtHeapBuf;
+ delete[] rgfOnCurveHeapBuf;
+ delete[] rgnXHeapBuf;
+ delete[] rgnYHeapBuf;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ A default unhinted implmentation of getGlyphMetrics(..)
+----------------------------------------------------------------------------------------------*/
+void Font::getGlyphMetrics(gid16 glyphID, gr::Rect & boundingBox, gr::Point & advances)
+{
+ EnsureTablesCached();
+
+ // Setup default return values in case of failiure.
+ boundingBox.left = 0;
+ boundingBox.right = 0;
+ boundingBox.bottom = 0;
+ boundingBox.top = 0;
+ advances.x = 0;
+ advances.y = 0;
+
+ if (m_pHead == 0) return;
+
+ // Calculate the number of design units per pixel.
+ float pixelEmSquare;
+ getFontMetrics(0, 0, &pixelEmSquare);
+ const float pixelsPerDesignUnit =
+ pixelEmSquare / float(TtfUtil::DesignUnits(m_pHead));
+
+ // getTable can return 0 for the lengths if it is hard to calculate them, but it should
+ // never do that for hmtx or loca.
+ Assert(m_cbHmtxSize > 0);
+
+ // Use the Hmtx and Head tables to find the glyph advances.
+ int lsb;
+ unsigned int advance = 0;
+ if (TtfUtil::HorMetrics(glyphID, m_pHmtx, m_cbHmtxSize, m_pHead,
+ lsb, advance))
+ {
+ advances.x = (advance * pixelsPerDesignUnit);
+ advances.y = 0.0f;
+ }
+
+ if (m_pGlyf == 0) return;
+ if (m_pLoca == 0) return;
+ Assert(m_cbLocaSize > 0);
+
+ // Fetch the glyph bounding box. GlyphBox may return false for a whitespace glyph.
+ // Note that using GlyfBox here allows attachment points (ie, points lying outside
+ // the glyph's outline) to affect the bounding box, which might not be what we want.
+ int xMin, xMax, yMin, yMax;
+ if (TtfUtil::GlyfBox(glyphID, m_pGlyf, m_pLoca, m_cbLocaSize, m_pHead,
+ xMin, yMin, xMax, yMax))
+ {
+ boundingBox.left = (xMin * pixelsPerDesignUnit);
+ boundingBox.bottom = (yMin * pixelsPerDesignUnit);
+ boundingBox.right = (xMax * pixelsPerDesignUnit);
+ boundingBox.top = (yMax * pixelsPerDesignUnit);
+ }
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Return a pair of iterators over a sequence of features defined for the font.
+----------------------------------------------------------------------------------------------*/
+std::pair<FeatureIterator, FeatureIterator> Font::getFeatures()
+{
+ std::pair<FeatureIterator, FeatureIterator> pairRet;
+ pairRet.first = BeginFeature();
+ pairRet.second = EndFeature();
+ return pairRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Returns an iterator indicating the feature with the given ID. If no such feature,
+ returns the end iterator.
+----------------------------------------------------------------------------------------------*/
+FeatureIterator Font::featureWithID(featid id)
+{
+ FeatureIterator fit = BeginFeature();
+ FeatureIterator fitEnd = EndFeature();
+ for ( ; fit != fitEnd ; ++fit)
+ {
+ if (*fit == id)
+ return fit;
+ }
+ return fitEnd; // invalid
+}
+
+/*----------------------------------------------------------------------------------------------
+ Returns the UI label for the indicated feature. Return false if there is no label for the
+ language, or it is empty.
+----------------------------------------------------------------------------------------------*/
+bool Font::getFeatureLabel(FeatureIterator fit, lgid nLanguage, utf16 * label)
+{
+ return GetFeatureLabel(fit.m_ifeat, nLanguage, label);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Returns an iterator pointing at the default value for the feature.
+----------------------------------------------------------------------------------------------*/
+FeatureSettingIterator Font::getDefaultFeatureValue(FeatureIterator fit)
+{
+ size_t ifset = GetFeatureDefault(fit.m_ifeat);
+ FeatureSettingIterator fsit = fit.BeginSetting();
+ fsit += ifset;
+ return fsit;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Returns a pair of iterators spanning the defined settings for the feature.
+----------------------------------------------------------------------------------------------*/
+std::pair<FeatureSettingIterator, FeatureSettingIterator>
+ Font::getFeatureSettings(FeatureIterator fit)
+{
+ std::pair<FeatureSettingIterator, FeatureSettingIterator> pairRet;
+ pairRet.first = fit.BeginSetting();
+ pairRet.second = fit.EndSetting();
+ return pairRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Returns the UI label for the indicated feature. Return false if there is no label for the
+ language, or it is empty.
+----------------------------------------------------------------------------------------------*/
+bool Font::getFeatureSettingLabel(FeatureSettingIterator fsit, lgid nLanguage, utf16 * label)
+{
+ //FeatureIterator * pfit = static_cast<FeatureIterator *>(fsit.m_pfit);
+ return GetFeatureSettingLabel(fsit.m_fit.m_ifeat, fsit.m_ifset, nLanguage, label);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Private methods for feature and language access.
+----------------------------------------------------------------------------------------------*/
+size_t Font::NumberOfFeatures()
+{
+ try {
+ return fontFace().NumberOfFeatures();
+ }
+ catch (...) { return 0; }
+}
+featid Font::FeatureID(size_t ifeat)
+{
+ try {
+ return fontFace().FeatureID(ifeat);
+ }
+ catch (...) { return 0; }
+}
+size_t Font::FeatureWithID(featid id)
+{
+ try {
+ return fontFace().FeatureWithID(id);
+ }
+ catch (...) { return 0; }
+}
+bool Font::GetFeatureLabel(size_t ifeat, lgid language, utf16 * label)
+{
+ try {
+ return fontFace().GetFeatureLabel(ifeat, language, label);
+ }
+ catch (...)
+ {
+ *label = 0;
+ return false;
+ }
+}
+int Font::GetFeatureDefault(size_t ifeat) // index of default setting
+{
+ try {
+ return fontFace().GetFeatureDefault(ifeat);
+ }
+ catch (...) { return 0; }
+}
+size_t Font::NumberOfSettings(size_t ifeat)
+{
+ try {
+ return fontFace().NumberOfSettings(ifeat);
+ }
+ catch (...) { return 0; }
+}
+int Font::GetFeatureSettingValue(size_t ifeat, size_t ifset)
+{
+ try {
+ return fontFace().GetFeatureSettingValue(ifeat, ifset);
+ }
+ catch (...) { return 0; }
+}
+bool Font::GetFeatureSettingLabel(size_t ifeat, size_t ifset, lgid language, utf16 * label)
+{
+ try {
+ return fontFace().GetFeatureSettingLabel(ifeat, ifset, language, label);
+ }
+ catch (...)
+ {
+ *label = 0;
+ return false;
+ }
+}
+size_t Font::NumberOfFeatLangs()
+{
+ try {
+ return fontFace().NumberOfFeatLangs();
+ }
+ catch (...) { return 0; }
+}
+short Font::FeatLabelLang(size_t ilang)
+{
+ try {
+ return fontFace().FeatLabelLang(ilang);
+ }
+ catch (...) { return 0; }
+}
+size_t Font::NumberOfLanguages()
+{
+ try {
+ return fontFace().NumberOfLanguages();
+ }
+ catch (...) { return 0; }
+}
+isocode Font::LanguageCode(size_t ilang)
+{
+ try {
+ return fontFace().LanguageCode(ilang);
+ }
+ catch (...)
+ {
+ isocode ret;
+ std::fill_n(ret.rgch, sizeof(ret.rgch), '\0');
+ return ret;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return a pair of iterators over a sequence of feature-label languages for this font.
+----------------------------------------------------------------------------------------------*/
+std::pair<FeatLabelLangIterator, FeatLabelLangIterator> Font::getFeatureLabelLanguages()
+{
+ std::pair<FeatLabelLangIterator, FeatLabelLangIterator> pairRet;
+ pairRet.first = BeginFeatLang();
+ pairRet.second = EndFeatLang();
+ return pairRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return a pair of iterators over a sequence of languages defined for the font, that is,
+ those that have features specified for them.
+----------------------------------------------------------------------------------------------*/
+std::pair<LanguageIterator, LanguageIterator> Font::getSupportedLanguages()
+{
+ std::pair<LanguageIterator, LanguageIterator> pairRet;
+ pairRet.first = BeginLanguage();
+ pairRet.second = EndLanguage();
+ return pairRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return a bitmap indicating which directions are supported by the font.
+----------------------------------------------------------------------------------------------*/
+ScriptDirCode Font::getSupportedScriptDirections() const throw()
+{
+ try {
+ Font * pfontThis = const_cast<Font *>(this);
+ FontFace & fface = pfontThis->fontFace();
+ return fface.ScriptDirection();
+ }
+ catch (...) {
+ return kfsdcHorizLtr;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ For segment creation.
+----------------------------------------------------------------------------------------------*/
+void Font::RenderLineFillSegment(Segment * pseg, ITextSource * pts, LayoutEnvironment & layout,
+ toffset ichStart, toffset ichStop, float xsMaxWidth, bool fBacktracking)
+{
+ fontFace(layout.dumbFallback()).RenderLineFillSegment(pseg, this, pts, layout,
+ ichStart, ichStop, xsMaxWidth, fBacktracking);
+}
+
+void Font::RenderRangeSegment(Segment * pseg, ITextSource * pts, LayoutEnvironment & layout,
+ toffset ichStart, toffset ichStop)
+{
+ fontFace(layout.dumbFallback()).RenderRangeSegment(pseg, this, pts, layout, ichStart, ichStop);
+}
+
+void Font::RenderJustifiedSegment(Segment * pseg, ITextSource * pts,
+ LayoutEnvironment & layout, toffset ichStart, toffset ichStop,
+ float xsCurrentWidth, float xsDesiredWidth)
+{
+ fontFace(layout.dumbFallback()).RenderJustifiedSegment(pseg, this, pts, layout,
+ ichStart, ichStop, xsCurrentWidth, xsDesiredWidth);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Feature iterators.
+----------------------------------------------------------------------------------------------*/
+FeatureIterator Font::BeginFeature()
+{
+ FeatureIterator fit(this, 0, NumberOfFeatures());
+ return fit;
+}
+
+FeatureIterator Font::EndFeature()
+{
+ int cfeat = NumberOfFeatures();
+ FeatureIterator fit (this, cfeat, cfeat);
+ return fit;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Feature-label language iterators.
+----------------------------------------------------------------------------------------------*/
+FeatLabelLangIterator Font::BeginFeatLang()
+{
+ FeatLabelLangIterator lgit(this, 0, NumberOfFeatLangs());
+ return lgit;
+}
+
+FeatLabelLangIterator Font::EndFeatLang()
+{
+ int clang = NumberOfFeatLangs();
+ FeatLabelLangIterator lgit(this, clang, clang);
+ return lgit;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Language iterators.
+----------------------------------------------------------------------------------------------*/
+LanguageIterator Font::BeginLanguage()
+{
+ LanguageIterator lgit(this, 0, NumberOfLanguages());
+ return lgit;
+}
+
+LanguageIterator Font::EndLanguage()
+{
+ int clang = NumberOfLanguages();
+ LanguageIterator lgit(this, clang, clang);
+ return lgit;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Debugging.
+----------------------------------------------------------------------------------------------*/
+//bool Font::DbgCheckFontCache()
+//{
+// return FontFace::DbgCheckFontCache();
+//}
+
+
+//:>********************************************************************************************
+//:> FeatureIterator methods
+//:>********************************************************************************************
+
+//FeatureIterator::FeatureIterator(FeatureIterator & fitToCopy)
+//{
+// m_pfont = fitToCopy.m_pfont;
+// m_ifeat = fitToCopy.m_ifeat;
+// m_cfeat = fitToCopy.m_cfeat;
+//}
+
+/*----------------------------------------------------------------------------------------------
+ Dereference the iterator, returning a feature ID.
+----------------------------------------------------------------------------------------------*/
+featid FeatureIterator::operator*()
+{
+ if (m_ifeat >= m_cfeat)
+ {
+ Assert(false);
+ return (unsigned int)kInvalid;
+ }
+
+ return m_pfont->FeatureID(m_ifeat);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Increment the iterator.
+----------------------------------------------------------------------------------------------*/
+FeatureIterator FeatureIterator::operator++()
+{
+ if (m_ifeat >= m_cfeat)
+ {
+ // Can't increment.
+ Assert(false);
+ }
+ else
+ m_ifeat++;
+
+ return *this;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Increment the iterator by the given value.
+----------------------------------------------------------------------------------------------*/
+FeatureIterator FeatureIterator::operator+=(int n)
+{
+ if (m_ifeat + n >= m_cfeat)
+ {
+ // Can't increment.
+ Assert(false);
+ m_ifeat = m_cfeat;
+ }
+ else if (m_ifeat + n < 0)
+ {
+ // Can't decrement.
+ Assert(false);
+ m_ifeat = 0;
+ }
+ else
+ m_ifeat += m_cfeat;
+
+ return *this;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Test whether the two iterators are equal.
+----------------------------------------------------------------------------------------------*/
+bool FeatureIterator::operator==(FeatureIterator & fit)
+{
+ return (fit.m_ifeat == m_ifeat && fit.m_pfont == m_pfont);
+}
+
+bool FeatureIterator::operator!=(FeatureIterator & fit)
+{
+ return (fit.m_ifeat != m_ifeat || fit.m_pfont != m_pfont);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of items represented by the range of the two iterators.
+----------------------------------------------------------------------------------------------*/
+int FeatureIterator::operator-(FeatureIterator & fit)
+{
+ if (m_pfont != fit.m_pfont)
+ {
+ throw;
+ }
+ return (m_ifeat - fit.m_ifeat);
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Iterators.
+----------------------------------------------------------------------------------------------*/
+FeatureSettingIterator FeatureIterator::BeginSetting()
+{
+ int cfset = m_pfont->NumberOfSettings(m_ifeat);
+ FeatureSettingIterator fsit(*this, 0, cfset);
+ return fsit;
+}
+
+FeatureSettingIterator FeatureIterator::EndSetting()
+{
+ int cfset = m_pfont->NumberOfSettings(m_ifeat);
+ FeatureSettingIterator fsit(*this, cfset, cfset);
+ return fsit;
+}
+
+
+//:>********************************************************************************************
+//:> FeatureSettingIterator methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Dereference the iterator, returning a feature value.
+----------------------------------------------------------------------------------------------*/
+int FeatureSettingIterator::operator*()
+{
+ if (m_ifset >= m_cfset)
+ {
+ Assert(false);
+ return kInvalid;
+ }
+
+ return m_fit.m_pfont->GetFeatureSettingValue(m_fit.m_ifeat, m_ifset);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Increment the iterator.
+----------------------------------------------------------------------------------------------*/
+FeatureSettingIterator FeatureSettingIterator::operator++()
+{
+ if (m_ifset >= m_cfset)
+ {
+ // Can't increment.
+ Assert(false);
+ }
+ else
+ m_ifset++;
+
+ return *this;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Increment the iterator by the given value.
+----------------------------------------------------------------------------------------------*/
+FeatureSettingIterator FeatureSettingIterator::operator+=(int n)
+{
+ if (m_ifset + n >= m_cfset)
+ {
+ // Can't increment.
+ Assert(false);
+ m_ifset = m_cfset;
+ }
+ if (m_ifset + n < 0)
+ {
+ // Can't decrement.
+ Assert(false);
+ m_ifset = 0;
+ }
+ else
+ m_ifset += n;
+
+ return *this;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Test whether the two iterators are equal.
+----------------------------------------------------------------------------------------------*/
+bool FeatureSettingIterator::operator==(FeatureSettingIterator & fsit)
+{
+ //FeatureIterator * pfit = static_cast<FeatureIterator *>(m_pfit);
+ //FeatureIterator * pfitOther = static_cast<FeatureIterator *>(fsit.m_pfit);
+ //return (m_ifset == fsit.m_ifset && pfit == pfitOther);
+ return (m_ifset == fsit.m_ifset && m_fit == fsit.m_fit);
+}
+
+bool FeatureSettingIterator::operator!=(FeatureSettingIterator & fsit)
+{
+ //FeatureIterator * pfit = static_cast<FeatureIterator *>(m_pfit);
+ //FeatureIterator * pfitOther = static_cast<FeatureIterator *>(fsit.m_pfit);
+ //return (m_ifset != fsit.m_ifset || pfit != pfitOther);
+
+ return (m_ifset != fsit.m_ifset || m_fit != fsit.m_fit);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of items represented by the range of the two iterators.
+----------------------------------------------------------------------------------------------*/
+int FeatureSettingIterator::operator-(FeatureSettingIterator fsit)
+{
+ //FeatureIterator * pfit = static_cast<FeatureIterator *>(m_pfit);
+ //FeatureIterator * pfitOther = static_cast<FeatureIterator *>(fsit.m_pfit);
+ //if (pfit != pfitOther)
+
+ if (m_fit != fsit.m_fit)
+ {
+ throw;
+ }
+ return (m_ifset - fsit.m_ifset);
+}
+
+//:>********************************************************************************************
+//:> FeatLabelLangIterator methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Dereference the iterator, returning a language LCID.
+----------------------------------------------------------------------------------------------*/
+data16 FeatLabelLangIterator::operator*()
+{
+ if (m_ilang >= m_clang)
+ {
+ Assert(false);
+ return 0;
+ }
+
+ return m_pfont->FeatLabelLang(m_ilang);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Increment the iterator.
+----------------------------------------------------------------------------------------------*/
+FeatLabelLangIterator FeatLabelLangIterator::operator++()
+{
+ if (m_ilang >= m_clang)
+ {
+ // Can't increment.
+ Assert(false);
+ }
+ else
+ m_ilang++;
+
+ return *this;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Increment the iterator by the given value.
+----------------------------------------------------------------------------------------------*/
+FeatLabelLangIterator FeatLabelLangIterator::operator+=(int n)
+{
+ if (m_ilang + n >= m_clang)
+ {
+ // Can't increment.
+ Assert(false);
+ m_ilang = m_clang;
+ }
+ else if (m_ilang + n < 0)
+ {
+ // Can't decrement.
+ Assert(false);
+ m_ilang = 0;
+ }
+ else
+ m_ilang += m_clang;
+
+ return *this;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Test whether the two iterators are equal.
+----------------------------------------------------------------------------------------------*/
+bool FeatLabelLangIterator::operator==(FeatLabelLangIterator & fllit)
+{
+ return (fllit.m_ilang == m_ilang && fllit.m_pfont == m_pfont);
+}
+
+bool FeatLabelLangIterator::operator!=(FeatLabelLangIterator & fllit)
+{
+ return (fllit.m_ilang != m_ilang || fllit.m_pfont != m_pfont);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of items represented by the range of the two iterators.
+----------------------------------------------------------------------------------------------*/
+int FeatLabelLangIterator::operator-(FeatLabelLangIterator & fllit)
+{
+ if (m_pfont != fllit.m_pfont)
+ {
+ throw;
+ }
+ return (m_ilang - fllit.m_ilang);
+}
+
+
+//:>********************************************************************************************
+//:> LanguageIterator methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Dereference the iterator, returning a language code.
+----------------------------------------------------------------------------------------------*/
+isocode LanguageIterator::operator*()
+{
+ if (m_ilang >= m_clang)
+ {
+ Assert(false);
+ isocode codeRet;
+ codeRet.rgch[0] = '?'; codeRet.rgch[1] = '?';
+ codeRet.rgch[2] = '?'; codeRet.rgch[3] = 0;
+ return codeRet;
+ }
+
+ return m_pfont->LanguageCode(m_ilang);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Increment the iterator.
+----------------------------------------------------------------------------------------------*/
+LanguageIterator LanguageIterator::operator++()
+{
+ if (m_ilang >= m_clang)
+ {
+ // Can't increment.
+ Assert(false);
+ }
+ else
+ m_ilang++;
+
+ return *this;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Increment the iterator by the given value.
+----------------------------------------------------------------------------------------------*/
+LanguageIterator LanguageIterator::operator+=(int n)
+{
+ if (m_ilang + n >= m_clang)
+ {
+ // Can't increment.
+ Assert(false);
+ m_ilang = m_clang;
+ }
+ else if (m_ilang + n < 0)
+ {
+ // Can't decrement.
+ Assert(false);
+ m_ilang = 0;
+ }
+ else
+ m_ilang += m_clang;
+
+ return *this;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Test whether the two iterators are equal.
+----------------------------------------------------------------------------------------------*/
+bool LanguageIterator::operator==(LanguageIterator & lgit)
+{
+ return (lgit.m_ilang == m_ilang && lgit.m_pfont == m_pfont);
+}
+
+bool LanguageIterator::operator!=(LanguageIterator & lgit)
+{
+ return (lgit.m_ilang != m_ilang || lgit.m_pfont != m_pfont);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of items represented by the range of the two iterators.
+----------------------------------------------------------------------------------------------*/
+int LanguageIterator::operator-(LanguageIterator & lgit)
+{
+ if (m_pfont != lgit.m_pfont)
+ {
+ throw;
+ }
+ return (m_ilang - lgit.m_ilang);
+}
+
+
+} // namespace gr
+
+
diff --git a/Build/source/libs/graphite/src/font/FontTableCache.h b/Build/source/libs/graphite/src/font/FontTableCache.h
new file mode 100644
index 00000000000..461b00d745f
--- /dev/null
+++ b/Build/source/libs/graphite/src/font/FontTableCache.h
@@ -0,0 +1,52 @@
+
+#include "TtfUtil.h"
+
+namespace gr
+{
+
+
+// used to allow table sharing among font copies
+// TBD: should this be a real class or is it acceptable to
+// make the attributes public
+class FontTableCache
+{
+public:
+ FontTableCache()
+ : m_fontCount(1)
+ {
+ for (int i = 0; i<ktiLast; i++)
+ {
+ m_pTable[i] = NULL;
+ }
+ }
+ ~FontTableCache()
+ {
+ Assert(m_fontCount == 0);
+ for (int i = 0; i<ktiLast; i++)
+ {
+ if (m_pTable[i]) delete[] m_pTable[i];
+ }
+ }
+ const int & getFontCount() { return m_fontCount; }
+ void incrementFontCount() { m_fontCount++; }
+ void decrementFontCount() { m_fontCount--; Assert(m_fontCount > -1); }
+ byte * getTable(TableId id) const { Assert(id < ktiLast); return m_pTable[id]; }
+ const long & getTableSize(TableId id) const
+ {
+ Assert(id < ktiLast);
+ return m_tableSize[id];
+ }
+ byte * allocateTable(TableId id, long size)
+ {
+ m_pTable[id] = new byte[size];
+ m_tableSize[id] = size;
+ return m_pTable[id];
+ }
+
+private:
+ int m_fontCount;
+ byte * m_pTable[ktiLast];
+ long m_tableSize[ktiLast];
+};
+
+}
diff --git a/Build/source/libs/graphite/src/font/Makefile.am b/Build/source/libs/graphite/src/font/Makefile.am
new file mode 100644
index 00000000000..461af621b49
--- /dev/null
+++ b/Build/source/libs/graphite/src/font/Makefile.am
@@ -0,0 +1,7 @@
+fontdir = $(top_srcdir)/src/font
+
+libgraphite_la_SOURCES += $(fontdir)/Font.cpp
+libgraphite_la_SOURCES += $(fontdir)/TtfUtil.cpp
+libgraphite_la_SOURCES += $(fontdir)/FileFont.cpp
+
+EXTRA_DIST += $(fontdir)/*.h
diff --git a/Build/source/libs/graphite/src/font/TtfTypes.h b/Build/source/libs/graphite/src/font/TtfTypes.h
new file mode 100644
index 00000000000..da8d90f1f26
--- /dev/null
+++ b/Build/source/libs/graphite/src/font/TtfTypes.h
@@ -0,0 +1,388 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2007 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: TtfTypes.h
+Responsibility: Tim Eves
+Last reviewed: Not yet.
+
+Description:
+Provides types required to represent the TTF basic types.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+
+//**********************************************************************************************
+// Include files
+//**********************************************************************************************
+#include "GrPlatform.h"
+
+namespace TtfUtil
+{
+//**********************************************************************************************
+// Forward declarations
+//**********************************************************************************************
+
+
+//**********************************************************************************************
+// Type declarations
+//**********************************************************************************************
+typedef gr::data8 uint8;
+typedef gr::sdata8 int8;
+typedef gr::data16 uint16;
+typedef gr::sdata16 int16;
+typedef gr::data32 uint32;
+typedef gr::sdata32 int32;
+
+typedef int16 short_frac;
+typedef int32 fixed;
+typedef int16 fword;
+typedef uint16 ufword;
+typedef int16 f2dot14;
+typedef uint32 long_date_time[2];
+
+//**********************************************************************************************
+// Constants and enum types
+//**********************************************************************************************/
+enum
+{
+ OneFix = 1<<16
+};
+
+//**********************************************************************************************
+// Table declarations
+//**********************************************************************************************
+namespace Sfnt
+{
+#pragma pack(1) // We need this or the structure members aren't alligned
+ // correctly. Fortunately this form of pragma is supposed
+ // to be recongnised by VS C++ too (at least according to
+ // MSDN).
+
+ struct OffsetSubTable
+ {
+ uint32 scaler_type;
+ uint16 num_tables,
+ search_range,
+ entry_selector,
+ range_shift;
+ struct Entry
+ {
+ uint32 tag,
+ checksum,
+ offset,
+ length;
+ } table_directory[1];
+
+ enum ScalerType
+ {
+ TrueTypeMac = 0x74727565U,
+ TrueTypeWin = 0x00010000U,
+ Type1 = 0x74797031U
+ };
+ };
+
+
+
+
+ struct CharacterCodeMap
+ {
+ uint16 version,
+ num_subtables;
+ struct
+ {
+ uint16 platform_id,
+ platform_specific_id;
+ uint32 offset;
+ } encoding[1];
+ };
+
+ struct CmapSubTable
+ {
+ uint16 format,
+ length,
+ language;
+ };
+
+ struct CmapSubTableFormat4 : CmapSubTable
+ {
+ uint16 seg_count_x2,
+ search_range,
+ entry_selector,
+ range_shift,
+ end_code[1];
+ // There are arrarys after this which need their
+ // start positions calculated since end_code is
+ // seg_count uint16s long.
+ };
+
+ struct CmapSubTableFormat12
+ {
+ fixed format;
+ uint32 length,
+ language,
+ num_groups;
+ struct
+ {
+ uint32 start_char_code,
+ end_char_code,
+ start_glyph_id;
+ } group[1];
+ };
+
+
+
+ struct FontHeader
+ {
+ fixed version,
+ font_revision;
+ uint32 check_sum_adjustment,
+ magic_number;
+ uint16 flags,
+ units_per_em;
+ long_date_time created,
+ modified;
+ fword x_min,
+ y_min,
+ x_max,
+ y_max;
+ uint16 mac_style,
+ lowest_rec_ppem;
+ int16 font_direction_hint,
+ index_to_loc_format,
+ glyph_data_format;
+ enum
+ {
+ MagicNumber = 0x5F0F3CF5,
+ GlypDataFormat = 0
+ };
+ enum {ShortIndexLocFormat, LongIndexLocFormat};
+ };
+
+
+
+
+ struct PostScriptGlyphName
+ {
+ fixed format,
+ italic_angle;
+ fword underline_position,
+ underline_thickness;
+ uint32 is_fixed_pitch,
+ min_mem_type42,
+ max_mem_type42,
+ min_mem_type1,
+ max_mem_type1;
+ enum
+ {
+ Format1 = 0x10000,
+ Format2 = 0x20000,
+ Format25 = 0x28000,
+ Format3 = 0x30000,
+ Format4 = 0x40000
+ };
+ };
+
+ struct PostScriptGlyphName2 : PostScriptGlyphName
+ {
+ uint16 number_of_glyphs,
+ glyph_name_index[1];
+ };
+
+ struct PostScriptGlyphName25 : PostScriptGlyphName
+ {
+ uint16 number_of_glyphs;
+ int8 offset[1];
+ };
+
+ struct PostScriptGlyphName3 : PostScriptGlyphName {};
+
+ struct PostScriptGlyphName4 : PostScriptGlyphName
+ {
+ uint16 glyph_to_char_map[1];
+ };
+
+
+ struct HorizontalHeader
+ {
+ fixed version;
+ fword ascent,
+ descent,
+ line_gap;
+ ufword advance_width_max;
+ fword min_left_side_bearing,
+ max_left_side_bearing,
+ x_max_element;
+ int16 caret_slope_rise,
+ caret_slope_run;
+ fword caret_offset;
+ int16 reserved[4],
+ metric_data_format;
+ uint16 num_long_hor_metrics;
+ };
+
+ struct MaximumProfile
+ {
+ fixed version;
+ uint16 num_glyphs,
+ max_points,
+ max_contours,
+ max_component_points,
+ max_component_contours,
+ max_zones,
+ max_twilight_points,
+ max_storage,
+ max_function_defs,
+ max_instruction_defs,
+ max_stack_elements,
+ max_size_of_instructions,
+ max_component_elements,
+ max_component_depth;
+ };
+
+
+ typedef gr::byte Panose[10];
+
+ struct Compatibility0
+ {
+ uint16 version;
+ int16 x_avg_char_width;
+ uint16 weight_class,
+ width_class;
+ int16 fs_type,
+ y_subscript_x_size,
+ y_subscript_y_size,
+ y_subscript_x_offset,
+ y_subscript_y_offset,
+ y_superscript_x_size,
+ y_superscript_y_size,
+ y_superscript_x_offset,
+ y_superscript_y_offset,
+ y_strikeout_size,
+ y_strikeout_position,
+ family_class;
+ Panose panose;
+ uint32 unicode_range[4];
+ int8 ach_vend_id[4];
+ uint16 fs_selection,
+ fs_first_char_index,
+ fs_last_char_index, // Acording to Apple's spec this is where v0 should end
+ typo_ascender,
+ typo_descender,
+ type_linegap,
+ win_ascent,
+ win_descent;
+
+ enum
+ {
+ Italic =0x01,
+ Underscore=0x02,
+ Negative =0x04,
+ Outlined =0x08,
+ StrikeOut =0x10,
+ Bold =0x20
+ };
+ };
+
+ struct Compatibility1 : Compatibility0
+ {
+ uint32 codepage_range[2];
+ };
+
+ struct Compatibility2 : Compatibility1
+ {
+ int16 x_height,
+ cap_height;
+ uint16 default_char,
+ break_char,
+ max_context;
+ };
+
+ struct Compatibility3 : Compatibility2 {};
+
+ typedef Compatibility3 Compatibility;
+
+
+ struct NameRecord
+ {
+ uint16 platform_id,
+ platform_specific_id,
+ language_id,
+ name_id,
+ length,
+ offset;
+ enum {Unicode, Mactintosh, Reserved, Microsoft};
+ enum
+ {
+ Copyright, Family, Subfamily, UniqueSubfamily,
+ Fullname, Version, PostScript
+ };
+ };
+
+ struct FontNames
+ {
+ uint16 format,
+ count,
+ string_offset;
+ NameRecord name_record[1];
+ };
+
+
+ struct HorizontalMetric
+ {
+ uint16 advance_width;
+ int16 left_side_bearing;
+ };
+
+
+ struct Glyph
+ {
+ int16 number_of_contours;
+ fword x_min,
+ y_min,
+ x_max,
+ y_max;
+ };
+
+ struct SimpleGlyph : Glyph
+ {
+ uint16 end_pts_of_contours[1];
+ enum
+ {
+ OnCurve = 0x01,
+ XShort = 0x02,
+ YShort = 0x04,
+ Repeat = 0x08,
+ XIsSame = 0x10,
+ XIsPos = 0x10,
+ YIsSame = 0x20,
+ YIsPos = 0x20
+ };
+ };
+
+ struct CompoundGlyph : Glyph
+ {
+ uint16 flags,
+ glyph_index;
+ enum
+ {
+ Arg1Arg2Words = 0x01,
+ ArgsAreXYValues = 0x02,
+ RoundXYToGrid = 0x04,
+ HaveScale = 0x08,
+ MoreComponents = 0x20,
+ HaveXAndYScale = 0x40,
+ HaveTwoByTwo = 0x80,
+ HaveInstructions = 0x100,
+ UseMyMetrics = 0x200,
+ OverlapCompund = 0x400,
+ ScaledOffset = 0x800,
+ UnscaledOffset = 0x1000
+ };
+ };
+
+#pragma pack()
+} // end of namespace Sfnt
+
+} // end of namespace TtfUtil
diff --git a/Build/source/libs/graphite/src/font/TtfUtil.cpp b/Build/source/libs/graphite/src/font/TtfUtil.cpp
new file mode 100644
index 00000000000..471b7eeca2c
--- /dev/null
+++ b/Build/source/libs/graphite/src/font/TtfUtil.cpp
@@ -0,0 +1,1935 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2000, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: TtfUtil.cpp
+Responsibility: Alan Ward
+Last reviewed: Not yet.
+
+Description:
+ Implements the methods for TtfUtil class. This file should remain portable to any C++
+ environment by only using standard C++ and the TTF structurs defined in Tt.h.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+
+/***********************************************************************************************
+ Include files
+***********************************************************************************************/
+// Language headers
+#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <cstring>
+#include <climits>
+#include <stdexcept>
+// Platform headers
+// Module headers
+#include "TtfUtil.h"
+#include "TtfTypes.h"
+
+/***********************************************************************************************
+ Forward declarations
+***********************************************************************************************/
+
+/***********************************************************************************************
+ Local Constants and static variables
+***********************************************************************************************/
+// max number of components allowed in composite glyphs
+namespace
+{
+ const int kMaxGlyphComponents = 8;
+
+ // These are basic byte order swapping functions
+ template<typename T> inline T rev16(const T d) {
+ T r = (d & 0xff) << 8; r |= (d & 0xff00) >> 8;
+ return r;
+ }
+
+ template<typename T> inline T rev32(const T d) {
+ T r = (d & 0xff) << 24; r |= (d & 0xff00) << 8;
+ r |= (d & 0xff0000) >> 8; r |= (d & 0xff000000) >> 24;
+ return r;
+ }
+
+ // This is the generic read function which does the swapping
+ template<typename T> inline T read(const T d) {
+ return d;
+ }
+
+#if !defined WORDS_BIGENDIAN || defined PC_OS
+ template<> inline TtfUtil::uint16 read(const TtfUtil::uint16 d) {
+ return rev16(d);
+ }
+
+ template<> inline TtfUtil::int16 read(const TtfUtil::int16 d) {
+ return rev16(d);
+ }
+
+ template<> inline TtfUtil::uint32 read(const TtfUtil::uint32 d) {
+ return rev32(d);
+ }
+
+ template<> inline TtfUtil::int32 read(const TtfUtil::int32 d) {
+ return rev32(d);
+ }
+#endif
+
+ template <int R, typename T>
+ inline float fixed_to_float(const T f) {
+ return float(f)/float(2^R);
+ }
+
+#define MAKE_TAG(a,b,c,d) ((a << 24UL) + (b << 16UL) + (c << 8UL) + (d))
+ const gr::fontTableId32 mapIdToTag[] = {
+ MAKE_TAG('c','m','a','p'),
+ MAKE_TAG('c','v','t',' '),
+ MAKE_TAG('c','r','y','p'),
+ MAKE_TAG('h','e','a','d'),
+ MAKE_TAG('f','p','g','m'),
+ MAKE_TAG('g','d','i','r'),
+ MAKE_TAG('g','l','y','f'),
+ MAKE_TAG('h','d','m','x'),
+ MAKE_TAG('h','h','e','a'),
+ MAKE_TAG('h','m','t','x'),
+ MAKE_TAG('l','o','c','a'),
+ MAKE_TAG('k','e','r','n'),
+ MAKE_TAG('L','T','S','H'),
+ MAKE_TAG('m','a','x','p'),
+ MAKE_TAG('n','a','m','e'),
+ MAKE_TAG('O','S','/','2'),
+ MAKE_TAG('p','o','s','t'),
+ MAKE_TAG('p','r','e','p'),
+ MAKE_TAG('F','e','a','t'),
+ MAKE_TAG('G','l','a','t'),
+ MAKE_TAG('G','l','o','c'),
+ MAKE_TAG('S','i','l','f'),
+ MAKE_TAG('S','i','l','e'),
+ MAKE_TAG('S','i','l','l')
+ };
+
+
+/*----------------------------------------------------------------------------------------------
+ Table of standard Postscript glyph names. From Martin Hosken. Disagress with ttfdump.exe
+---------------------------------------------------------------------------------------------*/
+ const int kcPostNames = 258;
+
+ const char * rgPostName[kcPostNames] = {
+ ".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign",
+ "dollar", "percent", "ampersand", "quotesingle", "parenleft",
+ "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
+ "zero", "one", "two", "three", "four", "five", "six", "seven", "eight",
+ "nine", "colon", "semicolon", "less", "equal", "greater", "question",
+ "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
+ "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
+ "bracketleft", "backslash", "bracketright", "asciicircum",
+ "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i",
+ "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w",
+ "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde",
+ "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis",
+ "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde",
+ "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis",
+ "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute",
+ "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave",
+ "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling",
+ "section", "bullet", "paragraph", "germandbls", "registered",
+ "copyright", "trademark", "acute", "dieresis", "notequal", "AE",
+ "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen",
+ "mu", "partialdiff", "summation", "product", "pi", "integral",
+ "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown",
+ "exclamdown", "logicalnot", "radical", "florin", "approxequal",
+ "Delta", "guillemotleft", "guillemotright", "ellipsis", "nonbreakingspace",
+ "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash",
+ "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide",
+ "lozenge", "ydieresis", "Ydieresis", "fraction", "currency",
+ "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered",
+ "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex",
+ "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute",
+ "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex",
+ "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi",
+ "circumflex", "tilde", "macron", "breve", "dotaccent", "ring",
+ "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash",
+ "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth",
+ "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply",
+ "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter",
+ "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla",
+ "scedilla", "Cacute", "cacute", "Ccaron", "ccaron",
+ "dcroat" };
+
+}
+
+/***********************************************************************************************
+ Methods
+***********************************************************************************************/
+
+/* Note on error processing: The code guards against bad glyph ids being used to look up data
+in open ended tables (loca, hmtx). If the glyph id comes from a cmap this shouldn't happen
+but it seems prudent to check for user errors here. The code does assume that data obtained
+from the TTF file is valid otherwise (though the CheckTable method seeks to check for
+obvious problems that might accompany a change in table versions). For example an invalid
+offset in the loca table which could exceed the size of the glyf table is NOT trapped.
+Likewise if numberOf_LongHorMetrics in the hhea table is wrong, this will NOT be trapped,
+which could cause a lookup in the hmtx table to exceed the table length. Of course, TTF tables
+that are completely corrupt will cause unpredictable results. */
+
+/* Note on composite glyphs: Glyphs that have components that are themselves composites
+are not supported. IsDeepComposite can be used to test for this. False is returned from many
+of the methods in this cases. It is unclear how to build composite glyphs in some cases,
+so this code represents my best guess until test cases can be found. See notes on the high-
+level GlyfPoints method. */
+
+namespace TtfUtil
+{
+
+
+/*----------------------------------------------------------------------------------------------
+ Get offset and size of the offset table needed to find table directory
+ Return true if success, false otherwise
+ lSize excludes any table directory entries
+----------------------------------------------------------------------------------------------*/
+bool GetHeaderInfo(size_t & lOffset, size_t & lSize)
+{
+ lOffset = 0;
+ lSize = offsetof(Sfnt::OffsetSubTable, table_directory);
+ assert(sizeof(uint32) + 4*sizeof (uint16) == lSize);
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Check the offset table for expected data
+ Return true if success, false otherwise
+----------------------------------------------------------------------------------------------*/
+bool CheckHeader(const void * pHdr)
+{
+ const Sfnt::OffsetSubTable * pOffsetTable
+ = reinterpret_cast<const Sfnt::OffsetSubTable *>(pHdr);
+
+ return read(pOffsetTable->scaler_type) == Sfnt::OffsetSubTable::TrueTypeWin;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get offset and size of the table directory
+ Return true if successful, false otherwise
+----------------------------------------------------------------------------------------------*/
+bool GetTableDirInfo(const void * pHdr, size_t & lOffset, size_t & lSize)
+{
+ const Sfnt::OffsetSubTable * pOffsetTable
+ = reinterpret_cast<const Sfnt::OffsetSubTable *>(pHdr);
+
+ lOffset = offsetof(Sfnt::OffsetSubTable, table_directory);
+ lSize = read(pOffsetTable->num_tables)
+ * sizeof(Sfnt::OffsetSubTable::Entry);
+
+ return true;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Get offset and size of the specified table
+ Return true if successful, false otherwise. On false, offset and size will be 0
+----------------------------------------------------------------------------------------------*/
+bool GetTableInfo(TableId ktiTableId, const void * pHdr, const void * pTableDir,
+ size_t & lOffset, size_t & lSize)
+{
+ gr::fontTableId32 lTableTag = TableIdTag(ktiTableId);
+ if (!lTableTag)
+ {
+ lOffset = 0;
+ lSize = 0;
+ return false;
+ }
+
+ const Sfnt::OffsetSubTable * pOffsetTable
+ = reinterpret_cast<const Sfnt::OffsetSubTable *>(pHdr);
+ const Sfnt::OffsetSubTable::Entry
+ * entry_itr = reinterpret_cast<const Sfnt::OffsetSubTable::Entry *>(
+ pTableDir),
+ * const dir_end = entry_itr + read(pOffsetTable->num_tables);
+
+ assert(read(pOffsetTable->num_tables) < 40);
+ if (read(pOffsetTable->num_tables) > 40)
+ return false;
+
+ for (;entry_itr != dir_end; ++entry_itr) // 40 - safe guard
+ {
+ if (read(entry_itr->tag) == lTableTag)
+ {
+ lOffset = read(entry_itr->offset);
+ lSize = read(entry_itr->length);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Check the specified table. Tests depend on the table type.
+ Return true if successful, false otherwise
+----------------------------------------------------------------------------------------------*/
+bool CheckTable(TableId ktiTableId, const void * pTable, size_t lTableSize)
+{
+ using namespace Sfnt;
+
+ switch(ktiTableId)
+ {
+ case ktiCmap: // cmap
+ {
+ const Sfnt::CharacterCodeMap * const pCmap
+ = reinterpret_cast<const Sfnt::CharacterCodeMap *>(pTable);
+ assert(read(pCmap->version) == 0);
+ return read(pCmap->version) == 0;
+ }
+
+ case ktiHead: // head
+ {
+ const Sfnt::FontHeader * const pHead
+ = reinterpret_cast<const Sfnt::FontHeader *>(pTable);
+ bool r = read(pHead->version) == OneFix
+ && read(pHead->magic_number) == FontHeader::MagicNumber
+ && read(pHead->glyph_data_format)
+ == FontHeader::GlypDataFormat
+ && (read(pHead->index_to_loc_format)
+ == FontHeader::ShortIndexLocFormat
+ || read(pHead->index_to_loc_format)
+ == FontHeader::LongIndexLocFormat)
+ && sizeof(FontHeader) <= lTableSize;
+ assert(r); return r;
+ }
+
+ case ktiPost: // post
+ {
+ const Sfnt::PostScriptGlyphName * const pPost
+ = reinterpret_cast<const Sfnt::PostScriptGlyphName *>(pTable);
+ const fixed format = read(pPost->format);
+ bool r = format == PostScriptGlyphName::Format1
+ || format == PostScriptGlyphName::Format2
+ || format == PostScriptGlyphName::Format3
+ || format == PostScriptGlyphName::Format25;
+ assert(r); return r;
+ }
+
+ case ktiHhea: // hhea
+ {
+ const Sfnt::HorizontalHeader * pHhea =
+ reinterpret_cast<const Sfnt::HorizontalHeader *>(pTable);
+ bool r = read(pHhea->version) == OneFix
+ && read(pHhea->metric_data_format) == 0
+ && sizeof (Sfnt::HorizontalHeader) <= lTableSize;
+ assert(r); return r;
+ }
+
+ case ktiMaxp: // maxp
+ {
+ const Sfnt::MaximumProfile * pMaxp =
+ reinterpret_cast<const Sfnt::MaximumProfile *>(pTable);
+ bool r = read(pMaxp->version) == OneFix
+ && sizeof(Sfnt::MaximumProfile) <= lTableSize;
+ assert(r); return r;
+ }
+
+ case ktiOs2: // OS/2
+ {
+ const Sfnt::Compatibility * pOs2
+ = reinterpret_cast<const Sfnt::Compatibility *>(pTable);
+ if (read(pOs2->version) == 0)
+ { // OS/2 table version 1 size
+// if (sizeof(Sfnt::Compatibility)
+// - sizeof(uint32)*2 - sizeof(int16)*2
+// - sizeof(uint16)*3 <= lTableSize)
+ if (sizeof(Sfnt::Compatibility0) <= lTableSize)
+ return true;
+ }
+ else if (read(pOs2->version) == 1)
+ { // OS/2 table version 2 size
+// if (sizeof(Sfnt::Compatibility)
+// - sizeof(int16) *2
+// - sizeof(uint16)*3 <= lTableSize)
+ if (sizeof(Sfnt::Compatibility1) <= lTableSize)
+ return true;
+ }
+ else if (read(pOs2->version) == 2)
+ { // OS/2 table version 3 size
+ if (sizeof(Sfnt::Compatibility2) <= lTableSize)
+ return true;
+ }
+ else if (read(pOs2->version) == 3)
+ { // OS/2 table version 4 size - version 4 changed the meaning of some fields which we don't use
+ if (sizeof(Sfnt::Compatibility3) <= lTableSize)
+ return true;
+ }
+ else
+ return false;
+ }
+
+ case ktiName:
+ {
+ const Sfnt::FontNames * pName
+ = reinterpret_cast<const Sfnt::FontNames *>(pTable);
+ assert(read(pName->format) == 0);
+ return read(pName->format) == 0;
+ }
+
+ default:
+ break;
+ }
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of glyphs in the font. Should never be less than zero.
+----------------------------------------------------------------------------------------------*/
+size_t GlyphCount(const void * pMaxp)
+{
+ const Sfnt::MaximumProfile * pTable =
+ reinterpret_cast<const Sfnt::MaximumProfile *>(pMaxp);
+ return read(pTable->num_glyphs);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the maximum number of components for any composite glyph in the font
+----------------------------------------------------------------------------------------------*/
+size_t MaxCompositeComponentCount(const void * pMaxp)
+{
+ const Sfnt::MaximumProfile * pTable =
+ reinterpret_cast<const Sfnt::MaximumProfile *>(pMaxp);
+ return read(pTable->max_component_elements);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Composite glyphs can be composed of glyphs that are themselves composites.
+ This method returns the maximum number of levels like this for any glyph in the font.
+ A non-composite glyph has a level of 1
+----------------------------------------------------------------------------------------------*/
+size_t MaxCompositeLevelCount(const void * pMaxp)
+{
+ const Sfnt::MaximumProfile * pTable =
+ reinterpret_cast<const Sfnt::MaximumProfile *>(pMaxp);
+ return read(pTable->max_component_depth);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of glyphs in the font according to a differt source.
+ Should never be less than zero. Return -1 on failure.
+----------------------------------------------------------------------------------------------*/
+size_t LocaGlyphCount(size_t lLocaSize, const void * pHead) throw(std::domain_error)
+{
+
+ const Sfnt::FontHeader * pTable
+ = reinterpret_cast<const Sfnt::FontHeader *>(pHead);
+
+ if (read(pTable->index_to_loc_format)
+ == Sfnt::FontHeader::ShortIndexLocFormat)
+ // loca entries are two bytes and have been divided by two
+ return (lLocaSize >> 1) - 1;
+
+ if (read(pTable->index_to_loc_format)
+ == Sfnt::FontHeader::LongIndexLocFormat)
+ // loca entries are four bytes
+ return (lLocaSize >> 2) - 1;
+
+ //return -1;
+ throw std::domain_error("head table in inconsistent state. The font may be corrupted");
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the design units the font is designed with
+----------------------------------------------------------------------------------------------*/
+int DesignUnits(const void * pHead)
+{
+ const Sfnt::FontHeader * pTable =
+ reinterpret_cast<const Sfnt::FontHeader *>(pHead);
+
+ return read(pTable->units_per_em);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the checksum from the head table, which serves as a unique identifer for the font.
+----------------------------------------------------------------------------------------------*/
+int HeadTableCheckSum(const void * pHead)
+{
+ const Sfnt::FontHeader * pTable =
+ reinterpret_cast<const Sfnt::FontHeader *>(pHead);
+
+ return read(pTable->check_sum_adjustment);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the create time from the head table. This consists of a 64-bit integer, which
+ we return here as two 32-bit integers.
+----------------------------------------------------------------------------------------------*/
+void HeadTableCreateTime(const void * pHead,
+ unsigned int * pnDateBC, unsigned int * pnDateAD)
+{
+ const Sfnt::FontHeader * pTable =
+ reinterpret_cast<const Sfnt::FontHeader *>(pHead);
+
+ *pnDateBC = read(pTable->created[0]);
+ *pnDateAD = read(pTable->created[1]);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the modify time from the head table.This consists of a 64-bit integer, which
+ we return here as two 32-bit integers.
+----------------------------------------------------------------------------------------------*/
+void HeadTableModifyTime(const void * pHead,
+ unsigned int * pnDateBC, unsigned int *pnDateAD)
+{
+ const Sfnt::FontHeader * pTable =
+ reinterpret_cast<const Sfnt::FontHeader *>(pHead);
+
+ *pnDateBC = read(pTable->modified[0]);
+ *pnDateAD = read(pTable->modified[1]);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the font is italic.
+----------------------------------------------------------------------------------------------*/
+bool IsItalic(const void * pHead)
+{
+ const Sfnt::FontHeader * pTable =
+ reinterpret_cast<const Sfnt::FontHeader *>(pHead);
+
+ return read(((pTable->mac_style) & 0x00000002) != 0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the ascent for the font
+----------------------------------------------------------------------------------------------*/
+int FontAscent(const void * pOs2)
+{
+ const Sfnt::Compatibility * pTable = reinterpret_cast<const Sfnt::Compatibility *>(pOs2);
+
+ return read(pTable->win_ascent);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the descent for the font
+----------------------------------------------------------------------------------------------*/
+int FontDescent(const void * pOs2)
+{
+ const Sfnt::Compatibility * pTable = reinterpret_cast<const Sfnt::Compatibility *>(pOs2);
+
+ return read(pTable->win_descent);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the bold and italic style bits.
+ Return true if successful. false otherwise.
+ In addition to checking the OS/2 table, one could also check
+ the head table's macStyle field (overridden by the OS/2 table on Win)
+ the sub-family name in the name table (though this can contain oblique, dark, etc too)
+----------------------------------------------------------------------------------------------*/
+bool FontOs2Style(const void *pOs2, bool & fBold, bool & fItalic)
+{
+ const Sfnt::Compatibility * pTable = reinterpret_cast<const Sfnt::Compatibility *>(pOs2);
+
+ fBold = (read(pTable->fs_selection) & Sfnt::Compatibility::Bold) != 0;
+ fItalic = (read(pTable->fs_selection) & Sfnt::Compatibility::Italic) != 0;
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Method for searching name table.
+----------------------------------------------------------------------------------------------*/
+bool GetNameInfo(const void * pName, int nPlatformId, int nEncodingId,
+ int nLangId, int nNameId, size_t & lOffset, size_t & lSize)
+{
+ lOffset = 0;
+ lSize = 0;
+
+ const Sfnt::FontNames * pTable = reinterpret_cast<const Sfnt::FontNames *>(pName);
+ uint16 cRecord = read(pTable->count);
+ uint16 nRecordOffset = read(pTable->string_offset);
+ const Sfnt::NameRecord * pRecord = reinterpret_cast<const Sfnt::NameRecord *>(pTable + 1);
+
+ for (int i = 0; i < cRecord; ++i)
+ {
+ if (read(pRecord->platform_id) == nPlatformId &&
+ read(pRecord->platform_specific_id) == nEncodingId &&
+ read(pRecord->language_id) == nLangId &&
+ read(pRecord->name_id) == nNameId)
+ {
+ lOffset = read(pRecord->offset) + nRecordOffset;
+ lSize = read(pRecord->length);
+ return true;
+ }
+ pRecord++;
+ }
+
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return all the lang-IDs that have data for the given name-IDs. Assume that there is room
+ in the return array (langIdList) for 128 items. The purpose of this method is to return
+ a list of all possible lang-IDs.
+----------------------------------------------------------------------------------------------*/
+int GetLangsForNames(const void * pName, int nPlatformId, int nEncodingId,
+ int * nameIdList, int cNameIds, short * langIdList)
+{
+ const Sfnt::FontNames * pTable = reinterpret_cast<const Sfnt::FontNames *>(pName);
+ uint16 cRecord = read(pTable->count);
+ //uint16 nRecordOffset = swapw(pTable->stringOffset);
+ const Sfnt::NameRecord * pRecord = reinterpret_cast<const Sfnt::NameRecord *>(pTable + 1);
+
+ int cLangIds = 0;
+ for (int i = 0; i < cRecord; ++i)
+ {
+ if (read(pRecord->platform_id) == nPlatformId &&
+ read(pRecord->platform_specific_id) == nEncodingId)
+ {
+ bool fNameFound = false;
+ int nLangId = read(pRecord->language_id);
+ int nNameId = read(pRecord->name_id);
+ for (int i = 0; i < cNameIds; i++)
+ {
+ if (nNameId == nameIdList[i])
+ {
+ fNameFound = true;
+ break;
+ }
+ }
+ if (fNameFound)
+ {
+ // Add it if it's not there.
+ int ilang;
+ for (ilang = 0; ilang < cLangIds; ilang++)
+ if (langIdList[ilang] == nLangId)
+ break;
+ if (ilang >= cLangIds)
+ {
+ langIdList[cLangIds] = short(nLangId);
+ cLangIds++;
+ }
+ if (cLangIds == 128)
+ return cLangIds;
+ }
+ }
+ pRecord++;
+ }
+
+ return cLangIds;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the offset and size of the font family name in English for the MS Platform with Unicode
+ writing system. The offset is within the pName data. The string is double byte with MSB first.
+----------------------------------------------------------------------------------------------*/
+bool Get31EngFamilyInfo(const void * pName, size_t & lOffset, size_t & lSize)
+{
+ return GetNameInfo(pName, Sfnt::NameRecord::Microsoft, 1, 1033,
+ Sfnt::NameRecord::Family, lOffset, lSize);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the offset and size of the full font name in English for the MS Platform with Unicode
+ writing system. The offset is within the pName data. The string is double byte with MSB first.
+----------------------------------------------------------------------------------------------*/
+bool Get31EngFullFontInfo(const void * pName, size_t & lOffset, size_t & lSize)
+{
+ return GetNameInfo(pName, Sfnt::NameRecord::Microsoft, 1, 1033,
+ Sfnt::NameRecord::Fullname, lOffset, lSize);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the offset and size of the font family name in English for the MS Platform with Symbol
+ writing system. The offset is within the pName data. The string is double byte with MSB first.
+----------------------------------------------------------------------------------------------*/
+bool Get30EngFamilyInfo(const void * pName, size_t & lOffset, size_t & lSize)
+{
+ return GetNameInfo(pName, Sfnt::NameRecord::Microsoft, 0, 1033,
+ Sfnt::NameRecord::Family, lOffset, lSize);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the offset and size of the full font name in English for the MS Platform with Symbol
+ writing system. The offset is within the pName data. The string is double byte with MSB first.
+----------------------------------------------------------------------------------------------*/
+bool Get30EngFullFontInfo(const void * pName, size_t & lOffset, size_t & lSize)
+{
+ return GetNameInfo(pName, Sfnt::NameRecord::Microsoft, 0, 1033,
+ Sfnt::NameRecord::Fullname, lOffset, lSize);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the Glyph ID for a given Postscript name. This method finds the first glyph which
+ matches the requested Postscript name. Ideally every glyph should have a unique Postscript
+ name (except for special names such as .notdef), but this is not always true.
+ On failure return value less than zero.
+ -1 - table search failed
+ -2 - format 3 table (no Postscript glyph info)
+ -3 - other failures
+----------------------------------------------------------------------------------------------*/
+int PostLookup(const void * pPost, size_t lPostSize, const void * pMaxp,
+ const char * pPostName)
+{
+ using namespace Sfnt;
+
+ const Sfnt::PostScriptGlyphName * pTable
+ = reinterpret_cast<const Sfnt::PostScriptGlyphName *>(pPost);
+ fixed format = read(pTable->format);
+
+ if (format == PostScriptGlyphName::Format3)
+ { // format 3 - no Postscript glyph info in font
+ return -2;
+ }
+
+ // search for given Postscript name among the standard names
+ int iPostName = -1; // index in standard names
+ for (int i = 0; i < kcPostNames; i++)
+ {
+ if (!strcmp(pPostName, rgPostName[i]))
+ {
+ iPostName = i;
+ break;
+ }
+ }
+
+ if (format == PostScriptGlyphName::Format1)
+ { // format 1 - use standard Postscript names
+ return iPostName;
+ }
+
+ if (format == PostScriptGlyphName::Format25)
+ {
+ if (iPostName == -1)
+ return -1;
+
+ const PostScriptGlyphName25 * pTable25
+ = static_cast<const PostScriptGlyphName25 *>(pTable);
+ int cnGlyphs = GlyphCount(pMaxp);
+ for (gr::gid16 nGlyphId = 0; nGlyphId < cnGlyphs && nGlyphId < kcPostNames;
+ nGlyphId++)
+ { // glyph_name_index25 contains bytes so no byte swapping needed
+ // search for first glyph id that uses the standard name
+ if (nGlyphId + pTable25->offset[nGlyphId] == iPostName)
+ return nGlyphId;
+ }
+ }
+
+ if (format == PostScriptGlyphName::Format2)
+ { // format 2
+ const PostScriptGlyphName2 * pTable2
+ = static_cast<const PostScriptGlyphName2 *>(pTable);
+
+ int cnGlyphs = read(pTable2->number_of_glyphs);
+
+ if (iPostName != -1)
+ { // did match a standard name, look for first glyph id mapped to that name
+ for (gr::gid16 nGlyphId = 0; nGlyphId < cnGlyphs; nGlyphId++)
+ {
+ if (read(pTable2->glyph_name_index[nGlyphId]) == iPostName)
+ return nGlyphId;
+ }
+ return -1; // no glyph with this standard name
+ }
+
+ else
+ { // did not match a standard name, search font specific names
+ size_t nStrSizeGoal = strlen(pPostName);
+ const char * pFirstGlyphName = reinterpret_cast<const char *>(
+ &pTable2->glyph_name_index[0] + cnGlyphs);
+ const char * pGlyphName = pFirstGlyphName;
+ int iInNames = 0; // index in font specific names
+ bool fFound = false;
+ const char * const endOfTable
+ = reinterpret_cast<const char *>(pTable2) + lPostSize;
+ while (pGlyphName < endOfTable && !fFound)
+ { // search Pascal strings for first matching name
+ size_t nStringSize = size_t(*pGlyphName);
+ if (nStrSizeGoal != nStringSize ||
+ strncmp(pGlyphName + 1, pPostName, nStringSize))
+ { // did not match
+ ++iInNames;
+ pGlyphName += nStringSize + 1;
+ }
+ else
+ { // did match
+ fFound = true;
+ }
+ }
+ if (!fFound)
+ return -1; // no font specific name matches request
+
+ iInNames += kcPostNames;
+ for (gr::gid16 nGlyphId = 0; nGlyphId < cnGlyphs; nGlyphId++)
+ { // search for first glyph id that maps to the found string index
+ if (read(pTable2->glyph_name_index[nGlyphId]) == iInNames)
+ return nGlyphId;
+ }
+ return -1; // no glyph mapped to this index (very strange)
+ }
+ }
+
+ return -3;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert a Unicode character string from big endian (MSB first, Motorola) format to little
+ endian (LSB first, Intel) format.
+ nSize is the number of Unicode characters in the string. It should not include any
+ terminating null. If nSize is 0, it is assumed the string is null terminated. nSize
+ defaults to 0.
+ Return true if successful, false otherwise.
+----------------------------------------------------------------------------------------------*/
+void SwapWString(void * pWStr, size_t nSize /* = 0 */) throw (std::invalid_argument)
+{
+ if (pWStr == 0)
+ throw std::invalid_argument("null pointer given");
+
+ uint16 * pStr = reinterpret_cast<uint16 *>(pWStr);
+ uint16 * const pStrEnd = pStr + (nSize == 0 ? gr::utf16len(pStr) : nSize);
+
+ std::transform(pStr, pStrEnd, pStr, read<uint16>);
+
+// for (int i = 0; i < nSize; i++)
+// { // swap the wide characters in the string
+// pStr[i] = gr::utf16(read(uint16(pStr[i])));
+// }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the left-side bearing and and advance width based on the given tables and Glyph ID
+ Return true if successful, false otherwise. On false, one or both value could be INT_MIN
+----------------------------------------------------------------------------------------------*/
+bool HorMetrics(gr::gid16 nGlyphId, const void * pHmtx, size_t lHmtxSize, const void * pHhea,
+ int & nLsb, unsigned int & nAdvWid)
+{
+ const Sfnt::HorizontalMetric * phmtx =
+ reinterpret_cast<const Sfnt::HorizontalMetric *>(pHmtx);
+
+ const Sfnt::HorizontalHeader * phhea =
+ reinterpret_cast<const Sfnt::HorizontalHeader *>(pHhea);
+
+ size_t cLongHorMetrics = read(phhea->num_long_hor_metrics);
+ if (nGlyphId < cLongHorMetrics)
+ { // glyph id is acceptable
+ nAdvWid = read(phmtx[nGlyphId].advance_width);
+ nLsb = read(phmtx[nGlyphId].left_side_bearing);
+ }
+ else
+ {
+ nAdvWid = read(phmtx[cLongHorMetrics - 1].advance_width);
+
+ // guard against bad glyph id
+ size_t lLsbOffset = sizeof(Sfnt::HorizontalMetric) * cLongHorMetrics +
+ sizeof(int16) * (nGlyphId - cLongHorMetrics); // offset in bytes
+ if (lLsbOffset + 1 >= lHmtxSize) // + 1 because entries are two bytes wide
+ {
+ nLsb = 0;
+ return false;
+ }
+ const int16 * pLsb = reinterpret_cast<const int16 *>(phmtx) +
+ lLsbOffset / sizeof(int16);
+ nLsb = read(*pLsb);
+ }
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return a pointer to the requested cmap subtable. By default find the Microsoft Unicode
+ subtable. Pass nEncoding as -1 to find first table that matches only nPlatformId.
+ Return NULL if the subtable cannot be found.
+----------------------------------------------------------------------------------------------*/
+void * FindCmapSubtable(const void * pCmap,
+ int nPlatformId, /* =3 */
+ int nEncodingId) /* = 1 */
+{
+ const Sfnt::CharacterCodeMap * pTable =
+ reinterpret_cast<const Sfnt::CharacterCodeMap *>(pCmap);
+
+ uint16 csuPlatforms = read(pTable->num_subtables);
+ for (int i = 0; i < csuPlatforms; i++)
+ {
+ if (read(pTable->encoding[i].platform_id) == nPlatformId &&
+ (nEncodingId == -1 || read(pTable->encoding[i].platform_specific_id) == nEncodingId))
+ {
+ const void * pRtn = reinterpret_cast<const uint8 *>(pCmap) +
+ read(pTable->encoding[i].offset);
+ return const_cast<void *>(pRtn);
+ }
+ }
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Check the Microsoft Unicode subtable for expected values
+----------------------------------------------------------------------------------------------*/
+bool CheckCmap31Subtable(const void * pCmap31)
+{
+ const Sfnt::CmapSubTable * pTable = reinterpret_cast<const Sfnt::CmapSubTable *>(pCmap31);
+ // Bob H says ome freeware TT fonts have version 1 (eg, CALIGULA.TTF)
+ // so don't check subtable version. 21 Mar 2002 spec changes version to language.
+
+ return read(pTable->format) == 4;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the Glyph ID for the given Unicode ID in the Microsoft Unicode subtable.
+ (Actually this code only depends on subtable being format 4.)
+ Return 0 if the Unicode ID is not in the subtable.
+----------------------------------------------------------------------------------------------*/
+gr::gid16 Cmap31Lookup(const void * pCmap31, int nUnicodeId)
+{
+ const Sfnt::CmapSubTableFormat4 * pTable = reinterpret_cast<const Sfnt::CmapSubTableFormat4 *>(pCmap31);
+
+ uint16 nSeg = read(pTable->seg_count_x2) >> 1;
+
+ uint16 n;
+ const uint16 * pLeft, * pMid;
+ uint16 cMid, chStart, chEnd;
+
+ // Binary search of the endCode[] array
+ pLeft = &(pTable->end_code[0]);
+ n = nSeg;
+ while (n > 0)
+ {
+ cMid = n >> 1; // Pick an element in the middle
+ pMid = pLeft + cMid;
+ chEnd = read(*pMid);
+ if (nUnicodeId <= chEnd)
+ {
+ if (cMid == 0 || nUnicodeId > read(pMid[-1]))
+ break; // Must be this seg or none!
+ n = cMid; // Continue on left side, omitting mid point
+ }
+ else
+ {
+ pLeft = pMid + 1; // Continue on right side, omitting mid point
+ n -= (cMid + 1);
+ }
+ }
+
+ if (!n)
+ return 0;
+
+ // Ok, we're down to one segment and pMid points to the endCode element
+ // Either this is it or none is.
+
+ chStart = read(*(pMid += nSeg + 1));
+ if (chEnd >= nUnicodeId && nUnicodeId >= chStart)
+ {
+ // Found correct segment. Find Glyph Id
+ int16 idDelta = read(*(pMid += nSeg));
+ uint16 idRangeOffset = read(*(pMid += nSeg));
+
+ if (idRangeOffset == 0)
+ return (uint16)(idDelta + nUnicodeId); // must use modulus 2^16
+
+ // Look up value in glyphIdArray
+ gr::gid16 nGlyphId = read(*(pMid + (nUnicodeId - chStart) + (idRangeOffset >> 1)));
+ // If this value is 0, return 0. Else add the idDelta
+ return nGlyphId ? nGlyphId + idDelta : 0;
+ }
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the next Unicode value in the cmap. Pass 0 to obtain the first item.
+ Returns 0xFFFF as the last item.
+ pRangeKey is an optional key that is used to optimize the search; its value is the range
+ in which the character is found.
+----------------------------------------------------------------------------------------------*/
+unsigned int Cmap31NextCodepoint(const void *pCmap31, unsigned int nUnicodeId, int * pRangeKey)
+{
+ const Sfnt::CmapSubTableFormat4 * pTable = reinterpret_cast<const Sfnt::CmapSubTableFormat4 *>(pCmap31);
+
+ uint16 nRange = read(pTable->seg_count_x2) >> 1;
+
+ uint32 nUnicodePrev = (uint32)nUnicodeId;
+
+ const uint16 * pStartCode = &(pTable->end_code[0])
+ + nRange // length of end code array
+ + 1; // reserved word
+
+ if (nUnicodePrev == 0)
+ {
+ // return the first codepoint.
+ if (pRangeKey)
+ *pRangeKey = 0;
+ return read(pStartCode[0]);
+ }
+ else if (nUnicodePrev >= 0xFFFF)
+ {
+ if (pRangeKey)
+ *pRangeKey = nRange - 1;
+ return 0xFFFF;
+ }
+
+ int iRange = (pRangeKey) ? *pRangeKey : 0;
+ // Just in case we have a bad key:
+ while (iRange > 0 && read(pStartCode[iRange]) > nUnicodePrev)
+ iRange--;
+ while (read(pTable->end_code[iRange]) < nUnicodePrev)
+ iRange++;
+
+ // Now iRange is the range containing nUnicodePrev.
+ unsigned int nStartCode = read(pStartCode[iRange]);
+ unsigned int nEndCode = read(pTable->end_code[iRange]);
+
+ if (nStartCode > nUnicodePrev)
+ // Oops, nUnicodePrev is not in the cmap! Adjust so we get a reasonable
+ // answer this time around.
+ nUnicodePrev = nStartCode - 1;
+
+ if (nEndCode > nUnicodePrev)
+ {
+ // Next is in the same range; it is the next successive codepoint.
+ if (pRangeKey)
+ *pRangeKey = iRange;
+ return nUnicodePrev + 1;
+ }
+
+ // Otherwise the next codepoint is the first one in the next range.
+ // There is guaranteed to be a next range because there must be one that
+ // ends with 0xFFFF.
+ if (pRangeKey)
+ *pRangeKey = iRange + 1;
+ return read(pStartCode[iRange + 1]);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Check the Microsoft UCS-4 subtable for expected values
+----------------------------------------------------------------------------------------------*/
+bool CheckCmap310Subtable(const void *pCmap310)
+{
+ const Sfnt::CmapSubTable * pTable = reinterpret_cast<const Sfnt::CmapSubTable *>(pCmap310);
+ return read(pTable->format) == 12;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the Glyph ID for the given Unicode ID in the Microsoft UCS-4 subtable.
+ (Actually this code only depends on subtable being format 12.)
+ Return 0 if the Unicode ID is not in the subtable.
+----------------------------------------------------------------------------------------------*/
+gr::gid16 Cmap310Lookup(const void * pCmap310, unsigned int uUnicodeId)
+{
+ const Sfnt::CmapSubTableFormat12 * pTable = reinterpret_cast<const Sfnt::CmapSubTableFormat12 *>(pCmap310);
+
+ //uint32 uLength = read(pTable->length); //could use to test for premature end of table
+ uint32 ucGroups = read(pTable->num_groups);
+
+ for (unsigned int i = 0; i < ucGroups; i++)
+ {
+ uint32 uStartCode = read(pTable->group[i].start_char_code);
+ uint32 uEndCode = read(pTable->group[i].end_char_code);
+ if (uUnicodeId >= uStartCode && uUnicodeId <= uEndCode)
+ {
+ uint32 uDiff = uUnicodeId - uStartCode;
+ uint32 uStartGid = read(pTable->group[i].start_glyph_id);
+ return static_cast<gr::gid16>(uStartGid + uDiff);
+ }
+ }
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the next Unicode value in the cmap. Pass 0 to obtain the first item.
+ Returns 0x10FFFF as the last item.
+ pRangeKey is an optional key that is used to optimize the search; its value is the range
+ in which the character is found.
+----------------------------------------------------------------------------------------------*/
+unsigned int Cmap310NextCodepoint(const void *pCmap310, unsigned int nUnicodeId, int * pRangeKey)
+{
+ const Sfnt::CmapSubTableFormat12 * pTable = reinterpret_cast<const Sfnt::CmapSubTableFormat12 *>(pCmap310);
+
+ int nRange = read(pTable->num_groups);
+
+ uint32 nUnicodePrev = (uint32)nUnicodeId;
+
+ if (nUnicodePrev == 0)
+ {
+ // return the first codepoint.
+ if (pRangeKey)
+ *pRangeKey = 0;
+ return read(pTable->group[0].start_char_code);
+ }
+ else if (nUnicodePrev >= 0x10FFFF)
+ {
+ if (pRangeKey)
+ *pRangeKey = nRange;
+ return 0x10FFFF;
+ }
+
+ int iRange = (pRangeKey) ? *pRangeKey : 0;
+ // Just in case we have a bad key:
+ while (iRange > 0 && read(pTable->group[iRange].start_char_code) > nUnicodePrev)
+ iRange--;
+ while (read(pTable->group[iRange].end_char_code) < nUnicodePrev)
+ iRange++;
+
+ // Now iRange is the range containing nUnicodePrev.
+
+ unsigned int nStartCode = read(pTable->group[iRange].start_char_code);
+ unsigned int nEndCode = read(pTable->group[iRange].end_char_code);
+
+ if (nStartCode > nUnicodePrev)
+ // Oops, nUnicodePrev is not in the cmap! Adjust so we get a reasonable
+ // answer this time around.
+ nUnicodePrev = nStartCode - 1;
+
+ if (nEndCode > nUnicodePrev)
+ {
+ // Next is in the same range; it is the next successive codepoint.
+ if (pRangeKey)
+ *pRangeKey = iRange;
+ return nUnicodePrev + 1;
+ }
+
+ // Otherwise the next codepoint is the first one in the next range, or 10FFFF if we're done.
+ if (pRangeKey)
+ *pRangeKey = iRange + 1;
+ return (iRange + 1 >= nRange) ? 0x10FFFF : read(pTable->group[iRange + 1].start_char_code);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the offset stored in the loca table for the given Glyph ID.
+ (This offset is into the glyf table.)
+ Return -1 if the lookup failed.
+ Technically this method should return an unsigned long but it is unlikely the offset will
+ exceed 2^31.
+----------------------------------------------------------------------------------------------*/
+size_t LocaLookup(gr::gid16 nGlyphId,
+ const void * pLoca, size_t lLocaSize,
+ const void * pHead) throw (std::out_of_range)
+{
+ const Sfnt::FontHeader * pTable = reinterpret_cast<const Sfnt::FontHeader *>(pHead);
+
+ // CheckTable verifies the index_to_loc_format is valid
+ if (read(pTable->index_to_loc_format) == Sfnt::FontHeader::ShortIndexLocFormat)
+ { // loca entries are two bytes and have been divided by two
+ if (nGlyphId <= (lLocaSize >> 1) - 1) // allow sentinel value to be accessed
+ {
+ const uint16 * pTable = reinterpret_cast<const uint16 *>(pLoca);
+ return (read(pTable[nGlyphId]) << 1);
+ }
+ }
+
+ if (read(pTable->index_to_loc_format) == Sfnt::FontHeader::LongIndexLocFormat)
+ { // loca entries are four bytes
+ if (nGlyphId <= (lLocaSize >> 2) - 1)
+ {
+ const uint32 * pTable = reinterpret_cast<const uint32 *>(pLoca);
+ return read(pTable[nGlyphId]);
+ }
+ }
+
+ // only get here if glyph id was bad
+ //return -1;
+ throw std::out_of_range("glyph id out of range for font");
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return a pointer into the glyf table based on the given offset (from LocaLookup).
+ Return NULL on error.
+----------------------------------------------------------------------------------------------*/
+void * GlyfLookup(const void * pGlyf, size_t nGlyfOffset)
+{
+ const uint8 * pByte = reinterpret_cast<const uint8 *>(pGlyf);
+ return const_cast<uint8 *>(pByte + nGlyfOffset);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the bounding box coordinates for a simple glyf entry (non-composite)
+ Return true if successful, false otherwise
+----------------------------------------------------------------------------------------------*/
+bool GlyfBox(const void * pSimpleGlyf, int & xMin, int & yMin,
+ int & xMax, int & yMax)
+{
+ const Sfnt::Glyph * pGlyph = reinterpret_cast<const Sfnt::Glyph *>(pSimpleGlyf);
+
+ xMin = read(pGlyph->x_min);
+ yMin = read(pGlyph->y_min);
+ xMax = read(pGlyph->x_max);
+ yMax = read(pGlyph->y_max);
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of contours for a simple glyf entry (non-composite)
+ Returning -1 means this is a composite glyph
+----------------------------------------------------------------------------------------------*/
+int GlyfContourCount(const void * pSimpleGlyf)
+{
+ const Sfnt::Glyph * pGlyph = reinterpret_cast<const Sfnt::Glyph *>(pSimpleGlyf);
+ return read(pGlyph->number_of_contours); // -1 means composite glyph
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the point numbers for the end points of the glyph contours for a simple
+ glyf entry (non-composite).
+ cnPointsTotal - count of contours from GlyfContourCount(); (same as number of end points)
+ prgnContourEndPoints - should point to a buffer large enough to hold cnPoints integers
+ cnPoints - count of points placed in above range
+ Return true if successful, false otherwise.
+ False could indicate a multi-level composite glyphs.
+----------------------------------------------------------------------------------------------*/
+bool GlyfContourEndPoints(const void * pSimpleGlyf, int * prgnContourEndPoint,
+ int cnPointsTotal, int & cnPoints)
+{
+ const Sfnt::SimpleGlyph * pGlyph = reinterpret_cast<const Sfnt::SimpleGlyph *>(pSimpleGlyf);
+
+ int cContours = read(pGlyph->number_of_contours);
+ if (cContours < 0)
+ return false; // this method isn't supposed handle composite glyphs
+
+ for (int i = 0; i < cContours && i < cnPointsTotal; i++)
+ {
+ prgnContourEndPoint[i] = read(pGlyph->end_pts_of_contours[i]);
+ }
+
+ cnPoints = cContours;
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the points for a simple glyf entry (non-composite)
+ cnPointsTotal - count of points from largest end point obtained from GlyfContourEndPoints
+ prgnX & prgnY - should point to buffers large enough to hold cnPointsTotal integers
+ The ranges are parallel so that coordinates for point(n) are found at offset n in both
+ ranges. This is raw point data with relative coordinates.
+ prgbFlag - should point to a buffer a large enough to hold cnPointsTotal bytes
+ This range is parallel to the prgnX & prgnY
+ cnPoints - count of points placed in above ranges
+ Return true if successful, false otherwise.
+ False could indicate a composite glyph
+ TODO: implement
+----------------------------------------------------------------------------------------------*/
+bool GlyfPoints(const void * pSimpleGlyf, int * prgnX, int * prgnY,
+ char * prgbFlag, int cnPointsTotal, int & cnPoints)
+{
+ using namespace Sfnt;
+
+ const Sfnt::SimpleGlyph * pGlyph = reinterpret_cast<const Sfnt::SimpleGlyph *>(pSimpleGlyf);
+ int cContours = read(pGlyph->number_of_contours);
+ // return false for composite glyph
+ if (cContours <= 0)
+ return false;
+ int cPts = read(pGlyph->end_pts_of_contours[cContours - 1]) + 1;
+ if (cPts > cnPointsTotal)
+ return false;
+
+ // skip over bounding box data & point to byte count of instructions (hints)
+ const uint8 * pbGlyph = reinterpret_cast<const uint8 *>
+ (&pGlyph->end_pts_of_contours[cContours]);
+
+ // skip over hints & point to first flag
+ int cbHints = read(*(uint16 *)pbGlyph);
+ pbGlyph += sizeof(uint16);
+ pbGlyph += cbHints;
+
+ // load flags & point to first x coordinate
+ int iFlag = 0;
+ while (iFlag < cPts)
+ {
+ if (!(*pbGlyph & SimpleGlyph::Repeat))
+ { // flag isn't repeated
+ prgbFlag[iFlag] = (char)*pbGlyph;
+ pbGlyph++;
+ iFlag++;
+ }
+ else
+ { // flag is repeated; count specified by next byte
+ char chFlag = (char)*pbGlyph;
+ pbGlyph++;
+ int cFlags = (int)*pbGlyph;
+ pbGlyph++;
+ prgbFlag[iFlag] = chFlag;
+ iFlag++;
+ for (int i = 0; i < cFlags; i++)
+ {
+ prgbFlag[iFlag + i] = chFlag;
+ }
+ iFlag += cFlags;
+ }
+ }
+ if (iFlag != cPts)
+ return false;
+
+ // load x coordinates
+ iFlag = 0;
+ while (iFlag < cPts)
+ {
+ if (prgbFlag[iFlag] & SimpleGlyph::XShort)
+ {
+ prgnX[iFlag] = *pbGlyph;
+ if (!(prgbFlag[iFlag] & SimpleGlyph::XIsPos))
+ {
+ prgnX[iFlag] = -prgnX[iFlag];
+ }
+ pbGlyph++;
+ }
+ else
+ {
+ if (prgbFlag[iFlag] & SimpleGlyph::XIsSame)
+ {
+ prgnX[iFlag] = 0;
+ // do NOT increment pbGlyph
+ }
+ else
+ {
+ prgnX[iFlag] = read(*(int16 *)pbGlyph);
+ pbGlyph += sizeof(int16);
+ }
+ }
+ iFlag++;
+ }
+
+ // load y coordinates
+ iFlag = 0;
+ while (iFlag < cPts)
+ {
+ if (prgbFlag[iFlag] & SimpleGlyph::YShort)
+ {
+ prgnY[iFlag] = *pbGlyph;
+ if (!(prgbFlag[iFlag] & SimpleGlyph::YIsPos))
+ {
+ prgnY[iFlag] = -prgnY[iFlag];
+ }
+ pbGlyph++;
+ }
+ else
+ {
+ if (prgbFlag[iFlag] & SimpleGlyph::YIsSame)
+ {
+ prgnY[iFlag] = 0;
+ // do NOT increment pbGlyph
+ }
+ else
+ {
+ prgnY[iFlag] = read(*(int16 *)pbGlyph);
+ pbGlyph += sizeof(int16);
+ }
+ }
+ iFlag++;
+ }
+
+ cnPoints = cPts;
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Fill prgnCompId with the component Glyph IDs from pSimpleGlyf.
+ Client must allocate space before calling.
+ pSimpleGlyf - assumed to point to a composite glyph
+ cCompIdTotal - the number of elements in prgnCompId
+ cCompId - the total number of Glyph IDs stored in prgnCompId
+ Return true if successful, false otherwise
+ False could indicate a non-composite glyph or the input array was not big enough
+----------------------------------------------------------------------------------------------*/
+bool GetComponentGlyphIds(const void * pSimpleGlyf, int * prgnCompId,
+ size_t cnCompIdTotal, size_t & cnCompId)
+{
+ using namespace Sfnt;
+
+ if (GlyfContourCount(pSimpleGlyf) >= 0)
+ return false;
+
+ const Sfnt::SimpleGlyph * pGlyph = reinterpret_cast<const Sfnt::SimpleGlyph *>(pSimpleGlyf);
+ // for a composite glyph, the special data begins here
+ const uint8 * pbGlyph = reinterpret_cast<const uint8 *>(&pGlyph->end_pts_of_contours[0]);
+
+ uint16 GlyphFlags;
+ size_t iCurrentComp = 0;
+ do
+ {
+ GlyphFlags = read(*((uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ prgnCompId[iCurrentComp++] = read(*((uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ if (iCurrentComp >= cnCompIdTotal)
+ return false;
+ int nOffset = 0;
+ nOffset += GlyphFlags & CompoundGlyph::Arg1Arg2Words ? 4 : 2;
+ nOffset += GlyphFlags & CompoundGlyph::HaveScale ? 2 : 0;
+ nOffset += GlyphFlags & CompoundGlyph::HaveXAndYScale ? 4 : 0;
+ nOffset += GlyphFlags & CompoundGlyph::HaveTwoByTwo ? 8 : 0;
+ pbGlyph += nOffset;
+ } while (GlyphFlags & CompoundGlyph::MoreComponents);
+
+ cnCompId = iCurrentComp;
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return info on how a component glyph is to be placed
+ pSimpleGlyph - assumed to point to a composite glyph
+ nCompId - glyph id for component of interest
+ bOffset - if true, a & b are the x & y offsets for this component
+ if false, b is the point on this component that is attaching to point a on the
+ preceding glyph
+ Return true if successful, false otherwise
+ False could indicate a non-composite glyph or that component wasn't found
+----------------------------------------------------------------------------------------------*/
+bool GetComponentPlacement(const void * pSimpleGlyf, int nCompId,
+ bool fOffset, int & a, int & b)
+{
+ using namespace Sfnt;
+
+ if (GlyfContourCount(pSimpleGlyf) >= 0)
+ return false;
+
+ const Sfnt::SimpleGlyph * pGlyph = reinterpret_cast<const Sfnt::SimpleGlyph *>(pSimpleGlyf);
+ // for a composite glyph, the special data begins here
+ const uint8 * pbGlyph = reinterpret_cast<const uint8 *>(&pGlyph->end_pts_of_contours[0]);
+
+ uint16 GlyphFlags;
+ do
+ {
+ GlyphFlags = read(*((uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ if (read(*((uint16 *)pbGlyph)) == nCompId)
+ {
+ pbGlyph += sizeof(uint16); // skip over glyph id of component
+ fOffset = (GlyphFlags & CompoundGlyph::ArgsAreXYValues) == CompoundGlyph::ArgsAreXYValues;
+
+ if (GlyphFlags & CompoundGlyph::Arg1Arg2Words )
+ {
+ a = read(*(int16 *)pbGlyph);
+ pbGlyph += sizeof(int16);
+ b = read(*(int16 *)pbGlyph);
+ pbGlyph += sizeof(int16);
+ }
+ else
+ { // args are signed bytes
+ a = *pbGlyph++;
+ b = *pbGlyph++;
+ }
+ return true;
+ }
+ pbGlyph += sizeof(uint16); // skip over glyph id of component
+ int nOffset = 0;
+ nOffset += GlyphFlags & CompoundGlyph::Arg1Arg2Words ? 4 : 2;
+ nOffset += GlyphFlags & CompoundGlyph::HaveScale ? 2 : 0;
+ nOffset += GlyphFlags & CompoundGlyph::HaveXAndYScale ? 4 : 0;
+ nOffset += GlyphFlags & CompoundGlyph::HaveTwoByTwo ? 8 : 0;
+ pbGlyph += nOffset;
+ } while (GlyphFlags & CompoundGlyph::MoreComponents);
+
+ // didn't find requested component
+ fOffset = true;
+ a = 0;
+ b = 0;
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return info on how a component glyph is to be transformed
+ pSimpleGlyph - assumed to point to a composite glyph
+ nCompId - glyph id for component of interest
+ flt11, flt11, flt11, flt11 - a 2x2 matrix giving the transform
+ bTransOffset - whether to transform the offset from above method
+ The spec is unclear about the meaning of this flag
+ Currently - initialize to true for MS rasterizer and false for Mac rasterizer, then
+ on return it will indicate whether transform should apply to offset (MSDN CD 10/99)
+ Return true if successful, false otherwise
+ False could indicate a non-composite glyph or that component wasn't found
+----------------------------------------------------------------------------------------------*/
+bool GetComponentTransform(const void * pSimpleGlyf, int nCompId,
+ float & flt11, float & flt12, float & flt21, float & flt22,
+ bool & fTransOffset)
+{
+ using namespace Sfnt;
+
+ if (GlyfContourCount(pSimpleGlyf) >= 0)
+ return false;
+
+ const Sfnt::SimpleGlyph * pGlyph = reinterpret_cast<const Sfnt::SimpleGlyph *>(pSimpleGlyf);
+ // for a composite glyph, the special data begins here
+ const uint8 * pbGlyph = reinterpret_cast<const uint8 *>(&pGlyph->end_pts_of_contours[0]);
+
+ uint16 GlyphFlags;
+ do
+ {
+ GlyphFlags = read(*((uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ if (read(*((uint16 *)pbGlyph)) == nCompId)
+ {
+ pbGlyph += sizeof(uint16); // skip over glyph id of component
+ pbGlyph += GlyphFlags & CompoundGlyph::Arg1Arg2Words ? 4 : 2; // skip over placement data
+
+ if (fTransOffset) // MS rasterizer
+ fTransOffset = !(GlyphFlags & CompoundGlyph::UnscaledOffset);
+ else // Apple rasterizer
+ fTransOffset = (GlyphFlags & CompoundGlyph::ScaledOffset) != 0;
+
+ if (GlyphFlags & CompoundGlyph::HaveScale)
+ {
+ flt11 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ flt12 = 0;
+ flt21 = 0;
+ flt22 = flt11;
+ }
+ else if (GlyphFlags & CompoundGlyph::HaveXAndYScale)
+ {
+ flt11 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ flt12 = 0;
+ flt21 = 0;
+ flt22 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ }
+ else if (GlyphFlags & CompoundGlyph::HaveTwoByTwo)
+ {
+ flt11 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ flt12 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ flt21 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ flt22 = fixed_to_float<14>(read(*(uint16 *)pbGlyph));
+ pbGlyph += sizeof(uint16);
+ }
+ else
+ { // identity transform
+ flt11 = 1.0;
+ flt12 = 0.0;
+ flt21 = 0.0;
+ flt22 = 1.0;
+ }
+ return true;
+ }
+ pbGlyph += sizeof(uint16); // skip over glyph id of component
+ int nOffset = 0;
+ nOffset += GlyphFlags & CompoundGlyph::Arg1Arg2Words ? 4 : 2;
+ nOffset += GlyphFlags & CompoundGlyph::HaveScale ? 2 : 0;
+ nOffset += GlyphFlags & CompoundGlyph::HaveXAndYScale ? 4 : 0;
+ nOffset += GlyphFlags & CompoundGlyph::HaveTwoByTwo ? 8 : 0;
+ pbGlyph += nOffset;
+ } while (GlyphFlags & CompoundGlyph::MoreComponents);
+
+ // didn't find requested component
+ fTransOffset = false;
+ flt11 = 1;
+ flt12 = 0;
+ flt21 = 0;
+ flt22 = 1;
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return a pointer into the glyf table based on the given tables and Glyph ID
+ Since this method doesn't check for spaces, it is good to call IsSpace before using it.
+ Return NULL on error
+----------------------------------------------------------------------------------------------*/
+void * GlyfLookup(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca,
+ size_t lLocaSize, const void * pHead)
+{
+ // test for valid glyph id
+ // CheckTable verifies the index_to_loc_format is valid
+
+ const Sfnt::FontHeader * pTable
+ = reinterpret_cast<const Sfnt::FontHeader *>(pHead);
+
+ if (read(pTable->index_to_loc_format) == Sfnt::FontHeader::ShortIndexLocFormat)
+ { // loca entries are two bytes (and have been divided by two)
+ if (nGlyphId >= (lLocaSize >> 1) - 1) // don't allow nGlyphId to access sentinel
+ throw std::out_of_range("glyph id out of range for font");
+ }
+ if (read(pTable->index_to_loc_format) == Sfnt::FontHeader::LongIndexLocFormat)
+ { // loca entries are four bytes
+ if (nGlyphId >= (lLocaSize >> 2) - 1)
+ throw std::out_of_range("glyph id out of range for font");
+ }
+
+ long lGlyfOffset = LocaLookup(nGlyphId, pLoca, lLocaSize, pHead);
+ void * pSimpleGlyf = GlyfLookup(pGlyf, lGlyfOffset); // invalid loca offset returns null
+ return pSimpleGlyf;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Determine if a particular Glyph ID has any data in the glyf table. If it is white space,
+ there will be no glyf data, though there will be metric data in hmtx, etc.
+----------------------------------------------------------------------------------------------*/
+bool IsSpace(gr::gid16 nGlyphId, const void * pLoca, size_t lLocaSize, const void * pHead)
+{
+ size_t lGlyfOffset = LocaLookup(nGlyphId, pLoca, lLocaSize, pHead);
+
+ // the +1 should always work because there is a sentinel value at the end of the loca table
+ size_t lNextGlyfOffset = LocaLookup(nGlyphId + 1, pLoca, lLocaSize, pHead);
+
+ return (lNextGlyfOffset - lGlyfOffset) == 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Determine if a particular Glyph ID is a multi-level composite.
+----------------------------------------------------------------------------------------------*/
+bool IsDeepComposite(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca,
+ long lLocaSize, const void * pHead)
+{
+ if (IsSpace(nGlyphId, pLoca, lLocaSize, pHead)) {return false;}
+
+ void * pSimpleGlyf = GlyfLookup(nGlyphId, pGlyf, pLoca, lLocaSize, pHead);
+ if (pSimpleGlyf == NULL)
+ return false; // no way to really indicate an error occured here
+
+ if (GlyfContourCount(pSimpleGlyf) >= 0)
+ return false;
+
+ int rgnCompId[kMaxGlyphComponents]; // assumes only a limited number of glyph components
+ size_t cCompIdTotal = kMaxGlyphComponents;
+ size_t cCompId = 0;
+
+ if (!GetComponentGlyphIds(pSimpleGlyf, rgnCompId, cCompIdTotal, cCompId))
+ return false;
+
+ for (size_t i = 0; i < cCompId; i++)
+ {
+ void * pSimpleGlyf = GlyfLookup(static_cast<gr::gid16>(rgnCompId[i]),
+ pGlyf, pLoca, lLocaSize, pHead);
+ if (pSimpleGlyf == NULL) {return false;}
+
+ if (GlyfContourCount(pSimpleGlyf) < 0)
+ return true;
+ }
+
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the bounding box coordinates based on the given tables and Glyph ID
+ Handles both simple and composite glyphs.
+ Return true if successful, false otherwise. On false, all point values will be INT_MIN
+ False may indicate a white space glyph
+----------------------------------------------------------------------------------------------*/
+bool GlyfBox(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca,
+ size_t lLocaSize, const void * pHead, int & xMin, int & yMin, int & xMax, int & yMax)
+{
+ xMin = yMin = xMax = yMax = INT_MIN;
+
+ if (IsSpace(nGlyphId, pLoca, lLocaSize, pHead)) {return false;}
+
+ void * pSimpleGlyf = GlyfLookup(nGlyphId, pGlyf, pLoca, lLocaSize, pHead);
+ if (pSimpleGlyf == NULL) {return false;}
+
+ return GlyfBox(pSimpleGlyf, xMin, yMin, xMax, yMax);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the number of contours based on the given tables and Glyph ID
+ Handles both simple and composite glyphs.
+ Return true if successful, false otherwise. On false, cnContours will be INT_MIN
+ False may indicate a white space glyph or a multi-level composite glyph.
+----------------------------------------------------------------------------------------------*/
+bool GlyfContourCount(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca,
+ size_t lLocaSize, const void * pHead, size_t & cnContours)
+{
+ cnContours = static_cast<size_t>(INT_MIN);
+
+ if (IsSpace(nGlyphId, pLoca, lLocaSize, pHead)) {return false;}
+
+ void * pSimpleGlyf = GlyfLookup(nGlyphId, pGlyf, pLoca, lLocaSize, pHead);
+ if (pSimpleGlyf == NULL) {return false;}
+
+ int cRtnContours = GlyfContourCount(pSimpleGlyf);
+ if (cRtnContours >= 0)
+ {
+ cnContours = size_t(cRtnContours);
+ return true;
+ }
+
+ //handle composite glyphs
+
+ int rgnCompId[kMaxGlyphComponents]; // assumes no glyph will be made of more than 8 components
+ size_t cCompIdTotal = kMaxGlyphComponents;
+ size_t cCompId = 0;
+
+ if (!GetComponentGlyphIds(pSimpleGlyf, rgnCompId, cCompIdTotal, cCompId))
+ return false;
+
+ cRtnContours = 0;
+ int cTmp = 0;
+ for (size_t i = 0; i < cCompId; i++)
+ {
+ if (IsSpace(static_cast<gr::gid16>(rgnCompId[i]), pLoca, lLocaSize, pHead)) {return false;}
+ pSimpleGlyf = GlyfLookup(static_cast<gr::gid16>(rgnCompId[i]),
+ pGlyf, pLoca, lLocaSize, pHead);
+ if (pSimpleGlyf == 0) {return false;}
+ // return false on multi-level composite
+ if ((cTmp = GlyfContourCount(pSimpleGlyf)) < 0)
+ return false;
+ cRtnContours += cTmp;
+ }
+
+ cnContours = size_t(cRtnContours);
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the point numbers for the end points of the glyph contours based on the given tables
+ and Glyph ID
+ Handles both simple and composite glyphs.
+ cnPoints - count of contours from GlyfContourCount (same as number of end points)
+ prgnContourEndPoints - should point to a buffer large enough to hold cnPoints integers
+ Return true if successful, false otherwise. On false, all end points are INT_MIN
+ False may indicate a white space glyph or a multi-level composite glyph.
+----------------------------------------------------------------------------------------------*/
+bool GlyfContourEndPoints(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca,
+ size_t lLocaSize, const void * pHead,
+ int * prgnContourEndPoint, size_t cnPoints)
+{
+ std::fill_n(prgnContourEndPoint, cnPoints, INT_MIN);
+
+ if (IsSpace(nGlyphId, pLoca, lLocaSize, pHead)) {return false;}
+
+ void * pSimpleGlyf = GlyfLookup(nGlyphId, pGlyf, pLoca, lLocaSize, pHead);
+ if (pSimpleGlyf == NULL) {return false;}
+
+ int cContours = GlyfContourCount(pSimpleGlyf);
+ int cActualPts = 0;
+ if (cContours > 0)
+ return GlyfContourEndPoints(pSimpleGlyf, prgnContourEndPoint, cnPoints, cActualPts);
+
+ // handle composite glyphs
+
+ int rgnCompId[kMaxGlyphComponents]; // assumes no glyph will be made of more than 8 components
+ size_t cCompIdTotal = kMaxGlyphComponents;
+ size_t cCompId = 0;
+
+ if (!GetComponentGlyphIds(pSimpleGlyf, rgnCompId, cCompIdTotal, cCompId))
+ return false;
+
+ int * prgnCurrentEndPoint = prgnContourEndPoint;
+ int cCurrentPoints = cnPoints;
+ int nPrevPt = 0;
+ for (size_t i = 0; i < cCompId; i++)
+ {
+ if (IsSpace(static_cast<gr::gid16>(rgnCompId[i]), pLoca, lLocaSize, pHead)) {return false;}
+ pSimpleGlyf = GlyfLookup(static_cast<gr::gid16>(rgnCompId[i]), pGlyf, pLoca, lLocaSize, pHead);
+ if (pSimpleGlyf == NULL) {return false;}
+ // returns false on multi-level composite
+ if (!GlyfContourEndPoints(pSimpleGlyf, prgnCurrentEndPoint, cCurrentPoints, cActualPts))
+ return false;
+ // points in composite are numbered sequentially as components are added
+ // must adjust end point numbers for new point numbers
+ for (int j = 0; j < cActualPts; j++)
+ prgnCurrentEndPoint[j] += nPrevPt;
+ nPrevPt = prgnCurrentEndPoint[cActualPts - 1] + 1;
+
+ prgnCurrentEndPoint += cActualPts;
+ cCurrentPoints -= cActualPts;
+ }
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the points for a glyph based on the given tables and Glyph ID
+ Handles both simple and composite glyphs.
+ cnPoints - count of points from largest end point obtained from GlyfContourEndPoints
+ prgnX & prgnY - should point to buffers large enough to hold cnPoints integers
+ The ranges are parallel so that coordinates for point(n) are found at offset n in
+ both ranges. These points are in absolute coordinates.
+ prgfOnCurve - should point to a buffer a large enough to hold cnPoints bytes (bool)
+ This range is parallel to the prgnX & prgnY
+ Return true if successful, false otherwise. On false, all points may be INT_MIN
+ False may indicate a white space glyph, a multi-level composite, or a corrupt font
+ // TODO: doesn't support composite glyphs whose components are themselves components
+ It's not clear from the TTF spec when the transforms should be applied. Should the
+ transform be done before or after attachment point calcs? (current code - before)
+ Should the transform be applied to other offsets? (currently - no; however commented
+ out code is in place so that if CompoundGlyph::UnscaledOffset on the MS rasterizer is
+ clear (typical) then yes, and if CompoundGlyph::ScaledOffset on the Apple rasterizer is
+ clear (typical?) then no). See GetComponentTransform.
+ It's also unclear where point numbering with attachment poinst starts
+ (currently - first point number is relative to whole glyph, second point number is
+ relative to current glyph).
+----------------------------------------------------------------------------------------------*/
+bool GlyfPoints(gr::gid16 nGlyphId, const void * pGlyf,
+ const void * pLoca, size_t lLocaSize, const void * pHead,
+ const int * prgnContourEndPoint, size_t cnEndPoints,
+ int * prgnX, int * prgnY, bool * prgfOnCurve, size_t cnPoints)
+{
+ std::fill_n(prgnX, cnPoints, INT_MAX);
+ std::fill_n(prgnY, cnPoints, INT_MAX);
+
+ if (IsSpace(nGlyphId, pLoca, lLocaSize, pHead))
+ return false;
+
+ void * pSimpleGlyf = GlyfLookup(nGlyphId, pGlyf, pLoca, lLocaSize, pHead);
+ if (pSimpleGlyf == NULL)
+ return false;
+
+ int cContours = GlyfContourCount(pSimpleGlyf);
+ int cActualPts;
+ if (cContours > 0)
+ {
+ if (!GlyfPoints(pSimpleGlyf, prgnX, prgnY, (char *)prgfOnCurve, cnPoints, cActualPts))
+ return false;
+ CalcAbsolutePoints(prgnX, prgnY, cnPoints);
+ SimplifyFlags((char *)prgfOnCurve, cnPoints);
+ return true;
+ }
+
+ // handle composite glyphs
+ int rgnCompId[kMaxGlyphComponents]; // assumes no glyph will be made of more than 8 components
+ size_t cCompIdTotal = kMaxGlyphComponents;
+ size_t cCompId = 0;
+
+ // this will fail if there are more components than there is room for
+ if (!GetComponentGlyphIds(pSimpleGlyf, rgnCompId, cCompIdTotal, cCompId))
+ return false;
+
+ int * prgnCurrentX = prgnX;
+ int * prgnCurrentY = prgnY;
+ char * prgbCurrentFlag = (char *)prgfOnCurve; // converting bool to char should be safe
+ int cCurrentPoints = cnPoints;
+ bool fOffset = true, fTransOff = true;
+ int a, b;
+ float flt11, flt12, flt21, flt22;
+ // int * prgnPrevX = prgnX; // in case first att pt number relative to preceding glyph
+ // int * prgnPrevY = prgnY;
+ for (size_t i = 0; i < cCompId; i++)
+ {
+ if (IsSpace(static_cast<gr::gid16>(rgnCompId[i]), pLoca, lLocaSize, pHead)) {return false;}
+ void * pCompGlyf = GlyfLookup(static_cast<gr::gid16>(rgnCompId[i]), pGlyf, pLoca, lLocaSize, pHead);
+ if (pCompGlyf == NULL) {return false;}
+ // returns false on multi-level composite
+ if (!GlyfPoints(pCompGlyf, prgnCurrentX, prgnCurrentY, prgbCurrentFlag,
+ cCurrentPoints, cActualPts))
+ return false;
+ if (!GetComponentPlacement(pSimpleGlyf, rgnCompId[i], fOffset, a, b))
+ return false;
+ if (!GetComponentTransform(pSimpleGlyf, rgnCompId[i],
+ flt11, flt12, flt21, flt22, fTransOff))
+ return false;
+ bool fIdTrans = flt11 == 1.0 && flt12 == 0.0 && flt21 == 0.0 && flt22 == 1.0;
+
+ // convert points to absolute coordinates
+ // do before transform and attachment point placement are applied
+ CalcAbsolutePoints(prgnCurrentX, prgnCurrentY, cActualPts);
+
+ // apply transform - see main method note above
+ // do before attachment point calcs
+ if (!fIdTrans)
+ for (int j = 0; j < cActualPts; j++)
+ {
+ int x = prgnCurrentX[j]; // store before transform applied
+ int y = prgnCurrentY[j];
+ prgnCurrentX[j] = (int)(x * flt11 + y * flt12);
+ prgnCurrentY[j] = (int)(x * flt21 + y * flt22);
+ }
+
+ // apply placement - see main method note above
+ int nXOff, nYOff;
+ if (fOffset) // explicit x & y offsets
+ {
+ /* ignore fTransOff for now
+ if (fTransOff && !fIdTrans)
+ { // transform x & y offsets
+ nXOff = (int)(a * flt11 + b * flt12);
+ nYOff = (int)(a * flt21 + b * flt22);
+ }
+ else */
+ { // don't transform offset
+ nXOff = a;
+ nYOff = b;
+ }
+ }
+ else // attachment points
+ { // in case first point is relative to preceding glyph and second relative to current
+ // nXOff = prgnPrevX[a] - prgnCurrentX[b];
+ // nYOff = prgnPrevY[a] - prgnCurrentY[b];
+ // first point number relative to whole composite, second relative to current glyph
+ nXOff = prgnX[a] - prgnCurrentX[b];
+ nYOff = prgnY[a] - prgnCurrentY[b];
+ }
+ for (int j = 0; j < cActualPts; j++)
+ {
+ prgnCurrentX[j] += nXOff;
+ prgnCurrentY[j] += nYOff;
+ }
+
+ // prgnPrevX = prgnCurrentX;
+ // prgnPrevY = prgnCurrentY;
+ prgnCurrentX += cActualPts;
+ prgnCurrentY += cActualPts;
+ prgbCurrentFlag += cActualPts;
+ cCurrentPoints -= cActualPts;
+ }
+
+ SimplifyFlags((char *)prgfOnCurve, cnPoints);
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Simplify the meaning of flags to just indicate whether point is on-curve or off-curve
+---------------------------------------------------------------------------------------------*/
+bool SimplifyFlags(char * prgbFlags, int cnPoints)
+{
+ for (int i = 0; i < cnPoints; i++)
+ prgbFlags[i] = static_cast<char>(prgbFlags[i] & Sfnt::SimpleGlyph::OnCurve);
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert relative point coordinates to absolute coordinates
+ Points are stored in the font such that they are offsets from one another except for the
+ first point of a glyph.
+---------------------------------------------------------------------------------------------*/
+bool CalcAbsolutePoints(int * prgnX, int * prgnY, int cnPoints)
+{
+ int nX = prgnX[0];
+ int nY = prgnY[0];
+ for (int i = 1; i < cnPoints; i++)
+ {
+ prgnX[i] += nX;
+ nX = prgnX[i];
+ prgnY[i] += nY;
+ nY = prgnY[i];
+ }
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert a numerical table ID to a string containing the actual name of the table.
+ Returns native order unsigned long.
+---------------------------------------------------------------------------------------------*/
+gr::fontTableId32 TableIdTag(const TableId tid)
+{
+ assert(sizeof(mapIdToTag) == sizeof(gr::fontTableId32) * ktiLast);
+ assert(tid < ktiLast);
+
+ return mapIdToTag[tid];
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the length of the 'name' table in bytes.
+ Currently used.
+---------------------------------------------------------------------------------------------*/
+#if 0
+size_t NameTableLength(const gr::byte * pTable)
+{
+ gr::byte * pb = (const_cast<gr::byte *>(pTable)) + 2; // skip format
+ size_t cRecords = *pb++ << 8; cRecords += *pb++;
+ int dbStringOffset0 = (*pb++) << 8; dbStringOffset0 += *pb++;
+ int dbMaxStringOffset = 0;
+ for (size_t irec = 0; irec < cRecords; irec++)
+ {
+ int nPlatform = (*pb++) << 8; nPlatform += *pb++;
+ int nEncoding = (*pb++) << 8; nEncoding += *pb++;
+ int nLanguage = (*pb++) << 8; nLanguage += *pb++;
+ int nName = (*pb++) << 8; nName += *pb++;
+ int cbStringLen = (*pb++) << 8; cbStringLen += *pb++;
+ int dbStringOffset = (*pb++) << 8; dbStringOffset += *pb++;
+ if (dbMaxStringOffset < dbStringOffset + cbStringLen)
+ dbMaxStringOffset = dbStringOffset + cbStringLen;
+ }
+ return dbStringOffset0 + dbMaxStringOffset;
+}
+#endif
+
+} // end of namespace TtfUtil
diff --git a/Build/source/libs/graphite/src/font/TtfUtil.h b/Build/source/libs/graphite/src/font/TtfUtil.h
new file mode 100644
index 00000000000..bf437ff3475
--- /dev/null
+++ b/Build/source/libs/graphite/src/font/TtfUtil.h
@@ -0,0 +1,147 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2000, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: TtfUtil.h
+Responsibility: Alan Ward
+Last reviewed: Not yet.
+
+Description:
+ Utility class for handling TrueType font files.
+----------------------------------------------------------------------------------------------*/
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef TTFUTIL_H
+#define TTFUTIL_H
+
+#include <cstddef>
+#include <stdexcept>
+#include "GrPlatform.h"
+
+// Enumeration used to specify a table in a TTF file
+enum TableId
+{
+ ktiCmap, ktiCvt, ktiCryp, ktiHead, ktiFpgm, ktiGdir, ktiGlyf,
+ ktiHdmx, ktiHhea, ktiHmtx, ktiLoca, ktiKern, ktiLtsh, ktiMaxp,
+ ktiName, ktiOs2, ktiPost, ktiPrep, ktiFeat, ktiGlat, ktiGloc,
+ ktiSilf, ktiSile, ktiSill,
+ ktiLast /*This gives the enum length - it is not a real table*/
+};
+
+/*----------------------------------------------------------------------------------------------
+ Class providing utility methods to parse a TrueType font file (TTF).
+ Callling application handles all file input and memory allocation.
+ Assumes minimal knowledge of TTF file format.
+----------------------------------------------------------------------------------------------*/
+namespace TtfUtil
+{
+ ////////////////////////////////// tools to find & check TTF tables
+ bool GetHeaderInfo(size_t & lOffset, size_t & lSize);
+ bool CheckHeader(const void * pHdr);
+ bool GetTableDirInfo(const void * pHdr, size_t & lOffset, size_t & lSize);
+ bool GetTableInfo(TableId ktiTableId, const void * pHdr, const void * pTableDir,
+ size_t & lOffset, size_t & lSize);
+ bool CheckTable(TableId ktiTableId, const void * pTable, size_t lTableSize);
+
+ ////////////////////////////////// simple font wide info
+ size_t GlyphCount(const void * pMaxp);
+ size_t MaxCompositeComponentCount(const void * pMaxp);
+ size_t MaxCompositeLevelCount(const void * pMaxp);
+ size_t LocaGlyphCount(size_t lLocaSize, const void * pHead) throw (std::domain_error);
+ int DesignUnits(const void * pHead);
+ int HeadTableCheckSum(const void * pHead);
+ void HeadTableCreateTime(const void * pHead, unsigned int * pnDateBC, unsigned int * pnDateAD);
+ void HeadTableModifyTime(const void * pHead, unsigned int * pnDateBC, unsigned int * pnDateAD);
+ bool IsItalic(const void * pHead);
+ int FontAscent(const void * pOs2);
+ int FontDescent(const void * pOs2);
+ bool FontOs2Style(const void *pOs2, bool & fBold, bool & fItalic);
+ bool Get31EngFamilyInfo(const void * pName, size_t & lOffset, size_t & lSize);
+ bool Get31EngFullFontInfo(const void * pName, size_t & lOffset, size_t & lSize);
+ bool Get30EngFamilyInfo(const void * pName, size_t & lOffset, size_t & lSize);
+ bool Get30EngFullFontInfo(const void * pName, size_t & lOffset, size_t & lSize);
+ int PostLookup(const void * pPost, size_t lPostSize, const void * pMaxp,
+ const char * pPostName);
+
+ ////////////////////////////////// utility methods helpful for name table
+ bool GetNameInfo(const void * pName, int nPlatformId, int nEncodingId,
+ int nLangId, int nNameId, size_t & lOffset, size_t & lSize);
+ //size_t NameTableLength(const gr::byte * pTable);
+ int GetLangsForNames(const void * pName, int nPlatformId, int nEncodingId,
+ int *nameIdList, int cNameIds, short *langIdList);
+ void SwapWString(void * pWStr, size_t nSize = 0) throw (std::invalid_argument);
+
+ ////////////////////////////////// cmap lookup tools
+ void * FindCmapSubtable(const void * pCmap, int nPlatformId = 3,
+ int nEncodingId = 1);
+ bool CheckCmap31Subtable(const void * pCmap31);
+ gr::gid16 Cmap31Lookup(const void * pCmap31, int nUnicodeId);
+ unsigned int Cmap31NextCodepoint(const void *pCmap31, unsigned int nUnicodeId,
+ int * pRangeKey = 0);
+ bool CheckCmap310Subtable(const void *pCmap310);
+ gr::gid16 Cmap310Lookup(const void * pCmap310, unsigned int uUnicodeId);
+ unsigned int Cmap310NextCodepoint(const void *pCmap310, unsigned int nUnicodeId,
+ int * pRangeKey = 0);
+
+ ///////////////////////////////// horizontal metric data for a glyph
+ bool HorMetrics(gr::gid16 nGlyphId, const void * pHmtx, size_t lHmtxSize,
+ const void * pHhea, int & nLsb, unsigned int & nAdvWid);
+
+ ///////////////////////////////// convert our TableId enum to standard TTF tags
+ gr::fontTableId32 TableIdTag(const TableId);
+
+ ////////////////////////////////// primitives for loca and glyf lookup
+ size_t LocaLookup(gr::gid16 nGlyphId, const void * pLoca, size_t lLocaSize,
+ const void * pHead) throw (std::out_of_range);
+ void * GlyfLookup(const void * pGlyf, size_t lGlyfOffset);
+
+ ////////////////////////////////// primitves for simple glyph data
+ bool GlyfBox(const void * pSimpleGlyf, int & xMin, int & yMin,
+ int & xMax, int & yMax);
+
+ int GlyfContourCount(const void * pSimpleGlyf);
+ bool GlyfContourEndPoints(const void * pSimpleGlyf, int * prgnContourEndPoint,
+ int cnPointsTotal, size_t & cnPoints);
+ bool GlyfPoints(const void * pSimpleGlyf, int * prgnX, int * prgnY,
+ char * prgbFlag, int cnPointsTotal, int & cnPoints);
+
+ // primitive to find the glyph ids in a composite glyph
+ bool GetComponentGlyphIds(const void * pSimpleGlyf, int * prgnCompId,
+ size_t cnCompIdTotal, size_t & cnCompId);
+ // primitive to find the placement data for a component in a composite glyph
+ bool GetComponentPlacement(const void * pSimpleGlyf, int nCompId,
+ bool fOffset, int & a, int & b);
+ // primitive to find the transform data for a component in a composite glyph
+ bool GetComponentTransform(const void * pSimpleGlyf, int nCompId,
+ float & flt11, float & flt12, float & flt21, float & flt22, bool & fTransOffset);
+
+ ////////////////////////////////// operate on composite or simple glyph (auto glyf lookup)
+ void * GlyfLookup(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca,
+ size_t lLocaSize, const void * pHead); // primitive used by below methods
+
+ // below are primary user methods for handling glyf data
+ bool IsSpace(gr::gid16 nGlyphId, const void * pLoca, size_t lLocaSize, const void * pHead);
+ bool IsDeepComposite(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca,
+ size_t lLocaSize, const void * pHead);
+
+ bool GlyfBox(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca, size_t lLocaSize,
+ const void * pHead, int & xMin, int & yMin, int & xMax, int & yMax);
+ bool GlyfContourCount(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca,
+ size_t lLocaSize, const void *pHead, size_t & cnContours);
+ bool GlyfContourEndPoints(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca,
+ size_t lLocaSize, const void * pHead, int * prgnContourEndPoint, size_t cnPoints);
+ bool GlyfPoints(gr::gid16 nGlyphId, const void * pGlyf, const void * pLoca,
+ size_t lLocaSize, const void * pHead, const int * prgnContourEndPoint, size_t cnEndPoints,
+ int * prgnX, int * prgnY, bool * prgfOnCurve, size_t cnPoints);
+
+ // utitily method used by high-level GlyfPoints
+ bool SimplifyFlags(char * prgbFlags, int cnPoints);
+ bool CalcAbsolutePoints(int * prgnX, int * prgnY, int cnPoints);
+
+} // end of namespace TtfUtil
+
+#endif
diff --git a/Build/source/libs/graphite/src/generic/BinTree.h b/Build/source/libs/graphite/src/generic/BinTree.h
new file mode 100644
index 00000000000..a487df03770
--- /dev/null
+++ b/Build/source/libs/graphite/src/generic/BinTree.h
@@ -0,0 +1,71 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: BinTree.h
+Responsibility: Darrell Zook
+Last reviewed: 9/8/99
+
+Description:
+ This file provides declarations of binary tree class(es).
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef BINTREE_H_INCLUDED
+#define BINTREE_H_INCLUDED
+
+/*----------------------------------------------------------------------------------------------
+ This template class implements a balanced tree, which is a binary tree where the height of
+ the two children of any node in the tree can only be different by +/- 1 or 0.
+
+ The class of objects to be stored in the tree should be derived from BalTreeBase, because
+ the constructor of BalTreeBase adds an object to the tree in sorted order without
+ allocating any memory.
+
+ Classes that derive from BalTreeBase must have a CompareKey member function that compares
+ a given key with this->key to determine which should be first when sorting the tree.
+ The declaration of CompareKey should be as follows:
+ int CompareKey(const Key & key);
+ and it should return:
+ <0 if key is less than the key in the current node (this->key)
+ 0 if key is equal to the key in the current node (this->key)
+ >0 if key is greater than the key in the current node (this->key)
+
+ CAUTION: Classes that use this template should never be dynamically instantiated (by using
+ local variables or new/NewObj). This class is meant to be used only for global
+ instances of a class. The reason for this restriction is that the tree is never
+ destroyed, so using dynamic instantiations of objects would result in stale pointers
+ in the tree.
+
+ Hungarian: btb
+----------------------------------------------------------------------------------------------*/
+
+template<typename Obj, typename Key> class BalTreeBase
+{
+protected:
+ // Pointers to the left and right subtrees.
+ Obj * m_rgpobj[2];
+
+ // The difference between the height of the right sub tree and the height of the left
+ // sub tree. This should be -1, 0, or +1. Insert may temporarily set it to -2 or +2.
+ short m_dht;
+
+ // Which way we went from this node when inserting the new node.
+ short m_ipobj;
+
+ // Inserts this in the balanced tree.
+ BalTreeBase(Obj ** ppobjRoot, const Key & key);
+
+ // Returns a node with the given key from the tree rooted at pobjRoot.
+ static Obj * Find(Obj * pobjRoot, const Key & key);
+
+private:
+ // Inserts a node in the tree rooted at *ppobjRoot, sorting it based on key.
+ void Insert(Obj ** ppobjRoot, const Key & key);
+};
+
+#endif // !BINTREE_H_INCLUDED
+
diff --git a/Build/source/libs/graphite/src/generic/BinTree_i.cpp b/Build/source/libs/graphite/src/generic/BinTree_i.cpp
new file mode 100644
index 00000000000..5929bf0bab1
--- /dev/null
+++ b/Build/source/libs/graphite/src/generic/BinTree_i.cpp
@@ -0,0 +1,225 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: BinTree_i.cpp
+Responsibility: Darrell Zook
+Last reviewed: 9/8/99
+
+Description:
+ This file provides implementations of binary tree class(es).
+ It is used as an #include file in any file which derives from one of the classes.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef BINTREE_I_CPP_INCLUDED
+#define BINTREE_I_CPP_INCLUDED
+
+#include "BinTree.h"
+////#include <algorithm>
+////#include "GrPlatform.h"
+#include "GrCommon.h"
+
+
+//using namespace gr;
+
+/***********************************************************************************************
+ BalTreeBase<Obj, Key> methods
+***********************************************************************************************/
+
+/*----------------------------------------------------------------------------------------------
+ Constructor.
+ This calls Insert to add this node to the tree in the correct (sorted) position.
+
+ Arguments:
+ [in] ppobjRoot -> The address of the pointer to the root node of the tree.
+ [in] key -> References the key of the node to insert.
+----------------------------------------------------------------------------------------------*/
+template<typename Obj, typename Key>
+ BalTreeBase<Obj, Key>::BalTreeBase(Obj ** ppobjRoot, const Key & key)
+{
+ AssertPtr(ppobjRoot);
+ AssertPtrN(*ppobjRoot);
+
+ m_rgpobj[0] = NULL;
+ m_rgpobj[1] = NULL;
+ m_dht = 0;
+
+ Insert(ppobjRoot, key);
+}
+
+/*----------------------------------------------------------------------------------------------
+ This method finds a node with the given key within the tree. If the key is not found in
+ the tree, NULL is returned.
+
+ Arguments:
+ [in] pobjRoot -> Points to the root node of the tree.
+ [in] key -> References the key of the node to search for.
+----------------------------------------------------------------------------------------------*/
+template<typename Obj, typename Key>
+ Obj * BalTreeBase<Obj, Key>::Find(Obj * pobjRoot, const Key & key)
+{
+ AssertPtrN(pobjRoot);
+
+ for (Obj * pobj = pobjRoot; pobj; )
+ {
+ int nT = pobj->CompareKey(key);
+ if (0 == nT)
+ return pobj;
+ pobj = pobj->m_rgpobj[nT > 0];
+ }
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------------------------
+ This method inserts a node within the tree, sorting it based on key. It does not allocate
+ any memory.
+
+ Arguments:
+ [in] ppobjRoot -> The address of the pointer to the root node of the tree.
+ [in] key -> References the key of the node to insert into the tree.
+ Note: "this" is the node that is being inserted into the tree.
+----------------------------------------------------------------------------------------------*/
+template<typename Obj, typename Key>
+ void BalTreeBase<Obj, Key>::Insert(Obj ** ppobjRoot, const Key & key)
+{
+ AssertPtr(ppobjRoot);
+ AssertPtrN(*ppobjRoot);
+
+ Assert(m_dht == 0);
+ Assert(!m_rgpobj[0]);
+ Assert(!m_rgpobj[1]);
+
+ Obj * pobjThis = static_cast<Obj *>(this);
+
+ // If the tree is empty, set the root of the tree to this and return.
+ if (!*ppobjRoot)
+ {
+ *ppobjRoot = pobjThis;
+ return;
+ }
+
+ Obj ** ppobjRebal = ppobjRoot;
+ Obj * pobjCur;
+
+ // Place this in the tree. Mark each node indicating which branch we took.
+ // Remember the lowest node with non-zero m_dht in ppobjRebal. If we have to do
+ // rebalancing, this is where we'll do it.
+ for (pobjCur = *ppobjRoot; ; )
+ {
+ AssertPtr(pobjCur);
+
+ int nT = pobjCur->CompareKey(key);
+ Assert(nT != 0);
+
+ // if nT is positive go right, otherwise go left.
+ pobjCur->m_ipobj = nT > 0;
+
+ Obj ** ppobjNext = &pobjCur->m_rgpobj[pobjCur->m_ipobj];
+ if (!*ppobjNext)
+ {
+ // Place the node and break.
+ *ppobjNext = pobjThis;
+ break;
+ }
+
+ // Remember this location if m_dht is non-zero.
+ if ((*ppobjNext)->m_dht != 0)
+ ppobjRebal = ppobjNext;
+
+ // Move on down.
+ pobjCur = *ppobjNext;
+ }
+
+ // Adjust m_dht from *ppobjRebal to pobjThis.
+ for (pobjCur = *ppobjRebal; pobjCur != pobjThis; )
+ {
+ AssertPtr(pobjCur);
+ Assert((unsigned int)pobjCur->m_ipobj < (unsigned int)2);
+
+ // Recall that ppobjRebal is the lowest node on the path which has non-zero m_dht.
+ Assert(pobjCur->m_dht == 0 || pobjCur == *ppobjRebal);
+
+ // If we went left (m_ipobj == 0) we need to subtract one. If we went right
+ // (m_ipobj == 1) we need to add one.
+ pobjCur->m_dht = (short)(pobjCur->m_dht + (pobjCur->m_ipobj << 1) - 1);
+ pobjCur = pobjCur->m_rgpobj[pobjCur->m_ipobj];
+ }
+
+ if ((unsigned int)((*ppobjRebal)->m_dht + 1) <= (unsigned int)2)
+ {
+ // No need to rebalance since the new m_dht for *ppobjRebal is within -1 to 1.
+ return;
+ }
+
+ // We need to rebalance.
+ Obj * pobjRebal = *ppobjRebal;
+ Assert(pobjRebal->m_dht == -2 || pobjRebal->m_dht == 2);
+
+ // Get the direction from pobjRebal and the next lower node.
+ int ipobj = pobjRebal->m_ipobj;
+ Obj * pobjChd = pobjRebal->m_rgpobj[ipobj];
+
+ if (pobjChd->m_ipobj == ipobj)
+ {
+ // We branched the same way at pobjRebal and pobjChd.
+ // Do a single rotation: make pobjChd the parent of pobjRebal.
+ Assert(pobjChd->m_dht << 1 == pobjRebal->m_dht);
+ pobjRebal->m_rgpobj[ipobj] = pobjChd->m_rgpobj[1 - ipobj];
+ pobjChd->m_rgpobj[1 - ipobj] = pobjRebal;
+ *ppobjRebal = pobjChd;
+
+ // Fix the m_dht values.
+ pobjChd->m_dht = 0;
+ pobjRebal->m_dht = 0;
+ return;
+ }
+
+ // We branched opposite ways at pobjRebal and pobjChd.
+ // Do a double rotation.
+ Assert(pobjChd->m_ipobj == 1 - ipobj);
+ pobjCur = pobjChd->m_rgpobj[1 - ipobj];
+ AssertPtr(pobjCur);
+
+ // Let (A own[ipobj] B) mean that A->m_rgpobj[ipobj] == B.
+ // Currently, (pobjRebal own[ipobj] pobjChd) and (pobjChd own[1 - ipobj] pobjCur).
+ // Make (pobjCur own[ipobj] pobjChd) and (pobjCur own[1 - ipobj] pobjRebal).
+
+ // Rotate pobjChd and pobjCur.
+ Assert(pobjCur == pobjChd->m_rgpobj[1 - ipobj]);
+ pobjChd->m_rgpobj[1 - ipobj] = pobjCur->m_rgpobj[ipobj];
+ pobjCur->m_rgpobj[ipobj] = pobjChd;
+
+ // Rotate pobjRebal and pobjCur.
+ Assert(pobjRebal->m_rgpobj[ipobj] == pobjChd);
+ pobjRebal->m_rgpobj[ipobj] = pobjCur->m_rgpobj[1 - ipobj];
+ pobjCur->m_rgpobj[1 - ipobj] = pobjRebal;
+
+ // Fix *ppobjRebal.
+ *ppobjRebal = pobjCur;
+
+ // Fix the m_dht values. Note that we don't compare with pobjRebal->m_dht since it
+ // currently has absolute value 2.
+ Assert(pobjChd->m_dht);
+ if (pobjCur->m_dht == pobjChd->m_dht)
+ {
+ pobjRebal->m_dht = 0;
+ pobjChd->m_dht = (short)-pobjChd->m_dht;
+ }
+ else if (pobjCur->m_dht == -pobjChd->m_dht)
+ {
+ pobjRebal->m_dht = pobjChd->m_dht;
+ pobjChd->m_dht = 0;
+ }
+ else
+ {
+ pobjRebal->m_dht = 0;
+ pobjChd->m_dht = 0;
+ }
+ pobjCur->m_dht = 0;
+}
+
+#endif // !BINTREE_I_CPP_INCLUDED
diff --git a/Build/source/libs/graphite/src/generic/Debug.cpp b/Build/source/libs/graphite/src/generic/Debug.cpp
new file mode 100644
index 00000000000..d1f2a67e364
--- /dev/null
+++ b/Build/source/libs/graphite/src/generic/Debug.cpp
@@ -0,0 +1,83 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: Debug.cpp
+Responsibility: Darrell Zook
+Last reviewed: Not yet.
+
+Description:
+ This file provides the standard debug error functions.
+----------------------------------------------------------------------------------------------*/
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+//#include "common.h"
+//#include "Main.h"
+#include "GrDebug.h"
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//#include "ModuleEntry.h"
+#include <stdio.h>
+#ifdef _MSC_VER
+#include <crtdbg.h>
+#endif
+
+
+#if 0
+//#ifdef DEBUG
+
+extern HMODULE Win32DllGetModuleHandle();
+
+void WINAPI AssertProcLocal(const char * pszExp, const char * pszFile, int nLine,
+ bool fCritical)
+{
+ AssertProc(pszExp, pszFile, nLine, fCritical, Win32DllGetModuleHandle());
+}
+
+void WINAPI WarnProcLocal(const char * pszExp, const char * pszFile, int nLine,
+ bool fCritical)
+{
+ WarnProc(pszExp, pszFile, nLine, fCritical, Win32DllGetModuleHandle());
+}
+
+void WINAPI WarnHrProc(HRESULT hr, const char * pszFile, int nLine, bool fCritical)
+{
+ char szBuffer[MAX_PATH + 25];
+ sprintf(szBuffer, "HRESULT[0x%08x]--", hr);
+ int cch = lstrlen(szBuffer);
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, 0, szBuffer + cch,
+ sizeof(szBuffer) - cch, NULL);
+ szBuffer[max(lstrlen(szBuffer) - 2, 0)] = 0;
+ WarnProcLocal(szBuffer, pszFile, nLine, fCritical);
+}
+
+
+OLECHAR * DebugWatch::WatchNV()
+{
+ // JT: we need this, otherwise if dealing with a deleted object or null pointer
+ // we may try to call a virtual function where there is no valid VTABLE pointer.
+ // In the debugger we can't be sure of not dereferencing a bad pointer.
+ if (!::_CrtIsValidPointer(this, isizeof(this), TRUE ))
+ return L"A very bad object pointer";
+ // We could also be referencing memory that is trashed (e.g., the object has
+ // been deleted, or deleted and replaced by something else).
+ if (!dynamic_cast<DebugWatch *>(this))
+ return L"A bad object pointer";
+ return Watch();
+}
+
+void DebugWatch::Output (char *fmt, ...) // LIMITED to 10 pointer-sized arguments
+{
+ struct args { void * pv[10]; };
+ _CrtDbgReport (_CRT_WARN, NULL, NULL, __FILE__, fmt, *(args*)(&fmt+1));
+}
+
+#endif // DEBUG
diff --git a/Build/source/libs/graphite/src/generic/GenericResource.h b/Build/source/libs/graphite/src/generic/GenericResource.h
new file mode 100644
index 00000000000..119c6317bcd
--- /dev/null
+++ b/Build/source/libs/graphite/src/generic/GenericResource.h
@@ -0,0 +1,86 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GenericResource.h
+Responsibility: John Thomson
+Last reviewed:
+
+ Resources needed by certain generic components (but must be created in app's or AppCore's
+ resource file).
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GenericResource_H
+#define GenericResource_H 1
+// Create suitable resources for these if your app uses StackDumper.
+// For example
+// STRINGTABLE DISCARDABLE
+// BEGIN
+// "A programming error (%s) has been detected in module %s.\n Please report this to the developers", kstidInternalError
+// "Out of memory. To attempt Save, close other apps and click OK. To quit without saving click Cancel", kstidOutOfMemory
+// END
+
+
+// Date qualifier string IDs:
+#define kstidDateQualBefore 24200
+#define kstidDateQualOn 24201
+#define kstidDateQualAbout 24202
+#define kstidDateQualAfter 24203
+#define kstidDateQualAbt 24204
+#define kstidDateQualBC 24205
+#define kstidDateQualAD 24206
+#define kstidDateBlank 24207
+#define kstidDateBlankM 24208
+#define kstidDateBlankD 24209
+
+
+#define kstidInternalError 25900
+#define khcidHelpOutOfMemory 25901
+#define khcidNoHelpAvailable 25902 // default help module when there is no specific one.
+#define kstidOutOfMemory 25903
+#define kstidUndoFrame 25904
+#define kstidRedoFrame 25905
+
+#define kstidFileErrUnknown 25920
+#define kstidFileErrNotFound 25921
+#define kstidFileErrPathNotFound 25922
+#define kstidFileErrTooManyFiles 25923
+#define kstidFileErrAccDenied 25924
+#define kstidFileErrBadHandle 25925
+#define kstidFileErrBadDrive 25926
+#define kstidFileErrWriteProtect 25927
+#define kstidFileErrBadUnit 25928
+#define kstidFileErrNotReady 25929
+#define kstidFileErrSeek 25930
+#define kstidFileErrNotDosDisk 25931
+#define kstidFileErrBadSector 25932
+#define kstidFileErrWriteFault 25933
+#define kstidFileErrReadFault 25934
+#define kstidFileErrGeneral 25935
+#define kstidFileErrSharing 25936
+#define kstidFileErrLock 25937
+#define kstidFileErrEof 25938
+#define kstidFileErrHandleDiskFull 25939
+#define kstidFileErrBadNetPath 25940
+#define kstidFileErrNetworkBusy 25941
+#define kstidFileErrNoDevice 25942
+#define kstidFileErrNoNetAccess 25943
+#define kstidFileErrBadDevice 25944
+#define kstidFileErrBadNetName 25945
+#define kstidFileErrExists 25946
+#define kstidFileErrCantMake 25947
+#define kstidFileErrBadPassword 25948
+#define kstidFileErrNetWriteFault 25949
+#define kstidFileErrDriveLocked 25950
+#define kstidFileErrOpenFailed 25951
+#define kstidFileErrBufOverflow 25952
+#define kstidFileErrDiskFull 25953
+#define kstidFileErrBadName 25954
+#define kstidFileErrNoVolLabel 25955
+#define kstidFileErrAlreadyExists 25956
+
+#endif // !GenericResource_H
diff --git a/Build/source/libs/graphite/src/generic/HashMap.h b/Build/source/libs/graphite/src/generic/HashMap.h
new file mode 100644
index 00000000000..dc2de9d0af7
--- /dev/null
+++ b/Build/source/libs/graphite/src/generic/HashMap.h
@@ -0,0 +1,328 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: HashMap.h
+Responsibility: Steve McConnel
+Last reviewed: Not yet.
+
+Description:
+ This provides a set of template collection classes to replace std::map. Their primary
+ reason to exist is to allow explicit checking for internal memory allocation failures.
+----------------------------------------------------------------------------------------------*/
+#pragma once
+#ifndef HASHMAP_H_INCLUDED
+#define HASHMAP_H_INCLUDED
+//:End Ignore
+
+/*----------------------------------------------------------------------------------------------
+ Functor class for computing a hash value from an arbitrary object.
+
+ Hungarian: hsho
+----------------------------------------------------------------------------------------------*/
+class HashObj
+{
+public:
+ int operator () (void * pKey, int cbKey);
+};
+
+/*----------------------------------------------------------------------------------------------
+ Functor class for comparing two arbitrary objects (of the same class) for equality.
+
+ Hungarian: eqlo
+----------------------------------------------------------------------------------------------*/
+class EqlObj
+{
+public:
+ bool operator () (void * pKey1, void * pKey2, int cbKey);
+};
+
+/*----------------------------------------------------------------------------------------------
+ Hash map template collection class whose keys are objects of an arbitrary class.
+
+ Hungarian: hm[K][T]
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H = HashObj, class Eq = EqlObj> class HashMap
+{
+public:
+ //:> Member classes
+
+ /*------------------------------------------------------------------------------------------
+ This is the basic data structure for storing one key-value pair in a hash map. In
+ order to handle hash collisions, this structure is a member of a linked list.
+ Hungarian: hsnd
+ ------------------------------------------------------------------------------------------*/
+ class HashNode
+ {
+ public:
+ //:> Constructors/destructors/etc.
+
+ HashNode(void)
+ : m_key(K()), m_value(T()), m_nHash(0), m_ihsndNext(0)
+ {
+ }
+ HashNode(K & key, T & value, int nHash, int ihsndNext = -1)
+ : m_key(key), m_value(value), m_nHash(nHash), m_ihsndNext(ihsndNext)
+ {
+ }
+ ~HashNode()
+ {
+ }
+
+ //:> Member variable access
+
+ void PutKey(K & key)
+ {
+ m_key = key;
+ }
+ K & GetKey()
+ {
+ return m_key;
+ }
+ void PutValue(T & value)
+ {
+ m_value = value;
+ }
+ T & GetValue()
+ {
+ return m_value;
+ }
+ void PutHash(int nHash)
+ {
+ m_nHash = nHash;
+ }
+ int GetHash()
+ {
+ return m_nHash;
+ }
+ void PutNext(int ihsndNext)
+ {
+ m_ihsndNext = ihsndNext;
+ }
+ int GetNext()
+ {
+ return m_ihsndNext;
+ }
+
+ /*--------------------------------------------------------------------------------------
+ Check whether the given HashNode is being used.
+ --------------------------------------------------------------------------------------*/
+ bool InUse()
+ {
+ return m_ihsndNext >= -1;
+ }
+
+ protected:
+ //:> Member variables
+
+ K m_key;
+ T m_value;
+ int m_nHash;
+ int m_ihsndNext; // -1 means end of list, -(ihsnd + 3) for free list members
+ };
+
+ /*------------------------------------------------------------------------------------------
+ This provides an iterator for stepping through all HashNodes stored in the hash map.
+ This is useful primarily for saving the contents of a hash map to a file.
+
+ Hungarian: ithm[K][T]
+ ------------------------------------------------------------------------------------------*/
+ class iterator
+ {
+ public:
+ // Constructors/destructors/etc.
+
+ iterator() : m_phmParent(NULL), m_ihsnd(0)
+ {
+ }
+ iterator(HashMap<K,T,H,Eq> * phm, int ihsnd) : m_phmParent(phm), m_ihsnd(ihsnd)
+ {
+ }
+ iterator(const iterator & v) : m_phmParent(v.m_phmParent), m_ihsnd(v.m_ihsnd)
+ {
+ }
+ ~iterator()
+ {
+ }
+
+ // Other public methods
+
+ iterator & operator = (const iterator & ithm)
+ {
+ m_phmParent = ithm.m_phmParent;
+ m_ihsnd = ithm.m_ihsnd;
+ return *this;
+ }
+ T & operator * (void)
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ return m_phmParent->m_prghsnd[m_ihsnd].GetValue();
+ }
+ HashNode * operator -> (void)
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ return &m_phmParent->m_prghsnd[m_ihsnd];
+ }
+ iterator & operator ++ (void)
+ {
+ Assert(m_phmParent);
+ ++m_ihsnd;
+ // make sure that this new HashNode is actually in use
+ while (m_ihsnd < m_phmParent->m_ihsndLim)
+ {
+ if (m_phmParent->m_prghsnd[m_ihsnd].InUse())
+ return *this;
+ // skip to the next one and check it
+ ++m_ihsnd;
+ }
+ if (m_ihsnd > m_phmParent->m_ihsndLim)
+ m_ihsnd = m_phmParent->m_ihsndLim;
+ return *this;
+ }
+ bool operator == (const iterator & ithm)
+ {
+ return (m_phmParent == ithm.m_phmParent) && (m_ihsnd == ithm.m_ihsnd);
+ }
+ bool operator != (const iterator & ithm)
+ {
+ return (m_phmParent != ithm.m_phmParent) || (m_ihsnd != ithm.m_ihsnd);
+ }
+ T & GetValue(void)
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ Assert(m_phmParent->m_prghsnd[m_ihsnd].InUse());
+ return m_phmParent->m_prghsnd[m_ihsnd].GetValue();
+ }
+ K & GetKey(void)
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ Assert(m_phmParent->m_prghsnd[m_ihsnd].InUse());
+ return m_phmParent->m_prghsnd[m_ihsnd].GetKey();
+ }
+ int GetHash()
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ Assert(m_phmParent->m_prghsnd[m_ihsnd].InUse());
+ return m_phmParent->m_prghsnd[m_ihsnd].GetHash();
+ }
+ int GetIndex()
+ {
+ Assert(m_phmParent);
+ Assert(m_phmParent->m_prghsnd);
+ Assert(m_ihsnd < m_phmParent->m_ihsndLim);
+ Assert(m_phmParent->m_prghsnd[m_ihsnd].InUse());
+ return m_ihsnd;
+ }
+
+ protected:
+ //:> Member variables
+
+ HashMap<K,T,H,Eq> * m_phmParent;
+ int m_ihsnd;
+ };
+ friend class iterator;
+
+ //:> Constructors/destructors/etc.
+
+ HashMap();
+ ~HashMap();
+ HashMap(HashMap<K,T,H,Eq> & hm);
+
+ //:> Other public methods
+
+ iterator Begin();
+ iterator End();
+ void Insert(K & key, T & value, bool fOverwrite = false, int * pihsndOut = NULL);
+ bool Retrieve(K & key, T * pvalueRet);
+ bool Delete(K & key);
+ void Clear();
+ void CopyTo(HashMap<K,T,H,Eq> & hmKT);
+ void CopyTo(HashMap<K,T,H,Eq> * phmKT);
+
+ bool GetIndex(K & key, int * pihsndRet);
+ bool IndexKey(int ihsnd, K * pkeyRet);
+ bool IndexValue(int ihsnd, T * pvalueRet);
+
+ int Size();
+
+ /*------------------------------------------------------------------------------------------
+ The assignment operator allows an entire hashmap to be assigned as the value of another
+ hashmap. It throws an error if it runs out of memory.
+
+ @return a reference to this hashmap. (That is how the assignment operator is defined!)
+
+ @param hm is a reference to the other hashmap.
+ ------------------------------------------------------------------------------------------*/
+ HashMap<K,T,H,Eq> & operator = (HashMap<K,T,H,Eq> & hm)
+ {
+ hm.CopyTo(this);
+ return *this;
+ }
+
+ //:Ignore
+#ifdef DEBUG
+ int _BucketCount();
+ int _EmptyBuckets();
+ int _BucketsUsed();
+ int _FullestBucket();
+ bool AssertValid()
+ {
+ AssertPtrN(m_prgihsndBuckets);
+ Assert(m_prgihsndBuckets || !m_cBuckets);
+ Assert(!m_prgihsndBuckets || m_cBuckets);
+ AssertArray(m_prgihsndBuckets, m_cBuckets);
+ AssertPtrN(m_prghsnd);
+ Assert(m_prghsnd || !m_ihsndMax);
+ Assert(!m_prghsnd || m_ihsndMax);
+ AssertArray(m_prghsnd, m_ihsndMax);
+ Assert(0 <= m_ihsndLim && m_ihsndLim <= m_ihsndMax);
+ Assert(-1 <= FreeListIdx(m_ihsndFirstFree));
+ Assert(FreeListIdx(m_ihsndFirstFree) < m_ihsndLim);
+ return true;
+ }
+#endif
+ //:End Ignore
+
+protected:
+ //:> Member variables
+
+ int * m_prgihsndBuckets;
+ int m_cBuckets;
+ HashNode * m_prghsnd;
+ int m_ihsndLim;
+ int m_ihsndMax;
+ int m_ihsndFirstFree; // stores -(ihsnd + 3)
+
+ //:> Protected methods
+ //:Ignore
+
+ /*------------------------------------------------------------------------------------------
+ Map between real index and "free list" index. Note that this mapping is bidirectional.
+ ------------------------------------------------------------------------------------------*/
+ int FreeListIdx(int ihsnd)
+ {
+ return -(ihsnd + 3);
+ }
+ //:End Ignore
+};
+
+
+// Local Variables:
+// mode:C++
+// c-file-style:"cellar"
+// tab-width:4
+// End:
+
+#endif /*HASHMAP_H_INCLUDED*/
diff --git a/Build/source/libs/graphite/src/generic/HashMap_i.cpp b/Build/source/libs/graphite/src/generic/HashMap_i.cpp
new file mode 100644
index 00000000000..baebe427a4e
--- /dev/null
+++ b/Build/source/libs/graphite/src/generic/HashMap_i.cpp
@@ -0,0 +1,561 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: HashMap_i.cpp
+Responsibility: Steve McConnel
+Last reviewed: Not yet.
+
+Description:
+ This file provides the implementations of methods for the HashMap template collection
+ classes. It is used as an #include file in any file which explicitly instantiates any
+ particular type of HashMap<K,T>, HashMapStrUni<T>, or HashMapChars<T>.
+----------------------------------------------------------------------------------------------*/
+#pragma once
+#ifndef HASHMAP_I_C_INCLUDED
+#define HASHMAP_I_C_INCLUDED
+
+#include "HashMap.h"
+////#include <algorithm>
+////#include "GrPlatform.h"
+#include "GrCommon.h"
+
+/***********************************************************************************************
+ Methods
+***********************************************************************************************/
+//:End Ignore
+
+/*----------------------------------------------------------------------------------------------
+ Constructor.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ HashMap<K,T,H,Eq>::HashMap()
+{
+ m_prgihsndBuckets = NULL;
+ m_cBuckets = 0;
+ m_prghsnd = NULL;
+ m_ihsndLim = 0;
+ m_ihsndMax = 0;
+ m_ihsndFirstFree = FreeListIdx(-1);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy constructor. It throws an error if it runs out of memory.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ HashMap<K,T,H,Eq>::HashMap(HashMap<K,T,H,Eq> & hm)
+{
+ m_prgihsndBuckets = NULL;
+ m_cBuckets= 0;
+ m_prghsnd = NULL;
+ m_ihsndLim = 0;
+ m_ihsndMax = 0;
+ m_ihsndFirstFree = FreeListIdx(-1);
+ hm.CopyTo(this);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Destructor.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ HashMap<K,T,H,Eq>::~HashMap()
+{
+ Clear();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return an iterator that references the first key and value stored in the HashMap.
+ If the hash map is empty, Begin returns the same value as End.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ typename HashMap<K,T,H,Eq>::iterator HashMap<K,T,H,Eq>::Begin()
+{
+ AssertObj(this);
+ int ihsnd;
+ for (ihsnd = 0; ihsnd < m_ihsndLim; ++ihsnd)
+ {
+ if (m_prghsnd[ihsnd].InUse())
+ {
+ iterator ithm(this, ihsnd);
+ return ithm;
+ }
+ }
+ return End();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return an iterator that marks the end of the set of keys and values stored in the HashMap.
+ If the HashMap is empty, End returns the same value as Begin.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ typename HashMap<K,T,H,Eq>::iterator HashMap<K,T,H,Eq>::End()
+{
+ AssertObj(this);
+ iterator ithm(this, m_ihsndLim);
+ return ithm;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Add one key and value to the HashMap. Insert potentially invalidates existing iterators
+ for this HashMap. An exception is thrown if there are any errors.
+
+ @param key Reference to the key object. An internal copy is made of this object.
+ @param value Reference to the object associated with the key. An internal copy is
+ made of this object.
+ @param fOverwrite Optional flag (defaults to false) to allow a value already associated
+ with this key to be replaced by this value.
+ @param pihsndOut Optional pointer to an integer for returning the internal index where the
+ key-value pair is stored.
+
+ @exception E_INVALIDARG if fOverwrite is not true and the key already is stored with a value
+ in this HashMap.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ void HashMap<K,T,H,Eq>::Insert(K & key, T & value, bool fOverwrite, int * pihsndOut)
+{
+ AssertObj(this);
+ // Check for initial allocation of memory.
+ if (!m_cBuckets)
+ {
+ int cBuckets = GetPrimeNear(10);
+ m_prgihsndBuckets = (int *)malloc(cBuckets * isizeof(int));
+ if (!m_prgihsndBuckets)
+ ThrowHr(WarnHr(E_OUTOFMEMORY));
+ std::fill_n(m_prgihsndBuckets, cBuckets, -1);
+ m_cBuckets = cBuckets;
+ }
+ if (!m_ihsndMax)
+ {
+ int iMax = 32;
+ m_prghsnd = (HashNode *)malloc(iMax * isizeof(HashNode));
+ if (!m_prghsnd)
+ ThrowHr(WarnHr(E_OUTOFMEMORY));
+ std::fill_n(m_prghsnd, iMax, 0);
+ m_ihsndLim = 0;
+ m_ihsndMax = iMax;
+ m_ihsndFirstFree = FreeListIdx(-1);
+ }
+ // Check whether this key is already used.
+ // If it is, store the value if overwriting is allowed, otherwise return an error value.
+ H hasher;
+ Eq equal;
+ int ihsnd;
+ int nHash = hasher(&key, isizeof(K));
+ int ie = (unsigned)nHash % m_cBuckets;
+ for (ihsnd = m_prgihsndBuckets[ie]; ihsnd != -1; ihsnd = m_prghsnd[ihsnd].GetNext())
+ {
+ if ((nHash == m_prghsnd[ihsnd].GetHash()) &&
+ equal(&key, &m_prghsnd[ihsnd].GetKey(), isizeof(K)))
+ {
+ if (fOverwrite)
+ {
+ m_prghsnd[ihsnd].PutValue(value);
+ if (pihsndOut)
+ *pihsndOut = ihsnd;
+ AssertObj(this);
+ return;
+ }
+ else
+ {
+ ThrowHr(WarnHr(E_INVALIDARG));
+ }
+ }
+ }
+ // Check whether to increase the number of buckets to redistribute the wealth.
+ // Calculate the average depth of hash collection chains.
+ // If greater than or equal to two, increase the number of buckets.
+ int chsndFree = 0;
+ int i;
+ for (i = m_ihsndFirstFree; i != FreeListIdx(-1); i = m_prghsnd[FreeListIdx(i)].GetNext())
+ ++chsndFree;
+ int chsndAvgDepth = (m_ihsndLim - chsndFree) / m_cBuckets;
+ if (chsndAvgDepth > 2)
+ {
+ int cNewBuckets = GetPrimeNear(4 * m_cBuckets);
+ if (cNewBuckets && cNewBuckets > m_cBuckets)
+ {
+ int * pNewBuckets = (int *)realloc(m_prgihsndBuckets, cNewBuckets * isizeof(int));
+ if (pNewBuckets)
+ {
+ std::fill_n(pNewBuckets, cNewBuckets, -1);
+ m_cBuckets = cNewBuckets;
+ m_prgihsndBuckets = pNewBuckets;
+ for (ihsnd = 0; ihsnd < m_ihsndLim; ++ihsnd)
+ {
+ if (m_prghsnd[ihsnd].InUse())
+ {
+ ie = (unsigned)m_prghsnd[ihsnd].GetHash() % m_cBuckets;
+ m_prghsnd[ihsnd].PutNext(m_prgihsndBuckets[ie]);
+ m_prgihsndBuckets[ie] = ihsnd;
+ }
+ }
+ // Recompute the new entry's slot so that it can be stored properly.
+ ie = (unsigned)nHash % m_cBuckets;
+ }
+ }
+ }
+ if (m_ihsndLim < m_ihsndMax)
+ {
+ ihsnd = m_ihsndLim;
+ ++m_ihsndLim;
+ }
+ else if (m_ihsndFirstFree != FreeListIdx(-1))
+ {
+ ihsnd = FreeListIdx(m_ihsndFirstFree);
+ m_ihsndFirstFree = m_prghsnd[ihsnd].GetNext();
+ }
+ else
+ {
+ int iNewMax = (!m_ihsndMax) ? 32 : 2 * m_ihsndMax;
+ HashNode * pNewNodes = (HashNode *)realloc(m_prghsnd, iNewMax * isizeof(HashNode));
+ if (!pNewNodes && iNewMax > 32)
+ {
+ iNewMax = m_ihsndMax + (m_ihsndMax / 2);
+ pNewNodes = (HashNode *)realloc(m_prghsnd, iNewMax * isizeof(HashNode));
+ if (!pNewNodes)
+ ThrowHr(WarnHr(E_OUTOFMEMORY));
+ }
+ m_prghsnd = pNewNodes;
+ m_ihsndMax = iNewMax;
+ Assert(m_ihsndLim < m_ihsndMax);
+ ihsnd = m_ihsndLim;
+ ++m_ihsndLim;
+ }
+ // Call constructor on previously allocated memory.
+ new((void *)&m_prghsnd[ihsnd]) HashNode(key, value, nHash, m_prgihsndBuckets[ie]);
+ m_prgihsndBuckets[ie] = ihsnd;
+ if (pihsndOut)
+ *pihsndOut = ihsnd;
+ AssertObj(this);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Search the HashMap for the given key, and return true if the key is found or false if the
+ key is not found. If the key is found and the given pointer is not NULL, copy the
+ associated value to that memory location.
+
+ @param key Reference to a key object.
+ @param pvalueRet Pointer to an empty object for storing a copy of the value associated with
+ the key, if one exists.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ bool HashMap<K,T,H,Eq>::Retrieve(K & key, T * pvalueRet)
+{
+ AssertObj(this);
+ if (!m_prgihsndBuckets)
+ return false;
+ H hasher;
+ Eq equal;
+ int nHash = hasher(&key, isizeof(K));
+ int ie = (unsigned)nHash % m_cBuckets;
+ int ihsnd;
+ for (ihsnd = m_prgihsndBuckets[ie]; ihsnd != -1; ihsnd = m_prghsnd[ihsnd].GetNext())
+ {
+ if ((nHash == m_prghsnd[ihsnd].GetHash()) &&
+ equal(&key, &m_prghsnd[ihsnd].GetKey(), isizeof(K)))
+ {
+ if (pvalueRet)
+ *pvalueRet = m_prghsnd[ihsnd].GetValue();
+ return true;
+ }
+ }
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Remove the element with the given key from the stored HashMap. This potentially
+ invalidates existing iterators for this HashMap. If the key is not found in the
+ HashMap, then nothing is deleted.
+
+ @param key Reference to a key object.
+
+ @return True if the key is found, and something is actually deleted; otherwise, false.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ bool HashMap<K,T,H,Eq>::Delete(K & key)
+{
+ AssertObj(this);
+ if (!m_prgihsndBuckets)
+ return false;
+ H hasher;
+ Eq equal;
+ int nHash = hasher(&key, isizeof(K));
+ int ie = (unsigned)nHash % m_cBuckets;
+ int ihsnd;
+ int ihsndPrev = -1;
+ for (ihsnd = m_prgihsndBuckets[ie]; ihsnd != -1; ihsnd = m_prghsnd[ihsnd].GetNext())
+ {
+ if ((nHash == m_prghsnd[ihsnd].GetHash()) &&
+ equal(&key, &m_prghsnd[ihsnd].GetKey(), isizeof(K)))
+ {
+ if (ihsndPrev == -1)
+ m_prgihsndBuckets[ie] = m_prghsnd[ihsnd].GetNext();
+ else
+ m_prghsnd[ihsndPrev].PutNext(m_prghsnd[ihsnd].GetNext());
+ m_prghsnd[ihsnd].~HashNode(); // Ensure member destructors are called.
+ memset(&m_prghsnd[ihsnd], 0, isizeof(HashNode));
+ m_prghsnd[ihsnd].PutNext(m_ihsndFirstFree);
+ m_ihsndFirstFree = FreeListIdx(ihsnd);
+ AssertObj(this);
+ return true;
+ }
+ ihsndPrev = ihsnd;
+ }
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Free all the memory used by the HashMap. When done, only the minimum amount of
+ bookkeeping memory is still taking up space, and any internal pointers all been set
+ to NULL. The appropriate destructor is called for all key and value objects stored
+ in the HashMap before the memory space is freed.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ void HashMap<K,T,H,Eq>::Clear()
+{
+ AssertObj(this);
+ if (!m_prgihsndBuckets)
+ return;
+ int ihsnd;
+ for (ihsnd = 0; ihsnd < m_ihsndLim; ++ihsnd)
+ {
+ if (m_prghsnd[ihsnd].InUse())
+ m_prghsnd[ihsnd].~HashNode(); // Ensure member destructors are called.
+ }
+ free(m_prgihsndBuckets);
+ free(m_prghsnd);
+ m_prgihsndBuckets = NULL;
+ m_cBuckets = 0;
+ m_prghsnd = NULL;
+ m_ihsndLim = 0;
+ m_ihsndMax = 0;
+ m_ihsndFirstFree = FreeListIdx(-1);
+ AssertObj(this);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy the content of one HashMap to another. An exception is thrown if there are any errors.
+
+ @param hmKT Reference to the other HashMap.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ void HashMap<K,T,H,Eq>::CopyTo(HashMap<K,T,H,Eq> & hmKT)
+{
+ AssertObj(this);
+ AssertObj(&hmKT);
+ hmKT.Clear();
+ iterator itmm;
+ for (itmm = Begin(); itmm != End(); ++itmm)
+ hmKT.Insert(itmm->GetKey(), itmm->GetValue());
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy the content of one HashMap to another. An exception is thrown if there are any errors.
+
+ @param phmKT Pointer to the other HashMap.
+
+ @exception E_POINTER if phmKT is NULL.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ void HashMap<K,T,H,Eq>::CopyTo(HashMap<K,T,H,Eq> * phmKT)
+{
+ if (!phmKT)
+ ThrowHr(WarnHr(E_POINTER));
+ CopyTo(*phmKT);
+}
+
+/*----------------------------------------------------------------------------------------------
+ If the given key is found in the HashMap, return true, and if the provided index pointer
+ is not NULL, also store the internal index value in the indicated memory location.
+ If the given key is NOT found in the HashMap, return false and ignore the provided index
+ pointer.
+
+ @param key Reference to a key object.
+ @param pihsndRet Pointer to an integer for returning the internal index where the
+ key-value pair is stored.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ bool HashMap<K,T,H,Eq>::GetIndex(K & key, int * pihsndRet)
+{
+ AssertObj(this);
+ if (!m_prgihsndBuckets)
+ return false;
+ H hasher;
+ Eq equal;
+ int nHash = hasher(&key, isizeof(K));
+ int ie = (unsigned)nHash % m_cBuckets;
+ int ihsnd;
+ for (ihsnd = m_prgihsndBuckets[ie]; ihsnd != -1; ihsnd = m_prghsnd[ihsnd].GetNext())
+ {
+ if ((nHash == m_prghsnd[ihsnd].GetHash()) &&
+ equal(&key, &m_prghsnd[ihsnd].GetKey(), isizeof(K)))
+ {
+ if (pihsndRet)
+ *pihsndRet = ihsnd;
+ return true;
+ }
+ }
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ If the given internal HashMap index is valid, return true, and if the provided pointer to a
+ key object is not NULL, also copy the indexed key to the indicated memory location.
+ If the given internal index is NOT valid, return false, and ignore the provided key
+ object pointer.
+
+ @param ihsnd Internal index value returned earlier by GetIndex or Insert.
+ @param pkeyRet Pointer to an empty key object for storing a copy of the key found at the
+ indexed location.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ bool HashMap<K,T,H,Eq>::IndexKey(int ihsnd, K * pkeyRet)
+{
+ AssertObj(this);
+ if ((ihsnd < 0) || (ihsnd >= m_ihsndLim))
+ return false;
+ if (m_prghsnd[ihsnd].InUse())
+ {
+ if (pkeyRet)
+ *pkeyRet = m_prghsnd[ihsnd].GetKey();
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ If the given internal HashMap index is valid, return true, and if the provided pointer to an
+ object is not NULL, also copy the indexed value to the indicated memory location.
+ If the given internal index is NOT valid, return false, and ignore the provided
+ object pointer.
+
+ @param ihsnd Internal index value returned earlier by GetIndex or Insert.
+ @param pvalueRet Pointer to an empty object for storing a copy of the value found at the
+ indexed location.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ bool HashMap<K,T,H,Eq>::IndexValue(int ihsnd, T * pvalueRet)
+{
+ AssertObj(this);
+ if (ihsnd < 0 || ihsnd >= m_ihsndLim)
+ return false;
+ if (m_prghsnd[ihsnd].InUse())
+ {
+ if (pvalueRet)
+ *pvalueRet = m_prghsnd[ihsnd].GetValue();
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of items (key-value pairs) stored in the HashMap.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ int HashMap<K,T,H,Eq>::Size()
+{
+ AssertObj(this);
+ if (!m_prgihsndBuckets)
+ return 0;
+ int chsndFree = 0;
+ int ihsnd;
+ for (ihsnd = m_ihsndFirstFree;
+ ihsnd != FreeListIdx(-1);
+ ihsnd = m_prghsnd[FreeListIdx(ihsnd)].GetNext())
+ {
+ ++chsndFree;
+ }
+ return m_ihsndLim - chsndFree;
+}
+
+//:Ignore
+#ifdef DEBUG
+/*----------------------------------------------------------------------------------------------
+ Return the number of buckets (hash slots) currently allocated for the hash map. This is
+ useful only for debugging the hash map mechanism itself.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ int HashMap<K,T,H,Eq>::_BucketCount()
+{
+ AssertObj(this);
+ return m_cBuckets;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of buckets (hash slots) that do not point to a list of HashNode objects.
+ This is useful only for debugging the hash map mechanism itself.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ int HashMap<K,T,H,Eq>::_EmptyBuckets()
+{
+ AssertObj(this);
+ int ceUnused = 0;
+ int ie;
+ for (ie = 0; ie < m_cBuckets; ++ie)
+ {
+ if (m_prgihsndBuckets[ie] == -1)
+ ++ceUnused;
+ }
+ return ceUnused;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of buckets (hash slots) that currently point to a list of HashNode
+ objects in the hash map. This is useful only for debugging the hash map mechanism itself.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ int HashMap<K,T,H,Eq>::_BucketsUsed()
+{
+ AssertObj(this);
+ int ceUsed = 0;
+ int ie;
+ for (ie = 0; ie < m_cBuckets; ++ie)
+ {
+ if (m_prgihsndBuckets[ie] != -1)
+ ++ceUsed;
+ }
+ return ceUsed;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the length of the longest list of HashNode objects stored in any bucket (hash slot)
+ of the hash map. This is useful only for debugging the hash map mechanism itself.
+----------------------------------------------------------------------------------------------*/
+template<class K, class T, class H, class Eq>
+ int HashMap<K,T,H,Eq>::_FullestBucket()
+{
+ AssertObj(this);
+ int chsndMax = 0;
+ int chsnd;
+ int ie;
+ int ihsnd;
+ for (ie = 0; ie < m_cBuckets; ++ie)
+ {
+ chsnd = 0;
+ for (ihsnd = m_prgihsndBuckets[ie]; ihsnd != -1; ihsnd = m_prghsnd[ihsnd].GetNext())
+ ++chsnd;
+ if (chsndMax < chsnd)
+ chsndMax = chsnd;
+ }
+ return chsndMax;
+}
+#endif
+//:End Ignore
+
+
+
+// Local Variables:
+// mode:C++
+// c-file-style:"cellar"
+// tab-width:4
+// End:
+
+#endif /*HASHMAP_I_C_INCLUDED*/
diff --git a/Build/source/libs/graphite/src/generic/Makefile.am b/Build/source/libs/graphite/src/generic/Makefile.am
new file mode 100644
index 00000000000..ec60b09be3a
--- /dev/null
+++ b/Build/source/libs/graphite/src/generic/Makefile.am
@@ -0,0 +1,8 @@
+genericdir = $(top_srcdir)/src/generic
+
+libgraphite_la_SOURCES += $(genericdir)/Debug.cpp
+libgraphite_la_SOURCES += $(genericdir)/Util.cpp
+
+EXTRA_DIST += $(genericdir)/*.h
+EXTRA_DIST += $(genericdir)/BinTree_i.cpp
+EXTRA_DIST += $(genericdir)/HashMap_i.cpp
diff --git a/Build/source/libs/graphite/src/generic/Util.cpp b/Build/source/libs/graphite/src/generic/Util.cpp
new file mode 100644
index 00000000000..aabd6563d3e
--- /dev/null
+++ b/Build/source/libs/graphite/src/generic/Util.cpp
@@ -0,0 +1,261 @@
+
+#include "GrCommon.h"
+#include "GrDebug.h"
+
+
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+ Swap two blocks of size cb starting at pv1 and pv2. Doesn't handle overlapping blocks.
+----------------------------------------------------------------------------------------------*/
+void SwapBytes(void * pv1, void * pv2, int cb)
+{
+ Assert((byte *)pv1 + cb <= (byte *)pv2 || (byte *)pv2 + cb <= (byte *)pv1);
+ AssertPtrSize(pv1, cb);
+ AssertPtrSize(pv2, cb);
+
+#ifdef NO_ASM
+
+ byte *pb1 = (byte *)pv1;
+ byte *pb2 = (byte *)pv2;
+ byte b;
+
+ while (--cb >= 0)
+ {
+ b = *pb1;
+ *pb1++ = *pb2;
+ *pb2++ = b;
+ }
+
+#else // !NO_ASM
+
+ __asm
+ {
+ // edi -> memory to swap, first pointer
+ // esi -> memory to swap, second pointer
+
+ mov edi,pv1
+ mov esi,pv2
+
+ mov ecx,cb
+ shr ecx,2
+ jz LBytes
+
+LIntLoop:
+ mov eax,[edi]
+ mov ebx,[esi]
+ mov [edi],ebx
+ mov [esi],eax
+
+ add edi,4
+ add esi,4
+ dec ecx
+ jnz LIntLoop;
+
+LBytes:
+ mov ecx,cb
+ and ecx,3
+ jz LDone
+
+LByteLoop:
+ mov al,[edi]
+ mov bl,[esi]
+ mov [edi],bl
+ mov [esi],al
+ inc edi
+ inc esi
+ dec ecx
+ jnz LByteLoop
+
+LDone:
+ }
+
+#endif //!NO_ASM
+}
+
+/*----------------------------------------------------------------------------------------------
+ Fills a block of memory with the given short value.
+----------------------------------------------------------------------------------------------*/
+void FillShorts(void * pv, short sn, int csn)
+{
+ AssertPtrSize(pv, csn * isizeof(short));
+
+#ifdef NO_ASM
+
+ short * psn = (short *)pv;
+ short * psnLim = psn + csn;
+
+ while (psn < psnLim)
+ *psn++ = sn;
+
+#else // !NO_ASM
+
+ __asm
+ {
+ // Setup the registers for using REP STOS instruction to set memory.
+ // NOTE: Alignment does not effect the speed of STOS.
+ //
+ // edi -> memory to set
+ // eax = value to store in destination
+ // direction flag is clear for auto-increment
+
+ mov edi,pv
+ mov ax,sn
+ mov ecx,csn
+
+ mov edx,ecx
+ and edx,1
+ jz LInts
+
+ // set 1 short
+ stosw
+
+LInts:
+ shr ecx,1
+ jz LDone
+
+ mov ebx,eax
+ shl eax,16
+ mov ax,bx
+
+ rep stosd
+LDone:
+ }
+
+#endif //!NO_ASM
+}
+
+/***********************************************************************************************
+ Integer utilities.
+***********************************************************************************************/
+
+/*
+ * table of powers of 2, and largest prime smaller than each power of 2
+ * n 2**n prime diff
+ * --- ---------- ---------- ----
+ * 2: 4 3 ( -1)
+ * 3: 8 7 ( -1)
+ * 4: 16 13 ( -3)
+ * 5: 32 31 ( -1)
+ * 6: 64 61 ( -3)
+ * 7: 128 127 ( -1)
+ * 8: 256 251 ( -5)
+ * 9: 512 509 ( -3)
+ * 10: 1024 1021 ( -3)
+ * 11: 2048 2039 ( -9)
+ * 12: 4096 4093 ( -3)
+ * 13: 8192 8191 ( -1)
+ * 14: 16384 16381 ( -3)
+ * 15: 32768 32749 (-19)
+ * 16: 65536 65521 (-15)
+ * 17: 131072 131071 ( -1)
+ * 18: 262144 262139 ( -5)
+ * 19: 524288 524287 ( -1)
+ * 20: 1048576 1048573 ( -3)
+ * 21: 2097152 2097143 ( -9)
+ * 22: 4194304 4194301 ( -3)
+ * 23: 8388608 8388593 (-15)
+ * 24: 16777216 16777213 ( -3)
+ * 25: 33554432 33554393 (-39)
+ * 26: 67108864 67108859 ( -5)
+ * 27: 134217728 134217689 (-39)
+ * 28: 268435456 268435399 (-57)
+ * 29: 536870912 536870909 ( -3)
+ * 30: 1073741824 1073741789 (-35)
+ * 31: 2147483648 2147483647 ( -1)
+ * 32: 4294967296 4294967291 ( -5)
+ */
+const static unsigned int g_rguPrimes[] = {
+ 3, 7, 13, 31, 61, 127, 251, 509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071,
+ 262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859,
+ 134217689, 268435399, 536870909, 1073741789, 2147483647, 4294967291U
+};
+
+
+/*----------------------------------------------------------------------------------------------
+ Returns the prime in g_rguPrimes that is closest to u.
+----------------------------------------------------------------------------------------------*/
+unsigned int GetPrimeNear(unsigned int u)
+{
+ int cu = isizeof(g_rguPrimes) / isizeof(unsigned int);
+ int iuMin;
+ int iuLim;
+ int iu;
+
+ for (iuMin = 0, iuLim = cu; iuMin < iuLim; )
+ {
+ iu = (iuMin + iuLim) / 2;
+ if (u > g_rguPrimes[iu])
+ iuMin = iu + 1;
+ else
+ iuLim = iu;
+ }
+ Assert(iuMin == cu || iuMin < cu && u <= g_rguPrimes[iuMin]);
+ Assert(iuMin == 0 || iuMin > 0 && u > g_rguPrimes[iuMin - 1]);
+
+ if (!iuMin)
+ return g_rguPrimes[0];
+ if (iuMin == cu)
+ return g_rguPrimes[cu - 1];
+ if (g_rguPrimes[iuMin] - u < u - g_rguPrimes[iuMin - 1])
+ return g_rguPrimes[iuMin];
+ return g_rguPrimes[iuMin - 1];
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Returns the prime in g_rguPrimes that is larger than u or is the largest in the list.
+----------------------------------------------------------------------------------------------*/
+unsigned int GetLargerPrime(unsigned int u)
+{
+ int cu = isizeof(g_rguPrimes) / isizeof(unsigned int);
+ int iuMin;
+ int iuLim;
+ int iu;
+
+ for (iuMin = 0, iuLim = cu; iuMin < iuLim; )
+ {
+ iu = (iuMin + iuLim) / 2;
+ if (u >= g_rguPrimes[iu])
+ iuMin = iu + 1;
+ else
+ iuLim = iu;
+ }
+ Assert(iuMin == cu || iuMin < cu && u < g_rguPrimes[iuMin]);
+ Assert(iuMin == 0 || iuMin > 0 && u >= g_rguPrimes[iuMin - 1]);
+
+ if (iuMin == cu)
+ return g_rguPrimes[cu - 1];
+ return g_rguPrimes[iuMin];
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Returns the prime in g_rguPrimes that is smaller than u or is the smallest in the list.
+----------------------------------------------------------------------------------------------*/
+unsigned int GetSmallerPrime(unsigned int u)
+{
+ int cu = isizeof(g_rguPrimes) / isizeof(unsigned int);
+ int iuMin;
+ int iuLim;
+ int iu;
+
+ for (iuMin = 0, iuLim = cu; iuMin < iuLim; )
+ {
+ iu = (iuMin + iuLim) / 2;
+ if (u > g_rguPrimes[iu])
+ iuMin = iu + 1;
+ else
+ iuLim = iu;
+ }
+ Assert(iuMin == cu || iuMin < cu && u <= g_rguPrimes[iuMin]);
+ Assert(iuMin == 0 || iuMin > 0 && u > g_rguPrimes[iuMin - 1]);
+
+ if (!iuMin)
+ return g_rguPrimes[0];
+ return g_rguPrimes[iuMin - 1];
+}
+
+}
+
diff --git a/Build/source/libs/graphite/src/painter/Makefile.am b/Build/source/libs/graphite/src/painter/Makefile.am
new file mode 100644
index 00000000000..497d31bd018
--- /dev/null
+++ b/Build/source/libs/graphite/src/painter/Makefile.am
@@ -0,0 +1,5 @@
+painterdir = $(top_srcdir)/src/painter
+
+libgraphite_la_SOURCES += $(painterdir)/SegmentPainter.cpp
+
+#EXTRA_DIST += $(painterdir)/*.h
diff --git a/Build/source/libs/graphite/src/painter/SegmentPainter.cpp b/Build/source/libs/graphite/src/painter/SegmentPainter.cpp
new file mode 100644
index 00000000000..ee92cbe8caf
--- /dev/null
+++ b/Build/source/libs/graphite/src/painter/SegmentPainter.cpp
@@ -0,0 +1,2986 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: SegmentPainter.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Implements the object that handles drawing, mouse clicks, and other UI-related behavior
+ for a Graphite segment.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+// any other headers (not precompiled)
+#include <math.h>
+#ifndef _WIN32
+#include <stdlib.h>
+#endif
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+namespace
+{
+
+static bool g_fDrawing;
+
+} // namespace
+
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Constructors.
+----------------------------------------------------------------------------------------------*/
+//SegmentPainter::SegmentPainter(Segment * pseg)
+//{
+// m_pseg = pseg;
+//
+// m_xsOrigin = 0;
+// m_ysOrigin = 0;
+// m_xdPosition = 0;
+// m_ydPosition = 0;
+// m_xFactor = 1.0;
+// m_yFactor = 1.0;
+//}
+
+SegmentPainter::SegmentPainter(Segment * pseg, float xsOrigin, float ysOrigin)
+{
+ m_pseg = pseg;
+
+ m_xsOrigin = xsOrigin;
+ m_ysOrigin = ysOrigin;
+ m_xdPosition = m_xsOrigin;
+ m_ydPosition = m_ysOrigin;
+ m_xFactor = 1.0;
+ m_yFactor = 1.0;
+
+ //m_xsOriginInt = GrEngine::RoundFloat(xsOrigin);
+ //m_xdPositionInt = m_xsOriginInt;
+ //m_xFactor64 = 64;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Destructor.
+----------------------------------------------------------------------------------------------*/
+SegmentPainter::~SegmentPainter()
+{
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialization.
+
+ The correspondence with the old rectangle approach is:
+ m_xsOrigin = sourceRect.left;
+ m_ysOrigin = sourceRect.top;
+ m_xdPosition = destRect.left;
+ m_ydPosition = destRect.top;
+
+ m_xFactor = (destRect.right - destRect.left) / (sourceRect.right - sourceRect.left);
+ m_yFactor = (destRect.top - destRect.bottom) / (sourceRect.top - sourceRect.bottom);
+
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::setOrigin(float xsOrigin, float ysOrigin)
+{
+ m_xsOrigin = xsOrigin;
+ m_ysOrigin = ysOrigin;
+
+ //m_xsOriginInt = GrEngine::RoundFloat(xsOrigin);
+}
+
+void SegmentPainter::setPosition(float xdPosition, float ydPosition)
+{
+ m_xdPosition = xdPosition;
+ m_ydPosition = ydPosition;
+
+ //m_xdPositionInt = GrEngine::RoundFloat(xdPosition);
+}
+
+void SegmentPainter::setScalingFactors(float xFactor, float yFactor)
+{
+ m_xFactor = xFactor;
+ m_yFactor = yFactor;
+
+ //int temp = GrEngine::RoundFloat(xFactor);
+ //m_xFactor64 = GrEngine::RoundFloat(xFactor * 64);
+}
+
+
+//:>********************************************************************************************
+//:> SegmentPainter interface methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Draw the text of the segment at the specified point in the graphics context.
+ This method must be implemented by a concrete subclass for painters that really need
+ to paint.
+----------------------------------------------------------------------------------------------*/
+//void SegmentPainter::paint()
+//{
+// Assert(false);
+//}
+
+/*----------------------------------------------------------------------------------------------
+ Indicate if the character position is a valid place for an insertion point.
+
+ @oaram ich - position to test
+ @param pipvr - answer: kipvrOK = IP here is valid;
+ kipvrBad = IP here no good;
+ kipvrUnknown = this seg can't decide, ask the next
+----------------------------------------------------------------------------------------------*/
+LgIpValidResult SegmentPainter::isValidInsertionPoint(int ichw)
+{
+ Assert(m_pseg->m_dxsWidth >= 0);
+ Assert(m_pseg->m_dysAscent >= 0);
+
+ int ichwSegOffset = ichw - m_pseg->m_ichwMin;
+ if (ichwSegOffset < m_pseg->m_ichwAssocsMin || ichwSegOffset >= m_pseg->m_ichwAssocsLim)
+ {
+ // If we're pointing at a hard line break character (Unicode 2028), then we know
+ // that it's a good insertion point in spite of missing the other conditions.
+ utf16 ch;
+ m_pseg->m_pgts->fetch(ichw, 1, &ch);
+ if (ch != knLineSep)
+ return kipvrUnknown; // Definitely in a different segment of the paragraph.
+ return kipvrOK;
+ }
+
+ int isloutLig = m_pseg->m_prgisloutLigature[ichwSegOffset - m_pseg->m_ichwAssocsMin];
+ if (isloutLig != kNegInfinity)
+ {
+ return kipvrOK;
+ }
+
+ // TODO: do we need to test ALL the associated glyphs? Here we just test the first.
+
+ LgIpValidResult ipvrRet;
+
+ int isloutBefore = m_pseg->UnderlyingToLogicalSurface(ichw, true);
+ int isloutAfter = m_pseg->UnderlyingToLogicalSurface(ichw - 1, false);
+ int isloutTest = m_pseg->UnderlyingToLogicalInThisSeg(ichw);
+ if (isloutBefore == isloutAfter)
+ // If inserting before this character yields the same visible result as
+ // inserting after the previous, then this character is invisible, or has
+ // been merged with the previous, and it doesn't make sense to put an insertion
+ // point here.
+ ipvrRet = kipvrBad;
+ else if (isloutTest == kNegInfinity || isloutTest == kPosInfinity)
+ ipvrRet = kipvrBad; // can't figure it out
+ else if (!m_pseg->OutputSlot(isloutTest)->InsertBefore())
+ ipvrRet = kipvrBad;
+ else if (m_pseg->SameSurfaceGlyphs(ichw - 1, ichw))
+ // The insertion point would be between two characters that map to the same
+ // set of glyphs. Not a good place.
+ ipvrRet = kipvrBad;
+ else
+ ipvrRet = kipvrOK;
+
+ return ipvrRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Answer whether the logical and physical boundaries of the string coincide.
+ This method is called by the application to handle writing system boundaries, and by
+ other segments in a writing-system chain to handle line-breaks.
+
+ @param fBoundaryEnd - asking about the logical end boundary?
+ @param fBoundaryRight - asking about the physical right boundary?
+ @param pfResult - return value
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::doBoundariesCoincide(bool fBoundaryEnd, bool fBoundaryRight)
+{
+ float xsBefore, ysBeforeTop, ysBeforeBottom;
+ float xsAfter, ysAfterTop, ysAfterBottom;
+ bool fRtlBefore, fRtlAfter;
+
+ if (m_pseg->m_cginf == 0)
+ {
+ // Empty segment.
+ return true;
+ }
+
+ //SetUpGraphics(ichwBase, pgg, true);
+
+ Assert(m_pseg->m_dxsWidth >= 0);
+ Assert(m_pseg->m_dysAscent >= 0);
+
+ if (fBoundaryEnd)
+ {
+ CalcIP(m_pseg->m_ichwMin + m_pseg->m_dichwLim, true,
+ &xsBefore, &ysBeforeTop, &ysBeforeBottom, &fRtlBefore);
+ CalcIP(m_pseg->m_ichwMin + m_pseg->m_dichwLim, false,
+ &xsAfter, &ysAfterTop, &ysAfterBottom, &fRtlAfter);
+ }
+ else
+ {
+ CalcIP(m_pseg->m_ichwMin, true,
+ &xsBefore, &ysBeforeTop, &ysBeforeBottom, &fRtlBefore);
+ CalcIP(m_pseg->m_ichwMin, false,
+ &xsAfter, &ysAfterTop, &ysAfterBottom, &fRtlAfter);
+ }
+
+ // We allow for rounding errors which might cause differences between the expected
+ // and the actual values, hence the test for a difference of <= 1.
+ bool fRet;
+ if (fBoundaryRight)
+ {
+ // right edge
+ if (fBoundaryEnd) // logical end
+ fRet = (!fRtlAfter && fabsf(xsAfter - (m_pseg->m_dxsTotalWidth + m_pseg->m_dxsStretch)) <= 1);
+ else // logical start
+ fRet = (fRtlBefore && fabsf(xsBefore - (m_pseg->m_dxsTotalWidth + m_pseg->m_dxsStretch)) <= 1);
+ }
+ else
+ {
+ // left edge
+ if (fBoundaryEnd) // logical end
+ fRet = (fRtlAfter && fabsf(xsAfter) <= 1);
+ else // logical start
+ fRet = (!fRtlBefore && fabsf(xsBefore) <= 1);
+ }
+
+ return fRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Draw an insertion point at an appropriate position.
+
+ @param twx, twy - same origin used to Draw segment
+ @param ich - character position; must be valid
+ @param fAssocPrev - associated with previous character?
+ @param bOn - turning on or off? Caller should alternate, first turning on
+ (ignored in this implementation)
+ @param dm - draw mode:
+ kdmNormal = draw complete insertion pt (I-beam or split cursor);
+ kdmPrimary = only draw primary half of split cursor;
+ kdmSecondary = only draw secondary half of split cursor
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::drawInsertionPoint(int ichwIP, bool fAssocPrev,
+ bool bOn, bool fForceSplit) // LgIPDrawMode dm)
+{
+ if (g_fDrawing)
+ return;
+
+ g_fDrawing = true;
+
+ //SetUpGraphics(ichwBase, pgg, true);
+
+ Assert(m_pseg->m_dxsWidth >= 0);
+ Assert(m_pseg->m_dysAscent >= 0);
+
+ CalcOrDrawInsertionPoint(ichwIP,
+ fAssocPrev, bOn, fForceSplit,
+ NULL, NULL); // passing NULLs here means we want to draw
+
+ //RestoreFont(pgg);
+
+ g_fDrawing = false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Fill in bounding rectangles for the (possibly 2-part) IP, in destination device coordinates.
+ Return flags indicating which of the 2 parts where rendered here.
+
+ @param rs,rd - source/destination coordinates, for scaling
+ @param ichwIP - insertion point
+ @param fAssocPrev - is the IP "leaning" backward?
+ @param dm - draw mode:
+ kdmNormal = draw complete insertion pt (I-beam or split cursor);
+ kdmPrimary = only draw primary half of split cursor;
+ kdmSecondary = only draw secondary half of split cursor
+ @param prdPrimary - return location of primary selection, in dest coords
+ @param prdSecondary - return location of secondary selection, in dest coords
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::positionsOfIP(
+ int ichwIP, bool fAssocPrev, bool fForceSplit,
+ Rect * prdPrimary, Rect * prdSecondary)
+{
+ ChkGrArgPtr(prdPrimary);
+ ChkGrArgPtr(prdSecondary);
+
+ //SetUpGraphics(ichwBase, pgg, true);
+
+ Assert(m_pseg->m_dxsWidth >= 0);
+ Assert(m_pseg->m_dysAscent >= 0);
+
+ CalcOrDrawInsertionPoint(ichwIP, fAssocPrev, true, fForceSplit,
+ prdPrimary, prdSecondary);
+
+ //RestoreFont(pgg);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Highlight a range of text.
+
+ @param ichwAnchor/End - selected range
+ @param ydLineTop/Bottom - top/bottom of area to highlight if whole line height;
+ includes half of inter-line spacing.
+ @param bOn - true if we are turning on (ignored in this implementation)
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::drawSelectionRange(int ichwAnchor, int ichwEnd,
+ float ydLineTop, float ydLineBottom, bool bOn)
+{
+ if (g_fDrawing)
+ return true;
+
+ g_fDrawing = true;
+
+ //SetUpGraphics(ichwBase, pgg, true);
+
+ Assert(m_pseg->m_dxsWidth >= 0);
+ Assert(m_pseg->m_dysAscent >= 0);
+
+ float xsSegLeft = 0;
+ float ysSegTop = 0;
+
+ float xdSegRight = ScaleXToDest(m_pseg->m_dxsTotalWidth);
+
+ int ichwMinSel = min(ichwAnchor, ichwEnd);
+ int ichwLimSel = max(ichwAnchor, ichwEnd);
+
+ int ichwMinSeg = max(ichwMinSel, m_pseg->m_ichwMin + m_pseg->m_ichwAssocsMin);
+ int ichwLimSeg = min(ichwLimSel, m_pseg->m_ichwMin + m_pseg->m_ichwAssocsLim);
+
+ std::vector<Rect> vrs;
+ std::vector<bool> vfEntireHt;
+
+ bool * prgfAllCompsSelected = new bool[m_pseg->m_dichwLim];
+ std::fill_n(prgfAllCompsSelected, m_pseg->m_dichwLim, false);
+ CalcPartialLigatures(prgfAllCompsSelected, ichwMinSeg, ichwLimSeg,
+ ichwMinSel, ichwLimSel);
+
+ // Array to keep track of which glyphs were highlighted.
+ int cginf = m_pseg->m_cginf;
+ bool * prgfHighlighted = new bool[cginf];
+ std::fill_n(prgfHighlighted, cginf, false);
+
+ for (int ichwLp = ichwMinSeg; ichwLp < ichwLimSeg; ichwLp++)
+ {
+ CalcHighlightRect(ichwLp, vrs, vfEntireHt,
+ !prgfAllCompsSelected[ichwLp - m_pseg->m_ichwMin], prgfHighlighted, false);
+ }
+
+ // If all the glyphs of a given cluster were highlighted, highlight the whole cluster
+ // as a unit.
+ for (int islout = 0; islout < m_pseg->m_cslout; islout++)
+ {
+ CalcCompleteCluster(islout, vrs, vfEntireHt, prgfHighlighted);
+ }
+
+ // Convert to destination coordinates; also extend full-line rectangles to the top
+ // and bottom of the line height.
+ std::vector<Rect> vrd;
+ for (size_t irs = 0; irs < vrs.size(); irs++)
+ {
+ Rect rsTmp = vrs[irs];
+ Rect rdTmp;
+ if (vfEntireHt[irs])
+ {
+ rdTmp.top = ydLineTop;
+ rdTmp.bottom = ydLineBottom;
+ }
+ else
+ {
+ float ydTmp = ScaleYToDest(rsTmp.top + ysSegTop);
+ rdTmp.top = min(ydLineBottom, max(ydLineTop, ydTmp));
+ ydTmp = ScaleYToDest(rsTmp.bottom + ysSegTop);
+ rdTmp.bottom = max(ydLineTop, min(ydLineBottom, ydTmp));
+ }
+ float xdTmp = ScaleXToDest(rsTmp.left + xsSegLeft);
+ rdTmp.left = min(xdSegRight, max(float(0), xdTmp));
+ xdTmp = ScaleXToDest(rsTmp.right + xsSegLeft);
+ rdTmp.right = max(float(0), min(xdSegRight, xdTmp));
+ if (rdTmp.left > rdTmp.right)
+ {
+ // I think this can happen due to rounding errors.
+ float tmp = rdTmp.left;
+ rdTmp.left = rdTmp.right;
+ rdTmp.right = tmp;
+ }
+ vrd.push_back(rdTmp);
+ }
+
+ // Create a list of rectangles with no overlaps, so the selection draws cleanly.
+ std::vector<Rect> vrdNoOverlaps;
+ size_t irect;
+ for (irect = 0; irect < vrd.size(); irect++)
+ AddRectWithoutOverlaps(vrdNoOverlaps, vrd[irect]);
+
+ AssertNoOverlaps(vrdNoOverlaps);
+
+ // Draw the hightlight.
+ for (irect = 0; irect < vrdNoOverlaps.size(); irect++)
+ {
+ Rect rdTmp = vrdNoOverlaps[irect];
+ InvertRect(rdTmp.left, rdTmp.top, rdTmp.right, rdTmp.bottom);
+ }
+
+ delete[] prgfAllCompsSelected;
+ delete[] prgfHighlighted;
+
+ //RestoreFont(pgg);
+
+ g_fDrawing = false;
+
+ return (vrdNoOverlaps.size() > 0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get a bounding rectangle that will contain the area highlighted by this segment
+ when drawing the specified range.
+
+ @param ichwAnchor/End - selected range
+ @param ydLineTop/Bottom - top/bottom of area to highlight if whole line height;
+ includes half of inter-line spacing.
+ @param prdBounds - return location of range
+ @return - true if the return rectange has a meaningful value
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::positionsOfRange(int ichwAnchor, int ichwEnd,
+ float ydLineTop, float ydLineBottom, Rect * prdBounds)
+{
+ ChkGrArgPtr(prdBounds);
+
+ std::vector<Rect> vrs;
+ std::vector<bool> vfEntireHt;
+
+ //SetUpGraphics(ichwBase, pgg, true);
+
+ Assert(m_pseg->m_dxsWidth >= 0);
+ Assert(m_pseg->m_dysAscent >= 0);
+
+ int ichwMin = min(ichwAnchor, ichwEnd);
+ int ichwLim = max(ichwAnchor, ichwEnd);
+
+ for (int ichwLp = ichwMin; ichwLp < ichwLim; ichwLp++)
+ {
+ CalcHighlightRect(ichwLp, vrs, vfEntireHt, true, NULL, false);
+ }
+
+ if (vrs.size() == 0)
+ {
+ return false;
+ }
+
+ Rect * prsBounds = &(vrs[0]);
+ for (size_t irect = 1; irect < vrs.size(); irect++)
+ {
+ Rect * prs = &(vrs[irect]);
+ prsBounds->left = min(prsBounds->left, prs->left);
+ prsBounds->right = max(prsBounds->right, prs->right);
+ }
+
+ prdBounds->top = ydLineTop;
+ prdBounds->bottom = ydLineBottom;
+ prdBounds->left = ScaleXToDest(prsBounds->left);
+ prdBounds->right = ScaleXToDest(prsBounds->right);
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert a click position to a character position.
+
+ @param zptdClickPosition - relative to the segment draw origin
+ @param pichw - return character clicked before
+ @param pfAssocPrev - return true if they clicked on the trailing half of
+ the previous char, false if click was on the
+ leading half of the following
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::pointToChar(Point zptdClickPosition, int * pichw, bool * pfAssocPrev)
+{
+ ChkGrOutPtr(pichw);
+ ChkGrOutPtr(pfAssocPrev);
+
+ //SetUpGraphics(ichwBase, pgg, true);
+
+ bool fRtl = m_pseg->rightToLeft();
+
+ if (m_pseg->m_dysAscent < 0 || m_pseg->m_dxsWidth < 0)
+ m_pseg->ComputeDimensions();
+
+ if (m_pseg->m_dichwLim == 0 || m_pseg->m_cginf == 0)
+ {
+ *pichw = m_pseg->m_ichwMin;
+ *pfAssocPrev = false;
+ //RestoreFont(pgg);
+ return;
+ }
+
+ float xsClick = ScaleXToSource(zptdClickPosition.x);
+ float ysClick = ScaleYToSource(zptdClickPosition.y);
+ ysClick = m_pseg->m_dysAscent - ysClick; // make relative to common base line
+
+ float xsTry = xsClick;
+ float ysTry = ysClick;
+
+ float xysInc = 1.0;
+ //res = pgg->LogUnitsFromXPixels(1, &xysInc);
+ //if (ResultFailed(res)) xysInc = 20;
+ int cTries = 1;
+ int nAdjustDir = 0;
+
+ while (true)
+ {
+ float xsGlyphOffset;
+ float xsGlyphWidth;
+ int iginfLoc = PointToCharAux(xsTry, ysTry, &xsGlyphOffset, &xsGlyphWidth);
+
+ bool fClickedAfter;
+ int ichwCharClicked;
+ if (xsTry < m_pseg->m_prgginf[m_pseg->LeftMostGlyph()].bb().left)
+ {
+ fClickedAfter = fRtl;
+ ichwCharClicked = (fClickedAfter) ?
+ m_pseg->m_ichwMin + m_pseg->m_ichwAssocsLim - 1 :
+ m_pseg->m_ichwMin + m_pseg->m_ichwAssocsMin;
+ }
+ else if (xsTry > m_pseg->m_prgginf[m_pseg->RightMostGlyph()].bb().right)
+ {
+ fClickedAfter = !fRtl;
+ ichwCharClicked = (fClickedAfter) ?
+ m_pseg->m_ichwMin + m_pseg->m_ichwAssocsLim - 1 :
+ m_pseg->m_ichwMin + m_pseg->m_ichwAssocsMin;
+ }
+ else
+ {
+ ichwCharClicked = m_pseg->PhysicalSurfaceToUnderlying(iginfLoc,
+ xsTry - xsGlyphOffset, m_pseg->m_dysAscent - ysClick,
+ xsGlyphWidth, m_pseg->m_dysHeight, &fClickedAfter); // handles ligature components
+ }
+
+ if (fClickedAfter)
+ {
+ *pichw = ichwCharClicked + 1;
+ while (!GrCharStream::AtUnicodeCharBoundary(m_pseg->GetString(), *pichw))
+ *pichw = *pichw + 1;
+ *pfAssocPrev = true;
+ }
+ else
+ {
+ *pichw = ichwCharClicked;
+ *pfAssocPrev = false;
+ }
+
+ if (*pichw < m_pseg->m_ichwMin + m_pseg->m_ichwAssocsMin)
+ {
+ //RestoreFont(pgg);
+ return;
+ }
+ else if (*pichw >= m_pseg->m_ichwMin + m_pseg->m_ichwAssocsLim)
+ {
+ //RestoreFont(pgg);
+ return;
+ }
+
+ //int islout = UnderlyingToLogicalInThisSeg(ichwBase, ichwCharClicked);
+ int isloutBefore = m_pseg->UnderlyingToLogicalInThisSeg(*pichw);
+ if (isloutBefore == kNegInfinity || isloutBefore == kPosInfinity)
+ { }
+ else
+ {
+ Assert(0 <= isloutBefore && isloutBefore < m_pseg->m_cslout);
+ if (m_pseg->OutputSlot(isloutBefore)->InsertBefore())
+ {
+ // Legal insertion point
+ //RestoreFont(pgg);
+ return;
+ }
+ }
+
+ // Gradually adjust the click position in various directions and try again
+ // until we find a legal insertion point.
+ switch (nAdjustDir)
+ {
+ case 0: // Adjust to the left
+ case 4:
+ xsTry = xsClick - (xysInc * cTries);
+ ysTry = ysClick;
+ nAdjustDir = 0;
+ break;
+ case 1: // Adjust to the right
+ xsTry = xsClick + (xysInc * cTries);
+ ysTry = ysClick;
+ break;
+ case 2: // Adjust up
+ xsTry = xsClick;
+ ysTry = ysClick - (xysInc * cTries);
+ break;
+ case 3: // Adjust down
+ xsTry = xsClick;
+ ysTry = ysClick + (xysInc * cTries);
+ cTries++;
+ break;
+ default:
+ Assert(false);
+ nAdjustDir = 0;
+ cTries++;
+ }
+ nAdjustDir++;
+
+ if (cTries > 50)
+ { // Safety net
+ *pichw = 0;
+ *pfAssocPrev = false;
+ THROW(kresFail);
+ }
+ else if (cTries > 20)
+ xysInc = xysInc * 2;
+ }
+
+ //RestoreFont(pgg);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert a click position to a glyph bounding-box position.
+----------------------------------------------------------------------------------------------*/
+int SegmentPainter::PointToCharAux(float xsTry, float ysTry,
+ float * pxsGlyphOffset, float * pxsGlyphWidth)
+{
+ int iginfLoc = m_pseg->GlyphHit(xsTry, ysTry);
+
+ GlyphInfo * pginf = m_pseg->m_prgginf + iginfLoc;
+ *pxsGlyphOffset = pginf->bb().left;
+ *pxsGlyphWidth = pginf->bb().right - *pxsGlyphOffset;
+
+ return iginfLoc;
+}
+
+// Review: may need a way to do this and subsequent methods with one result per method?
+/*----------------------------------------------------------------------------------------------
+ Returns a value what logical position an arrow key should move the IP to.
+
+ @param ichwIP - initial position
+ @param pfAssocPrev - is the IP "leaning" backwards? input and output
+ @param fRight - direction of desired movement (physical or logical?)
+ @param pfInThisSeg - initially true if ichwIP is in the current segment;
+ return value is true if there is a legitimate output
+----------------------------------------------------------------------------------------------*/
+int SegmentPainter::arrowKeyPosition(int ichwIP, bool * pfAssocPrev,
+ bool fRight, bool * pfInThisSeg)
+//GrResult SegmentPainter::arrowKeyPosition(
+// int * pichwIP, bool * pfAssocPrev,
+// bool fRight, bool fMovingIn,
+// bool * pfResult)
+{
+ ChkGrArgPtr(pfAssocPrev);
+ //ChkGrOutPtr(pfInThisSeg);
+
+ bool fMovingIn = !*pfInThisSeg;
+ int ichwTmp = ichwIP;
+ bool fResult;
+ ArrowKeyPositionAux(&ichwTmp, pfAssocPrev, fRight, fMovingIn, false, false, &fResult);
+ *pfInThisSeg = fResult;
+ return ichwTmp;
+
+ //return ArrowKeyPositionAux(pichwIP, pfAssocPrev,
+ // fRight, fMovingIn, false, false, pfResult);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Indicate what logical position a shift-arrow-key combination should move the
+ end of the selection to.
+
+ @param pichw - initial endpoint and also adjusted result
+ @param fAssocPrevMatch - true if we need a certain orientation for the result;
+ should be false when *pichw = 0 and we are moving within the
+ same segment
+ @param fAssocPrevNeeded - association of the end-point, ie, true if it follows the anchor
+ @param ichAnchor - -1 if anchor is in a different segment
+ @param fRight - direction of desired movement
+ @param fMovingIn - true if we are moving in to this segment;
+ if so, initial pichw meaningless
+ @param pfRet - if false try next seg or string
+----------------------------------------------------------------------------------------------*/
+int SegmentPainter::extendSelectionPosition(int ichwEnd, bool fAssocPrevMatch, bool fAssocPrevNeeded,
+ int ichwAnchor, bool fRight, bool * pfInThisSeg)
+//GrResult SegmentPainter::extendSelectionPosition(
+// int * pichw, bool fAssocPrevMatch, bool fAssocPrevNeeded, int ichwAnchor,
+// bool fRight, bool fMovingIn,
+// bool* pfRet)
+{
+ //ChkGrArgPtr(pichw);
+ //ChkGrOutPtr(pfRet);
+
+ // Make the same adjustment as for an insertion point.
+ bool fAssocPrevCopy = fAssocPrevMatch;
+ bool fMovingIn = !*pfInThisSeg;
+ int ichwOld = ichwEnd;
+ int ichwNew = ichwEnd;
+ bool fResult;
+ ArrowKeyPositionAux(&ichwNew, &fAssocPrevCopy,
+ fRight, fMovingIn, fAssocPrevMatch, fAssocPrevNeeded, &fResult);
+ *pfInThisSeg = fResult;
+
+ //int ichwNew = *pichw;
+ //bool fAssocPrevCopy = fAssocPrevMatch;
+ //// TODO: adjust fAssocPrevCopy based on assoc-prev value of IP
+ //*pfRet = false;
+ //int ichwOld = *pichw;
+ //GrResult res = ArrowKeyPositionAux(&ichwNew, &fAssocPrevCopy,
+ // fRight, fMovingIn,
+ // fAssocPrevMatch, fAssocPrevNeeded,
+ // pfRet);
+
+// if (*pfRet && ichwNew == *pichw)
+// {
+// // The selection wasn't actually moved, just switched the direction it leans.
+// // Try one more time.
+// res = ArrowKeyPositionAux(&ichwNew, &fAssocPrevCopy,
+// fRight, fMovingIn,
+// (ichwAnchor != *pichw && fAssocPrevNeeded), fAssocPrevNeeded,
+// pfRet);
+// }
+ if (ichwAnchor != -1 && fResult &&
+ ((ichwNew < ichwAnchor && ichwAnchor < ichwOld) ||
+ (ichwOld < ichwAnchor && ichwAnchor < ichwNew)))
+ {
+ // Don't switch directions in one operation--force to an insertion point.
+ ichwNew = ichwAnchor;
+ }
+ return ichwNew;
+ //*pichw = ichwNew;
+ //ReturnResult(res);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Handle arrow key movement for both plain and shifted arrows.
+
+ @param pichw - initial endpoint and also adjusted result
+ @param pfAssocPrev - association of the end-point, ie, true if it follows the anchor
+ @param fRight - direction of desired movement
+ @param fMovingIn - true if we are moving in to this segment;
+ if so, initial pichw meaningless
+ @param fAssocPrevMatch - true if the direction of the result should
+ match the requested orientation, to avoid flipping around and
+ infinite loops
+ @param fAssocPrevNeeded - what is needed for the result, if fAssocPrevMatch == true
+ @param pfRet - if false try next segment or string
+----------------------------------------------------------------------------------------------*/
+GrResult SegmentPainter::ArrowKeyPositionAux(
+ int * pichwIP, bool * pfAssocPrev,
+ bool fRight, bool fMovingIn,
+ bool fAssocPrevMatch, bool fAssocPrevNeeded,
+ bool * pfResult)
+{
+ ChkGrArgPtr(pfResult);
+
+ //bool fAssocPrevTmp = *pfAssocPrev;
+
+ Assert(m_pseg->m_dxsWidth >= 0);
+ Assert(m_pseg->m_dysAscent >= 0);
+
+ int nNextOrPrevSeg;
+ if (!fMovingIn)
+ {
+ *pfResult = ArrowKeyPositionInternal(pichwIP, pfAssocPrev, fRight,
+ fAssocPrevMatch, fAssocPrevNeeded, &nNextOrPrevSeg);
+ ReturnResult(kresOk);
+ }
+ else
+ {
+ int ichw;
+ bool fAssocPrevNew;
+ if (fRight)
+ {
+ // Moving right: make selection at left edge.
+ int iginf = m_pseg->LeftMostGlyph();
+ bool fBefore = !m_pseg->rightToLeft();
+ ichw = m_pseg->PhysicalSurfaceToUnderlying(iginf, fBefore) +
+ ((fBefore) ? 0 : 1);
+ fAssocPrevNew = !fBefore; // Review: should it be based on the char dir?
+ }
+ else
+ {
+ // Moving left: make selection at right edge;
+ int iginf = m_pseg->RightMostGlyph();
+ bool fBefore = m_pseg->rightToLeft();
+ ichw = m_pseg->PhysicalSurfaceToUnderlying(iginf, fBefore) +
+ ((fBefore) ? 0 : 1);
+ fAssocPrevNew = !fBefore; // Review: should it be based on the char dir?
+ }
+
+ // Okay, now we have a selection at the edge of the segment. Try moving inside by
+ // one glyph.
+ *pfResult = ArrowKeyPositionInternal(&ichw, &fAssocPrevNew, fRight,
+ fAssocPrevMatch, fAssocPrevNeeded, &nNextOrPrevSeg);
+ if (*pfResult)
+ {
+ *pichwIP = ichw;
+ *pfAssocPrev = fAssocPrevNew;
+ }
+
+ }
+
+ ReturnResult(kresOk);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Used to find out where underlines should be drawn.
+
+ @param ichwMin/Lim - range of text of interest
+ @param rs, rd - source/destination coordinates, for scaling
+ @param fSkipSpace - true if white space should not be underlined; some renderers may
+ ignore this
+ @param cxdMax - number of ranges allowed
+ @param prgxdLefts/Rights/UnderTops
+ - arrays of corresponding values indicating where an underline
+ should be drawn, in logical order
+
+ TODO: fix the bug where if you have trailing spaces in different segments (eg,
+ at different sizes), the spaces all but the last segment will be erroneously included
+ in the underline result.
+----------------------------------------------------------------------------------------------*/
+size_t SegmentPainter::getUnderlinePlacement(int ichwMin, int ichwLim,
+ bool fSkipSpace, size_t cxdMax,
+ float * prgxdLefts, float * prgxdRights, float * prgydUnderTops)
+{
+ ChkGrArrayArg(prgxdLefts, cxdMax);
+ ChkGrArrayArg(prgxdRights, cxdMax);
+ //ChkGrArrayArg(prgydUnderTops, cxdMax);
+
+ GrResult res = kresOk;
+
+ //SetUpGraphics(ichwBase, pgg, true);
+
+ Assert(m_pseg->m_dxsWidth >= 0);
+ Assert(m_pseg->m_dysAscent >= 0);
+
+ float xsSegLeft = m_pseg->m_dxsTotalWidth;
+ for (int iginf = 0; iginf < m_pseg->m_cginf; iginf++)
+ {
+ xsSegLeft = min(xsSegLeft, m_pseg->GlyphLeftEdge(iginf));
+ }
+
+ float xdSegLeft = this->ScaleXToDest(xsSegLeft);
+ float xdSegRight = xdSegLeft + m_pseg->m_dxsTotalWidth;
+
+ int ichwMinSel = min(ichwMin, ichwLim);
+ int ichwLimSel = max(ichwMin, ichwLim);
+
+ int ichwMinSeg = max(ichwMinSel, m_pseg->m_ichwMin + m_pseg->m_ichwAssocsMin);
+ int ichwLimSeg = min(ichwLimSel, m_pseg->m_ichwMin + m_pseg->m_ichwAssocsLim);
+
+ std::vector<Rect> vrs;
+ std::vector<bool> vfEntireHt;
+
+ bool * prgfAllCompsSelected = new bool[m_pseg->m_dichwLim];
+ std::fill_n(prgfAllCompsSelected, m_pseg->m_dichwLim, false);
+ CalcPartialLigatures(prgfAllCompsSelected, ichwMinSeg, ichwLimSeg,
+ ichwMinSel, ichwLimSel);
+
+ // Array to keep track of which glyphs were highlighted:
+ int cginf = m_pseg->m_cginf;
+ bool * prgfHighlighted = new bool[cginf];
+ std::fill_n(prgfHighlighted, cginf, false);
+
+ for (int ichwLp = ichwMinSeg; ichwLp < ichwLimSeg; ichwLp++)
+ {
+ CalcHighlightRect(ichwLp, vrs, vfEntireHt,
+ !prgfAllCompsSelected[ichwLp - m_pseg->m_ichwMin], prgfHighlighted,
+ (m_pseg->m_fEndLine && fSkipSpace));
+ }
+
+ // If all the glyphs of a given cluster were highlighted, highlight the whole cluster
+ // as a unit.
+ for (int islout = 0; islout < m_pseg->m_cslout; islout++)
+ {
+ CalcCompleteCluster(islout, vrs, vfEntireHt, prgfHighlighted);
+ }
+
+ // Convert rectangles in source coordinates to line segments in destination
+ // coordinates.
+ std::vector<LineSeg> vlsd;
+ for (size_t irs = 0; irs < vrs.size(); irs++)
+ {
+ Rect rsTmp = vrs[irs];
+ LineSeg lsdTmp;
+ lsdTmp.left = min(xdSegRight, max(xdSegLeft, ScaleXToDest(rsTmp.left)));
+ lsdTmp.right = max(xdSegLeft, min(xdSegRight, ScaleXToDest(rsTmp.right)));
+ vlsd.push_back(lsdTmp);
+ }
+
+ // Create a list of line segments with no overlaps.
+ std::vector<LineSeg> vlsdNoOverlaps;
+ size_t ils;
+ for (ils = 0; ils < vlsd.size(); ils++)
+ AddLineSegWithoutOverlaps(vlsdNoOverlaps, vlsd[ils]);
+
+ AssertNoOverlaps(vlsdNoOverlaps);
+
+ // The gap between the baseline and underlining is one pixel, on a normal screen
+ // at standard magnification, and as near as we can get to the equivalent in any
+ // special case.
+ //float dydGap = rdHeight / 96;
+ //float dydSubscript = max(float(0), (-1 * GrEngine::GrFloatMulDiv(m_pseg->m_dysOffset, rsHeight, rdHeight)));
+ float dydGap = 1;
+ float dydSubscript = max(float(0), (-1 * (m_pseg->m_dysOffset * m_yFactor)));
+ float ydBottom = ScaleYToDest(m_pseg->m_dysAscent) + dydGap + dydSubscript;
+
+ // Put the results in the output buffers.
+ size_t cxdRet = vlsdNoOverlaps.size();
+ for (ils = 0; ils < min(cxdRet, size_t(cxdMax)); ils++)
+ {
+ prgxdLefts[ils] = vlsdNoOverlaps[ils].left;
+ prgxdRights[ils] = vlsdNoOverlaps[ils].right;
+ if (prgydUnderTops)
+ prgydUnderTops[ils] = ydBottom;
+ }
+ delete[] prgfAllCompsSelected;
+ delete[] prgfHighlighted;
+
+ //RestoreFont(pgg);
+
+ if (vlsdNoOverlaps.size() > cxdMax)
+ res = kresFail;
+
+ return cxdRet;
+}
+
+
+//:>********************************************************************************************
+//:> Other methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Handle either drawing an insertion point or returning the position at which it
+ would be drawn.
+
+ @param ichwIP - character position
+ @param fAssocPrev - true if selection is associated with previous character
+ @param bOn - turning on or off? (ignored in this implementation)
+ @param fForceSplit - force a split insertion point
+ @param prdPrimary - if NULL, do drawing; otherwise, return location of primary IP
+ in destination device coordinates
+ @param prdSecondary - return location of secondary IP in dest device coordinates
+ @param pfPrimaryHere - true if primary selection is rendered in this segment
+ @param pfSecHere - true if (distinct) secondary selection is rendered in this segment;
+ false if it is in a different segment, or we are rendering
+ an I-beam (std selection)
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::CalcOrDrawInsertionPoint(
+ int ichwIP, bool fAssocPrev, bool bOn, bool fForceSplit,
+ Rect * prdPrimary, Rect * prdSecondary)
+{
+ GrResult res = kresOk;
+
+ float xsSegLeft = 0;
+ float ysSegTop = 0;
+
+ if (prdPrimary)
+ {
+ prdPrimary->top = 0;
+ prdPrimary->bottom = 0;
+ prdPrimary->left = 0;
+ prdPrimary->right = 0;
+ }
+ if (prdSecondary)
+ {
+ prdSecondary->top = 0;
+ prdSecondary->bottom = 0;
+ prdSecondary->left = 0;
+ prdSecondary->right = 0;
+ }
+
+ int ichwLim = m_pseg->m_ichwMin + m_pseg->m_dichwLim;
+ bool fRtl = m_pseg->rightToLeft();
+
+ if (m_pseg->m_dxsWidth < 0)
+ m_pseg->ComputeDimensions();
+
+ // Get the locations for the before and after selections.
+
+ float xsBefore, ysBeforeTop, ysBeforeBottom;
+ float xsAfter, ysAfterTop, ysAfterBottom;
+ bool fRtlBefore, fRtlAfter;
+ CalcIP(ichwIP, true, &xsBefore, &ysBeforeTop, &ysBeforeBottom, &fRtlBefore);
+ CalcIP(ichwIP, false, &xsAfter, &ysAfterTop, &ysAfterBottom, &fRtlAfter);
+
+ if (m_pseg->m_cginf == 0 && ichwIP == ichwLim)
+ {
+ Assert(kPosInfFloat == xsBefore && kPosInfFloat == xsAfter);
+ xsBefore = 0;
+ xsAfter = 0;
+ }
+ else if ((kPosInfFloat == xsBefore || kNegInfFloat == xsBefore) &&
+ (kPosInfFloat == xsAfter || kNegInfFloat == xsAfter))
+ {
+ return; // quick exit for nothing-to-draw case
+ }
+
+ bool fPrimary = true;
+ if (fForceSplit)
+ {
+ // Supposedly we can't find both halves of the IP in this segment.
+ Assert(xsBefore == kPosInfFloat || xsBefore == kNegInfFloat
+ || xsAfter == kPosInfFloat || xsAfter == kNegInfFloat);
+ if (xsBefore == kPosInfFloat || xsBefore == kNegInfFloat)
+ {
+ // Can't find the char the IP is before.
+ fPrimary = fAssocPrev;
+ }
+ else // if (xsAfter == kPosInfinity || xsAfter == kNegInfinity)
+ {
+ // Can't find the char the IP is after.
+ fPrimary = !fAssocPrev;
+ }
+ ////Assert((dm == kdmSplitPrimary) == fPrimary);
+ }
+
+ if (xsBefore == kPosInfinity || xsBefore == kNegInfinity)
+ {
+ ysBeforeTop = ysSegTop;
+ ysBeforeBottom = ysSegTop + m_pseg->m_dysHeight;
+ }
+ else
+ {
+ xsBefore += xsSegLeft;
+ ysBeforeTop += ysSegTop;
+ ysBeforeBottom += ysSegTop;
+ }
+ if (xsAfter == kNegInfinity || xsAfter == kPosInfinity)
+ {
+ ysAfterTop = ysSegTop;
+ ysAfterBottom = ysSegTop + m_pseg->m_dysHeight;
+ }
+ else
+ {
+ xsAfter += xsSegLeft;
+ ysAfterTop += ysSegTop;
+ ysAfterBottom += ysSegTop;
+ }
+
+ float xsLeft = xsSegLeft
+ + ((fRtl && m_pseg->m_fEndLine) ? (m_pseg->m_dxsVisibleWidth - m_pseg->m_dxsTotalWidth) :0);
+ float xsRight = xsSegLeft
+ + ((fRtl && m_pseg->m_fEndLine) ? m_pseg->m_dxsVisibleWidth : m_pseg->m_dxsTotalWidth)
+ + m_pseg->m_dxsStretch;
+ float dysMinSplitHeight = m_pseg->m_dysHeight / 4;
+
+ if (!fForceSplit) // kdmNormal == dm)
+ {
+ // Standard I-beam, or both halves of split IP.
+
+ bool fIBeam = false;
+
+ if (xsBefore == xsAfter)
+ // Positions coincide within this segment: make an I-beam.
+ fIBeam = true;
+
+ else if (fabsf(xsBefore - xsLeft) <= 1 && ichwIP == m_pseg->m_ichwMin)
+ {
+ // Logical start is at a left edge: allow I-beam if previous segment has one
+ // at the end (or there is no previous segment).
+ //Assert(!fRtlBefore);
+ //if (m_pseg->m_psegPrev)
+ //{
+ // SegmentPainter segpPrev(m_pseg->m_psegPrev);
+ // fIBeam = segpPrev.doBoundariesCoincide(true, true);
+ //}
+ //else
+
+ fIBeam = true;
+ }
+ else if (fabsf(xsBefore - xsRight) <= 1 && ichwIP == m_pseg->m_ichwMin)
+ {
+ // Logical start is at a right edge: allow I-beam if previous segment has one
+ // at the end (or there is no previous segment).
+ //Assert(fRtlBefore);
+ //if (m_pseg->m_psegPrev)
+ //{
+ // SegmentPainter segpPrev(m_pseg->m_psegPrev);
+ // fIBeam = segpPrev.doBoundariesCoincide(true, false);
+ //}
+ //else
+
+ fIBeam = true;
+ }
+ else if (fabsf(xsAfter - xsLeft) <= 1 && ichwIP == ichwLim)
+ {
+ // Logical end is at a left edge: allow I-beam if next segment has one
+ // at the beginning (or there is no next segment).
+ //Assert(fRtlAfter);
+ //if (m_pseg->m_psegNext == NULL)
+ //{
+ // SegmentPainter segpPrev(m_pseg->m_psegPrev);
+ // fIBeam = segpPrev.doBoundariesCoincide(false, true);
+ //}
+ //else
+
+ fIBeam = true;
+ }
+ else if (fabsf(xsAfter - xsRight) <= 1 && ichwIP == ichwLim)
+ {
+ // Logical end is at a right edge: allow I-beam if next segment has one
+ // at the beginning (or there is no next segment).
+ //Assert(!fRtlAfter);
+ //if (m_pseg->m_psegNext == NULL)
+ //{
+ // SegmentPainter segpPrev(m_pseg->m_psegPrev);
+ // fIBeam = segpPrev.doBoundariesCoincide(false, false);
+ //}
+ //else
+
+ fIBeam = true;
+ }
+ else
+ {
+ // If the horizontal positions of the two halves are sufficiently close,
+ // make an I-beam.
+ fIBeam = CloseIPPositions(
+ &xsBefore, ysBeforeTop, ysBeforeBottom,
+ &xsAfter, ysAfterTop, ysAfterBottom);
+ }
+ if (ResultFailed(res))
+ THROW(WARN(res));
+
+ if (fIBeam &&
+ ((ichwIP == m_pseg->m_ichwMin && fAssocPrev) || (ichwIP == ichwLim && !fAssocPrev)))
+ {
+ // Adjacent segment will show the I-beam, so don't show it here.
+ if (m_pseg->m_cginf == 0)
+ {
+ // Empty segment--assume no adjacent segment.
+ }
+ else
+ return;
+ }
+
+ if (fIBeam)
+ { // I-beam caret
+
+ float ysTop = min(ysBeforeTop, ysAfterTop);
+ float ysBottom = max(ysBeforeBottom, ysAfterBottom);
+ float xsMid = (xsBefore == kPosInfFloat) ? xsAfter : xsBefore;
+ InvertIBeam(xsMid, ysTop, ysBottom, fAssocPrev, prdPrimary);
+ }
+ else
+ { // split caret
+ if (fAssocPrev)
+ { // xsAfter is primary, xsBefore is secondary
+ if (xsAfter != kNegInfinity)
+ {
+ InvertSplitIP(xsAfter, ysAfterTop, ysAfterBottom,
+ true, fRtlAfter, false, dysMinSplitHeight, prdPrimary);
+ }
+ if (xsBefore != kPosInfFloat)
+ {
+ InvertSplitIP(xsBefore, ysBeforeTop, ysBeforeBottom,
+ false, !fRtlBefore, true, dysMinSplitHeight, prdSecondary);
+ }
+ }
+ else
+ { // xsBefore is primary, xsAfter is secondary
+ if (xsBefore != kPosInfinity)
+ {
+ InvertSplitIP(xsBefore, ysBeforeTop, ysBeforeBottom,
+ false, !fRtlBefore, false, dysMinSplitHeight, prdPrimary);
+ }
+ if (xsAfter != kNegInfinity)
+ {
+ InvertSplitIP(xsAfter, ysAfterTop, ysAfterBottom,
+ true, fRtlAfter, true, dysMinSplitHeight, prdSecondary);
+ }
+ }
+ //*pfSecHere = true;
+ }
+ //*pfPrimaryHere = true;
+ }
+ else if (fForceSplit && fPrimary) // kdmSplitPrimary == dm)
+ {
+ // Draw just the primary caret.
+ if (fAssocPrev)
+ { // xsAfter is primary
+ if (xsAfter == kNegInfinity)
+ {} // no primary
+ else
+ InvertSplitIP(xsAfter, ysAfterTop, ysAfterBottom,
+ true, fRtlAfter, false, dysMinSplitHeight, prdPrimary);
+ }
+ else
+ { // xsBefore is primary
+ if (xsBefore == kPosInfinity)
+ {} // no primary
+ else
+ InvertSplitIP(xsBefore, ysBeforeTop, ysBeforeBottom,
+ false, !fRtlBefore, false, dysMinSplitHeight, prdPrimary);
+ }
+ }
+ else // fForceSplit && !fPrimary
+ {
+ // Draw just the secondary caret.
+ //Assert(kdmSplitSecondary == dm);
+ if (fAssocPrev)
+ { // xsBefore is secondary
+ if (xsBefore == kPosInfinity)
+ {} // no secondary
+ else
+ InvertSplitIP(xsBefore, ysBeforeTop, ysBeforeBottom,
+ false, !fRtlBefore, true, dysMinSplitHeight, prdSecondary);
+ }
+ else
+ { // xsAfter is secondary
+ if (xsAfter == kNegInfinity)
+ {} // no secondary
+ else
+ InvertSplitIP(xsAfter, ysAfterTop, ysAfterBottom,
+ true, fRtlAfter, true, dysMinSplitHeight, prdSecondary);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Draw an I-beam cursor, or return the location at which it would be drawn.
+
+ Note that currently we do not draw a true I-beam, but rather just a vertical line.
+
+ @param xs - horizontal center of IP
+ @param ysTop - top of glyph (or ligature component) box
+ @param ysBottom - bottom of glyph (or ligature component) box
+ @param fAssocRight - true if the IP is associated with the text to the right
+ @param rs, rd - source/destination device coordinates
+ @param prdRet - return location to be drawn in dest device coords;
+ if NULL, do the drawing
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::InvertIBeam(float xs, float ysTop, float ysBottom,
+ bool fAssocPrev, Rect * prdRet)
+{
+ float xd = ScaleXToDest(xs);
+ float ydTop = ScaleYToDest(ysTop);
+ float ydBottom = ScaleYToDest(ysBottom);
+
+ // For now, assume that destination coordinates are in terms of pixels.
+ float dxdTwoXPixels = 2;
+
+ float dxdLeftAdjust = dxdTwoXPixels / 2;
+ float dxdRightAdjust = dxdTwoXPixels - dxdLeftAdjust;
+
+// int dysFontAscent;
+// pgg->GetFontAscentSourceUnits(pgg, &dysFontAscent);
+// dysFontAscent += m_dysXAscent;
+// if (dysFontAscent < 20)
+// {
+// dxdRightAdjust--;
+// dxdRightHook = 1;
+// }
+
+ if (prdRet)
+ {
+ prdRet->left = xd - dxdLeftAdjust;
+ prdRet->right = xd + dxdRightAdjust;
+ prdRet->top = ydTop;
+ prdRet->bottom = ydBottom;
+ }
+ else
+ {
+ InvertRect(xd-dxdLeftAdjust, ydTop,
+ xd+dxdRightAdjust, ydBottom);
+
+ // To make a true I-beam:
+// InvertRect(xd-dxdTwoXPixels, ydTop-dydOneYPixel,
+// xd+dxdRightHook, ydTop);
+// InvertRect(xd-dxdTwoXPixels, ydBottom,
+// xd+dxdRightHook, ydBottom+dydOneYPixel);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Draw a split insertion point, or return the location at which it would be drawn.
+
+ @param xs - horizontal center of IP
+ @param ysTop - top of glyph (or ligature component) box
+ @param ysBottom - bottom of glyph (or ligature component) box
+ @param fTop - true if the IP is to be drawn at the top of the line of text
+ @param fAssocRight - true if the IP is associated with the text to the right
+ @param fSecondary - true if the IP is secondary, false if it is primary
+ @param dysMinSplitHeight
+ - minimum split cursor height
+ @param rs, rd - source/destination device coordinates
+ @param prdRet - return location to be drawn in dest device coords;
+ if NULL, do the drawing
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::InvertSplitIP(float xs, float ysTop, float ysBottom,
+ bool fTop, bool fAssocRight, bool fSecondary, float dysMinSplitHeight,
+ Rect * prdRet)
+{
+ if (prdRet == NULL && ysTop == ysBottom)
+ return; // invisible IP
+
+ float xd = ScaleXToDest(xs);
+ float ydTop = ScaleYToDest(ysTop);
+ float ydBottom = ScaleYToDest(ysBottom);
+ float dydMinSplitHeight = dysMinSplitHeight;
+
+ float ydMid = (ydTop + ydBottom) / 2;
+
+ // For now, assume that destination coordinates are in terms of pixels.
+ float dxdOneXPixel = 1;
+ float dydOneYPixel = 1;
+ float dxdTwoXPixels = 2;
+
+ float xdLeft, xdRight, dxdHookLen;
+ if (fSecondary)
+ {
+ xdLeft = xd - (dxdOneXPixel / 2);
+ xdRight = xdLeft + 1;
+ dxdHookLen = 2;
+ }
+ else
+ {
+ xdLeft = xd - (dxdTwoXPixels / 2);
+ xdRight = xdLeft + 2;
+ dxdHookLen = 3;
+ }
+
+ float yd1, yd2;
+ if (fTop)
+ {
+ yd1 = ydTop;
+ if (ydMid - ydTop < dydMinSplitHeight)
+ ydMid = ydTop + dydMinSplitHeight;
+ yd2 = (fSecondary) ? ydMid : ydMid + 3;
+ }
+ else
+ {
+ yd2 = ydBottom;
+ if (ydBottom - ydMid < dydMinSplitHeight)
+ ydMid = ydBottom - dydMinSplitHeight;
+ yd1 = (fSecondary) ? ydMid : ydMid - 3;
+ }
+
+ if (prdRet)
+ {
+ prdRet->left = xdLeft;
+ prdRet->right = xdRight;
+ // The most common reason for returning the positions of the IP is to scroll it into
+ // view, in which case we want to return the entire line height, not just the
+ // height of the IP itself.
+ prdRet->top = ydTop; // yd1;
+ prdRet->bottom = ydBottom; // yd2;
+ }
+ else
+ {
+ InvertRect(xdLeft, yd1, xdRight, yd2);
+ }
+
+ if (fAssocRight)
+ {
+ if (prdRet)
+ prdRet->right = xdRight + dxdHookLen;
+ else
+ {
+ if (fTop)
+ InvertRect(xdRight, ydTop,
+ xdRight + dxdHookLen, ydTop + dydOneYPixel);
+ else
+ InvertRect(xdRight, ydBottom-dydOneYPixel,
+ xdRight + dxdHookLen, ydBottom);
+ }
+ }
+ else
+ {
+ if (prdRet)
+ prdRet->left = xdLeft - dxdHookLen;
+ else
+ {
+ if (fTop)
+ InvertRect(xdLeft - dxdHookLen, ydTop,
+ xdLeft, ydTop + dydOneYPixel);
+ else
+ InvertRect(xdLeft - dxdHookLen, ydBottom - dydOneYPixel,
+ xdLeft, ydBottom);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Given a character position (relative to the beginning of the string), return the
+ position for the insertion point, relative to the top-left of the segment.
+ Notice that these are before/after positions, not left/right positions.
+ Return an infinity value to indicate no appropriate IP.
+
+ @param ichwSel - selection position, relative to beginning of string
+ @param fBefore - true if we are interested in the character the IP is before.
+ @param pxs, pysTop, pysBottom
+ - return locations for drawing the IP (top and bottom are not
+ adjusted for half-selections)
+ @param pfRtl - return true if the character is right-to-left
+
+ Review: it might be useful to figure out if the two surface glyphs are physically adjacent
+ in such a way that their IPs can be combined into one I-beam. For now we use a simple
+ rule that assumes that any glyph or ligature component is at least 10% as wide as the
+ height of the font (see CloseIPPositions).
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::CalcIP(int ichwSel, bool fBefore,
+ float * pxs, float * pysTop, float * pysBottom, bool * pfRtl)
+{
+ Font & font = this->m_pseg->getFont();
+
+ int ichw = (fBefore) ? ichwSel : ichwSel - 1;
+
+ int iginfOutput;
+
+ *pfRtl = m_pseg->CharIsRightToLeft(ichw, fBefore);
+
+ GrEngine * pgreng = m_pseg->EngineImpl();
+ GrGlyphTable * pgtbl = (pgreng) ? pgreng->GlyphTable() : NULL;
+
+ float dysFontAscent = m_pseg->m_dysFontAscent;
+ ////GrResult res = GetFontAscentSourceUnits(pgg, &dysFontAscent);
+ ////if (ResultFailed(res))
+ //// THROW(WARN(res));
+ dysFontAscent += m_pseg->m_dysXAscent;
+
+ *pysTop = 0;
+ *pysBottom = m_pseg->m_dysHeight;
+
+ int ichwSegOffset = ichw - m_pseg->m_ichwMin;
+ int isloutLig;
+ if (ichwSegOffset < m_pseg->m_ichwAssocsMin || ichwSegOffset >= m_pseg->m_ichwAssocsLim)
+ isloutLig = kNegInfinity;
+ else
+ isloutLig = m_pseg->m_prgisloutLigature[ichwSegOffset - m_pseg->m_ichwAssocsMin];
+ bool fOkLig = (isloutLig != kNegInfinity);
+ if (pgtbl && fOkLig)
+ {
+ // Ligature component; place the IP at the boundary
+ // of the component box.
+
+ GrSlotOutput * pslout = m_pseg->OutputSlot(isloutLig);
+ int icomp = m_pseg->m_prgiComponent[ichwSegOffset - m_pseg->m_ichwAssocsMin];
+
+ iginfOutput = m_pseg->LogicalToPhysicalSurface(isloutLig);
+
+ float xsGlyphOffset = m_pseg->GlyphLeftEdge(iginfOutput);
+
+ float xsLeft, xsRight, ysTop, ysBottom;
+
+ // TODO: Rework ComponentIndexForGlyph to take slati rather than iForGlyph.
+ int slati = pslout->ComponentId(icomp);
+ int iForGlyph = pgtbl->ComponentIndexForGlyph(pslout->GlyphID(), slati);
+ fOkLig = pgtbl->ComponentBoxLogUnits(m_pseg->m_xysEmSquare, pslout->GlyphID(), iForGlyph,
+ m_pseg->m_mFontEmUnits, m_pseg->m_dysAscent,
+ &xsLeft, &ysTop, &xsRight, &ysBottom);
+ if (fOkLig)
+ {
+ if (fBefore == *pfRtl)
+ // Position of interest is to the right.
+ *pxs = xsGlyphOffset + xsRight;
+ else
+ // Position of interest is to the left.
+ *pxs = xsGlyphOffset + xsLeft;
+
+ GlyphInfo * pginf = m_pseg->m_prgginf + iginfOutput;
+ float ysGlyph = pginf->yOffset();
+
+ *pysTop = ysTop + (m_pseg->m_dysAscent - dysFontAscent) - ysGlyph;
+ *pysBottom = ysBottom + (m_pseg->m_dysAscent - dysFontAscent) - ysGlyph;
+ }
+ }
+
+ if (!fOkLig)
+ {
+ // Not a ligature component.
+
+ int islout = m_pseg->UnderlyingToLogicalSurface(ichw, fBefore);
+ GrSlotOutput * psloutTmp = m_pseg->OutputSlot(islout);
+ iginfOutput = m_pseg->LogicalToPhysicalSurface(islout);
+
+ if (kPosInfinity == iginfOutput || kNegInfinity == iginfOutput)
+ *pxs = kPosInfFloat;
+
+ else
+ {
+ bool fCluster = (psloutTmp->IsPartOfCluster());
+ bool fHighlightBB = fCluster;
+ // Test below should match the one in CalcHighlightRect:
+ if ((psloutTmp->ClusterAdvance() == 0
+ || psloutTmp->GlyphMetricLogUnits(&font, kgmetAdvWidth) == 0)
+ && !psloutTmp->IsSpace())
+ {
+ fHighlightBB = true; // use bounding box for zero-advance glyph
+ }
+ if (fHighlightBB)
+ {
+ // Cluster member or zero-width glyph.
+
+ if (fCluster && AtEdgeOfCluster(psloutTmp, islout, fBefore) &&
+ !CanInsertIntoCluster(psloutTmp, islout))
+ {
+ // Place the IP at the edge of the whole cluster.
+
+ int isloutBase = psloutTmp->ClusterBase();
+ GrSlotOutput * psloutBase = m_pseg->OutputSlot(isloutBase);
+ //int igbbBase = psloutBase->GlyphBbIndex();
+ int iginfBase = m_pseg->LogicalToPhysicalSurface(isloutBase);
+
+ float xsBase = m_pseg->GlyphLeftEdge(iginfBase);
+
+ float xsLeft = xsBase + psloutBase->ClusterXOffset();
+ float xsRight = xsBase + psloutBase->ClusterAdvance();
+
+ if (fBefore == *pfRtl)
+ // Position of interest is to the right
+ *pxs = xsRight;
+ else
+ // Position of interest is to the left.
+ *pxs = xsLeft;
+ }
+ else
+ {
+ // Place the IP on the perimeter of the bounding box of the cluster member.
+
+ float xsGlyphStart = m_pseg->GlyphLeftEdge(iginfOutput);
+
+// float dysFontAscent;
+// res = GetFontAscentSourceUnits(pgg, &dysFontAscent);
+// if (ResultFailed(res)) THROW(WARN(res));
+// dysFontAscent += m_dysXAscent;
+
+ float ysBbTop = psloutTmp->GlyphMetricLogUnits(&font, kgmetBbTop);
+ float ysBbBottom = psloutTmp->GlyphMetricLogUnits(&font, kgmetBbBottom);
+ float xsBbLeft = psloutTmp->GlyphMetricLogUnits(&font, kgmetBbLeft);
+ float xsBbRight = psloutTmp->GlyphMetricLogUnits(&font, kgmetBbRight);
+
+ int twoPixels = 2; // assume dest coords are in pixels
+
+ if (fBefore == *pfRtl)
+ // Position of interest is to the right
+ *pxs = xsGlyphStart + xsBbRight + twoPixels;
+ else
+ // Position of interest is to the left.
+ *pxs = xsGlyphStart + xsBbLeft - twoPixels;
+
+ GlyphInfo * pginf = m_pseg->m_prgginf + iginfOutput;
+ float ysGlyph = pginf->yOffset();
+ float ysGlyphBaseline = m_pseg->m_dysAscent - ysGlyph; // relative to top
+
+ *pysTop = ysGlyphBaseline - ysBbTop - twoPixels;
+ *pysBottom = ysGlyphBaseline - ysBbBottom + twoPixels;
+ }
+ }
+ else
+ {
+ // Insertion point goes at origin or advance width of glyph.
+
+ *pxs = m_pseg->GlyphLeftEdge(iginfOutput);
+ if (fBefore == *pfRtl)
+ {
+ // Position of interest is to the right
+ //*pxs += psloutTmp->GlyphMetricLogUnits(&font, kgmetAdvWidth);
+ *pxs += psloutTmp->ClusterAdvance();
+ }
+ // else position of interest is to the left
+ }
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ If the two positions for the insertion point are close enough, merge them into
+ one insertion point, and return true to indicate that we want an I-beam.
+
+ @param pxsBefore, pxsAfter - for comparing, and also adjusted results
+ @param ysBeforeTop/Bottom, ysAfterTop/Bottom - for comparing
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::CloseIPPositions(float * pxsBefore, float ysBeforeTop, float ysBeforeBottom,
+ float * pxsAfter, float ysAfterTop, float ysAfterBottom)
+{
+ // No adjustment if vertical positions are disjoint.
+ if (ysBeforeBottom <= ysAfterTop)
+ return false;
+ if (ysAfterBottom <= ysBeforeTop)
+ return false;
+
+ float dysHt = max(ysBeforeBottom, ysAfterBottom) - min(ysBeforeTop, ysAfterTop);
+ float dxsDiff = fabsf(*pxsBefore - *pxsAfter);
+
+ // If the difference in the x positions is less than 10% of the height,
+ // we want an I-beam--use the average.
+ if (dxsDiff * 10 < dysHt)
+ {
+ *pxsBefore = (*pxsBefore + *pxsAfter) / 2;
+ *pxsAfter = *pxsBefore;
+ return true;
+ }
+
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the slot in question is the first or last slot of its cluster,
+ or if it is not part of a cluster at all. Return false if the specified side
+ of the slot is interior to a cluster.
+
+ @param fBefore - if true, we are examining the slot the insertion point is before,
+ so we are interested in whether this slot is at the
+ leading edge of the cluster.
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::AtEdgeOfCluster(GrSlotOutput * pslout, int islout, bool fBefore)
+{
+ if (!pslout->IsPartOfCluster())
+ return true;
+
+ if (fBefore && (islout == 0))
+ return true;
+ if (!fBefore && (m_pseg->m_cslout == islout + 1))
+ return true;
+
+ // If the adjacent slot in whatever direction we're interested in has the same
+ // cluster base, this slot is not on the edge of the cluster.
+ // -- NO, because you could have an intervening glyph that is not part of the
+ // cluster.
+ //int isloutAdjacentBase = (fBefore) ?
+ // m_pseg->OutputSlot(islout - 1)->ClusterBase() :
+ // m_pseg->OutputSlot(islout + 1)->ClusterBase();
+ //return (isloutAdjacentBase != m_pseg->OutputSlot(islout)->ClusterBase());
+
+ // Ask the cluster base.
+ return AtEdgeOfCluster(m_pseg->OutputSlot(pslout->ClusterBase()), pslout->ClusterBase(),
+ pslout, islout, fBefore);
+}
+
+bool SegmentPainter::AtEdgeOfCluster(GrSlotOutput * psloutBase, int isloutBase,
+ GrSlotOutput * pslout, int islout, bool fBefore)
+{
+ // Compare pslout to all the members of the cluster. If it is the minimum or maximum, it
+ // is at an edge.
+ if (fBefore && isloutBase < islout)
+ return false;
+ if (!fBefore && isloutBase > islout)
+ return false;
+
+ std::vector<int> visloutCluster;
+ m_pseg->ClusterMembersForGlyph(isloutBase, psloutBase->ClusterRange(), visloutCluster);
+
+ for (size_t iislout = 0; iislout < visloutCluster.size(); iislout++)
+ {
+ int isloutMember = visloutCluster[iislout];
+ if (fBefore && isloutMember < islout)
+ return false;
+ if (!fBefore && isloutMember > islout)
+ return false;
+ }
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if it is permitted to put an insertion point somewhere in the middle of
+ the given slot's cluster.
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::CanInsertIntoCluster(GrSlotOutput * pslout, int islout)
+{
+ if (!pslout->IsPartOfCluster())
+ return false;
+
+ int isloutBase = pslout->ClusterBase();
+ if (islout != isloutBase)
+ {
+ // Ask the cluster base.
+ Assert(pslout->ClusterRange() == 0);
+ return CanInsertIntoCluster(m_pseg->OutputSlot(isloutBase), isloutBase);
+ }
+
+ if (!AtEdgeOfCluster(pslout, islout, true) && pslout->InsertBefore())
+ return true;
+
+ std::vector<int> visloutCluster;
+ m_pseg->ClusterMembersForGlyph(isloutBase, pslout->ClusterRange(), visloutCluster);
+
+ for (size_t iislout = 0; iislout < visloutCluster.size(); iislout++)
+ {
+ int isloutMember = visloutCluster[iislout];
+ if (AtEdgeOfCluster(m_pseg->OutputSlot(isloutMember), isloutMember, true))
+ // Inserting before the first member of the cluster doesn't count.
+ continue;
+
+ if (m_pseg->OutputSlot(isloutMember)->InsertBefore())
+ return true;
+ }
+
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Determine which characters in the selected range are part of ligatures that are fully
+ selected vs. those that are only partially selected. Those that are only partially selected
+ must have their components highlighted individually, but those that are fully selected
+ should be highlighted fully, to avoid blank spots in the case that the components do not
+ fully cover the surface of the glyph.
+
+ @param prgfAllSelected - array of flags to fill in with results
+ @param ichwMin/LimSeg - range of characters to examine
+ @param ichwMin/LimSel - range of characters that are selected
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::CalcPartialLigatures(bool * prgfAllSelected,
+ int ichwMinSeg, int ichwLimSeg,
+ int ichwMinSel, int ichwLimSel)
+{
+ GrEngine * pgreng = m_pseg->EngineImpl();
+ GrGlyphTable * pgtbl = (pgreng) ? pgreng->GlyphTable() : NULL;
+
+ for (int ichw = ichwMinSeg; ichw < ichwLimSeg; ichw++)
+ {
+ int ichwSegOffset = ichw - m_pseg->m_ichwMin;
+ int isloutLig;
+ if (ichwSegOffset < m_pseg->m_ichwAssocsMin || ichwSegOffset >= m_pseg->m_ichwAssocsLim)
+ isloutLig = kNegInfinity;
+ else
+ isloutLig = m_pseg->m_prgisloutLigature[ichwSegOffset - m_pseg->m_ichwAssocsMin];
+ bool fLigComp = (pgtbl && isloutLig != kNegInfinity);
+ if (fLigComp && !prgfAllSelected[ichwSegOffset])
+ {
+ GrSlotOutput * pslout = m_pseg->OutputSlot(isloutLig);
+ bool fAll = true;
+ int icomp;
+ for (icomp = 0; icomp < pslout->NumberOfComponents(); icomp++)
+ {
+ int ichwUnderlying = pslout->UnderlyingComponent(icomp);
+ if (ichwUnderlying < ichwMinSel - m_pseg->m_ichwMin ||
+ ichwUnderlying >= ichwLimSel - m_pseg->m_ichwMin)
+ {
+ fAll = false; // found a component that is not selected
+ }
+ }
+ for (icomp = 0; icomp < pslout->NumberOfComponents(); icomp++)
+ {
+ int ichwUnderlying = pslout->UnderlyingComponent(icomp);
+ prgfAllSelected[ichwUnderlying] = fAll;
+ }
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ The given character is part of the selected range. Add to the vector a rectangle (or
+ eventually, several) indicating the corresponding screen area(s) of the character.
+ The rectangle is relative to the top left of the segment.
+
+ @param ichw - selected char, relative to beginning of string
+ @param vrs - list of rectangles to highlight, in source coords, relative to
+ segment draw position (top-left)
+ @param vfEntireHt - for each of the above rectangles, true if the rect should be
+ extended to include the entire line
+ @param fJustComponent - true if we want to highlight just the single ligature component
+ this character maps to; false if the entire ligature is selected
+ @param rgfHighlighted - for each glyph in this segment, whether it is being highlighted
+ by this operation
+ @param fSkipTrSpace - should we skip trailing white space?
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::CalcHighlightRect(int ichw,
+ std::vector<Rect> & vrs, std::vector<bool> & vfEntireHt,
+ bool fJustComponent, bool * rgfHighlighted, bool fSkipTrSpace)
+{
+ GrResult res;
+
+ GrEngine * pgreng = m_pseg->EngineImpl();
+ GrGlyphTable * pgtbl = (pgreng) ? pgreng->GlyphTable() : NULL;
+ //bool fRtl = m_pseg->rightToLeft();
+
+ Font & font = m_pseg->getFont();
+
+ if (!GrCharStream::AtUnicodeCharBoundary(m_pseg->GetString(), ichw))
+ // Second half of a surrogate pair, or UTF-8: ignore.
+ return;
+
+ // Calculate the location for the glyph that this IP is before.
+
+ int ichwSegOffset = ichw - m_pseg->m_ichwMin;
+ int isloutLig;
+ if (ichwSegOffset < m_pseg->m_ichwAssocsMin || ichwSegOffset >= m_pseg->m_ichwAssocsLim)
+ isloutLig = kNegInfinity;
+ else
+ isloutLig = m_pseg->m_prgisloutLigature[ichwSegOffset - m_pseg->m_ichwAssocsMin];
+ bool fLigComp = (pgtbl && isloutLig != kNegInfinity);
+ if (fLigComp && fJustComponent)
+ {
+ // Character is a ligature component.
+
+ GrSlotOutput * pslout = m_pseg->OutputSlot(isloutLig);
+ int icomp = m_pseg->m_prgiComponent[ichwSegOffset - m_pseg->m_ichwAssocsMin];
+ int iginfOutput = m_pseg->LogicalToPhysicalSurface(isloutLig);
+
+ float xsGlyphStart = m_pseg->GlyphLeftEdge(iginfOutput);
+
+ float xsLeft, xsRight, ysTop, ysBottom;
+
+ // TODO: Rework ComponentIndexForGlyph to take slati rather than iForGlyph.
+ int slati = pslout->ComponentId(icomp);
+ int iForGlyph = pgtbl->ComponentIndexForGlyph(pslout->GlyphID(), slati);
+ pgtbl->ComponentBoxLogUnits(m_pseg->m_xysEmSquare, pslout->GlyphID(), iForGlyph,
+ m_pseg->m_mFontEmUnits, m_pseg->m_dysAscent,
+ &xsLeft, &ysTop, &xsRight, &ysBottom);
+
+ float dysFontAscent = m_pseg->m_dysFontAscent;
+ ////GetFontAscentSourceUnits(pgg, &dysFontAscent);
+ dysFontAscent += m_pseg->m_dysXAscent;
+ GlyphInfo * pginf = m_pseg->m_prgginf + iginfOutput;
+ float ysForGlyph = pginf->yOffset();
+ float dysGlyphTop = (m_pseg->m_dysAscent - dysFontAscent) - ysForGlyph; // rel. to common baseline
+
+ Rect rsNew;
+ rsNew.top = ysTop + dysGlyphTop;
+ rsNew.bottom = ysBottom + dysGlyphTop;
+ rsNew.left = xsGlyphStart + xsLeft;
+ rsNew.right = xsGlyphStart + xsRight;
+ vrs.push_back(rsNew);
+
+ vfEntireHt.push_back(false);
+ }
+ else
+ {
+ std::vector<int> vislout = m_pseg->UnderlyingToLogicalAssocs(ichw);
+ if (vislout.size() == 0)
+ return;
+
+ float xsGlyphLeft, xsGlyphRight;
+
+ res = kresOk;
+
+ for (size_t iislout = 0; iislout < vislout.size(); iislout++)
+ {
+ int islout = vislout[iislout];
+ if (islout == kNegInfinity || islout == kPosInfinity)
+ continue;
+ int iginfTmp = m_pseg->LogicalToPhysicalSurface(islout);
+ Assert(iginfTmp != kNegInfinity);
+ Assert(iginfTmp != kPosInfinity);
+
+ if (fSkipTrSpace && islout >= m_pseg->m_isloutVisLim)
+ continue;
+
+ Rect rsNew;
+ GrSlotOutput * psloutTmp = m_pseg->OutputSlot(islout);
+ bool fHighlightBB = psloutTmp->IsPartOfCluster();
+ // Test below should match the one in CalcIP--
+ // If the glyph has no advance width but does have a real bounding box,
+ // highlight the bounding box. Review: do we want this???
+ if ((psloutTmp->ClusterAdvance() == 0
+ || psloutTmp->GlyphMetricLogUnits(&font, kgmetAdvWidth) == 0)
+ && !psloutTmp->IsSpace())
+ {
+ fHighlightBB = true;
+ }
+ xsGlyphLeft = m_pseg->GlyphLeftEdge(iginfTmp);
+ if (fHighlightBB)
+ {
+ // For now, highlight just the bounding box of this glyph. After we finish
+ // highlighting all glyphs individually, we'll go back and highlight
+ // as one unit any clusters that are completely selected.
+
+// int dysFontAscent;
+// res = GetFontAscentSourceUnits(pgg, &dysFontAscent); // if we restore this code, add in ExtraAscent
+// if (ResultFailed(res)) THROW(WARN(res));
+// dysFontAscent += m_dysXAscent;
+
+ GlyphInfo * pginf = m_pseg->m_prgginf + iginfTmp;
+ float ysForGlyph = pginf->yOffset();
+ float ysGlyphBaseline = m_pseg->m_dysAscent - ysForGlyph; // relative to top
+
+ float ysBbTop = psloutTmp->GlyphMetricLogUnits(&font, kgmetBbTop);
+ float ysBbBottom = psloutTmp->GlyphMetricLogUnits(&font, kgmetBbBottom);
+ float xsBbLeft = psloutTmp->GlyphMetricLogUnits(&font, kgmetBbLeft);
+ float xsBbRight = psloutTmp->GlyphMetricLogUnits(&font, kgmetBbRight);
+
+ rsNew.top = ysGlyphBaseline - ysBbTop - 2;
+ rsNew.bottom = ysGlyphBaseline - ysBbBottom + 2;
+ rsNew.left = xsGlyphLeft + xsBbLeft - 2;
+ rsNew.right = xsGlyphLeft + xsBbRight + 2;
+
+ vfEntireHt.push_back(false);
+ }
+ else
+ {
+ // Highlight entire width of the glyph from the top of the line to the bottom.
+ // Horizontally, highlight from the origin of the glyph to the advance width.
+
+ //xsGlyphRight = xsGlyphLeft + psloutTmp->GlyphMetricLogUnits(&font kgmetAdvWidth);
+ xsGlyphRight = xsGlyphLeft + psloutTmp->ClusterAdvance();
+
+ if (xsGlyphLeft > xsGlyphRight)
+ std::swap(xsGlyphLeft, xsGlyphRight);
+
+ rsNew.top = 0;
+ rsNew.bottom = m_pseg->m_dysHeight;
+ rsNew.left = xsGlyphLeft;
+ rsNew.right = xsGlyphRight;
+
+ vfEntireHt.push_back(true);
+ }
+ vrs.push_back(rsNew);
+
+ if (rgfHighlighted)
+ rgfHighlighted[iginfTmp] = true;
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ If the output slot is a cluster base and all the members of the cluster are highlighted,
+ simply highlight the cluster as a single rectangle, to avoid unslightly gaps
+ between glyphs. (Note that this does not remove the rectangles that were already included
+ to handle the individual members.)
+ The rectangles are relative to the top left of the segment.
+
+ @param islout - output slot index
+ @param vrect - list of rectangles to highlight; add result here
+ @param prgfHighlighted - flags indicating which glyphs have been highlighted, indexed by
+ physical surface position
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::CalcCompleteCluster(int islout,
+ std::vector<Rect> & vrs, std::vector<bool> & vfEntireHt, bool * prgfHighlighted)
+{
+ //GrEngine * pgreng = m_pseg->EngineImpl();
+
+ GrSlotOutput * pslout = m_pseg->OutputSlot(islout);
+ if (pslout->ClusterRange() == 0)
+ return;
+
+ int iginfDraw = m_pseg->LogicalToPhysicalSurface(islout);
+ if (!prgfHighlighted[iginfDraw])
+ return;
+
+ bool fAllHighlighted = true;
+
+ std::vector<int> visloutCluster;
+ m_pseg->ClusterMembersForGlyph(islout, pslout->ClusterRange(), visloutCluster);
+ for (size_t i = 0; i < visloutCluster.size(); i++)
+ {
+ int iginfMemberDraw = m_pseg->LogicalToPhysicalSurface(visloutCluster[i]);
+ if (!prgfHighlighted[iginfMemberDraw])
+ {
+ fAllHighlighted = false;
+ break;
+ }
+ }
+
+ if (!fAllHighlighted)
+ return;
+
+ // All the members of this cluster are highlighted.
+
+ float xsGlyphStart = m_pseg->GlyphLeftEdge(iginfDraw);
+
+ Rect rsNew;
+ rsNew.top = 0;
+ rsNew.bottom = m_pseg->m_dysHeight;
+ rsNew.left = xsGlyphStart + pslout->ClusterXOffset();
+ rsNew.right = xsGlyphStart + pslout->ClusterAdvance();
+ vrs.push_back(rsNew);
+
+ vfEntireHt.push_back(true);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Add the given rectangle to the vector, eliminating any overlapping areas.
+
+ Note this method can be recursive: if we have to break the current rectangle into
+ two, we'll call the method again the for new
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::AddRectWithoutOverlaps(std::vector<Rect> & vrect, Rect rectToAdd)
+{
+ std::vector<Rect> vrectMoreToAdd;
+
+ bool fAnythingToAdd = AnyArea(&rectToAdd);
+
+ size_t irect;
+ for (irect = 0; irect < vrect.size(); irect++)
+ {
+ bool f = AdjustRectsToNotOverlap(vrect, irect, &rectToAdd, vrectMoreToAdd);
+ if (!AnyArea(&vrect[irect]))
+ {
+ vrect.erase(vrect.begin() + irect);
+ irect--;
+ }
+ if (!f)
+ {
+ fAnythingToAdd = false;
+ break;
+ }
+ }
+
+ // Now rectToAdd is in a state that it does not intersect with any other rectangles
+ // in the list.
+
+ if (fAnythingToAdd)
+ vrect.push_back(rectToAdd);
+
+ // Add in any extra rectangles that are needed to handle overlaps.
+
+ for (irect = 0; irect < vrectMoreToAdd.size(); irect++)
+ AddRectWithoutOverlaps(vrect, vrectMoreToAdd[irect]);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the rectangle has an area greater than 0.
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::AnyArea(Rect * prect)
+{
+ Assert(prect->left <= prect->right);
+ Assert(prect->top <= prect->bottom);
+
+ return (prect->left < prect->right && prect->top < prect->bottom);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Adjust the rectangle prect2 to avoid overlaps with the given one in the vector.
+ Return false if the rectangle does not need to be added after all.
+
+ If we have to split this rectangle into two, add the second one to vrectMoreToAdd, so
+ we can do the same process on it.
+
+ If we can merge the two rectangles, add the result to vrectMoreToAdd (so it can be properly
+ checked for further overlaps), and adjust the rectangle in the vector so it will be
+ deleted.
+
+ @param vrect - current list of valid rectangles
+ @param irect - item in vrect we're comparing with prect2
+ @param prect2 - rectangle to add
+ @param vrectMoreToAdd - list of accumulated rectangles that need to be added
+ (caused by splitting one into two)
+
+ @return True if we want to add prect2 (possibly adjusted) to the list;
+ false it it is completely subsumed by vrect[irect], or has been merged with it,
+ or has no area.
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::AdjustRectsToNotOverlap(std::vector<Rect> & vrect, int irect, Rect * prect2,
+ std::vector<Rect> & vrectMoreToAdd)
+{
+ Rect * prect1 = &(vrect[irect]);
+
+ float xLeft1 = prect1->left;
+ float xRight1 = prect1->right;
+ float yTop1 = prect1->top;
+ float yBottom1 = prect1->bottom;
+ Assert(xLeft1 < xRight1);
+ Assert(yTop1 < yBottom1);
+
+ float xLeft2 = prect2->left;
+ float xRight2 = prect2->right;
+ float yTop2 = prect2->top;
+ float yBottom2 = prect2->bottom;
+ Assert(xLeft2 <= xRight2);
+ Assert(yTop2 <= yBottom2);
+
+ if (!AnyArea(prect2))
+ return false;
+
+ // No overlap: keep both as they are.
+ if (yBottom2 < yTop1 || yBottom1 < yTop2)
+ return true;
+ if (xRight2 < xLeft1 || xRight1 < xLeft2)
+ return true;
+
+ // Present rect subsumes new: ignore new
+ if (xLeft1 <= xLeft2 && xRight2 <= xRight1 && yTop1 <= yTop2 && yBottom2 <= yBottom1)
+ return false;
+
+ // New rect subsumes present: replace.
+ if (xLeft2 <= xLeft1 && xRight1 <= xRight2 && yTop2 <= yTop1 && yBottom1 <= yBottom2)
+ {
+ prect1->bottom = prect1->top; // delete
+ return true; // keep this one
+ }
+
+ // Abutting rectangles of same height or width: merge.
+ if (yTop1 == yTop2 && yBottom1 == yBottom2)
+ {
+ if (xRight1 == xLeft2)
+ {
+ // prect2 is to the right
+ prect2->left = prect1->left;
+ vrectMoreToAdd.push_back(*prect2);
+ prect1->bottom = prect1->top; // delete previous
+ return false;
+ }
+ else if (xRight2 == xLeft1)
+ {
+ // prect2 is to the left
+ prect2->right = prect1->right;
+ vrectMoreToAdd.push_back(*prect2);
+ prect1->bottom = prect1->top; // delete
+ return false;
+ }
+ }
+ if (xLeft1 == xLeft2 && xRight1 == xRight2)
+ {
+ if (yBottom1 == yTop2)
+ {
+ // prect2 is below
+ prect2->top = prect1->top;
+ vrectMoreToAdd.push_back(*prect2);
+ prect1->bottom = prect1->top; // delete
+ return false;
+ }
+ else if (yBottom2 == yTop1)
+ {
+ // prect2 is above
+ prect2->bottom = prect1->bottom;
+ vrectMoreToAdd.push_back(*prect2);
+ prect1->bottom = prect1->top; // delete
+ return false;
+ }
+ }
+
+ // Abutting rectangles of different heights or widths: leave as they are.
+ if (xRight1 == xLeft2 || xRight2 == xLeft1)
+ return true;
+ if (yBottom1 == yTop2 || yBottom2 == yTop1)
+ return true;
+
+ // Overlapping on one axis: adjust smaller rectangle
+ if (yTop1 <= yTop2 && yBottom2 <= yBottom1)
+ {
+ if (xLeft1 <= xLeft2 && xLeft2 < xRight1)
+ {
+ Assert(xRight1 < xRight2); // otherwise rect2 is subsumed
+ prect2->left = prect1->right;
+ return true;
+ }
+ else if (xLeft1 < xRight2 && xRight2 <= xRight1)
+ {
+ Assert(xLeft2 < xLeft1); // otherwise rect2 is subsumed
+ prect2->right = prect1->left;
+ return true;
+ }
+ }
+ else if (yTop2 <= yTop1 && yBottom1 <= yBottom2)
+ {
+ if (xLeft2 <= xLeft1 && xLeft1 < xRight2)
+ {
+ Assert(xRight2 < xRight1); // otherwise rect1 is subsumed
+ prect1->left = prect2->right;
+ return true;
+ }
+ else if (xLeft2 < xRight1 && xRight1 <= xRight2)
+ {
+ Assert(xLeft1 < xLeft2); // otherwise rect1 is subsumed
+ prect1->right = prect2->left;
+ return true;
+ }
+ }
+
+ if (xLeft1 <= xLeft2 && xRight2 <= xRight1)
+ {
+ if (yTop1 <= yTop2 && yTop2 < yBottom1)
+ {
+ Assert(yBottom1 < yBottom2); // otherwise rect2 is subsumed
+ prect2->top = prect1->bottom;
+ return true;
+ }
+ else if (yTop1 < yBottom2 && yBottom2 <= yBottom1)
+ {
+ Assert(yTop2 < yTop1); // otherwise rect2 is subsumed
+ prect2->bottom = prect1->top;
+ return true;
+ }
+ }
+ else if (xLeft2 <= xLeft1 && xRight1 <= xRight2)
+ {
+ if (yTop2 <= yTop1 && yTop1 < yBottom2)
+ {
+ Assert(yBottom2 < yBottom1); // otherwise rect1 is subsumed
+ prect1->top = prect2->bottom;
+ return true;
+ }
+ else if (yTop2 < yBottom1 && yBottom1 <= yBottom2)
+ {
+ Assert(yTop1 < yTop2); // otherwise rect1 is subsumed
+ prect1->bottom = prect2->top;
+ return true;
+ }
+ }
+
+ // Centers overlap: break prect2 into two disjoint rectangles.
+ if (xLeft1 < xLeft2 && xRight2 < xRight1 && yTop2 < yTop1 && yBottom1 < yBottom2)
+ {
+ // create a new rectangle for the bottom of prect2 that is below prect1
+ Rect rectNew = *prect2;
+ rectNew.top = prect1->bottom;
+ prect2->bottom = prect1->top;
+ vrectMoreToAdd.push_back(rectNew);
+ return true;
+ }
+ else if (xLeft2 < xLeft1 && xRight1 < xRight2 && yTop1 < yTop2 && yBottom2 < yBottom1)
+ {
+ // create a new rectangle for the right of prect2 that is to the right of prect1
+ Rect rectNew = *prect2;
+ rectNew.left = prect1->right;
+ prect2->right = prect1->left;
+ vrectMoreToAdd.push_back(rectNew);
+ return true;
+ }
+
+ // Corners overlap: break prect2 into two adjacent rectangles.
+ if (xLeft1 < xLeft2 && xRight1 < xRight2)
+ {
+ // prect2 is partially to the right
+ if (yTop1 < yTop2 && yBottom1 < yBottom2)
+ {
+ // prect2 is partially below
+ Rect rectNew = *prect2;
+ rectNew.left = prect1->right;
+ prect2->top = prect1->bottom;
+ vrectMoreToAdd.push_back(rectNew);
+ return true;
+ }
+ else if (yTop2 < yTop1 && yBottom2 < yBottom1)
+ {
+ // prect2 is partially above
+ Rect rectNew = *prect2;
+ rectNew.left = prect1->right;
+ prect2->bottom = prect1->top;
+ vrectMoreToAdd.push_back(rectNew);
+ return true;
+ }
+ }
+ else if (xLeft2 < xLeft1 && xRight2 < xRight1)
+ {
+ // prect2 is partially to the left
+ if (yTop1 < yTop2 && yBottom1 < yBottom2)
+ {
+ // prect2 is partially below
+ Rect rectNew = *prect2;
+ rectNew.right = prect1->left;
+ prect2->top = prect1->bottom;
+ vrectMoreToAdd.push_back(rectNew);
+ return true;
+ }
+ else if (yTop2 < yTop1 && yBottom2 < yBottom1)
+ {
+ // prect2 is partially above
+ Rect rectNew = *prect2;
+ rectNew.right = prect1->left;
+ prect2->bottom = prect1->top;
+ vrectMoreToAdd.push_back(rectNew);
+ return true;
+ }
+ }
+
+ // No overlap.
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Assert that there are no overlaps among all the rectangles in the array, which should
+ be the case if AdjustRectsToNotOverlap is working properly.
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::AssertNoOverlaps(std::vector<Rect> & vrect)
+{
+#ifdef _DEBUG
+ for (int irect1 = 0; irect1 < signed(vrect.size() - 1); irect1++)
+ {
+ for (int irect2 = irect1 + 1; irect2 < signed(vrect.size()); irect2++)
+ {
+ float xLeft1 = vrect[irect1].left;
+ float xRight1 = vrect[irect1].right;
+ float yTop1 = vrect[irect1].top;
+ float yBottom1 = vrect[irect1].bottom;
+ Assert(xLeft1 < xRight1);
+ Assert(yTop1 < yBottom1);
+
+ float xLeft2 = vrect[irect2].left;
+ float xRight2 = vrect[irect2].right;
+ float yTop2 = vrect[irect2].top;
+ float yBottom2 = vrect[irect2].bottom;
+ Assert(xLeft2 <= xRight2);
+ Assert(yTop2 <= yBottom2);
+
+ Assert(xRight1 <= xLeft2 || xRight2 <= xLeft1 ||
+ yBottom1 <= yTop2 || yBottom2 <= yTop1);
+ }
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------------------------
+ Add the given line segment to the vector, eliminating any overlapping areas.
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::AddLineSegWithoutOverlaps(std::vector<LineSeg> & vls, LineSeg lsToAdd)
+{
+ std::vector<LineSeg> vlsMoreToAdd;
+
+ bool fAnythingToAdd = AnyLength(&lsToAdd);
+
+ size_t ils;
+ for (ils = 0; ils < vls.size(); ils++)
+ {
+ bool f = AdjustLineSegsToNotOverlap(vls, ils, &lsToAdd, vlsMoreToAdd);
+ if (!AnyLength(&vls[ils]))
+ {
+ vls.erase(vls.begin() + ils);
+ ils--;
+ }
+ if (!f)
+ {
+ fAnythingToAdd = false;
+ break;
+ }
+ }
+
+ // Now lsToAdd is in a state that it does not overlap with any other line segments
+ // in the list.
+
+ if (fAnythingToAdd)
+ vls.push_back(lsToAdd);
+
+ // Add in any extra line segments that are needed to handle overlaps.
+
+ for (ils = 0; ils < vlsMoreToAdd.size(); ils++)
+ AddLineSegWithoutOverlaps(vls, vlsMoreToAdd[ils]);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the rectangle has an area greater than 0.
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::AnyLength(LineSeg * pls)
+{
+ Assert(pls->left <= pls->right);
+ return (pls->left < pls->right);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Adjust the line segment pls2 to avoid overlaps with the given one in the vector.
+ Return false if the line segment does not need to be added after all.
+
+ If we can merge the two line segments, add the result to vrectMoreToAdd (so it can be properly
+ checked for further overlaps), and adjust the rectangle in the vector so it will be
+ deleted.
+
+ @param vls - current list of valid line segments
+ @param ils - item in vrect we're comparing with pls2
+ @param pls2 - line segment to add
+ @param vlsMoreToAdd - list of accumulated line segments that need to be added
+ (caused by splitting one into two)
+
+ @return True if we want to add pls2 (possibly adjusted) to the list;
+ false it it is completely subsumed by vls[ils], or has been merged with it,
+ or has no length.
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::AdjustLineSegsToNotOverlap(std::vector<LineSeg> & vls, int ils, LineSeg * pls2,
+ std::vector<LineSeg> & vlsMoreToAdd)
+{
+ LineSeg * pls1 = &(vls[ils]);
+
+ float xLeft1 = pls1->left;
+ float xRight1 = pls1->right;
+ Assert(xLeft1 < xRight1);
+
+ float xLeft2 = pls2->left;
+ float xRight2 = pls2->right;
+ Assert(xLeft2 <= xRight2);
+
+ if (!AnyLength(pls2))
+ return false;
+
+ // No overlap: keep both as they are.
+ if (xRight2 < xLeft1 || xRight1 < xLeft2)
+ return true;
+
+ // Present line segment subsumes new: ignore new
+ if (xLeft1 <= xLeft2 && xRight2 <= xRight1)
+ return false;
+
+ // New line segment subsumes present: replace.
+ if (xLeft2 <= xLeft1 && xRight1 <= xRight2)
+ {
+ pls1->left = pls1->right; // delete previous
+ return true; // keep this one
+ }
+
+ // Adjacent or partially overlapping line segments: merge.
+ if (xLeft1 <= xLeft2 && xLeft2 <= xRight1 && xRight1 <= xRight2)
+ {
+ pls2->left = xLeft1;
+ vlsMoreToAdd.push_back(*pls2);
+ pls1->left = pls1->right; // delete previous
+ return false;
+ }
+ else if (xLeft2 <= xLeft1 && xLeft1 <= xRight2 && xRight2 <= xRight1)
+ {
+ pls2->right = xRight1;
+ vlsMoreToAdd.push_back(*pls2);
+ pls1->left = pls1->right; // delete previous
+ return false;
+ }
+ else
+ Assert(false);
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Assert that there are no overlaps among all the rectangles in the array, which should
+ be the case if AdjustRectsToNotOverlap is working properly.
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::AssertNoOverlaps(std::vector<LineSeg> & vls)
+{
+#ifdef _DEBUG
+ for (int ils1 = 0; ils1 < (int)vls.size() - 1; ils1++)
+ {
+ for (int ils2 = ils1 + 1; ils2 < (int)vls.size(); ils2++)
+ {
+ float xLeft1 = vls[ils1].left;
+ float xRight1 = vls[ils1].right;
+ Assert(xLeft1 < xRight1);
+
+ float xLeft2 = vls[ils2].left;
+ float xRight2 = vls[ils2].right;
+ Assert(xLeft2 <= xRight2);
+
+ Assert(xRight1 <= xLeft2 || xRight2 <= xLeft1);
+ }
+ }
+#endif
+}
+
+/*----------------------------------------------------------------------------------------------
+ Find the next physical location for the IP. Return true if we found one.
+
+ @param pichw - current insertion point, and adjusted result to return
+ @param pfAssocPrev - is the IP "leaning" backwards? adjust to return
+ @param fRight - true if we are moving right
+ @param fAssocPrevMatch - the assoc-prev of the result must match the original selection.
+ This is used when extending range selections; the orientation
+ of the resulting end-point must be the same as previously.
+ This helps avoids circular loops when dealing with reordering.
+ @param fAssocPrevNeeded - value needed for result; ignored if fAssocPrevMatch == false
+ @param pnNextOrPrevSeg - return 1 if we need to try the following segment, -1 if we
+ need to try the previous - CURRENTLY NOT USED for anything
+ practical
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::ArrowKeyPositionInternal(
+ int * pichw, bool * pfAssocPrev,
+ bool fRight, bool fAssocPrevMatch, bool fAssocPrevNeeded, int * pnNextOrPrevSeg)
+{
+ int kBefore = true;
+ int kAfter = false;
+
+ bool fResult = false;
+
+ // Handle ligatures.
+
+ fResult = AdjacentLigComponent(pichw, pfAssocPrev, fRight, true);
+ if (fResult)
+ return true;
+
+ // Not within a ligature, or on the outside edge of one.
+
+ int iginfStart;
+ bool fCharRtl;
+ if (*pfAssocPrev)
+ {
+ iginfStart = m_pseg->UnderlyingToPhysicalSurface(*pichw - 1, kAfter);
+ fCharRtl = m_pseg->CharIsRightToLeft(*pichw - 1, kAfter);
+ }
+ else
+ {
+ iginfStart = m_pseg->UnderlyingToPhysicalSurface(*pichw, kBefore);
+ fCharRtl = m_pseg->CharIsRightToLeft(*pichw, kBefore);
+ }
+ if (kNegInfinity == iginfStart || kPosInfinity == iginfStart)
+ {
+ *pnNextOrPrevSeg = 0;
+ return false;
+ }
+
+ //if (*pfAssocPrev)
+ // fCharRtl ? iginfStart : iginfStart++;
+ //else
+ // fCharRtl ? iginfStart++ : iginfStart;
+
+ if (*pfAssocPrev)
+ iginfStart++;
+
+ // At this point iginfStart indicates the index of the glyph we are before.
+
+ int ichwNewIndex;
+ bool fAPNew;
+
+ bool fRtl = m_pseg->rightToLeft();
+ bool fForward = (fRtl) ? !fRight : fRight;
+ int dir = (fForward) ? 1 : -1;
+ int diginf = 0;
+
+ // When moving forward, we first move to the opposite side of the current glyph,
+ // so initially diginf should be zero.
+ if (fForward)
+ diginf = -1;
+
+ while (true)
+ {
+ diginf++;
+ int iginfTry = iginfStart + (dir * diginf);
+
+ if (iginfTry < 0)
+ {
+ *pnNextOrPrevSeg = -1;
+ return false;
+ }
+ if (iginfTry > m_pseg->m_cginf)
+ {
+ *pnNextOrPrevSeg = 1;
+ return false;
+ }
+ if (iginfTry == m_pseg->m_cginf && fForward)
+ {
+ *pnNextOrPrevSeg = 1;
+ return false;
+ }
+
+ bool fAfter;
+ int ichwTryChar;
+ if (iginfTry == m_pseg->m_cginf)
+ {
+ ichwTryChar = m_pseg->PhysicalSurfaceToUnderlying(iginfTry - 1,
+ kPosInfFloat, kPosInfFloat, 0, 0, &fAfter);
+ }
+ else
+ {
+ ichwTryChar = m_pseg->PhysicalSurfaceToUnderlying(iginfTry,
+ (fRight) ? kPosInfFloat : kNegInfFloat,
+ (fRight) ? kPosInfFloat : kNegInfFloat,
+ 0, 0, &fAfter);
+ }
+
+ if (fAfter)
+ {
+ ichwNewIndex = ichwTryChar + 1;
+ fAPNew = true;
+ }
+ else
+ {
+ ichwNewIndex = ichwTryChar;
+ fAPNew = false;
+ }
+
+ if (ichwNewIndex == *pichw)
+ continue; // didn't make any progress
+
+ LgIpValidResult ipvr = isValidInsertionPoint(ichwNewIndex);
+ if (ipvr == kipvrBad)
+ continue; // bad insertion point
+
+ if (fAssocPrevMatch && (fAssocPrevNeeded != fAPNew))
+ {
+ // Try switching fAPNew and see if that gives the right result
+ bool fAPAlt = !fAPNew;
+ int iginfAlt = m_pseg->UnderlyingToPhysicalSurface(
+ fAPAlt ? ichwTryChar - 1 : ichwTryChar + 1,
+ fAPAlt ? kAfter : kBefore);
+ fCharRtl = m_pseg->CharIsRightToLeft(
+ fAPAlt ? ichwTryChar - 1 : ichwTryChar + 1,
+ fAPAlt ? kAfter : kBefore);
+
+ if (fAPAlt)
+ fCharRtl ? iginfAlt : iginfAlt++;
+ else
+ fCharRtl ? iginfAlt++ : iginfAlt;
+
+ if ((fForward && iginfAlt <= iginfStart)
+ || (!fForward && iginfAlt >= iginfStart))
+ {
+ // Switching fAPNew would cause us to move in the opposite direction, so
+ // that's not a good solution. Keep going.
+ if ((iginfStart == 0 && !fForward) || (iginfStart == m_pseg->m_cginf && fForward))
+ {
+ // Can't go any further, so go with this even though AP is wrong.
+ }
+ else
+ continue;
+ }
+ fAPNew = fAPAlt;
+ }
+ break;
+ }
+
+ // If we have a selection within a ligature, adjust to either the right-most or the
+ // left-most.
+ AdjacentLigComponent(&ichwNewIndex, &fAPNew, fRight, false);
+
+ *pichw = ichwNewIndex;
+ *pfAssocPrev = fAPNew;
+ return true;
+}
+
+/****** OLD VERSION
+bool Segment::ArrowKeyPositionInternal(
+ int * pichw, bool * pfAssocPrev,
+ bool fRight, bool fAssocPrevMatch, bool fAssocPrevNeeded, int * pnNextOrPrevSeg)
+{
+ int kBefore = true;
+ int kAfter = false;
+
+ bool fResult = false;
+
+ // Handle ligatures.
+
+ fResult = AdjacentLigComponent(pichw, pfAssocPrev, fRight, true);
+ if (fResult)
+ return true;
+
+ // Not within a ligature, or on the outside edge of one.
+
+ int igbbOutput;
+ bool fCharRtl;
+ if (*pfAssocPrev)
+ {
+ igbbOutput = UnderlyingToPhysicalSurface(*pichw - 1, kAfter);
+ fCharRtl = CharIsRightToLeft(*pichw - 1, kAfter);
+ }
+ else
+ {
+ igbbOutput = UnderlyingToPhysicalSurface(*pichw, kBefore);
+ fCharRtl = CharIsRightToLeft(*pichw, kBefore);
+ }
+ if (kNegInfinity == igbbOutput || kPosInfinity == igbbOutput)
+ {
+ *pnNextOrPrevSeg = 0;
+ return false;
+ }
+
+ if (*pfAssocPrev)
+ fCharRtl ? igbbOutput : igbbOutput++;
+ else
+ fCharRtl ? igbbOutput++ : igbbOutput;
+
+ bool fBackward = (fRight == m_fWsRtl);
+
+ // Try to find an underlying position that would produce an IP in the expected place.
+ // First look in the same direction in the underlying text, then, if necessary, try the
+ // opposite direction (which may be necessary when reordering occurred).
+
+ int igbbNeed = (fRight) ? igbbOutput + 1 : igbbOutput - 1;
+ int ichwNew;
+ bool fAssocPrevNew;
+
+ while (0 <= igbbNeed && igbbNeed <= NumGbb()) // include end-points--we may need to
+ // be before or after them.
+ {
+ int dichwInc = fBackward ? -1 : 1;
+ int dichwLim = m_ichwMin + (fBackward ? 0 : m_dichwLim);
+
+ int nDirectionsTried = 0;
+// while (nDirectionsTried < 2) -- Nope, for now we are being very strict above moving
+ while (nDirectionsTried < 1) // only in the desired direction
+ {
+ for (int ichwTry = *pichw;
+ ((dichwInc == 1 && ichwTry <= dichwLim) ||
+ (dichwInc == -1 && ichwTry >= dichwLim));
+ ichwTry += dichwInc)
+ {
+ int igbbTry = UnderlyingToPhysicalSurface(ichwTry, kBefore);
+ fCharRtl = CharIsRightToLeft(ichwTry, kBefore);
+ igbbTry = fCharRtl ? igbbTry + 1 : igbbTry;
+ if (igbbTry == igbbNeed &&
+ (ichwTry != *pichw || *pfAssocPrev) &&
+ (!fAssocPrevMatch || !fAssocPrevNeeded))
+ {
+ ichwNew = ichwTry;
+ fAssocPrevNew = false;
+ goto LFixLigatures;
+ }
+
+ igbbTry = UnderlyingToPhysicalSurface(ichwTry - 1, kAfter);
+ fCharRtl = CharIsRightToLeft(ichwTry - 1, kAfter);
+ igbbTry = fCharRtl ? igbbTry : igbbTry + 1;
+ if (igbbTry == igbbNeed &&
+ (ichwTry != *pichw || !*pfAssocPrev) &&
+ (!fAssocPrevMatch || fAssocPrevNeeded))
+ {
+ ichwNew = ichwTry;
+ fAssocPrevNew = true;
+ goto LFixLigatures;
+ }
+ }
+
+ nDirectionsTried++;
+
+ // Didn't find an answer going the expected way; try the opposite direction.
+ dichwInc = (fRight) ? -1 : 1;
+ dichwLim = m_ichwMin + ((fRight) ? 0 : m_dichwLim);
+ }
+
+ // Didn't find an underlying position that would produce an IP in the next glyph;
+ // try the glyph after that.
+
+ igbbNeed = (fRight) ? igbbNeed + 1 : igbbNeed - 1;
+ }
+
+ if (igbbNeed >= NumGbb())
+ *pnNextOrPrevSeg = 1; // try next segment
+ else if (igbbNeed < 0)
+ *pnNextOrPrevSeg = -1; // try previous segment
+ else
+ {
+ Assert(false);
+ *pnNextOrPrevSeg = 0;
+ }
+
+ return false;
+
+LFixLigatures:
+
+ // If we have a selection within a ligature, adjust to either the right-most or the
+ // left-most.
+ AdjacentLigComponent(&ichwNew, &fAssocPrevNew, fRight, false);
+
+ *pichw = ichwNew;
+ *pfAssocPrev = fAssocPrevNew;
+ return true;
+}
+******************/
+
+/*----------------------------------------------------------------------------------------------
+ Return position for the physically next or previous ligature component, or the right-most
+ or left-most. Return true if this routine handled it.
+
+ @param pichw - starting underlying position
+ @param pfAssocPrev - is selection leaning backwards?
+ @param fMovingRight - true if right arrow key was pressed, false if left
+ @param fMove - if true, we want to find the next one over from *pichw;
+ if false, we want to find either the right-most
+ (fMovingRight = false)
+ or the left-most (fMovingRight = true)
+----------------------------------------------------------------------------------------------*/
+bool SegmentPainter::AdjacentLigComponent(int * pichw, bool * pfAssocPrev,
+ bool fMovingRight, bool fMove)
+{
+ int kBefore = true;
+ int kAfter = false;
+
+ GrEngine * pgreng = m_pseg->EngineImpl();
+ GrGlyphTable * pgtbl = (pgreng) ? pgreng->GlyphTable() : NULL;
+
+ if (!pgtbl)
+ {
+ return false;
+ }
+
+ // Find the slot containing the ligature glyph.
+
+ int ichwSegOffset = *pichw - m_pseg->m_ichwMin;
+ int isloutLig = kNegInfinity;
+ if (*pfAssocPrev)
+ {
+ if (ichwSegOffset - 1 >= m_pseg->m_ichwAssocsMin && ichwSegOffset - 1 < m_pseg->m_ichwAssocsLim)
+ isloutLig = m_pseg->m_prgisloutLigature[ichwSegOffset - 1 - m_pseg->m_ichwAssocsMin];
+ }
+ else
+ {
+ if (ichwSegOffset >= m_pseg->m_ichwAssocsMin && ichwSegOffset < m_pseg->m_ichwAssocsLim)
+ isloutLig = m_pseg->m_prgisloutLigature[ichwSegOffset - m_pseg->m_ichwAssocsMin];
+ }
+
+ if (isloutLig == kNegInfinity)
+ {
+ return false;
+ }
+
+ if (*pfAssocPrev)
+ ichwSegOffset--;
+
+ bool fGlyphRtl = (*pfAssocPrev) ?
+ m_pseg->CharIsRightToLeft(*pichw - 1, kAfter) :
+ m_pseg->CharIsRightToLeft(*pichw, kBefore);
+
+ // Comparing right-sides.
+ bool fIPOnRight = (fGlyphRtl != *pfAssocPrev);
+
+ // When two ligatures are horizontally equal, take vertical position into account.
+ // In left-to-right writing systems, moving right means moving down.
+ bool fMovingDown = (fMovingRight != m_pseg->m_fWsRtl);
+
+ // Get the coordinates for all the ligatures.
+
+ std::vector<float> vysTops;
+ std::vector<float> vysBottoms;
+ std::vector<float> vxsLefts;
+ std::vector<float> vxsRights;
+
+ float ysTopCurr, ysBottomCurr, xsLeftCurr, xsRightCurr;
+ int icompCurr = -1;
+ if (fMovingRight)
+ ysTopCurr = ysBottomCurr = xsLeftCurr = xsRightCurr = kNegInfFloat;
+ else
+ ysTopCurr = ysBottomCurr = xsLeftCurr = xsRightCurr = kPosInfFloat;
+
+ GrSlotOutput * pslout = m_pseg->OutputSlot(isloutLig);
+ //int iginfOutput = m_pseg->LogicalToPhysicalSurface(isloutLig);
+
+ int icomp;
+ for (icomp = 0; icomp < pslout->NumberOfComponents(); icomp++)
+ {
+ float xsLeft, ysTop, xsRight, ysBottom;
+
+ // TODO: Rework ComponentIndexForGlyph to take slati rather than iForGlyph.
+ int slati = pslout->ComponentId(icomp);
+ int iForGlyph = pgtbl->ComponentIndexForGlyph(pslout->GlyphID(), slati);
+ pgtbl->ComponentBoxLogUnits(m_pseg->m_xysEmSquare, pslout->GlyphID(), iForGlyph,
+ m_pseg->m_mFontEmUnits, m_pseg->m_dysAscent,
+ &xsLeft, &ysTop, &xsRight, &ysBottom);
+
+ vysTops.push_back(ysTop);
+ vysBottoms.push_back(ysBottom);
+ vxsLefts.push_back(xsLeft);
+ vxsRights.push_back(xsRight);
+
+ // If we're moving, record this component as the one we're moving relative to.
+ if (fMove && icomp == m_pseg->m_prgiComponent[ichwSegOffset - m_pseg->m_ichwAssocsMin])
+ {
+ icompCurr = icomp;
+ ysTopCurr = ysTop;
+ ysBottomCurr = ysBottom;
+ xsLeftCurr = xsLeft;
+ xsRightCurr = xsRight;
+ }
+ }
+
+ float xsHorizCurr = (fIPOnRight) ? xsRightCurr : xsLeftCurr;
+ float xsHorizNext;
+
+ // Find the first ligature that is in the proper direction.
+ int icompNext;
+ for (icompNext = 0; icompNext < pslout->NumberOfComponents(); icompNext++)
+ {
+ if (icompNext != icompCurr)
+ {
+ float xsHorizNext = (fIPOnRight) ? vxsRights[icompNext] : vxsLefts[icompNext];
+ if (fMovingRight && xsHorizNext > xsHorizCurr)
+ break;
+ else if (!fMovingRight && xsHorizNext < xsHorizCurr)
+ break;
+ }
+ }
+ if (icompNext == pslout->NumberOfComponents())
+ {
+ bool fResult;
+ // No component in the proper direction. Can we switch to the opposite edge of the
+ // current component?
+ if (fMovingRight && !fIPOnRight)
+ {
+ if (fGlyphRtl)
+ --(*pichw);
+ else
+ ++(*pichw);
+ *pfAssocPrev = !*pfAssocPrev;
+ fResult = true;
+ }
+ else if (!fMovingRight && fIPOnRight)
+ {
+ if (fGlyphRtl)
+ ++(*pichw);
+ else
+ --(*pichw);
+
+ *pfAssocPrev = !*pfAssocPrev;
+ fResult = true;
+ }
+ else
+ fResult = false;
+ return fResult;
+ }
+
+ xsHorizNext = (fIPOnRight) ? vxsRights[icompNext] : vxsLefts[icompNext];
+
+ // Now find the closest one in the proper direction.
+ for (icomp = icompNext + 1; icomp < pslout->NumberOfComponents(); icomp++)
+ {
+ if (icomp != icompCurr)
+ {
+ float xsHorizTry = (fIPOnRight) ? vxsRights[icomp] : vxsLefts[icomp];
+
+ if (fMovingRight && xsHorizTry > xsHorizCurr &&
+ (xsHorizTry < xsHorizNext ||
+ (xsHorizTry == xsHorizNext &&
+ (vysTops[icomp] > vysTops[icompNext]) == fMovingDown)))
+ {
+ icompNext = icomp;
+ xsHorizNext = xsHorizTry;
+ }
+ else if (!fMovingRight && xsHorizTry < xsHorizCurr &&
+ (xsHorizTry > xsHorizNext ||
+ (xsHorizTry == xsHorizNext &&
+ (vysTops[icomp] > vysTops[icompNext]) == fMovingDown)))
+ {
+ icompNext = icomp;
+ xsHorizNext = xsHorizTry;
+ }
+ }
+ }
+
+ *pichw = pslout->UnderlyingComponent(icompNext) + m_pseg->m_ichwMin;
+ if (*pfAssocPrev)
+ ++(*pichw);
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Scale the x-coordinate by the scaling factors for this painter.
+----------------------------------------------------------------------------------------------*/
+float SegmentPainter::ScaleX(float xs, Rect rs, Rect rd)
+{
+ //return rs.MapXTo(xs, rd);
+
+ float dxs = rs.right - rs.left;
+ float dxd = rd.right - rd.left;
+ Assert(dxs > 0);
+ if (dxs == dxd)
+ return xs + rd.left - rs.left;
+
+ float xd = rd.left + GrEngine::GrFloatMulDiv((xs - rs.left), dxd, dxs);
+ return xd;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Scale the y-coordinate by the scaling factors for this painter.
+----------------------------------------------------------------------------------------------*/
+float SegmentPainter::ScaleY(float ys, Rect rs, Rect rd)
+{
+ //return rs.MapYTo(ys, rd);
+
+ float dys = rs.bottom - rs.top;
+ float dyd = rd.bottom - rd.top;
+ Assert(dys > 0);
+ if (dys == dyd)
+ return ys + rd.top - rs.top;
+ float yd = rd.top + GrEngine::GrFloatMulDiv((ys - rs.top), dyd, dys);
+ return yd;
+}
+
+
+//:>********************************************************************************************
+//:> Low-level platform-specific drawing methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Make sure the font is set to use the character properties required by this segment.
+----------------------------------------------------------------------------------------------*/
+void SegmentPainter::SetFontProps(unsigned long clrFore, unsigned long clrBack)
+{
+ return;
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/FileInput.cpp b/Build/source/libs/graphite/src/segment/FileInput.cpp
new file mode 100644
index 00000000000..52969532cd3
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/FileInput.cpp
@@ -0,0 +1,266 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: FileInput.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Contains the functions for reading from a TT file. (These are functions, not methods
+ associated with a class.)
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+
+#include "GrCommon.h"
+#include "GrData.h"
+#ifndef _WIN32
+#include "GrMstypes.h"
+#endif
+#include "GrDebug.h"
+#include <fstream>
+#include <iostream>
+#include <string>
+#include "FileInput.h"
+#include "GrResult.h"
+
+//#ifndef _MSC_VER
+//#include "config.h"
+//#endif
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods of GrBufferIStream
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Constructor.
+----------------------------------------------------------------------------------------------*/
+GrBufferIStream::GrBufferIStream()
+{
+ m_pbStart = NULL;
+ m_pbNext = NULL;
+ m_pbLim = NULL;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Destructor.
+----------------------------------------------------------------------------------------------*/
+GrBufferIStream::~GrBufferIStream()
+{
+ Close();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the stream.
+----------------------------------------------------------------------------------------------*/
+#ifdef GR_FW
+bool GrBufferIStream::Open(std::wstring stuFileName, int kMode)
+#else
+bool GrBufferIStream::Open(const char * pcFileName, std::ios::openmode kMode)
+#endif
+{
+ Assert(false); // use OpenBuffer
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the stream to a buffer.
+----------------------------------------------------------------------------------------------*/
+bool GrBufferIStream::OpenBuffer(byte * pbBuffer, int cb)
+{
+ Assert(m_pbStart == NULL);
+ Assert(m_pbNext == NULL);
+ Assert(m_pbLim == NULL);
+
+ m_pbStart = pbBuffer;
+ m_pbNext = pbBuffer;
+ if (cb > 0)
+ m_pbLim = m_pbStart + cb;
+ // otherwise we don't know the length
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Close the stream.
+----------------------------------------------------------------------------------------------*/
+void GrBufferIStream::Close()
+{
+ m_pbStart = NULL;
+ m_pbNext = NULL;
+ m_pbLim = NULL;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read a byte from the stream.
+----------------------------------------------------------------------------------------------*/
+byte GrBufferIStream::ReadByteFromFont()
+{
+ byte bInput = *m_pbNext;
+ m_pbNext += isizeof(byte);
+ if (m_pbLim && m_pbNext > m_pbLim)
+ THROW(kresReadFault);
+ return bInput;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read a short (signed 16-bit) word from the stream. Switch the bytes from big-endian
+ to little-endian format.
+----------------------------------------------------------------------------------------------*/
+short GrBufferIStream::ReadShortFromFont()
+{
+ short snInput = *(short *)m_pbNext;
+ m_pbNext += isizeof(short);
+ if (m_pbLim && m_pbNext > m_pbLim)
+ THROW(kresReadFault);
+ snInput = lsbf(snInput);
+ return snInput;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read a wide character (unsigned 16-bit word) from the stream.
+ Switch the bytes from big-endian to little-endian format.
+----------------------------------------------------------------------------------------------*/
+utf16 GrBufferIStream::ReadUShortFromFont()
+{
+ utf16 chwInput = *(utf16 *)m_pbNext;
+ m_pbNext += isizeof(utf16);
+ if (m_pbLim && m_pbNext > m_pbLim)
+ THROW(kresReadFault);
+ chwInput = lsbf(chwInput);
+ return chwInput;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read a standard (32-bit) word from the stream. Switch the bytes from big-endian
+ to little-endian format.
+----------------------------------------------------------------------------------------------*/
+int GrBufferIStream::ReadIntFromFont()
+{
+ int nInput = *(int *)m_pbNext;
+ m_pbNext += isizeof(int);
+ if (m_pbLim && m_pbNext > m_pbLim)
+ THROW(kresReadFault);
+ nInput = lsbf(nInput);
+ return nInput;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read a block of data from the stream. DON'T switch the bytes from big-endian
+ to little-endian format.
+----------------------------------------------------------------------------------------------*/
+void GrBufferIStream::ReadBlockFromFont(void * pvInput, int cb)
+{
+ std::copy(m_pbNext, m_pbNext + cb, reinterpret_cast<byte*>(pvInput));
+ m_pbNext += cb;
+ if (m_pbLim && m_pbNext > m_pbLim)
+ THROW(kresReadFault);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the absolute position of the font-file stream (relative to the beginning of
+ the file). For buffers, we just return the byte position in the buffer.
+----------------------------------------------------------------------------------------------*/
+void GrBufferIStream::GetPositionInFont(long * plPos)
+{
+ *plPos = (m_pbNext - m_pbStart);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the position of the font-file stream to the given absolute position (relative
+ to the beginning of the file). For buffers, assume the position is relative to the
+ beginning of the buffer.
+----------------------------------------------------------------------------------------------*/
+void GrBufferIStream::SetPositionInFont(long lPos)
+{
+ m_pbNext = m_pbStart + lPos;
+ if (m_pbLim && m_pbNext > m_pbLim)
+ THROW(kresReadFault);
+}
+
+
+//:>********************************************************************************************
+//:> Swap byte order.
+//:>********************************************************************************************
+int swapb(int nArg)
+{
+#if WORDS_BIGENDIAN
+return nArg;
+#else
+ int b1, b2, b3, b4;
+ b1 = ((nArg & 0xFF000000) >> 24) & 0x000000FF; // remove sign extension
+ b2 = ((nArg & 0x00FF0000) >> 8); // & 0x0000FF00;
+ b3 = ((nArg & 0x0000FF00) << 8); // & 0x00FF0000;
+ b4 = ((nArg & 0x000000FF) << 24); // & 0xFF000000;
+ int nRet = b1 | b2 | b3 | b4;
+ return nRet;
+#endif
+}
+
+unsigned int swapb(unsigned int nArg)
+{
+#if WORDS_BIGENDIAN
+return nArg;
+#else
+ int b1, b2, b3, b4;
+ b1 = ((nArg & 0xFF000000) >> 24) & 0x000000FF; // remove sign extension
+ b2 = ((nArg & 0x00FF0000) >> 8); // & 0x0000FF00;
+ b3 = ((nArg & 0x0000FF00) << 8); // & 0x00FF0000;
+ b4 = ((nArg & 0x000000FF) << 24); // & 0xFF000000;
+ int nRet = b1 | b2 | b3 | b4;
+ return nRet;
+#endif
+}
+
+utf16 swapb(utf16 chwArg)
+{
+#if WORDS_BIGENDIAN
+return chwArg;
+#else
+ utf16 b1, b2;
+ b1 = ((chwArg & 0xFF00) >> 8) & 0x00FF; // remove sign extension
+ b2 = ((chwArg & 0x00FF) << 8); // & 0xFF00;
+ utf16 chwRet = b1 | b2;
+ return chwRet;
+#endif
+}
+
+short swapb(short snArg)
+{
+#if WORDS_BIGENDIAN
+return snArg;
+#else
+ short b1, b2;
+ b1 = ((snArg & 0xFF00) >> 8) & 0x00FF; // remove sign extension
+ b2 = ((snArg & 0x00FF) << 8); // & 0xFF00;
+ short snRet = b1 | b2;
+ return snRet;
+#endif
+}
+
+} //namespace gr
+
diff --git a/Build/source/libs/graphite/src/segment/FileInput.h b/Build/source/libs/graphite/src/segment/FileInput.h
new file mode 100644
index 00000000000..f8c32b762eb
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/FileInput.h
@@ -0,0 +1,104 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: FileInput.h
+Responsibility: Sharon Correll
+Last reviewed: not yet
+
+Description:
+ Defines utility functions for reading from a font file.
+----------------------------------------------------------------------------------------------*/
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef FILEINPUT_INCLUDED
+#define FILEINPUT_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+int swapb(int nArg);
+unsigned int swapb(unsigned int nArg);
+utf16 swapb(utf16 chwArg);
+short swapb(short snArg);
+
+// Most significant byte first (converting from least-sig-first):
+inline int msbf(int nArg) { return swapb(nArg); }
+inline unsigned int msbf(unsigned int nArg) { return swapb(nArg); }
+inline utf16 msbf(utf16 chwArg) { return swapb(chwArg); }
+inline short msbf(short chwArg) { return swapb(chwArg); }
+
+// Least significant byte first (converting from most-sig first):
+inline int lsbf(int nArg) { return swapb(nArg); }
+inline unsigned int lsbf(unsigned int nArg) { return swapb(nArg); };
+inline utf16 lsbf(utf16 chwArg) { return swapb(chwArg); }
+inline short lsbf(short chwArg) { return swapb(chwArg); }
+
+class GrIStream
+{
+public:
+ virtual void Close() = 0;
+
+ virtual byte ReadByteFromFont() = 0;
+ virtual short ReadShortFromFont() = 0;
+ virtual utf16 ReadUShortFromFont() = 0;
+ virtual int ReadIntFromFont() = 0;
+ virtual void ReadBlockFromFont(void * pvInput, int cb) = 0;
+
+ virtual void GetPositionInFont(long * plPos) = 0;
+ virtual void SetPositionInFont(long lPos) = 0;
+
+ virtual bool OpenBuffer(byte * pbBuffer, int cb) = 0;
+ virtual void CloseBuffer() = 0;
+
+protected:
+ virtual ~GrIStream() {}
+};
+
+
+/*----------------------------------------------------------------------------------------------
+ A stream that reads from a buffer rather than a file.
+----------------------------------------------------------------------------------------------*/
+class GrBufferIStream : public GrIStream
+{
+public:
+ GrBufferIStream();
+ ~GrBufferIStream();
+
+ #ifdef GR_FW
+ virtual bool Open(std::wstring stuFileName, std::ios::openmode kMode);
+ #else
+ virtual bool Open(const char * pcFileName, std::ios::openmode kMode);
+ #endif
+ virtual void Close();
+
+ virtual byte ReadByteFromFont();
+ virtual short ReadShortFromFont();
+ virtual utf16 ReadUShortFromFont();
+ virtual int ReadIntFromFont();
+ virtual void ReadBlockFromFont(void * pvInput, int cb);
+
+ virtual void GetPositionInFont(long * plPos);
+ virtual void SetPositionInFont(long lPos);
+
+ virtual bool OpenBuffer(byte * pbBuffer, int cb);
+ virtual void CloseBuffer()
+ {
+ Close();
+ }
+
+protected:
+ byte * m_pbStart;
+ byte * m_pbNext;
+ byte * m_pbLim;
+};
+
+} // namespace gr
+
+#endif // !FILEINPUT_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/FontCache.cpp b/Build/source/libs/graphite/src/segment/FontCache.cpp
new file mode 100644
index 00000000000..f0540463e3b
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/FontCache.cpp
@@ -0,0 +1,308 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: FontCache.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ A cache of all the font-face objects.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+// any other headers (not precompiled)
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+ Store the given font-face in the cache. Overwrite whatever was there before.
+ Return NULL if there is nothing appropriate there.
+----------------------------------------------------------------------------------------------*/
+void FontCache::GetFontFace(std::wstring strFaceName, bool fBold, bool fItalic,
+ FontFace ** ppfface)
+{
+ int ifci = FindCacheItem(strFaceName);
+ if (ifci < 0) // no fonts of that family present
+ {
+ *ppfface = NULL;
+ return;
+ }
+
+ CacheItem * pfci = m_prgfci + ifci;
+ if (fBold)
+ {
+ if (fItalic)
+ *ppfface = pfci->pffaceBI;
+ else
+ *ppfface = pfci->pffaceBold;
+ }
+ else
+ {
+ if (fItalic)
+ *ppfface = pfci->pffaceItalic;
+ else
+ *ppfface = pfci->pffaceRegular;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Store the given font-face in the cache. Overwrite whatever was there before.
+----------------------------------------------------------------------------------------------*/
+void FontCache::CacheFontFace(std::wstring strFaceName, bool fBold, bool fItalic,
+ FontFace * pfface)
+{
+ if (m_prgfci == NULL)
+ Initialize();
+
+ int ifciIns = FindCacheItem(strFaceName);
+ int ifci = ifciIns;
+ if (ifciIns < 0)
+ {
+ ifci = (ifciIns + 1) * -1;
+ InsertCacheItem(ifci);
+ std::copy(strFaceName.c_str(), strFaceName.c_str() +
+ (strFaceName.size() + 1), m_prgfci[ifci].szFaceName);
+ }
+
+ CacheItem * pfci = m_prgfci + ifci;
+
+ bool fPrevNull;
+ if (fBold)
+ {
+ if (fItalic)
+ {
+ fPrevNull = (pfci->pffaceBI == NULL);
+ pfci->pffaceBI = pfface;
+ }
+ else
+ {
+ fPrevNull = (pfci->pffaceBold == NULL);
+ pfci->pffaceBold = pfface;
+ }
+ }
+ else
+ {
+ if (fItalic)
+ {
+ fPrevNull = (pfci->pffaceItalic == NULL);
+ pfci->pffaceItalic = pfface;
+ }
+ else
+ {
+ fPrevNull = (pfci->pffaceRegular == NULL);
+ pfci->pffaceRegular = pfface;
+ }
+ }
+
+ if (fPrevNull && (pfface != NULL))
+ m_cfface++;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Remove the given font-face from the cache. Return false if it couldn't be found.
+----------------------------------------------------------------------------------------------*/
+bool FontCache::RemoveFontFace(std::wstring strFaceName, bool fBold, bool fItalic,
+ bool fZapCache)
+{
+ int ifci = FindCacheItem(strFaceName);
+ if (ifci < 0)
+ {
+ return false;
+ }
+
+ bool fPrevVal;
+ CacheItem * pfci = m_prgfci + ifci;
+ if (fBold)
+ {
+ if (fItalic)
+ {
+ fPrevVal = (pfci->pffaceBI != NULL);
+ pfci->pffaceBI = NULL;
+ }
+ else
+ {
+ fPrevVal = (pfci->pffaceBold != NULL);
+ pfci->pffaceBold = NULL;
+ }
+ }
+ else
+ {
+ if (fItalic)
+ {
+ fPrevVal = (pfci->pffaceItalic != NULL);
+ pfci->pffaceItalic = NULL;
+ }
+ else
+ {
+ fPrevVal = (pfci->pffaceRegular != NULL);
+ pfci->pffaceRegular = NULL;
+ }
+ }
+
+ if (fPrevVal)
+ m_cfface--;
+
+ Assert(m_cfface >= 0);
+
+ if (m_flush == kflushAuto && fZapCache)
+ {
+ DeleteIfEmpty();
+ }
+
+ return fPrevVal;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Search for the font-family in the cache and return its index.
+ If not present, return a negative number indicating where it was expected.
+----------------------------------------------------------------------------------------------*/
+int FontCache::FindCacheItem(std::wstring strFaceName)
+{
+ if (m_cfci == 0)
+ return -1;
+
+ Assert(m_prgfci);
+
+ // Use a binary-chop search.
+
+ int ifciLow = 0;
+ int ifciHigh = m_cfci;
+ while (true)
+ {
+ int ifciMid = (ifciHigh + ifciLow) >> 1; // divide by 2
+ CacheItem * pfci = m_prgfci + ifciMid;
+ int tst = wcscmp(strFaceName.c_str(), (const wchar_t *)pfci->szFaceName);
+ if (tst == 0)
+ return ifciMid; // found it
+ if (ifciLow + 1 == ifciHigh)
+ {
+ // not there; return where expected: 0 -> -1, 1 -> -2
+ Assert(ifciMid == ifciLow);
+ if (tst < 0)
+ return (ifciLow * -1) - 1;
+ else
+ return (ifciHigh * -1) - 1;
+ }
+
+ // Keep looking.
+ if (tst < 0)
+ ifciHigh = ifciMid;
+ else
+ ifciLow = ifciMid;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Insert space in the cache at location ifci.
+----------------------------------------------------------------------------------------------*/
+void FontCache::InsertCacheItem(int ifci)
+{
+ if (m_cfci == m_cfciMax)
+ {
+ // Cache is full; double the space.
+ CacheItem * m_prgfciOld = m_prgfci;
+ m_prgfci = new CacheItem[m_cfciMax * 2];
+ std::copy(m_prgfciOld, m_prgfciOld + m_cfciMax, m_prgfci);
+ delete[] m_prgfciOld;
+ m_cfciMax *= 2;
+ }
+
+ // This copy involves overlapping ranges, so we need copy_backward not copy
+ // to satisfy the preconditions
+ std::copy_backward(m_prgfci + ifci, m_prgfci + m_cfci, m_prgfci + m_cfci + 1);
+ m_cfci++;
+
+ // Initialize inserted item.
+ CacheItem * pfci = m_prgfci + ifci;
+ pfci->pffaceRegular = NULL;
+ pfci->pffaceBold = NULL;
+ pfci->pffaceItalic = NULL;
+ pfci->pffaceBI = NULL;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Delete the cache if it is empty.
+----------------------------------------------------------------------------------------------*/
+void FontCache::DeleteIfEmpty()
+{
+ if (m_cfface <= 0)
+ // All items are NULL; delete this cache. Probably this is because
+ // the program is exiting.
+ FontFace::ZapFontCache();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Check that the cache is indeed empty.
+----------------------------------------------------------------------------------------------*/
+void FontCache::AssertEmpty()
+{
+#ifdef _DEBUG
+ for (int ifci = 0; ifci < m_cfci; ifci++)
+ {
+ CacheItem * pfci = m_prgfci + ifci;
+ Assert(pfci->pffaceRegular == NULL);
+ Assert(pfci->pffaceBold == NULL);
+ Assert(pfci->pffaceItalic == NULL);
+ Assert(pfci->pffaceBI == NULL);
+ }
+#endif // _DEBUG
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the flush mode on the cache to indicate whether or not it should be deleted when
+ it becomes empty.
+----------------------------------------------------------------------------------------------*/
+void FontCache::SetFlushMode(int flush)
+{
+ m_flush = flush;
+
+ if (m_flush == kflushAuto)
+ {
+ // Delete any font faces that have no remaining corresponding fonts.
+ // Work backwards so as we remove items the loop still works.
+ for (int ifci = m_cfci; --ifci >= 0; )
+ {
+ CacheItem * pfci = m_prgfci + ifci;
+ if (pfci->pffaceRegular && pfci->pffaceRegular->NoFonts())
+ RemoveFontFace(pfci->szFaceName, false, false, false);
+ if (pfci->pffaceBold && pfci->pffaceBold->NoFonts())
+ RemoveFontFace(pfci->szFaceName, true, false, false);
+ if (pfci->pffaceItalic && pfci->pffaceItalic->NoFonts())
+ RemoveFontFace(pfci->szFaceName, false, true, false);
+ if (pfci->pffaceBI && pfci->pffaceBI->NoFonts())
+ RemoveFontFace(pfci->szFaceName, true, true, false);
+ }
+
+ if (m_cfface <= 0)
+ FontFace::ZapFontCache();
+ }
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/FontCache.h b/Build/source/libs/graphite/src/segment/FontCache.h
new file mode 100644
index 00000000000..56da5ab26b8
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/FontCache.h
@@ -0,0 +1,105 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: FontCache.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ A cache of all the font-face objects known to mankind. There is exactly one instance
+ of a FontCache.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef FONTCACHE_INCLUDED
+#define FONTCACHE_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+class FontFace;
+class FontMemoryUsage;
+
+/*----------------------------------------------------------------------------------------------
+ TODO: change from a sorted list to a hash table, if performance so requires.
+----------------------------------------------------------------------------------------------*/
+class FontCache {
+ friend class FontMemoryUsage;
+
+public:
+ FontCache()
+ {
+ m_cfci = 0;
+ m_prgfci = NULL;
+ m_cfciMax = 0;
+ m_cfface = 0;
+ m_flush = kflushAuto;
+ }
+
+ ~FontCache()
+ {
+ delete[] m_prgfci;
+ m_prgfci = NULL;
+ m_cfci = 0;
+ m_cfciMax = 0;
+ m_cfface = 0;
+ }
+
+ void Initialize()
+ {
+ m_cfci = 0;
+ m_prgfci = new CacheItem[12];
+ m_cfciMax = 12;
+ m_cfface = 0;
+ }
+
+ struct CacheItem
+ {
+ wchar_t szFaceName[32]; // type should match std::wstring
+ FontFace * pffaceRegular;
+ FontFace * pffaceBold;
+ FontFace * pffaceItalic;
+ FontFace * pffaceBI;
+ };
+
+ void GetFontFace(std::wstring strFaceName, bool fBold, bool fItalic, FontFace ** ppfface);
+ void CacheFontFace(std::wstring strFaceName, bool fBold, bool fItalic, FontFace * pfface);
+ bool RemoveFontFace(std::wstring strFaceName, bool fBold, bool fItalic, bool fZapCache = true);
+ void DeleteIfEmpty();
+ void AssertEmpty();
+
+ int GetFlushMode()
+ {
+ return m_flush;
+ }
+ void SetFlushMode(int);
+
+ // Debugging:
+ //bool DbgCheckFontCache();
+
+ void calculateMemoryUsage(FontMemoryUsage & fmu);
+
+protected:
+ int FindCacheItem(std::wstring strFaceName);
+ void InsertCacheItem(int ifci);
+
+protected:
+ // member variables;
+ int m_cfci; // number of items (font-families)
+ int m_cfciMax; // amount of space available
+ int m_cfface; // number of font-faces
+ CacheItem * m_prgfci;
+
+ int m_flush;
+};
+
+} // namespace gr
+
+
+#endif // !FONTCACHE_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/FontFace.cpp b/Build/source/libs/graphite/src/segment/FontFace.cpp
new file mode 100644
index 00000000000..45461fe63ac
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/FontFace.cpp
@@ -0,0 +1,598 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrEngine.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description: Contains the implementation of the FontFace class.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+#include <functional>
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+// any other headers (not precompiled)
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+FontCache * FontFace::s_pFontCache = 0;
+
+//:>********************************************************************************************
+//:> New interface
+//:>********************************************************************************************
+/*----------------------------------------------------------------------------------------------
+ Return the appropriate FontFace, initialized with Graphite tables.
+ Called from the font constructor.
+----------------------------------------------------------------------------------------------*/
+FontFace * FontFace::GetFontFace(Font * pfont,
+ std::wstring strFaceName, bool fBold, bool fItalic,
+ bool fDumbFallback)
+{
+ if (s_pFontCache == NULL)
+ s_pFontCache = new FontCache;
+
+ FontFace * pfface;
+ s_pFontCache->GetFontFace(strFaceName, fBold, fItalic, &pfface);
+ if (pfface)
+ return pfface;
+
+ // Create a new font face.
+ pfface = new FontFace();
+ pfface->InitFontFace(pfont, strFaceName, fBold, fItalic, fDumbFallback);
+ return pfface;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the engine using the given Graphite font.
+----------------------------------------------------------------------------------------------*/
+GrResult FontFace::InitFontFace(Font * pfont,
+ std::wstring stuFaceName, bool fBold, bool fItalic,
+ bool fDumbFallback)
+{
+ AssertPtrN(pfont);
+
+ m_pgreng = new GrEngine;
+ m_pgreng->m_pfface = this;
+
+ m_pgreng->m_nScriptTag = 0; // not currently used, but set it to something
+
+ std::wstring stuFeatures;
+
+ //stuFeatures = stuFeaturesArg;
+
+ if (wcscmp(stuFaceName.c_str(), m_pgreng->m_stuFaceName.c_str()) != 0)
+ {
+ s_pFontCache->RemoveFontFace(m_pgreng->FaceName(), m_pgreng->Bold(), m_pgreng->Italic());
+
+ m_pgreng->DestroyEverything(); // nothing we've cached is safe or useful.
+ m_pgreng->m_stuFaceName = stuFaceName; // if this is buggy, using assign might fix it
+ }
+
+ //GrResult res = kresFail;
+//#ifdef GR_FW
+// // Read from the control file indicated by the registry, if any.
+// std::wstring stuFaceNameTmp;
+// stuFaceNameTmp.assign(rgchFaceName, wcslen(rgchFaceName));
+// res = InitFromControlFile(pfont, stuFaceName.c_str(), fBold, fItalic);
+//#endif // GR_FW
+
+ // Read directly from the font.
+ m_pgreng->DestroyContents();
+ GrResult res = kresUnexpected;
+ try {
+ res = m_pgreng->ReadFontTables(pfont, fItalic);
+ }
+ catch (...)
+ {
+ if (fDumbFallback && m_pgreng->DumbFallback() && !m_pgreng->BadFont())
+ {
+ // If we have a basically good font but can't do Graphite,
+ // just go with empty tables, which should be set up.
+ res = m_pgreng->m_resFontRead;
+ }
+ else
+ {
+ if (m_cfonts == 0)
+ {
+ //s_pFontCache->DeleteIfEmpty();
+ //Assert(s_pFontCache == 0);
+ delete this; // will also delete GrEngine
+ }
+ else
+ {
+ delete m_pgreng;
+ }
+ m_pgreng = NULL;
+ throw; // throw original exception
+ }
+ }
+
+ m_pgreng->m_resFontValid = res;
+
+ m_pgreng->m_fBold = fBold;
+ m_pgreng->m_fItalic = fItalic;
+
+ s_pFontCache->CacheFontFace(m_pgreng->FaceName(), fBold, fItalic, this);
+
+ return m_pgreng->m_resFontValid;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the cmap and Graphite tables from the font that is selected into the graphics
+ device.
+
+ @return A GrResult indicating whether we were successful in loading the Graphite font:
+ - kresOk means success
+ - kresFail means the Graphite font could not be found or the basic font tables
+ (head, name, cmap) could not be loaded
+ - kresUnexpected means the Graphite tables could not be loaded
+ - kresFalse means it is not a Graphite font at all (has no Silf table).
+----------------------------------------------------------------------------------------------*/
+GrResult GrEngine::ReadFontTables(Font * pfont, bool fItalic)
+{
+ GrResult res = kresOk;
+ m_ferr = kferrOkay;
+ GrBufferIStream grstrm;
+
+ FontException fexptn;
+ fexptn.version = -1;
+ fexptn.subVersion = -1;
+
+ bool fOk = false;
+
+ const void * pHeadTbl; const void * pSileTbl; const void * pSilfTbl;
+ const void * pFeatTbl; const void * pGlatTbl; const void * pGlocTbl; const void * pSillTbl;
+ //const void * pCmapTbl; const void * pNameTbl;
+ size_t cbHeadSz, cbSilfSz, cbFeatSz, cbGlatSz, cbGlocSz, cbSillSz;
+ //size_t cbCmapSz, cbSileSz, cbNameSz;
+
+ m_fFakeItalic = false;
+
+ bool fBasicTables = false;
+ bool fSilf = false; // does the font have some sort of Silf table?
+ int nCheckSum = 0;
+
+ bool fBadBase = false,
+ fMismatchedBase = false,
+ fFontIsItalic = false;
+
+ // First read the head table. This gives us the checksum that we are using as a
+ // unique identifer. If it is the same as the one stored, and things appear set up,
+ // don't reload the tables.
+ res = (pHeadTbl = pfont->getTable(TtfUtil::TableIdTag(ktiHead), &cbHeadSz)) ? kresOk : kresFail;
+ fOk = pHeadTbl && (cbHeadSz == 0 || TtfUtil::CheckTable(ktiHead, pHeadTbl, cbHeadSz));
+ if (res == kresFail)
+ {
+ m_stuInitError = L"could not locate head table for Graphite rendering";
+ m_ferr = kferrFindHeadTable;
+ goto LUnexpected;
+ }
+ if (!fOk)
+ {
+ m_stuInitError = L"could not read design units for Graphite rendering";
+ m_ferr = kferrReadDesignUnits;
+ goto LUnexpected;
+ }
+ m_mFontEmUnits = TtfUtil::DesignUnits(pHeadTbl);
+ nCheckSum = TtfUtil::HeadTableCheckSum(pHeadTbl);
+ fFontIsItalic = TtfUtil::IsItalic(pHeadTbl);
+
+ if (m_nFontCheckSum == nCheckSum && m_ptman)
+ return m_resFontRead; // already initialized in some form
+
+ DestroyContents();
+
+ Assert(!m_ptman);
+ Assert(!m_pctbl);
+ Assert(!m_pgtbl);
+ Assert(!m_prgpsd);
+ m_prgpsd = NULL;
+ m_cpsd = 0;
+
+ m_ptman = new GrTableManager(this);
+
+ m_fFakeItalic = (fItalic && !fFontIsItalic);
+
+ // Look for an Sile table. If there is one, this is an extension font containing only
+ // the Graphite tables. Read the base font name out of the Sile table, and use it to
+ // read the cmap. Then replace the original font name to read the Graphite tables.
+
+ m_fUseSepBase = false;
+ m_stuBaseFaceName.erase();
+
+ // TODO: rework the handling of the Sile table.
+ pSileTbl = NULL;
+ //pSileTbl = pfont->getTable(TtfUtil::TableIdTag(ktiSile));
+ //if (pSileTbl)
+ //{
+ // pgg->get_FontCharProperties(&chrpOriginal);
+ // grstrm.OpenBuffer(pSileTbl, sile_tbl.size());
+ // m_fUseSepBase = ReadSileTable(pgg, grstrm, 0, &m_mFontEmUnits, &fMismatchedBase);
+ // grstrm.Close();
+
+ // if (!m_fUseSepBase)
+ // {
+ // SwitchGraphicsFont(pgg, false); // back to Graphite table font
+ // m_stuBaseFaceName.erase();
+ // fBadBase = true;
+ // m_fUseSepBase = false;
+ // }
+ // // Otherwise leave the GrGraphics in a state to read from the base font.
+ //}
+
+ // We don't need the offset table, and there's no way to get it anyway
+ // without a font file.
+
+ // cmap and name
+ Assert(!m_fCmapTblCopy);
+ Assert(!m_fNameTblCopy);
+ fOk = SetCmapAndNameTables(pfont);
+ if (!fOk)
+ {
+ goto LUnexpected;
+ }
+
+ fBasicTables = true;
+
+ // If we have a bad base file, don't do Graphite stuff.
+ if (fBadBase || fMismatchedBase)
+ goto LUnexpected;
+
+ /****
+ Obtain font name from InitNew() now instead of reading from font file. InitNew should
+ should have a correct font name passed to it since it should come from a font registered
+ by GrFontInst.exe. This commented code could be use to verify name in font file matches.
+ NOTE: if we ever use this code again, make sure we're using the base font name table,
+ not the Graphite wrapper font name table.
+ // find the font family name
+ if (!TtfUtil::Get31EngFamilyInfo(vbName.Begin(), lnNameOff, lnNameSz))
+ { // use Name table which is Symbol encode instead
+ // this could cause problems if a real Symbol writing system is used in the name table
+ // however normally real Unicode values are used instead a Symbol writing system
+ if (!TtfUtil::Get30EngFamilyInfo(vbName.Begin(), lnNameOff, lnNameSz))
+ {
+ ReturnResult(kresFail);
+ }
+ // test for Symbol writing system. first byte of Unicode id should be 0xF0
+ if (vbName[lnNameOff + 1] == (unsigned char)0xF0) // 1 - Unicode id is big endian
+ ReturnResult(kresFail);
+ }
+ if (!TtfUtil::SwapWString(vbName.Begin() + lnNameOff, lnNameSz / isizeof(utf16)))
+ ReturnResult(kresFail);
+
+ m_stuFaceName = std::wstring((utf16 *)(vbName.begin() + lnNameOff), lnNameSz / isizeof(utf16));
+ ****/
+
+ // Silf
+ res = (pSilfTbl = pfont->getTable(TtfUtil::TableIdTag(ktiSilf), &cbSilfSz)) ? kresOk : kresFail;
+ fOk = pSilfTbl && (cbSilfSz == 0 || TtfUtil::CheckTable(ktiSilf, pSilfTbl, cbSilfSz));
+ if (!fOk)
+ {
+ m_stuInitError = L"could not load Silf table for Graphite rendering";
+ m_ferr = kferrLoadSilfTable;
+ goto LUnexpected;
+ }
+
+ // Feat
+ res = (pFeatTbl = pfont->getTable(TtfUtil::TableIdTag(ktiFeat), &cbFeatSz)) ? kresOk : kresFail;
+ fOk = pFeatTbl && (cbFeatSz == 0 || TtfUtil::CheckTable(ktiFeat, pFeatTbl, cbFeatSz));
+ if (!fOk)
+ {
+ // TODO: just create an empty set of features, since this is not disastrous.
+ m_stuInitError = L"could not load Feat table for Graphite rendering";
+ m_ferr = kferrLoadFeatTable;
+ goto LUnexpected;
+ }
+
+ // Glat
+ res = (pGlatTbl = pfont->getTable(TtfUtil::TableIdTag(ktiGlat), &cbGlatSz)) ? kresOk : kresFail;
+ fOk = pGlatTbl && (cbGlatSz == 0 || TtfUtil::CheckTable(ktiGlat, pGlatTbl, cbGlatSz));
+ if (!fOk)
+ {
+ m_stuInitError = L"could not load Glat table for Graphite rendering";
+ m_ferr = kferrLoadGlatTable;
+ goto LUnexpected;
+ }
+
+ // Gloc
+ res = (pGlocTbl = pfont->getTable(TtfUtil::TableIdTag(ktiGloc), &cbGlocSz)) ? kresOk : kresFail;
+ fOk = pGlocTbl && (cbGlocSz == 0 || TtfUtil::CheckTable(ktiGloc, pGlocTbl, cbGlocSz));
+ if (!fOk)
+ {
+ m_stuInitError = L"could not load Gloc table for Graphite rendering";
+ m_ferr = kferrLoadGlocTable;
+ goto LUnexpected;
+ }
+
+ // Sill
+ try {
+ res = (pSillTbl = pfont->getTable(TtfUtil::TableIdTag(ktiSill), &cbSillSz)) ? kresOk : kresFail;
+ fOk = pSillTbl && (cbSillSz == 0 || TtfUtil::CheckTable(ktiSill, pSillTbl, cbSillSz));
+ }
+ catch (...)
+ {
+ fOk = true;
+ pSillTbl = NULL;
+ }
+ // if table couldn't be loaded, this is not disastrous.
+
+// ibGlocStart = cbGlatTbl;
+ fOk = CheckTableVersions(&grstrm,
+ (byte *)pSilfTbl, 0,
+ (byte *)pGlocTbl, 0,
+ (byte *)pFeatTbl, 0,
+ &m_fxdBadVersion);
+ if (!fOk)
+ {
+// wchar_t rgch1[50];
+// wchar_t rgch2[50];
+//#if defined(_WIN32)
+// // This version does not work in Windows, in spite of being documented:
+// // swprintf(rgch, 50, L"%d", (m_fxdBadVersion >> 16));
+// // Removing the size argument make it work.
+// swprintf(rgch1, L"%d", (m_fxdBadVersion >> 16));
+// swprintf(rgch2, L"%d", (m_fxdBadVersion & 0x0000FFFF));
+//#else
+// swprintf(rgch1, 50, L"%d", (m_fxdBadVersion >> 16));
+// swprintf(rgch2, 50, L"%d", (m_fxdBadVersion & 0x0000FFFF));
+//#endif
+ char rgch[50]; // more than enough space to print two 16-bit ints
+ char *pch = &rgch[0];
+ sprintf(rgch, "%d.%d", (m_fxdBadVersion >> 16), (m_fxdBadVersion & 0x0000FFFF));
+ std::wstring stu = L"unsupported version (";
+ //stu.append(rgch1);
+ //stu.append(L".");
+ //stu.append(rgch2);
+ while (*pch != 0)
+ stu.push_back((wchar_t)*pch++);
+ stu.append(L") of Graphite tables");
+ m_stuInitError.assign(stu.c_str());
+ m_ferr = kferrBadVersion;
+ goto LUnexpected;
+ }
+
+ try
+ {
+ // Parse the "Silf" table.
+ grstrm.OpenBuffer((byte*)pSilfTbl, cbSilfSz);
+ int chwGlyphIDMax, fxdVersion;
+ bool f = ReadSilfTable(grstrm, 0, 0, &chwGlyphIDMax, &fxdVersion);
+ grstrm.Close();
+ if (!f)
+ {
+ m_ferr = kferrReadSilfTable;
+ fexptn.errorCode = m_ferr;
+ throw fexptn;
+ }
+
+ // Parse the "Gloc" and "Glat" tables.
+ {
+ GrBufferIStream grstrmGlat;
+
+ grstrm.OpenBuffer((byte *)pGlocTbl, cbGlocSz);
+ grstrmGlat.OpenBuffer((byte *)pGlatTbl, cbGlatSz);
+ f = ReadGlocAndGlatTables(grstrm, 0, grstrmGlat, 0, chwGlyphIDMax, fxdVersion);
+ grstrm.Close();
+ grstrmGlat.Close();
+ if (!f)
+ {
+ m_ferr = kferrReadGlocGlatTable;
+ fexptn.errorCode = m_ferr;
+ throw fexptn;
+ }
+ }
+
+ // Parse the "Feat" table.
+ grstrm.OpenBuffer((byte *)pFeatTbl, cbFeatSz);
+ f = ReadFeatTable(grstrm, 0);
+ grstrm.Close();
+ if (!f)
+ {
+ m_ferr = kferrReadFeatTable;
+ fexptn.errorCode = m_ferr;
+ throw fexptn;
+ }
+
+ // Parse the "Sill" table.
+ if (pSillTbl)
+ {
+ grstrm.OpenBuffer((byte *)pSillTbl, cbFeatSz);
+ f = ReadSillTable(grstrm, 0);
+ grstrm.Close();
+ if (!f)
+ {
+ m_ferr = kferrReadSillTable;
+ fexptn.errorCode = m_ferr;
+ throw fexptn;
+ }
+ }
+ else
+ m_langtbl.CreateEmpty();
+ }
+ catch (...)
+ {
+ fSilf = false;
+ m_resFontRead = kresUnexpected;
+ try {
+ DestroyContents(false);
+ }
+ catch (...)
+ {}
+ goto LUnexpected;
+ }
+
+ m_stuErrCtrlFile.erase();
+ m_nFontCheckSum = nCheckSum;
+ m_resFontRead = kresOk;
+ m_ferr = kferrOkay;
+ ReturnResult(kresOk);
+
+LUnexpected:
+ // Don't do this, because it is possible to use a base font with an empty Graphite
+ // engine:
+ //if (m_fUseSepBase || m_stuBaseFaceName.Length() > 0)
+ //{
+ // SwitchGraphicsFont(pgg, false); // back to Graphite table font
+ // m_stuBaseFaceName.erase();
+ // m_fUseSepBase = false;
+ //}
+
+ CreateEmpty();
+ m_nFontCheckSum = nCheckSum;
+ if (!fBasicTables)
+ m_resFontRead = kresFail; // bad font
+ else if (!fSilf)
+ m_resFontRead = kresFalse; // no Silf table--not a Graphite font
+ else
+ m_resFontRead = kresUnexpected; // couldn't read the Graphite tables
+
+ fexptn.errorCode = m_ferr;
+ fexptn.version = m_fxdBadVersion >> 16;
+ fexptn.subVersion = m_fxdBadVersion & 0x0000FFFF;
+ throw fexptn;
+
+ ReturnResult(m_resFontRead);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the cmap and name tables.
+
+ This is called from two places. One is when we first initialize the engine. Also, if the
+ font tables have not been actually copied from the font, they may have been deleted
+ when the font was deleted. So when reusing the engine, set them to something valid based
+ on the current font.
+----------------------------------------------------------------------------------------------*/
+bool GrEngine::SetCmapAndNameTables(Font * pfont)
+{
+ GrResult res = kresOk;
+ bool fOk;
+ const void * pCmapTbl;
+ const void * pNameTbl;
+ size_t cbCmapSz, cbNameSz;
+
+ // cmap
+ if (!m_fCmapTblCopy)
+ {
+ res = (pCmapTbl = pfont->getTable(TtfUtil::TableIdTag(ktiCmap), &cbCmapSz)) ? kresOk : kresFail;
+ fOk = pCmapTbl && (cbCmapSz == 0 || TtfUtil::CheckTable(ktiCmap, pCmapTbl, cbCmapSz));
+ if (!fOk)
+ {
+ m_stuInitError = L"could not locate cmap table";
+ m_ferr = kferrFindCmapTable;
+ return false;
+ }
+
+ if (pCmapTbl && cbCmapSz > 0)
+ {
+ // Make a private copy of the cmap for the engine's use.
+ m_pCmapTbl = new byte[cbCmapSz];
+ std::copy(reinterpret_cast<const byte*>(pCmapTbl),
+ reinterpret_cast<const byte*>(pCmapTbl) + cbCmapSz, m_pCmapTbl);
+ m_fCmapTblCopy = true;
+ m_cbCmapTbl = cbCmapSz;
+ }
+ else
+ {
+ m_pCmapTbl = const_cast<byte*>(reinterpret_cast<const byte*>(pCmapTbl));
+ m_fCmapTblCopy = false;
+ }
+
+ // MS Unicode cmap
+ m_pCmap_3_1 = TtfUtil::FindCmapSubtable(m_pCmapTbl, 3, 1);
+ m_pCmap_3_10 = TtfUtil::FindCmapSubtable(m_pCmapTbl, 3, 10);
+ if (!m_pCmap_3_1)
+ m_pCmap_3_1 = TtfUtil::FindCmapSubtable(m_pCmapTbl, 3, 0);
+ if (!m_pCmap_3_1)
+ {
+ m_stuInitError = L"failure to load cmap subtable";
+ m_ferr = kferrLoadCmapSubtable;
+ return false;
+ }
+ if (!TtfUtil::CheckCmap31Subtable(m_pCmap_3_1))
+ {
+ m_stuInitError = L"checking cmap subtable failed";
+ m_ferr = kferrCheckCmapSubtable;
+ return false;
+ }
+ }
+ else
+ {
+ Assert(m_pCmapTbl);
+ }
+
+ // name table - eventually need feature label strings
+
+ // Currently the only stuff we're getting from the name table are our feature names,
+ // so use the version from the Graphite font (not the base font if any).
+ //////if (m_fUseSepBase)
+ ////// pgg->SetupGraphics(&chrpOriginal);
+
+ if (!m_fNameTblCopy)
+ {
+ res = (pNameTbl = (byte *)pfont->getTable(TtfUtil::TableIdTag(ktiName), &cbNameSz)) ? kresOk : kresFail;
+ fOk = pNameTbl && (cbNameSz == 0 || TtfUtil::CheckTable(ktiName, pNameTbl, cbNameSz));
+ if (!fOk)
+ {
+ m_stuInitError = L"could not locate name table";
+ m_ferr = kferrFindNameTable;
+ return false;
+ }
+
+ if (pNameTbl && cbNameSz > 0)
+ {
+ // Make a private copy of the name table for the engine's use.
+ m_pNameTbl = new byte[cbNameSz];
+ std::copy(reinterpret_cast<const byte*>(pNameTbl),
+ reinterpret_cast<const byte*>(pNameTbl) + cbNameSz, m_pNameTbl);
+ m_fNameTblCopy = true;
+ m_cbNameTbl = cbNameSz;
+ }
+ else
+ {
+ m_pNameTbl = const_cast<byte*>(reinterpret_cast<const byte*>(pNameTbl));
+ m_fNameTblCopy = false;
+ }
+ }
+ else
+ {
+ Assert(m_pNameTbl);
+ }
+
+ return true;
+}
+
+
+//void FontFace::DbgCheckFontFace()
+//{
+// Assert(m_cfonts < 5000);
+// Assert(m_cfonts >= 0);
+// wchar_t chw0 = m_pgreng->m_stuFaceName[0];
+// Assert(chw0 >= 0x0040); // A
+// Assert(chw0 <= 0x007A); // z
+//}
+
+} // namespace gr
+
+//:End Ignore
diff --git a/Build/source/libs/graphite/src/segment/FontFace.h b/Build/source/libs/graphite/src/segment/FontFace.h
new file mode 100644
index 00000000000..7f2684a5908
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/FontFace.h
@@ -0,0 +1,246 @@
+/*--------------------------------------------------------------------
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: FontFace.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Contains the definition of the FontFace class.
+ TODO: Merge with GrEngine.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef FONTFACE_INCLUDED
+#define FONTFACE_INCLUDED
+#include <limits>
+
+#ifdef _MSC_VER
+#include <crtdbg.h>
+#endif
+
+namespace gr
+{
+
+class IGrJustifier;
+class Segment;
+
+
+/*----------------------------------------------------------------------------------------------
+ The GrEngine serves as the top level object that knows how to run Graphite tables
+ and generate Graphite segments.
+
+ Primarily, this class implements IRenderEngine, which allows it to serve as a FW
+ rendering engine. It also implements ISimpleInit, a general interface for initializing
+ using a string. Finally, it implements ITraceControl, a very simple interface which
+ allows a client to flip a flag indicating whether or not we want to output a log of
+ the Graphite transduction process.
+
+ Hungarian: greng
+----------------------------------------------------------------------------------------------*/
+class FontFace
+{
+ friend class gr::FontMemoryUsage;
+
+public:
+ FontFace()
+ {
+ m_cfonts = 0;
+ }
+
+ ~FontFace()
+ {
+ if (s_pFontCache)
+ s_pFontCache->RemoveFontFace(m_pgreng->FaceName(), m_pgreng->Bold(), m_pgreng->Italic());
+ delete m_pgreng;
+ }
+
+ void IncFontCount()
+ {
+ m_cfonts++;
+ }
+ void DecFontCount()
+ {
+ m_cfonts--;
+ if (m_cfonts <= 0 && (s_pFontCache == NULL || s_pFontCache->GetFlushMode() == kflushAuto))
+ delete this;
+ }
+
+ bool NoFonts()
+ {
+ return (m_cfonts <= 0);
+ }
+
+ static FontFace * GetFontFace(Font * pfont,
+ std::wstring strFaceName, bool fBold, bool fItalic,
+ bool fDumbFallback = false);
+
+ GrResult InitFontFace(Font * pfont,
+ std::wstring stuFaceName, bool fBold, bool fItalic,
+ bool fDumbLayout);
+
+ FontErrorCode IsValidForGraphite(int * pnVersion, int * pnSubVersion)
+ {
+ return m_pgreng->IsValidForGraphite(pnVersion, pnSubVersion);
+ }
+
+ static void ZapFontCache()
+ {
+ if (s_pFontCache)
+ {
+ s_pFontCache->AssertEmpty();
+ delete s_pFontCache;
+ }
+ s_pFontCache = NULL;
+ }
+
+ static void SetFlushMode(int flush)
+ {
+ if (s_pFontCache == NULL)
+ s_pFontCache = new FontCache;
+ s_pFontCache->SetFlushMode(flush);
+ }
+ static int GetFlushMode()
+ {
+ if (s_pFontCache == NULL)
+ s_pFontCache = new FontCache;
+ return s_pFontCache->GetFlushMode();
+ }
+
+ // Temporary, until interface gets thoroughly reworked:
+ GrEngine * GraphiteEngine()
+ {
+ return m_pgreng;
+ }
+
+ // Feature access:
+ size_t NumberOfFeatures()
+ {
+ return m_pgreng->NumberOfFeatures_ff();
+ }
+ featid FeatureID(size_t ifeat)
+ {
+ return m_pgreng->FeatureID_ff(ifeat);
+ }
+ size_t FeatureWithID(featid id)
+ {
+ return m_pgreng->FeatureWithID_ff(id);
+ }
+ bool GetFeatureLabel(size_t ifeat, lgid language, utf16 * label)
+ {
+ return m_pgreng->GetFeatureLabel_ff(ifeat, language, label);
+ }
+ int GetFeatureDefault(size_t ifeat) // index of default setting
+ {
+ return m_pgreng->GetFeatureDefault_ff(ifeat);
+ }
+ size_t NumberOfSettings(size_t ifeat)
+ {
+ return m_pgreng->NumberOfSettings_ff(ifeat);
+ }
+ int GetFeatureSettingValue(size_t ifeat, size_t ifset)
+ {
+ return m_pgreng->GetFeatureSettingValue_ff(ifeat, ifset);
+ }
+ bool GetFeatureSettingLabel(size_t ifeat, size_t ifset, lgid language, utf16 * label)
+ {
+ return m_pgreng->GetFeatureSettingLabel_ff(ifeat, ifset, language, label);
+ }
+ // Feature-label language access:
+ size_t NumberOfFeatLangs()
+ {
+ return m_pgreng->NumberOfFeatLangs_ff();
+ }
+ short FeatLabelLang(int ilang)
+ {
+ return m_pgreng->GetFeatLabelLang_ff(ilang);
+ }
+ // Language access:
+ size_t NumberOfLanguages()
+ {
+ return m_pgreng->NumberOfLanguages_ff();
+ }
+ isocode LanguageCode(size_t ilang)
+ {
+ return m_pgreng->GetLanguageCode_ff(ilang);
+ }
+
+ // Script Direction access:
+ ScriptDirCode ScriptDirection() const throw()
+ {
+ unsigned int script_dirs = 0;
+ OLECHAR err_dummy = 0;
+ m_pgreng->get_ScriptDirection(&script_dirs, &err_dummy, 1);
+ return ScriptDirCode(script_dirs);
+ }
+
+ bool BadFont(FontErrorCode * pferr = NULL)
+ {
+ return m_pgreng->BadFont(pferr);
+ }
+ bool DumbFallback(FontErrorCode * pferr = NULL)
+ {
+ return m_pgreng->DumbFallback(pferr);
+ }
+
+public:
+ // For use in segment creation:
+ void RenderLineFillSegment(Segment * pseg, Font * pfont, ITextSource * pts,
+ LayoutEnvironment & layout,
+ toffset ichStart, toffset ichStop, float xsMaxWidth, bool fBacktracking)
+ {
+ m_pgreng->MakeSegment(pseg, pfont, pts, NULL, layout,
+ ichStart, ichStop, xsMaxWidth, fBacktracking, false, 0, kestMoreLines);
+ }
+ void RenderRangeSegment(Segment * pseg, Font * pfont,
+ ITextSource * pts, LayoutEnvironment & layout,
+ toffset ichStart, toffset ichStop)
+ {
+ m_pgreng->MakeSegment(pseg, pfont, pts, NULL, layout,
+ ichStart, ichStop, kPosInfFloat, false, false, 0, kestMoreLines);
+ }
+ void RenderJustifiedSegment(Segment * pseg, Font * pfont,
+ ITextSource * pts, LayoutEnvironment & layout,
+ toffset ichStart, toffset ichStop, float xsCurrentWidth, float xsDesiredWidth)
+ {
+ m_pgreng->MakeSegment(pseg, pfont, pts, NULL, layout,
+ ichStart, ichStop, xsCurrentWidth, false, true, xsDesiredWidth, kestMoreLines);
+ }
+
+ // Debugging.
+ //static bool DbgCheckFontCache()
+ //{
+ // if (s_pFontCache)
+ // return s_pFontCache->DbgCheckFontCache();
+ // else
+ // return true;
+ //}
+ //void DbgCheckFontFace();
+
+ static void calculateAllMemoryUsage(FontMemoryUsage & fmu);
+ void calculateMemoryUsage(FontMemoryUsage & fmu);
+
+protected:
+ // Number of fonts in existence that use this face; when it goes to zero, delete.
+ int m_cfonts;
+
+ // Static variable:
+ static FontCache * s_pFontCache;
+
+ // Member variables:
+ GrEngine * m_pgreng;
+};
+
+} // namespace gr
+
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+
+#endif // !FONTFACE_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/GrCharStream.cpp b/Build/source/libs/graphite/src/segment/GrCharStream.cpp
new file mode 100644
index 00000000000..20b5a46ab76
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrCharStream.cpp
@@ -0,0 +1,652 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrCharStream.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Implements the GrCharStream class.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Constructor.
+----------------------------------------------------------------------------------------------*/
+GrCharStream::GrCharStream(ITextSource * pgts, int ichrMin, int ichrLim,
+ bool fStartLine, bool fEndLine)
+ : m_pgts(pgts),
+ m_ichrMin(ichrMin),
+ m_ichrLim(ichrLim),
+ m_ichrPos(ichrMin),
+ m_fStartLine(fStartLine),
+ m_fEndLine(fEndLine),
+ m_cchrBackedUp(0),
+ m_ichrRunMin(0),
+ m_ichrRunLim(0),
+ m_ichlRunOffset(kPosInfinity),
+ m_ichrRunOffset(kPosInfinity)
+{
+ #if 0 // ??? surely m_cnRunMax and m_prgnRunText are undefined at this point
+ if (m_cchlRunMax > -1)
+ delete[] m_prgchlRunText;
+ #endif
+ m_cchlRunMax = -1;
+ m_prgchlRunText = NULL;
+
+ m_vislotNextChunkMap.clear();
+
+ m_utf = m_pgts->utfEncodingForm();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Restart the stream when an error has a occurred and we need to fall back to dumb rendering.
+----------------------------------------------------------------------------------------------*/
+void GrCharStream::Restart()
+{
+ if (m_cchlRunMax > -1)
+ delete[] m_prgchlRunText;
+
+ m_ichrPos = m_ichrMin;
+ m_cchrBackedUp = 0;
+ m_ichrRunMin = 0;
+ m_ichrRunLim = 0;
+ m_ichlRunOffset = kPosInfinity;
+ m_ichrRunOffset = kPosInfinity;
+
+ m_cchlRunMax = -1;
+ m_prgchlRunText = NULL;
+
+ m_vislotNextChunkMap.clear();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the next character from the stream.
+
+ @param pichwSegOffset - index of this character from the beginning of the segment
+ @param pcchRaw - number of raw (UTF-16 or UTF-8) chars consumed to get one complete
+ Unicode codepoint.
+----------------------------------------------------------------------------------------------*/
+int GrCharStream::NextGet(GrTableManager * ptman,
+ GrFeatureValues * pfval, int * pichrSegOffset, int * pcchr)
+{
+ if (AtEnd())
+ {
+ Assert(m_ichrPos == m_ichrLim);
+ return 0;
+ }
+
+ int m_ichrMinBackedUp = m_ichrMin - m_cchrBackedUp;
+
+ if ((m_ichrRunOffset + m_ichrRunMin) >= m_ichrRunLim)
+ {
+ // Get the next run of characters
+
+ std::pair<toffset, toffset> pairRange = m_pgts->propertyRange(m_ichrPos);
+ m_ichrRunMin = pairRange.first;
+ m_ichrRunLim = pairRange.second;
+
+ // The only time the run extends before what we want is on the first run.
+ Assert((m_ichrRunMin == m_ichrPos) // m_ichwPos is beginning of run
+ || (m_ichrPos == m_ichrMinBackedUp)); // first run
+ // Pretend like the run starts where we need it:
+ m_ichrRunMin = max(m_ichrRunMin, m_ichrMinBackedUp);
+ Assert(m_ichrRunMin == m_ichrPos);
+
+ if (m_cchlRunMax != -1 && m_cchlRunMax < m_ichrRunLim - m_ichrRunMin)
+ {
+ // Text buffer is too small: delete it and create a new one.
+ delete[] m_prgchlRunText;
+ m_cchlRunMax = -1;
+ }
+
+ if (m_cchlRunMax == -1)
+ {
+ // Note that combining surrogates or UTF-8 will always result in the same or fewer
+ // number of characters needed in m_prgchlRunText, so the following is safe:
+ m_cchlRunMax = m_ichrRunLim - m_ichrRunMin;
+ m_prgchlRunText = new int[m_cchlRunMax];
+ }
+
+ utf32 * prgchlRunText32 = NULL;
+ utf16 * prgchwRunText16 = NULL;
+ utf8 * prgchsRunText8 = NULL;
+
+ int cchGot;
+ switch (m_utf)
+ {
+ case kutf8:
+ prgchsRunText8 = new utf8[m_ichrRunLim - m_ichrRunMin];
+ cchGot = m_pgts->fetch(m_ichrRunMin, m_ichrRunLim - m_ichrRunMin, prgchsRunText8);
+ break;
+ case kutf16:
+ prgchwRunText16 = new utf16[m_ichrRunLim - m_ichrRunMin];
+ cchGot = m_pgts->fetch(m_ichrRunMin, m_ichrRunLim - m_ichrRunMin, prgchwRunText16);
+ break;
+ default:
+ Assert(false);
+ // Assume UTF-32: fall through
+ case kutf32:
+ prgchlRunText32 = new utf32[m_ichrRunLim - m_ichrRunMin];
+ cchGot = m_pgts->fetch(m_ichrRunMin, m_ichrRunLim - m_ichrRunMin, prgchlRunText32);
+ break;
+ }
+
+ int ichlUtf32 = 0;
+ for (int ichr = 0; ichr < m_ichrRunLim - m_ichrRunMin; ichr++)
+ {
+ if (ichr == m_ichrPos - m_ichrRunMin)
+ {
+ m_ichrRunOffset = ichr;
+ m_ichlRunOffset = ichlUtf32;
+ }
+ Assert(m_ichrRunOffset != kPosInfinity || ichr < m_ichrPos - m_ichrRunMin);
+
+ int cchrUsed;
+ switch (m_utf)
+ {
+ case kutf8:
+ m_prgchlRunText[ichlUtf32] = Utf8ToUtf32(prgchsRunText8 + ichr,
+ m_ichrRunLim - m_ichrRunMin - ichr, &cchrUsed);
+ break;
+ case kutf16:
+ m_prgchlRunText[ichlUtf32] = Utf16ToUtf32(prgchwRunText16 + ichr,
+ m_ichrRunLim - m_ichrRunMin - ichr, &cchrUsed);
+ break;
+ default:
+ Assert(false);
+ // Assume UTF-32: fall through
+ case kutf32:
+ m_prgchlRunText[ichlUtf32] = prgchlRunText32[ichlUtf32];
+ cchrUsed = 1;
+ break;
+ }
+
+ m_vislotNextChunkMap.push_back(ichlUtf32);
+ for (int i = 1; i < cchrUsed; i++)
+ m_vislotNextChunkMap.push_back(-1);
+ ichr += cchrUsed - 1;
+ ichlUtf32++;
+ }
+ delete[] prgchlRunText32;
+ delete[] prgchwRunText16;
+ delete[] prgchsRunText8;
+
+ while (m_ichrLim - m_ichrRunMin < signed(m_vislotNextChunkMap.size())
+ && m_vislotNextChunkMap[m_ichrLim - m_ichrRunMin] == -1)
+ {
+ // Invalid surrogate boundary; this is really a bug in the application program,
+ // but adjust here to avoid a crash!
+ m_ichrLim--;
+ }
+
+ SetUpFeatureValues(ptman, m_ichrPos);
+
+ Assert(m_ichrRunOffset >= 0);
+ Assert(m_ichrRunOffset < m_ichrRunLim - m_ichrRunMin);
+ Assert(m_vislotNextChunkMap.size() == (unsigned) m_ichrRunLim - m_ichrMinBackedUp);
+ }
+
+ int chlRet = m_prgchlRunText[m_ichlRunOffset];
+ *pfval = m_fvalRunFeats;
+ *pichrSegOffset = m_ichrPos - m_ichrMin; // offset from the official start of the segment
+ // of the first 16-bit char
+ int ichrPosPrev = m_ichrPos;
+ ++m_ichlRunOffset;
+ do {
+ ++m_ichrPos;
+ ++m_ichrRunOffset;
+ } while (m_ichrPos - m_ichrMinBackedUp < signed(m_vislotNextChunkMap.size())
+ && m_vislotNextChunkMap[m_ichrPos - m_ichrMinBackedUp] == -1);
+
+ *pcchr = m_ichrPos - ichrPosPrev; // number of raw chars consumed
+ Assert(m_utf != kutf8 || *pcchr <= 6);
+ Assert(m_utf != kutf16 || *pcchr <= 2);
+
+ Assert(m_ichrPos == (m_ichrRunMin + m_ichrRunOffset));
+ Assert(m_ichrPos <= m_ichrLim);
+
+ /* KLUDGE for debugging
+ if (m_ichrPos == 1)
+ nRet = 0x1018;
+ else if (m_ichrPos == 2)
+ nRet = 0x1039;
+ else if (m_ichrPos == 3)
+ nRet = 0x101b;
+ else if (m_ichrPos == 4)
+ nRet = 0x1032;
+ else if (m_ichrPos == 5)
+ nRet = 0x1037;
+ else if (m_ichrPos == 6)
+ nRet = 0x1037;
+ */
+
+ return chlRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert UTF-8 to UTF-32--a single character's worth. Also pass back the number of 8-bit
+ items consumed.
+----------------------------------------------------------------------------------------------*/
+utf32 GrCharStream::Utf8ToUtf32(utf8 * prgchs, int cchs, int * pcchsUsed)
+{
+ if (cchs <= 0)
+ {
+ *pcchsUsed = 0;
+ return 0;
+ }
+
+ long chlRet = DecodeUtf8(prgchs, cchs, pcchsUsed);
+ Assert(chlRet > 0);
+ if (chlRet == -1)
+ {
+ // Some error occurred. Just treat the UTF-8 as UTF-32.
+ *pcchsUsed = 1;
+ return (utf32)prgchs[0];
+ }
+ else
+ return chlRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert UTF-16 to UTF-32--a single character's worth. Also pass back the number of 16-bit
+ items consumed.
+----------------------------------------------------------------------------------------------*/
+utf32 GrCharStream::Utf16ToUtf32(utf16 * prgchw, int cchw, int * pcchwUsed)
+{
+ if (cchw <= 0)
+ {
+ *pcchwUsed = 0;
+ return 0;
+ }
+
+ unsigned int nUtf32;
+ bool fSurrogate = FromSurrogatePair(prgchw[0], ((cchw < 2) ? 0 : prgchw[1]), &nUtf32);
+ *pcchwUsed = (fSurrogate) ? 2 : 1;
+ return (int)nUtf32;
+
+/*
+ // For testing:
+ int nCharRet;
+ if (cchw >= 2 && prgchw[0] == '^' && prgchw[1] == 'a')
+ {
+ nCharRet = 'A';
+ *pcchwUsed = 2;
+ }
+ else if (cchw >= 3 && prgchw[0] == '#' && prgchw[1] == '#' &&
+ prgchw[2] == 'B')
+ {
+ nCharRet = 'b';
+ *pcchwUsed = 3;
+ }
+ else if (cchw >= 1)
+ {
+ nCharRet = prgchw[0];
+ *pcchwUsed = 1;
+ }
+ else
+ {
+ nCharRet = 0;
+ *pcchwUsed = 0;
+ }
+ return nCharRet;
+*/
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the given position is at the boundary of a Unicode character; return false
+ if it is between two parts of pair of surrogates.
+----------------------------------------------------------------------------------------------*/
+bool GrCharStream::AtUnicodeCharBoundary(ITextSource * pgts, int ichr)
+{
+ int cchr = pgts->getLength();
+ if (ichr <= 0 || ichr >= cchr)
+ return true;
+
+ UtfType utf = pgts->utfEncodingForm();
+
+ // Note that we never need more than a handful of characters.
+ int ichrMinGet = max(0, ichr - 1);
+ int ichrLimGet = ichr + 1;
+ utf16 rgchwText16[3];
+ utf8 rgchsText8[3];
+ bool fRet;
+ switch (utf)
+ {
+ case kutf8:
+ pgts->fetch(ichrMinGet, ichrLimGet - ichrMinGet, rgchsText8);
+ fRet = AtUnicodeCharBoundary(rgchsText8, ichrLimGet - ichrMinGet,
+ ichr - ichrMinGet, utf);
+ break;
+ case kutf16:
+ pgts->fetch(ichrMinGet, ichrLimGet - ichrMinGet, rgchwText16);
+ fRet = AtUnicodeCharBoundary(rgchwText16, ichrLimGet - ichrMinGet,
+ ichr - ichrMinGet, utf);
+ break;
+ default:
+ Assert(false);
+ case kutf32:
+ fRet = true;
+ break;
+ }
+
+ return fRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the given position is at the boundary of a Unicode character; return false
+ if it is between two parts of pair of surrogates.
+----------------------------------------------------------------------------------------------*/
+bool GrCharStream::AtUnicodeCharBoundary(utf16 * prgchw, int cchw, int ichr, UtfType utf)
+{
+ Assert(ichr >= 0);
+ Assert(ichr <= cchw);
+
+ if (ichr == 0)
+ return true;
+ if (ichr >= cchw)
+ return true;
+
+ switch (utf)
+ {
+ case kutf16:
+ {
+ unsigned int nUtf32;
+ bool fMiddleOfPair = FromSurrogatePair(prgchw[ichr - 1], prgchw[ichr], &nUtf32);
+ return !fMiddleOfPair;
+ }
+ case kutf8:
+ {
+ // 16-bit buffer being treated like UTF-8.
+ utf8 rgchs[2];
+ rgchs[1] = (utf8)prgchw[ichr];
+ return AtUnicodeCharBoundary(rgchs, 2, 1, kutf8);
+ }
+ case kutf32:
+ default:
+ return true;
+ }
+
+/*
+ // temp stuff for debugging:
+ if (ichr > 0 && cchw >= 1 && prgchw[ichr-1] == '^' && prgchw[ichr] == 'a')
+ {
+ return false;
+ }
+ if (ichr > 0 && cchw >= 2 && prgchw[ichr-1] == '#' && prgchw[ichr] == '#' &&
+ prgchw[ichr+1] == 'B')
+ {
+ return false;
+ }
+ if (ichr > 1 && cchw >= 1 && prgchw[ichr-2] == '#' && prgchw[ichr-1] == '#' &&
+ prgchw[ichr] == 'B')
+ {
+ return false;
+ }
+
+ return true;
+*/
+}
+
+bool GrCharStream::AtUnicodeCharBoundary(utf8 * prgchs, int cchs, int ichs, UtfType utf)
+{
+ Assert(ichs >= 0);
+ Assert(ichs <= cchs);
+
+ Assert(utf == kutf8);
+
+ if (ichs == 0)
+ return true;
+ if (ichs >= cchs)
+ return true;
+
+ if (cchs == 0)
+ return true;
+
+ // A bit pattern of 10xxxxxx indicates a continuation of a sequence
+ // (11xxxxxx means the first byte of a sequence, 0xxxxxxx means a single character).
+
+ utf8 chsTest = prgchs[ichs] & 0xC0;
+ return (chsTest != 0x80);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert the given pair of characters into a single 32-bit Unicode character. Return
+ true if they are a legitimate surrogate pair. If not, just return the first of the
+ two 16-bit characters.
+----------------------------------------------------------------------------------------------*/
+bool GrCharStream::FromSurrogatePair(utf16 chwIn1, utf16 chwIn2, unsigned int * pchlOut)
+{
+ if ((chwIn1 < kzUtf16HighFirst) || (chwIn1 > kzUtf16HighLast)
+ || (chwIn2 < kzUtf16LowFirst) || (chwIn2 > kzUtf16LowLast))
+ {
+ // Not a surrogate
+ *pchlOut = (unsigned int)chwIn1;
+ return false;
+ }
+ else
+ {
+ *pchlOut = ((chwIn1 - kzUtf16HighFirst) << kzUtf16Shift) + chwIn2 + kzUtf16Inc;
+ return true;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Decode 1-6 bytes in the character string from UTF-8 format to Unicode (UCS-4).
+ As a side-effect, cbOut is set to the number of UTF-8 bytes consumed.
+
+ @param rgchUtf8 Pointer to a a character array containing UTF-8 data.
+ @param cchUtf8 Number of characters in the array.
+ @param cbOut Reference to an integer for holding the number of input (8-bit) characters
+ consumed to produce the single output Unicode character.
+
+ @return A single Unicode (UCS-4) character. If an error occurs, return -1.
+----------------------------------------------------------------------------------------------*/
+long GrCharStream::DecodeUtf8(const utf8 * rgchUtf8, int cchUtf8, int * pcbOut)
+{
+ // check for valid input
+ AssertArray(rgchUtf8, cchUtf8);
+ if ((cchUtf8 == 0) || (rgchUtf8[0] == '\0'))
+ {
+ *pcbOut = (cchUtf8) ? 1 : 0;
+ return 0;
+ }
+ //
+ // decode the first byte of the UTF-8 sequence
+ //
+ long lnUnicode;
+ int cbExtra;
+ int chsUtf8 = *rgchUtf8++ & 0xFF;
+ if (chsUtf8 >= kzUtf8Flag6) // 0xFC
+ {
+ lnUnicode = chsUtf8 & kzUtf8Mask6;
+ cbExtra = 5;
+ }
+ else if (chsUtf8 >= kzUtf8Flag5) // 0xF8
+ {
+ lnUnicode = chsUtf8 & kzUtf8Mask5;
+ cbExtra = 4;
+ }
+ else if (chsUtf8 >= kzUtf8Flag4) // 0xF0
+ {
+ lnUnicode = chsUtf8 & kzUtf8Mask4;
+ cbExtra = 3;
+ }
+ else if (chsUtf8 >= kzUtf8Flag3) // 0xE0
+ {
+ lnUnicode = chsUtf8 & kzUtf8Mask3;
+ cbExtra = 2;
+ }
+ else if (chsUtf8 >= kzUtf8Flag2) // 0xC0
+ {
+ lnUnicode = chsUtf8 & kzUtf8Mask2;
+ cbExtra = 1;
+ }
+ else // 0x00
+ {
+ lnUnicode = chsUtf8;
+ cbExtra = 0;
+ }
+ if (cbExtra >= cchUtf8)
+ {
+ return -1;
+ }
+
+ switch (cbExtra)
+ {
+ case 5:
+ lnUnicode <<= kzUtf8ByteShift;
+ chsUtf8 = *rgchUtf8++ & 0xFF;
+ if ((chsUtf8 & ~kzByteMask) != 0x80)
+ return -1;
+ lnUnicode += chsUtf8 & kzByteMask;
+ // fall through
+ case 4:
+ lnUnicode <<= kzUtf8ByteShift;
+ chsUtf8 = *rgchUtf8++ & 0xFF;
+ if ((chsUtf8 & ~kzByteMask) != 0x80)
+ return -1;
+ lnUnicode += chsUtf8 & kzByteMask;
+ // fall through
+ case 3:
+ lnUnicode <<= kzUtf8ByteShift;
+ chsUtf8 = *rgchUtf8++ & 0xFF;
+ if ((chsUtf8 & ~kzByteMask) != 0x80)
+ return -1;
+ lnUnicode += chsUtf8 & kzByteMask;
+ // fall through
+ case 2:
+ lnUnicode <<= kzUtf8ByteShift;
+ chsUtf8 = *rgchUtf8++ & 0xFF;
+ if ((chsUtf8 & ~kzByteMask) != 0x80)
+ return -1;
+ lnUnicode += chsUtf8 & kzByteMask;
+ // fall through
+ case 1:
+ lnUnicode <<= kzUtf8ByteShift;
+ chsUtf8 = *rgchUtf8++ & 0xFF;
+ if ((chsUtf8 & ~kzByteMask) != 0x80)
+ return -1;
+ lnUnicode += chsUtf8 & kzByteMask;
+ break;
+ case 0:
+ // already handled
+ break;
+ default:
+ Assert(false);
+ }
+ if ((unsigned long)lnUnicode > kzUnicodeMax)
+ {
+ return -1;
+ }
+ *pcbOut = cbExtra + 1;
+ return lnUnicode;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the current feature values and character properties from the stream.
+----------------------------------------------------------------------------------------------*/
+void GrCharStream::CurrentFeatures(GrTableManager * ptman, GrFeatureValues * pfval)
+{
+ if (m_ichrRunOffset == kPosInfinity)
+ {
+ // Not yet set up.
+ if (AtEnd())
+ {
+ // Empty stream; no valid values.
+ Assert(false);
+ return;
+ }
+
+ // Get the settings from the first character.
+ int ichrSegOffset;
+ int ichrPosSave = m_ichrPos;
+ int ichrRunOffsetSave = m_ichrRunOffset;
+ int ichlRunOffsetSave = m_ichlRunOffset;
+ int cMapSize = m_vislotNextChunkMap.size();
+ int cchrConsumed;
+ NextGet(ptman, pfval, &ichrSegOffset, &cchrConsumed);
+ // Put the character back.
+ m_ichrPos = ichrPosSave;
+ m_ichrRunOffset = ichrRunOffsetSave;
+ m_ichlRunOffset = ichlRunOffsetSave;
+ while (signed(m_vislotNextChunkMap.size()) > cMapSize)
+ m_vislotNextChunkMap.pop_back();
+ }
+ else
+ {
+ *pfval = m_fvalRunFeats;
+ //*ppchrp = &m_chrpRun;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the feature settings from the text properties.
+
+ Eventually, handle style index here?
+----------------------------------------------------------------------------------------------*/
+void GrCharStream::SetUpFeatureValues(GrTableManager * ptman, int ichr)
+{
+ // Set all the features to their default values.
+ for (int i = 0; i < kMaxFeatures; ++i)
+ {
+ m_fvalRunFeats.m_rgnFValues[i] = ptman->DefaultForFeatureAt(i);
+ }
+ m_fvalRunFeats.m_nStyleIndex = 0;
+
+ // Add in the defaults for the language of the text.
+ std::vector<featid> vnFeats;
+ std::vector<int> vnValues;
+ isocode lgcode = m_pgts->getLanguage(ichr);
+ ptman->DefaultsForLanguage(lgcode, vnFeats, vnValues);
+ size_t ifeatLp;
+ int ifeat;
+ for (ifeatLp = 0; ifeatLp < vnFeats.size(); ifeatLp++)
+ {
+ ptman->FeatureWithID(vnFeats[ifeatLp], &ifeat);
+ m_fvalRunFeats.m_rgnFValues[ifeat] = vnValues[ifeatLp];
+ }
+
+ // Add in the explicit feature settings.
+ FeatureSetting rgfset[kMaxFeatures];
+ int cfeat = m_pgts->getFontFeatures(ichr, rgfset);
+
+ for (ifeatLp = 0; ifeatLp < (size_t)cfeat; ifeatLp++)
+ {
+ ptman->FeatureWithID(rgfset[ifeatLp].id, &ifeat);
+ if (ifeat >= 0)
+ m_fvalRunFeats.m_rgnFValues[ifeat] = rgfset[ifeatLp].value;
+ }
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/GrCharStream.h b/Build/source/libs/graphite/src/segment/GrCharStream.h
new file mode 100644
index 00000000000..892435d376e
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrCharStream.h
@@ -0,0 +1,183 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999 - 2008 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrCharStream.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+
+
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GR_CHARSTREAM_INCLUDED
+#define GR_CHARSTREAM_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+ Makes a stream out of a text string that is serving as input to the process.
+
+ Hungarian: chstrm
+----------------------------------------------------------------------------------------------*/
+class GrCharStream
+{
+public:
+ // Constructor and destructor:
+ GrCharStream(ITextSource * pgts, int ichrMin, int ichrLim,
+ bool fStartLine, bool fEndLine);
+
+ ~GrCharStream()
+ {
+ if (m_cchlRunMax >= 0)
+ delete[] m_prgchlRunText;
+ }
+
+ // Getters:
+ ITextSource * TextSrc() { return m_pgts; }
+ int Min() { return m_ichrMin; }
+ int Pos() { return m_ichrPos; }
+ int Lim() { return m_ichrLim; }
+ bool StartLine() { return m_fStartLine; }
+ bool EndLine() { return m_fEndLine; }
+
+ // offset from the beginning of the segment
+ int SegOffset() { return m_ichrPos - m_ichrMin; }
+ int SegOffset(int ichr) { return ichr - m_ichrMin; }
+
+ bool AtEnd()
+ {
+ return (m_ichrPos >= m_ichrLim);
+ }
+
+ // The input string is empty.
+ bool IsEmpty()
+ {
+ return (m_ichrLim - m_ichrMin == 0);
+ }
+
+ // When we are restarting in order to create a segment other than the first,
+ // back up the position in the stream slightly in order to reprocess a few characters
+ // before the line-break.
+ void Backup(int cchrToReprocess)
+ {
+ Assert(m_ichrPos >= cchrToReprocess);
+ m_ichrPos -= cchrToReprocess;
+ m_ichrRunOffset = kPosInfinity;
+ m_cchrBackedUp = cchrToReprocess;
+ }
+
+ // When we found a hard-break in the input stream, we need to put it back, and since
+ // we're done, we set the end of the stream to that position.
+ void HitHardBreak()
+ {
+ m_ichrPos -= 1;
+ m_ichrRunOffset -= 1;
+ m_ichrLim = m_ichrPos;
+ }
+
+ void Restart();
+
+ int NextGet(GrTableManager *, GrFeatureValues * pfval, int * ichrSegOffset, int * pcchr);
+
+ void CurrentFeatures(GrTableManager * ptman, GrFeatureValues * pfval);
+
+ // For transduction logging:
+ int GetLogData(GrTableManager * ptman, int * rgnChars, bool * rgfNewRun,
+ GrFeatureValues * rgfval, int cchwBackup,
+ int * pcchwMaxRaw);
+ void GetLogDataRaw(GrTableManager * ptman, int cchw, int cchwBackup,
+ int cchwMax16bit, int * prgnChars,
+ utf16 * prgchw2, utf16 * prgchw3, utf16 * prgchw4, utf16 * prgchw5, utf16 * prgchw6,
+ int * prgichwRaw);
+
+protected:
+ void SetUpFeatureValues(GrTableManager * ptman, int ichr);
+public:
+ static utf32 Utf8ToUtf32(utf8 * prgchs8bit, int cchs, int * pcchsUsed);
+ static utf32 Utf16ToUtf32(utf16 * prgchw16bit, int cchw, int * pcchwUsed);
+ bool AtUnicodeCharBoundary(int cchr)
+ {
+ return AtUnicodeCharBoundary(m_pgts, cchr);
+ }
+ static bool AtUnicodeCharBoundary(ITextSource * pgts, int ichr);
+ static bool AtUnicodeCharBoundary(utf8 * prgchs, int cchs, int ichs, UtfType utf);
+ static bool AtUnicodeCharBoundary(utf16 * prgchw, int cchw, int ichr, UtfType utf);
+ static bool FromSurrogatePair(utf16 chwIn1, utf16 chwIn2, unsigned int * pch32Out);
+ static long DecodeUtf8(const utf8 * rgchUtf8, int cchUtf8, int * pcbOut);
+
+protected:
+ // Instance variables:
+ // Hungarian note: chr = raw characters, chl = long characters (UTF-32)
+ // chs = short characters (UTF-8), chw = wide characters (UTF-16)
+ ITextSource * m_pgts; // string to render
+ UtfType m_utf; // what encoding form the text-source uses
+ int m_ichrMin; // official start of segment relative to beginning of string
+ int m_ichrLim; // end of stream (potential end of seg) relative to beginning of string
+ int m_ichrPos; // stream position (0 = start of string)
+ bool m_fStartLine; // true if a line-break character should be prepended
+ bool m_fEndLine; // true if a line-break character should be appended
+ int m_cchrBackedUp; // number of characters backed up before beginning of segment
+
+ // We read a run's worth of data at a time and cache it in the following variables:
+ int m_cchlRunMax; // size of buffer allocated
+ int * m_prgchlRunText; // buffer containing current run
+ int m_ichrRunMin; // start of run relative to beginning of string
+ int m_ichrRunLim; // end of run relative to beginning of string
+ int m_ichlRunOffset; // index into m_prgchlRunText; kPosInfinity if nothing set up
+ int m_ichrRunOffset; // corresponding index into text source
+ GrFeatureValues m_fvalRunFeats;
+
+ std::vector<int> m_vislotNextChunkMap; // maps from 16-bit chars to 32-bit chars & glyphs
+
+ enum
+ {
+ kzUtf8Mask1 = 0x7F,
+ kzUtf8Mask2 = 0x1F,
+ kzUtf8Mask3 = 0x0F,
+ kzUtf8Mask4 = 0x07,
+ kzUtf8Mask5 = 0x03,
+ kzUtf8Mask6 = 0x01
+ };
+
+ enum
+ {
+ kzUtf8Flag1 = 0x00,
+ kzUtf8Flag2 = 0xC0,
+ kzUtf8Flag3 = 0xE0,
+ kzUtf8Flag4 = 0xF0,
+ kzUtf8Flag5 = 0xF8,
+ kzUtf8Flag6 = 0xFC
+ };
+
+ enum
+ {
+ kzByteMask = 0x3F,
+ kzByteMark = 0x80,
+ kzUtf8ByteShift = 6,
+ kzUnicodeMax = 0x7FFFFFFF
+ };
+
+ enum
+ {
+ kzUtf16Shift = 10,
+ kzUtf16Inc = 0x2400,
+ kzUtf16HighFirst = 0xD800,
+ kzUtf16HighLast = 0xDBFF,
+ kzUtf16LowFirst = 0xDC00,
+ kzUtf16LowLast = 0xDFFF
+ };
+};
+
+} // namespace gr
+
+#endif // !GR_CHARSTREAM_INCLUDED
+
diff --git a/Build/source/libs/graphite/src/segment/GrClassTable.cpp b/Build/source/libs/graphite/src/segment/GrClassTable.cpp
new file mode 100644
index 00000000000..43316fdc04a
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrClassTable.cpp
@@ -0,0 +1,382 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrClassTable.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Implements the GrClassTable class and related classes.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Fill in by reading from the file stream.
+----------------------------------------------------------------------------------------------*/
+bool GrClassTable::ReadFromFont(GrIStream & grstrm, int fxdVersion)
+{
+ long lClassMapStart;
+ grstrm.GetPositionInFont(&lClassMapStart);
+
+ // number of classes
+ m_ccls = grstrm.ReadUShortFromFont();
+ if (m_ccls >= kMaxReplcmtClasses)
+ return false; // bad table
+ if (fxdVersion < 0x00030000 && m_ccls > kMaxReplcmtClassesV1_2)
+ return false; // bad table
+
+ // number of linear classes
+ m_cclsLinear = grstrm.ReadUShortFromFont();
+ if (m_cclsLinear > m_ccls)
+ return false; // bad table
+
+ // class offsets
+ m_prgichwOffsets = new data16[m_ccls + 1];
+ gAssert(m_prgichwOffsets);
+ if (!m_prgichwOffsets)
+ return false; // bad table
+
+ data16 * pchw = m_prgichwOffsets;
+ int icls;
+ for (icls = 0; icls <= m_ccls; icls++, pchw++)
+ {
+ *pchw = grstrm.ReadUShortFromFont();
+ }
+
+ // Offsets are relative to the start class map; make them relative to the class list
+ // itself, and in terms of utf16s, not bytes.
+ long lClassesPos;
+ grstrm.GetPositionInFont(&lClassesPos);
+ int cbDiff = lClassesPos - lClassMapStart;
+ for (icls = 0; icls <= m_ccls; icls++)
+ {
+ m_prgichwOffsets[icls] = data16(int(m_prgichwOffsets[icls]) - cbDiff);
+ gAssert((m_prgichwOffsets[icls] & 0x00000001) == 0);
+ if ((m_prgichwOffsets[icls] & 0x00000001) != 0)
+ return false; // bad table
+ m_prgichwOffsets[icls] >>= 1; // divide by 2
+ }
+
+ // classes - slurp entire block (data remains in big-endian format)
+ m_prgchwBIGGlyphList = new data16[m_prgichwOffsets[m_ccls]];
+ gAssert(m_prgchwBIGGlyphList);
+ if (!m_prgchwBIGGlyphList)
+ return false; // bad table
+ grstrm.ReadBlockFromFont(m_prgchwBIGGlyphList,
+ m_prgichwOffsets[m_ccls] * isizeof(data16));
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set up an empty class table.
+----------------------------------------------------------------------------------------------*/
+void GrClassTable::CreateEmpty()
+{
+ // number of classes
+ m_ccls = 0;
+ // number of linear classes
+ m_cclsLinear = 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Search for the glyph ID using a fast binary search, and return the matching index.
+----------------------------------------------------------------------------------------------*/
+int GrInputClass::FindIndex(gid16 gid)
+{
+ int digixInit = InitialSearchRange();
+ int igixStart = StartSearch();
+#ifdef _DEBUG
+ int cgix = NumberOfGlyphs();
+ int nPowerOf2 = 1;
+ while (nPowerOf2 <= cgix)
+ nPowerOf2 <<= 1;
+ nPowerOf2 >>= 1;
+ // Now nPowerOf2 is the max power of 2 <= cgix
+ gAssert((1 << LoopCount()) == nPowerOf2); // LoopCount() == log2(nPowerOf2)
+ gAssert(digixInit == nPowerOf2);
+ gAssert(igixStart == cgix - digixInit);
+#endif // _DEBUG
+
+ int digixCurr = digixInit;
+
+ GrGlyphIndexPair * pgixCurr = m_pgixFirst + igixStart;
+ while (digixCurr > 0)
+ {
+ int nTest;
+ if (pgixCurr < m_pgixFirst)
+ nTest = -1;
+ else
+ nTest = pgixCurr->GlyphID() - gid;
+
+ if (nTest == 0)
+ return pgixCurr->Index();
+
+ digixCurr >>= 1; // divide by 2
+ if (nTest < 0)
+ pgixCurr += digixCurr;
+ else // (nTest > 0)
+ pgixCurr -= digixCurr;
+ }
+
+ return -1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the selector index for the given glyph ID.
+----------------------------------------------------------------------------------------------*/
+int GrClassTable::FindIndex(int icls, gid16 chwGlyphID)
+{
+ if (icls >= m_ccls)
+ {
+ gAssert(false); // bad compiler problem
+ return 0;
+ }
+
+ if (icls < m_cclsLinear)
+ {
+ // The class is an output class--uses linear format--and is being used as an
+ // input class. Shouldn't happen if the compiler is working right.
+ gAssert(false); // comment out for test procedures
+
+ // Do a slow linear search to find the glyph ID.
+ int ichwMin = m_prgichwOffsets[icls];
+ int ichwLim = m_prgichwOffsets[icls+1];
+ int cchw = ichwLim - ichwMin;
+
+ for (int ichw = 0; ichw < cchw; ichw++)
+ {
+ if (GlyphAt(ichwMin + ichw) == chwGlyphID)
+ return ichw;
+ }
+ return -1;
+ }
+
+ // Slurp the class into an instance so we can see what's there.
+ GrInputClass clsin;
+ int ichwMin = m_prgichwOffsets[icls];
+ int ichwLim = m_prgichwOffsets[icls+1];
+ clsin.CopyFrom(GlyphListLoc(ichwMin), (ichwLim - ichwMin));
+
+ // Do a fast binary search to find our glyph.
+ int iRet = clsin.FindIndex(chwGlyphID);
+ return iRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the glyph ID at the selector index.
+----------------------------------------------------------------------------------------------*/
+gid16 GrClassTable::GetGlyphID(int icls, int ichw)
+{
+ if (ichw < 0)
+ {
+ gAssert(false);
+ return 0;
+ }
+
+ if (icls >= m_cclsLinear)
+ {
+ // The class is an input class--sorted by glyph ID--and is being used as an
+ // output class. Shouldn't happen if the compiler is working right.
+ gAssert(false); // comment out for test procedures
+
+ if (icls >= m_ccls) // bad compiler problem
+ return 0;
+
+ // Do a slow linear search to find the index and answer the matching glyph.
+ // Slurp the class into an instance so we can see what's there.
+ GrInputClass clsin;
+ int ichwMin = m_prgichwOffsets[icls];
+ int ichwLim = m_prgichwOffsets[icls+1];
+ clsin.CopyFrom(GlyphListLoc(ichwMin), (ichwLim - ichwMin));
+
+ int cgix = clsin.NumberOfGlyphs();
+ for (int igix = 0; igix < cgix; igix++)
+ {
+ GrGlyphIndexPair * m_pgix = clsin.m_pgixFirst + igix;
+ if (m_pgix->Index() == ichw)
+ return m_pgix->GlyphID();
+ }
+ return 0;
+ }
+
+ int ichwMin = m_prgichwOffsets[icls];
+ int ichwLim = m_prgichwOffsets[icls+1];
+
+ if (ichw >= ichwLim - ichwMin)
+ return 0;
+ else
+ return GlyphAt(ichwMin + ichw);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of glyphs in the class.
+----------------------------------------------------------------------------------------------*/
+int GrClassTable::NumberOfGlyphsInClass(int icls)
+{
+ int ichwMin = m_prgichwOffsets[icls];
+ int ichwLim = m_prgichwOffsets[icls+1];
+
+ if (icls >= m_cclsLinear)
+ {
+ if (icls >= m_ccls) // bad compiler problem
+ return 0;
+
+ GrInputClass clsin;
+ clsin.CopyFrom(GlyphListLoc(ichwMin), (ichwLim - ichwMin));
+
+ int cgix = clsin.NumberOfGlyphs();
+ return cgix;
+ }
+ else
+ {
+ gAssert(false); // this method should not be used for output classes.
+ return ichwLim - ichwMin;
+ }
+}
+
+//:>********************************************************************************************
+//:> For test procedures
+//:>********************************************************************************************
+
+//:Ignore
+
+#ifdef OLD_TEST_STUFF
+/*----------------------------------------------------------------------------------------------
+ General test of class table.
+----------------------------------------------------------------------------------------------*/
+void GrClassTable::SetUpTestData()
+{
+ m_ccls = 7; // number of classes
+ m_cclsLinear = 4; // number of classes in linear format
+
+ m_prgchwBIGGlyphList = new gid16[100];
+
+ m_prgichwOffsets = new data16[7+1];
+
+ gid16 * pchw = m_prgchwBIGGlyphList;
+
+ // Output class 0: uppercase consonants B - H
+ m_prgichwOffsets[0] = 0;
+ *pchw++ = msbf(gid16(66)); *pchw++ = msbf(utf16(67)); *pchw++ = msbf(utf16(68));
+ *pchw++ = msbf(gid16(70)); *pchw++ = msbf(utf16(71)); *pchw++ = msbf(utf16(72));
+
+ // Output class 1: grave vowels
+ m_prgichwOffsets[1] = 6;
+ *pchw++ = msbf(gid16(192)); // A
+ *pchw++ = msbf(gid16(224)); // a
+ *pchw++ = msbf(gid16(200)); // E
+ *pchw++ = msbf(gid16(232)); // e
+ *pchw++ = msbf(gid16(204)); // I
+ *pchw++ = msbf(gid16(236)); // i
+ *pchw++ = msbf(gid16(210)); // O
+ *pchw++ = msbf(gid16(243)); // o
+ *pchw++ = msbf(gid16(217)); // U
+ *pchw++ = msbf(gid16(249)); // u
+
+ // Output class 2: circumflex vowels
+ m_prgichwOffsets[2] = 6 + 10;
+ *pchw++ = msbf(gid16(194)); // A
+ *pchw++ = msbf(gid16(226)); // a
+ *pchw++ = msbf(gid16(202)); // E
+ *pchw++ = msbf(gid16(234)); // e
+ *pchw++ = msbf(gid16(206)); // I
+ *pchw++ = msbf(gid16(238)); // i
+ *pchw++ = msbf(gid16(212)); // O
+ *pchw++ = msbf(gid16(244)); // o
+ *pchw++ = msbf(gid16(219)); // U
+ *pchw++ = msbf(gid16(251)); // u
+
+ // Output class 3: diaeresis vowels, uppercase
+ m_prgichwOffsets[3] = 16 + 10;
+ *pchw++ = msbf(gid16(196)); // A
+ *pchw++ = msbf(gid16(196)); // A
+ *pchw++ = msbf(gid16(203)); // E
+ *pchw++ = msbf(gid16(203)); // E
+ *pchw++ = msbf(gid16(207)); // I
+ *pchw++ = msbf(gid16(207)); // I
+ *pchw++ = msbf(gid16(214)); // O
+ *pchw++ = msbf(gid16(214)); // O
+ *pchw++ = msbf(gid16(220)); // U
+ *pchw++ = msbf(gid16(220)); // U
+
+ // Input class 4: lowercase consonants b - h
+ m_prgichwOffsets[4] = 26 + 10; // = 36
+ *pchw++ = msbf(gid16(6));
+ *pchw++ = msbf(gid16(4)); *pchw++ = msbf(gid16(2)); *pchw++ = msbf(gid16(6-4));
+ *pchw++ = msbf(gid16(98)); *pchw++ = msbf(gid16(0));
+ *pchw++ = msbf(gid16(99)); *pchw++ = msbf(gid16(1));
+ *pchw++ = msbf(gid16(100)); *pchw++ = msbf(gid16(2));
+ *pchw++ = msbf(gid16(102)); *pchw++ = msbf(gid16(3));
+ *pchw++ = msbf(gid16(103)); *pchw++ = msbf(gid16(4));
+ *pchw++ = msbf(gid16(104)); *pchw++ = msbf(gid16(5));
+
+ // Input class 5: vowels
+ m_prgichwOffsets[5] = 36 + 4 + 6*2; // = 52
+ *pchw++ = msbf(gid16(10));
+ *pchw++ = msbf(gid16(8)); *pchw++ = msbf(utf16(3)); *pchw++ = msbf(utf16(10-8));
+ *pchw++ = msbf(gid16(65)); *pchw++ = msbf(gid16(0)); // A
+ *pchw++ = msbf(gid16(69)); *pchw++ = msbf(gid16(2)); // E
+ *pchw++ = msbf(gid16(73)); *pchw++ = msbf(gid16(4)); // I
+ *pchw++ = msbf(gid16(79)); *pchw++ = msbf(gid16(6)); // O
+ *pchw++ = msbf(gid16(85)); *pchw++ = msbf(gid16(8)); // U
+ *pchw++ = msbf(gid16(97)); *pchw++ = msbf(gid16(1)); // a
+ *pchw++ = msbf(gid16(101)); *pchw++ = msbf(gid16(3)); // e
+ *pchw++ = msbf(gid16(105)); *pchw++ = msbf(gid16(5)); // i
+ *pchw++ = msbf(gid16(111)); *pchw++ = msbf(gid16(7)); // o
+ *pchw++ = msbf(gid16(117)); *pchw++ = msbf(gid16(9)); // u
+
+ // Input class 6: acute vowels
+ m_prgichwOffsets[6] = 52 + 4 + 10*2; // = 76
+ *pchw++ = msbf(gid16(10));
+ *pchw++ = msbf(gid16(8)); *pchw++ = msbf(gid16(3)); *pchw++ = msbf(gid16(10-8));
+ *pchw++ = msbf(gid16(193)); *pchw++ = msbf(gid16(0)); // A
+ *pchw++ = msbf(gid16(201)); *pchw++ = msbf(gid16(2)); // E
+ *pchw++ = msbf(gid16(205)); *pchw++ = msbf(gid16(4)); // I
+ *pchw++ = msbf(gid16(211)); *pchw++ = msbf(gid16(6)); // O
+ *pchw++ = msbf(gid16(218)); *pchw++ = msbf(gid16(8)); // U
+ *pchw++ = msbf(gid16(225)); *pchw++ = msbf(gid16(1)); // a
+ *pchw++ = msbf(gid16(233)); *pchw++ = msbf(gid16(3)); // e
+ *pchw++ = msbf(gid16(237)); *pchw++ = msbf(gid16(5)); // i
+ *pchw++ = msbf(gid16(243)); *pchw++ = msbf(gid16(7)); // o
+ *pchw++ = msbf(gid16(250)); *pchw++ = msbf(gid16(9)); // u
+
+ m_prgichwOffsets[7] = 76 + 4 + 10*2; // = 100
+};
+
+#endif // OLD_TEST_STUFF
+
+} // namespace gr
+
+//:End Ignore
+
diff --git a/Build/source/libs/graphite/src/segment/GrClassTable.h b/Build/source/libs/graphite/src/segment/GrClassTable.h
new file mode 100644
index 00000000000..67d6940862c
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrClassTable.h
@@ -0,0 +1,188 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrClassTable.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ The GrClassTable and related classes that store the classes that are used in substitutions.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GR_CTABLE_INCLUDED
+#define GR_CTABLE_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+ A glyph ID / index pair, a member of the GrInputClass where the items are sorted
+ by glyph ID.
+
+ Hungarian: gix
+----------------------------------------------------------------------------------------------*/
+class GrGlyphIndexPair
+{
+ friend class GrInputClass;
+ friend class GrClassTable;
+
+ gid16 GlyphID() { return lsbf(m_gidBIG); }
+ data16 Index() { return lsbf(m_nBIGIndex); }
+
+ gid16 m_gidBIG;
+ data16 m_nBIGIndex;
+};
+
+/*----------------------------------------------------------------------------------------------
+ A class consisting of a mapping from glyph ID to index, used for classes that
+ function as input classes (eg, occurrng in the left-hand side of a rule).
+
+ Hungarian: clsin
+----------------------------------------------------------------------------------------------*/
+class GrInputClass
+{
+ friend class GrClassTable;
+
+protected:
+ /*------------------------------------------------------------------------------------------
+ Copy the raw memory into the instance.
+ ------------------------------------------------------------------------------------------*/
+ void CopyFrom(data16 * pchwStart, int cchw)
+ {
+ m_cgixBIG = pchwStart[0];
+ m_digixBIGInit = pchwStart[1];
+ m_cBIGLoop = pchwStart[2];
+ m_igixBIGStart = pchwStart[3];
+
+ int cgix = NumberOfGlyphs();
+ m_pgixFirst = m_prggixBuffer;
+ if (cgix > 64)
+ {
+ m_vgix.resize(cgix);
+ m_pgixFirst = &m_vgix[0];
+ }
+ gAssert((4 + (cgix * 2)) == cchw);
+ #ifdef _DEBUG
+ memset(m_pgixFirst, 0, cgix * isizeof(GrGlyphIndexPair));
+ #endif
+ Assert(sizeof(GrGlyphIndexPair) == sizeof(gid16) + sizeof(data16));
+ GrGlyphIndexPair * pgixStart = reinterpret_cast<GrGlyphIndexPair*>(pchwStart + 4);
+ std::copy(pgixStart, pgixStart + cgix, m_pgixFirst);
+ }
+
+ int NumberOfGlyphs() { return lsbf(m_cgixBIG); }
+ int LoopCount() { return lsbf(m_cBIGLoop); }
+ int InitialSearchRange() { return lsbf(m_digixBIGInit); }
+ int StartSearch() { return lsbf(m_igixBIGStart); }
+
+ int FindIndex(gid16 gid);
+
+protected:
+ // Instance variables:
+ data16 m_cgixBIG; // number of glyphs in the class
+
+ // constants for fast binary search
+ data16 m_digixBIGInit; // (max power of 2 <= m_cgix);
+ // size of initial range to consider
+ data16 m_cBIGLoop; // log2(max power of 2 <= m_cgix);
+ // indicates how many iterations are necessary
+ data16 m_igixBIGStart; // m_cgix - m_digixInit;
+ // where to start search
+
+ GrGlyphIndexPair m_prggixBuffer[64];
+ std::vector<GrGlyphIndexPair> m_vgix;
+ GrGlyphIndexPair * m_pgixFirst;
+};
+
+
+/*----------------------------------------------------------------------------------------------
+ Contains all the classes used for substitution rules.
+
+ Hungarian: ctbl
+----------------------------------------------------------------------------------------------*/
+
+class GrClassTable
+{
+ friend class FontMemoryUsage;
+
+public:
+ // Constructor & destructor:
+ GrClassTable()
+ : m_prgichwOffsets(NULL),
+ m_prgchwBIGGlyphList(NULL)
+ {
+ }
+
+ ~GrClassTable()
+ {
+ delete[] m_prgichwOffsets;
+ delete[] m_prgchwBIGGlyphList;
+ }
+
+ int NumberOfClasses() { return m_ccls; }
+ int NumberOfInputClasses() { return m_ccls - m_cclsLinear; }
+ int NumberOfOutputClasses() { return m_cclsLinear; }
+
+ bool ReadFromFont(GrIStream & grstrm, int fxdVersion);
+ void CreateEmpty();
+
+ int FindIndex(int icls, gid16 chwGlyphID);
+ gid16 GetGlyphID(int icls, int ichw);
+ int NumberOfGlyphsInClass(int icls);
+
+ gid16 GlyphAt(int ichw)
+ {
+ return lsbf(m_prgchwBIGGlyphList[ichw]);
+ }
+ data16 * GlyphListLoc(int ichw)
+ {
+ return m_prgchwBIGGlyphList + ichw;
+ }
+
+protected:
+ // Instance variables:
+ int m_ccls; // number of classes
+ int m_cclsLinear; // number of classes in linear format
+
+ data16 * m_prgichwOffsets;
+
+ // Two formats are included in the following array: the first section consists of
+ // flat ordered lists of glyphs, used for the "output" classes that use linear format.
+ // This provides an index-to-glyph mapping.
+ // The second section contains data in the format of GrInputClasses, used for "input"
+ // classes that need a binary-search format. This provides a glyph-to-index mapping.
+ // We don't create instances of GrInputClasses, because that would make reading
+ // from the ECF file slow. Instead we just set up a single instance at the time
+ // we're interested in it.
+ // NOTE that all this data has been slurped directly from the ECF file and therefore
+ // uses BIG-ENDIAN format.
+ gid16 * m_prgchwBIGGlyphList;
+
+//:Ignore
+#ifdef OLD_TEST_STUFF
+public:
+ // For test procedures:
+ void SetUpTestData();
+ void SetUpRuleActionTest();
+ void SetUpRuleAction2Test();
+ void SetUpAssocTest();
+ void SetUpAssoc2Test();
+ void SetUpDefaultAssocTest();
+ void SetUpFeatureTest();
+ void SetUpLigatureTest();
+ void SetUpLigature2Test();
+#endif // OLD_TEST_STUFF
+//:End Ignore
+};
+
+} // namespace gr
+
+#endif // !GR_CTABLE_INCLUDED
+
diff --git a/Build/source/libs/graphite/src/segment/GrEngine.cpp b/Build/source/libs/graphite/src/segment/GrEngine.cpp
new file mode 100644
index 00000000000..0fda68df880
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrEngine.cpp
@@ -0,0 +1,2030 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrEngine.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description: Contains the implementation of the GrEngine class.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+#include <functional>
+#include <cstring>
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+// any other headers (not precompiled)
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+
+//:>********************************************************************************************
+//:> General functions
+//:>********************************************************************************************
+
+bool compareCmap(const byte *lhs, const byte *rhs)
+{
+ using namespace gr;
+
+ typedef const struct index {data16 version; data16 numberSubtables;} *const IndexPtr;
+ typedef const struct enc {data16 platID; data16 platSpecID; data32 offset;} *const EncPtr;
+
+ // Calculate the size of the cmap.
+
+ IndexPtr rhsIndex = IndexPtr(rhs);
+ size_t numSubTbl = lsbf(rhsIndex->numberSubtables);
+ size_t cbCmapSz = sizeof(index) + sizeof(enc) * numSubTbl;
+ EncPtr encTbl = EncPtr(rhs + sizeof(index));
+
+ for (size_t iSubTbl = 0; iSubTbl < numSubTbl; iSubTbl++)
+ //for (int iSubTbl = numSubTbl - 1; iSubTbl >= 0; --iSubTbl)
+ {
+ const data16 *const mapTbl = reinterpret_cast<const data16 *>(rhs + lsbf((int)encTbl[iSubTbl].offset));
+ int format = lsbf(*mapTbl);
+ switch (format)
+ {
+ // 16-bit lengths
+ case 0:
+ case 2:
+ case 4:
+ case 6:
+ cbCmapSz += lsbf((data16)unsigned(mapTbl[1]));
+ break;
+ // 32-bit lengths
+ case 8:
+ case 10:
+ case 12:
+ cbCmapSz += lsbf((int)unsigned(reinterpret_cast<const data32 *>(mapTbl)[1]));
+ break;
+ default:
+ Assert(false);
+ }
+ }
+
+ // Do the comparison.
+ return (memcmp(lhs, rhs, cbCmapSz) ? false : true);
+}
+
+
+//:>********************************************************************************************
+//:> GrEngine class.
+//:>********************************************************************************************
+
+GrEngine::GrEngine()
+{
+ /////////////_CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF); ////////////////
+
+
+ m_cref = 1;
+ BasicInit();
+}
+
+void GrEngine::BasicInit()
+{
+ m_pfface = NULL;
+
+ m_ptman = NULL;
+ m_pctbl = NULL;
+ m_pgtbl = NULL;
+ m_prgpsd = NULL;
+ m_cpsd = 0;
+ m_cfeat = 0;
+ m_mFontEmUnits = -1;
+ m_dysOffset = 0;
+
+ ////m_tbufCmap.reset();
+ m_pCmap_3_1 = NULL;
+ m_pCmap_3_10 = NULL;
+ ////m_tbufNameTbl.reset();
+ // new interface stuff:
+ m_pCmapTbl = NULL;
+ m_pNameTbl = NULL;
+ m_fCmapTblCopy = false;
+ m_fNameTblCopy = false;
+
+ m_fLogXductn = false;
+
+ m_resFontValid = kresInvalidArg; // not yet initialized
+ m_ferr = kferrUninitialized;
+ m_fxdBadVersion = 0;
+
+ m_fSmartReg = false;
+ m_fSmartBold = false;
+ m_fSmartItalic = false;
+ m_fSmartBI = false;
+ m_fFakeItalicCache = false;
+ m_fFakeBICache = false;
+ m_strCtrlFileReg.erase();
+ m_strCtrlFileBold.erase();
+ m_strCtrlFileItalic.erase();
+ m_strCtrlFileBI.erase();
+ m_fFakeItalic = false;
+ m_stuCtrlFile.erase();
+ m_stuInitError.erase();
+ m_stuErrCtrlFile.erase();
+ m_stuFaceName.erase();
+ m_stuBaseFaceName.erase();
+ m_fUseSepBase = false;
+ m_stuFeatures.erase();
+
+ m_nFontCheckSum = 0;
+
+ m_fInErrorState = false;
+
+ m_rglcidFeatLabelLangs = NULL; // initialize lazily, when needed
+ m_clcidFeatLabelLangs = 0;
+}
+
+GrEngine::~GrEngine()
+{
+ DestroyEverything();
+ #ifdef _MSC_VER
+ if (!_CrtCheckMemory())
+ {
+ OutputDebugString(L"bad memory");
+ }
+ #endif
+}
+
+/*----------------------------------------------------------------------------------------------
+ Clean everything out (destructor or reinitializing with a different face name).
+----------------------------------------------------------------------------------------------*/
+void GrEngine::DestroyEverything()
+{
+ DestroyContents();
+ #ifdef _MSC_VER
+ if (!_CrtCheckMemory())
+ {
+ OutputDebugString(L"bad memory");
+ }
+ #endif
+
+ m_strCtrlFileReg.erase();
+ m_strCtrlFileBold.erase();
+ m_strCtrlFileItalic.erase();
+ m_strCtrlFileBI.erase();
+ m_fSmartReg = false;
+ m_fSmartBold = false;
+ m_fSmartItalic = false;
+ m_fSmartBI = false;
+ m_fFakeItalicCache = false;
+ m_fFakeBICache = false;
+ m_stuBaseFaceName.erase();
+
+ //m_stuFaceName.erase();
+ //m_stuFaceName = L"this is not a usable or valid string";
+ m_fUseSepBase = false;
+ m_stuFeatures.erase();
+}
+
+void GrEngine::DestroyContents(bool fDestroyCmap)
+{
+ if (fDestroyCmap)
+ {
+ ////m_tbufCmap.reset();
+ m_pCmap_3_1 = NULL;
+ m_pCmap_3_10 = NULL;
+
+ if (m_fCmapTblCopy)
+ delete[] m_pCmapTbl;
+ if (m_fNameTblCopy)
+ delete[] m_pNameTbl;
+ m_pCmapTbl = NULL;
+ m_pNameTbl = NULL;
+ m_fCmapTblCopy = false;
+ m_fNameTblCopy = false;
+ }
+
+ delete m_ptman;
+ delete m_pctbl;
+ delete m_pgtbl;
+ delete[] m_prgpsd;
+ m_ptman = NULL;
+ m_pctbl = NULL;
+ m_pgtbl = NULL;
+ m_prgpsd = NULL;
+
+ ////m_tbufNameTbl.reset();
+
+ m_stuCtrlFile.erase();
+ m_stuInitError.erase();
+
+ m_resFontValid = kresInvalidArg;
+ m_ferr = kferrUninitialized;
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the number of features.
+----------------------------------------------------------------------------------------------*/
+size_t GrEngine::NumberOfFeatures_ff()
+{
+ return (size_t)m_cfeat;
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the feature ID for the ifeat-th feature.
+----------------------------------------------------------------------------------------------*/
+featid GrEngine::FeatureID_ff(size_t ifeat)
+{
+ return (featid)m_rgfeat[ifeat].ID();
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the index of the feature with the given ID.
+----------------------------------------------------------------------------------------------*/
+size_t GrEngine::FeatureWithID_ff(featid fid)
+{
+ int ifeatRet;
+ /* GrFeature * pfeat = */
+ FeatureWithID(fid, &ifeatRet);
+ return (size_t)ifeatRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the label for the ifeat-th feature.
+----------------------------------------------------------------------------------------------*/
+bool GrEngine::GetFeatureLabel_ff(size_t ifeat, lgid nLanguage, utf16 * rgchwLabel)
+{
+ std::wstring stu = m_rgfeat[ifeat].Label(this, nLanguage);
+
+ int cch = stu.size();
+ cch = min(cch, 127); // 1 char for zero-termination
+ std::copy(stu.data(), stu.data() + cch, rgchwLabel);
+ rgchwLabel[cch] = 0;
+
+ return (cch > 0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the index of the default setting. Return -1 if it cannot be found.
+----------------------------------------------------------------------------------------------*/
+int GrEngine::GetFeatureDefault_ff(size_t ifeat)
+{
+ GrFeature * pfeat = m_rgfeat + ifeat;
+ int defaultValue = pfeat->DefaultValue();
+ int cfset = pfeat->NumberOfSettings();
+ int rgnSettings[100];
+ pfeat->Settings(100, rgnSettings);
+ Assert(cfset < 100); // TODO: improve this
+ for (int ifset = 0; ifset < cfset; ifset++)
+ {
+ if (rgnSettings[ifset] == defaultValue)
+ return ifset;
+ }
+ return -1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the number of settings for the ifeat-th feature.
+----------------------------------------------------------------------------------------------*/
+size_t GrEngine::NumberOfSettings_ff(size_t ifeat)
+{
+ return m_rgfeat[ifeat].NumberOfSettings();
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the value of the ifset-th setting for the ifeat-th feature.
+----------------------------------------------------------------------------------------------*/
+int GrEngine::GetFeatureSettingValue_ff(size_t ifeat, size_t ifset)
+{
+ return m_rgfeat[ifeat].NthSetting(ifset);
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the UI label for the given feature setting.
+----------------------------------------------------------------------------------------------*/
+bool GrEngine::GetFeatureSettingLabel_ff(size_t ifeat, size_t ifset, lgid language,
+ utf16 * rgchwLabel)
+{
+ std::wstring stu = m_rgfeat[ifeat].NthSettingLabel(this, ifset, language);
+
+ int cch = stu.size();
+ cch = min(cch, 127); // 1 char for zero-termination
+ // Note: the wchar_t label was originally assigned from utf16 data, so although wchar_t is
+ // utf32 on some platforms the conversion back to utf16 should still give correct results.
+ std::copy(stu.data(), stu.data() + cch, rgchwLabel);
+ rgchwLabel[cch] = 0;
+
+ return (cch > 0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the number of languages that are possible among the feature labels.
+----------------------------------------------------------------------------------------------*/
+size_t GrEngine::NumberOfFeatLangs_ff()
+{
+ SetUpFeatLangList();
+ return m_clcidFeatLabelLangs;
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the language LCID for the feature-label language with the given index.
+----------------------------------------------------------------------------------------------*/
+short GrEngine::GetFeatLabelLang_ff(size_t ilang)
+{
+ SetUpFeatLangList();
+ return m_rglcidFeatLabelLangs[ilang];
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the number of supported languages.
+----------------------------------------------------------------------------------------------*/
+size_t GrEngine::NumberOfLanguages_ff()
+{
+ return (size_t)m_langtbl.NumberOfLanguages();
+}
+
+/*----------------------------------------------------------------------------------------------
+ For FontFace: return the language code for the language with the given index.
+----------------------------------------------------------------------------------------------*/
+isocode GrEngine::GetLanguageCode_ff(size_t ilang)
+{
+ return m_langtbl.LanguageCode(ilang);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set up the list of all the languages that are present in the feature labels.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetUpFeatLangList()
+{
+ if (m_rglcidFeatLabelLangs)
+ return;
+
+ int rgnNameIDs[kMaxFeatures];
+ for (int ifeat = 0; ifeat < m_cfeat; ifeat++)
+ rgnNameIDs[ifeat] = m_rgfeat[ifeat].NameId();
+ short rglcid[128]; // 128 is the number expected by TtfUtil::GetLangsForNames
+ m_clcidFeatLabelLangs = TtfUtil::GetLangsForNames(m_pNameTbl, 3, 1, rgnNameIDs, m_cfeat, rglcid);
+ m_rglcidFeatLabelLangs = new short[m_clcidFeatLabelLangs];
+ memcpy(m_rglcidFeatLabelLangs, rglcid, sizeof(short) * m_clcidFeatLabelLangs);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the maximum size needed for the block of data to pass between segments, that is,
+ to reinitialize the engine based on the results of the previously generated segment.
+ This value must match what is in GrTableManager::InitializeStreams() and
+ InitializeForNextSeg(). 256 is an absolute maximum imposed by the interface.
+
+ In Graphite, what this block of data will contain is information about cross-line
+ contextualization and some directionality information.
+
+ Assumes InitNew() has already been called to set the font name.
+----------------------------------------------------------------------------------------------*/
+GrResult GrEngine::get_SegDatMaxLength(int * pcb)
+{
+ ChkGrOutPtr(pcb);
+
+ if (m_resFontValid == kresInvalidArg)
+ ReturnResult(kresUnexpected); // engine not initialized
+
+ GrResult res = m_resFontValid;
+ if (m_resFontValid == kresFail || m_resFontValid == kresUnexpected || m_resFontValid == kresFalse)
+ res = kresOk; // invalid font
+ if (ResultFailed(res))
+ ReturnResult(res);
+
+ Assert(m_ptman);
+ if (!m_ptman)
+ *pcb = 256;
+ else
+ *pcb = m_ptman->NumberOfPasses() + 4;
+
+ ReturnResult(res);
+}
+
+/*----------------------------------------------------------------------------------------------
+ @return The supported script direction(s). If more than one, the application is
+ responsible for choosing the most appropriate.
+----------------------------------------------------------------------------------------------*/
+GrResult GrEngine::get_ScriptDirection(unsigned int * pgrfsdc, OLECHAR * prgchwErrMsg, int cchMaxErrMsg)
+{
+ ChkGrOutPtr(pgrfsdc);
+ ChkGrArrayArg(prgchwErrMsg, cchMaxErrMsg);
+
+ if (m_resFontValid == kresInvalidArg)
+ ReturnResult(kresUnexpected); // engine not initialized
+
+ GrResult res = m_resFontValid;
+
+ *pgrfsdc = m_grfsdc;
+
+// ClearFontError(prgchwErrMsg, cchMaxErrMsg);
+// try
+// {
+// if (m_resFontValid == kresFail || m_resFontValid == kresUnexpected || m_resFontValid == kresFalse)
+// {
+// RecordFontLoadError(prgchwErrMsg, cchMaxErrMsg);
+// res = kresOk;
+// }
+// *pgrfsdc = m_grfsdc;
+// }
+// catch (Throwable & thr)
+// {
+// res = (GrResult)thr.Error();
+// *pgrfsdc = kfsdcHorizLtr;
+// }
+// catch (...)
+// {
+// res = WARN(kresFail);
+// *pgrfsdc = kfsdcHorizLtr;
+// }
+
+ ReturnResult(res);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get an glyph attribute from the engine that will help the GrJustifier in its work.
+----------------------------------------------------------------------------------------------*/
+GrResult GrEngine::getGlyphAttribute(int iGlyph, int jgat, int nLevel, float * pValueRet)
+{
+ return m_ptman->State()->GetGlyphAttrForJustification(iGlyph, jgat, nLevel, pValueRet);
+}
+
+GrResult GrEngine::getGlyphAttribute(int iGlyph, int jgat, int nLevel, int * pValueRet)
+{
+ return m_ptman->State()->GetGlyphAttrForJustification(iGlyph, jgat, nLevel, pValueRet);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set an glyph attribute in the engine as a result of the decisions made by the
+ GrJustifier.
+----------------------------------------------------------------------------------------------*/
+GrResult GrEngine::setGlyphAttribute(int iGlyph, int jgat, int nLevel, float value)
+{
+ return m_ptman->State()->SetGlyphAttrForJustification(iGlyph, jgat, nLevel, value);
+}
+
+GrResult GrEngine::setGlyphAttribute(int iGlyph, int jgat, int nLevel, int value)
+{
+ return m_ptman->State()->SetGlyphAttrForJustification(iGlyph, jgat, nLevel, value);
+}
+
+//:>********************************************************************************************
+//:> Non-FieldWorks interface methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Make a complete segment that can be used to measure and do line-breaking.
+
+ OBSOLETE - delete
+----------------------------------------------------------------------------------------------*/
+/*
+GrResult GrEngine::MakeMeasuredSegment(
+ Font * pfont, ITextSource * pgts,
+ int ichMin, int ichLim,
+ bool fParaRtl,
+ Segment ** ppsegRet, SegEnd * pest,
+ std::ostream * pstrmLog,
+ OLECHAR * prgchwErrMsg, int cchMaxErrMsg)
+{
+ int dichContext, dichLimSeg;
+ float dxWidth;
+ return MakeSegment(ksegmodeMsfr,
+ pfont, pgts, NULL, ichMin, ichLim, false, false,
+ 100000, klbClipBreak, ktwshAll, // not used
+ fParaRtl,
+ ppsegRet, &dxWidth,
+ 0, NULL, 0, NULL, NULL, &dichContext, // not used
+ pstrmLog,
+ prgchwErrMsg, cchMaxErrMsg,
+ -1, false, false, klbClipBreak, // not used
+ &dichLimSeg, pest,
+ false, 100000, kestMoreLines); // not used
+}
+*/
+
+/*----------------------------------------------------------------------------------------------
+ Make a segment from the given range, regardless of the kind of line-break that results.
+
+ OBSOLETE - delete
+----------------------------------------------------------------------------------------------*/
+/*
+GrResult GrEngine::MakeSegmentFromRange(
+ Font * pfont, ITextSource * pgts, IGrJustifier * pgj,
+ int ichMin, int ichLim,
+ bool fStartLine, bool fEndLine,
+ TrWsHandling twsh, bool fParaRtl,
+ Segment ** ppsegRet, float * pdxWidth, SegEnd * pest,
+ int cbPrev, byte * pbPrevSegDat, int cbNextMax, byte * pbNextSegDat, int * pcbNextSegDat,
+ int * pdichwContext,
+ std::ostream * pstrmLog,
+ OLECHAR * prgchwErrMsg, int cchwMaxErrMsg)
+{
+ int dichLimSegBogus;
+ return MakeSegment(ksegmodeMsfr, pfont, pgts, pgj,
+ ichMin, ichLim,
+ fStartLine, fEndLine,
+ 10000, klbWordBreak, // not used
+ twsh, fParaRtl,
+ ppsegRet, pdxWidth,
+ //cbPrev, pbPrevSegDat, cbNextMax, pbNextSegDat, pcbNextSegDat, pdichwContext,
+ 0, NULL, 0, NULL, NULL, NULL,
+ pstrmLog,
+ prgchwErrMsg, cchwMaxErrMsg,
+ ichLim, false, false, klbClipBreak, // not used
+ &dichLimSegBogus, pest,
+ 10000, kestMoreLines); // not used
+}
+*/
+
+
+//:>********************************************************************************************
+//:> Other methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Create a segment.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::MakeSegment(
+ // Common parameters
+ Segment * psegNew,
+ Font * pfont, ITextSource * pgts, IGrJustifier * pjus,
+ LayoutEnvironment & layout,
+ int ichMin, int ichLim,
+ // for finding a break point
+ float dxMaxWidth,
+ bool fBacktracking,
+ // for justification
+ bool fJust, float dxJustifiedWidthJ, SegEnd estJ)
+{
+ ChkGrArgPtr(pgts);
+ ChkGrArgPtrN(pjus);
+ ChkGrOutPtr(psegNew);
+ Assert(layout.bestBreak() <= layout.worstBreak());
+
+ if (pjus == NULL)
+ pjus = layout.justifier();
+
+ if (m_resFontValid == kresInvalidArg)
+ // Uninitialized.
+ return; // ReturnResult(kresUnexpected);
+
+ SetCmapAndNameTables(pfont);
+
+ int segmode = ksegmodeRange; // segment from range
+ if (fJust)
+ segmode = ksegmodeJust; // justified segment
+ else if (dxMaxWidth < kPosInfFloat)
+ segmode = ksegmodeBreak; // find break point
+
+ // Temporary:
+ if (!this->m_ptman)
+ {
+ Warn("No Graphite tables");
+ m_ptman = new GrTableManager(this);
+ CreateEmpty();
+ }
+
+ // GrResult hr = kresOk;
+ m_fInErrorState = false;
+
+ bool fBold, fItalic;
+ GetStyles(pfont, ichMin, &fBold, &fItalic);
+
+ GetWritingSystemDirection(pgts, ichMin);
+
+ // Find the end of the range to render with the current font.
+ int nDirDepth = 0;
+ int ichFontLim = FindFontLim(pgts, ichMin, &nDirDepth);
+ int ichStrmLim = 0;
+ int ichSegLim = 0;
+ switch (segmode)
+ {
+ case ksegmodeBreak: // find break point
+ // Here ichLim should be the end of the text-source, unless we're backtracking.
+ ichStrmLim = min(ichFontLim, ichLim);
+ ichSegLim = -1; // unknown
+ break;
+ case ksegmodeJust: // stretching an existing segment to achieve justification
+ ichStrmLim = ichFontLim;
+ ichSegLim = ichLim;
+ break;
+ //case ksegmodeMms: // MakeMeasuredSegment
+ // ichLim = ichFontLim;
+ // ichStrmLim = ichFontLim;
+ // ichSegLim = -1; // process to the end of the stream
+ // break;
+ case ksegmodeRange: // segment from range
+ ichLim = min(ichLim, ichFontLim);
+ ichStrmLim = ichFontLim;
+ ichSegLim = (ichLim == kPosInfinity) ? -1 : ichLim;
+ break;
+ default:
+ Assert(false);
+ }
+
+ // Initialize the graphics object with the font and character properties.
+ // SILE
+ ////if (m_fUseSepBase)
+ ////{
+ //// Assert(m_stuBaseFaceName.size() > 0);
+ //// SetUpGraphics(pgg, pgts, ichMin, m_stuBaseFaceName);
+ ////}
+ ////else
+ //// SetUpGraphics(pgg, pgts, ichMin, m_stuFaceName);
+
+ GrResult res = kresOk;
+
+ Assert(m_ptman);
+ m_ptman->State()->SetFont(pfont);
+
+ // Create a character stream on the text source.
+ GrCharStream * pchstrm = new GrCharStream(pgts, ichMin, ichStrmLim,
+ layout.startOfLine(), layout.endOfLine());
+
+ // TODO: change vertical offset to work on a character-by-character basis
+ m_dysOffset = (pgts->getVerticalOffset(ichMin) * pfont->getDPIy()) / 72;
+
+ // Run the tables and get back a segment.
+
+ bool fMoreText = false;
+ int ichCallerBtLim = -1;
+ bool fInfiniteWidth = false;
+ switch (segmode)
+ {
+ //case ksegmodeMms:
+ case ksegmodeBreak:
+ case ksegmodeRange:
+ if (segmode == ksegmodeBreak)
+ {
+ fMoreText = ((ichFontLim < ichLim) || fBacktracking);
+ ichCallerBtLim = (fBacktracking) ? ichLim : -1;
+ fInfiniteWidth = false;
+ }
+ //else if (segmode == ksegmodeMms)
+ //{
+ // fMoreText = false;
+ // ichCallerBtLim = -1;
+ // fInfiniteWidth = true;
+ // Assert(twsh == ktwshAll);
+ //}
+ else if (segmode == ksegmodeRange)
+ {
+ int ichTextLim;
+ ichTextLim = pgts->getLength();
+ fMoreText = (ichLim < ichTextLim);
+ ichCallerBtLim = -1;
+ fInfiniteWidth = true;
+ }
+ try {
+ m_ptman->Run(psegNew, pfont, pchstrm, pjus,
+ ((pjus) ? kjmodiCanShrink : kjmodiNormal),
+ layout,
+ ichSegLim, dxMaxWidth, 0,
+ fBacktracking, fMoreText, ichFontLim, fInfiniteWidth, false,
+ ichCallerBtLim,
+ nDirDepth, estJ);
+ }
+ catch (...)
+ {
+ // Disastrous problem in rendering.
+ if (!layout.dumbFallback())
+ throw; // throws original exception
+
+ // Try dumb rendering.
+ if (m_fUseSepBase)
+ SwitchGraphicsFont(true); // use the base font, which has real glyphs
+
+ m_fInErrorState = true;
+ res = RunUsingEmpty(psegNew, pfont, pchstrm, layout,
+ ichSegLim,
+ dxMaxWidth,
+ fBacktracking, fMoreText, fInfiniteWidth,
+ ichCallerBtLim,
+ nDirDepth, estJ);
+ }
+ break;
+
+ case ksegmodeJust: // justified segment
+ {
+ m_ptman->Run(psegNew, pfont, pchstrm, pjus, kjmodiJustify, layout,
+ ichSegLim,
+ dxJustifiedWidthJ, dxMaxWidth,
+ false, false, // not used
+ ichFontLim,
+ true, // infinite width
+ false, // kludge
+ -1,
+ nDirDepth, estJ);
+ //&dxWidth, &est);
+ Assert((ichLim - ichMin) == (psegNew->stopCharacter() - psegNew->startCharacter()));
+ break;
+ }
+
+ default:
+ Assert(false);
+ }
+
+ delete pchstrm;
+
+ if (m_fUseSepBase)
+ SwitchGraphicsFont(false);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return an indication of whether an error happened in trying to load Graphite tables.
+----------------------------------------------------------------------------------------------*/
+FontErrorCode GrEngine::IsValidForGraphite(int * pnVersion, int * pnSubVersion)
+{
+ if (pnVersion)
+ *pnVersion = m_fxdBadVersion >> 16;
+ if (pnSubVersion)
+ *pnSubVersion = m_fxdBadVersion & 0x0000FFFF;
+
+ return m_ferr;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Record a system error indicating that the font could not be loaded properly.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+void GrEngine::RecordFontLoadError(OLECHAR * prgchwErrMsg, int cchMax)
+{
+ if (prgchwErrMsg == NULL || cchMax == 0)
+ return;
+
+ std::wstring stuMessage = L"Error in initializing Graphite font \"";
+ stuMessage.append(m_stuFaceName);
+ if (m_stuErrCtrlFile.size())
+ {
+ stuMessage.append(L"\" (");
+ stuMessage.append(m_stuErrCtrlFile);
+ stuMessage.append(L")");
+ }
+ else
+ stuMessage.append(L"\"");
+ if (m_stuInitError.size())
+ {
+ stuMessage.append(L"--\n");
+ stuMessage.append(m_stuInitError);
+ }
+
+ std::fill_n(prgchwErrMsg, cchMax, 0);
+ std::copy(stuMessage.data(), stuMessage.data() + min(cchMax - 1, signed(stuMessage.size())),
+ prgchwErrMsg);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Record a system error indicating a bad error in rendering using a supposedly valid font.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+void GrEngine::RecordFontRunError(OLECHAR * prgchwErrMsg, int cchMax, GrResult res)
+{
+ if (prgchwErrMsg == NULL || cchMax == 0)
+ return;
+
+ std::wstring stuMessage = L"Error in rendering using Graphite font \"";
+ stuMessage.append(m_stuFaceName);
+ if (m_stuErrCtrlFile.size())
+ {
+ stuMessage.append(L"\" (");
+ stuMessage.append(m_stuErrCtrlFile);
+ stuMessage.append(L")");
+ }
+ else
+ stuMessage.append(L"\"");
+
+ std::fill_n(prgchwErrMsg, cchMax, 0);
+ std::copy(stuMessage.data(), stuMessage.data() + min(cchMax - 1, signed(stuMessage.size())),
+ prgchwErrMsg);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the font error message buffer to zero. This way we can be sure to recognize
+ an error condition by the fact that the buffer is non-zero.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+void GrEngine::ClearFontError(OLECHAR * prgchwErrMsg, int cchMaxErrMsg)
+{
+ std::fill_n(prgchwErrMsg, cchMaxErrMsg, 0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the overall direction of the writing system based on the text properties.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::GetWritingSystemDirection(ITextSource * pgts, int ichwMin)
+{
+#ifdef OLD_TEST_STUFF
+ // for test procedures:
+ if (m_stuInitialize == "RightToLeftLayout")
+ {
+ m_fRightToLeft = true;
+ return;
+ }
+#endif // OLD_TEST_STUFF
+
+ m_fRightToLeft = pgts->getRightToLeft(ichwMin);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Find the end of the range that uses the current font.
+
+ @param pgts - contains text to render
+ @param ichwMinFont - beginning of range to render with this font
+ @param pnDirDepth - return direction depth: 0=LTR, 1=RTL
+
+ @return The lim of the range that could be rendered by this font. Also the direction depth.
+----------------------------------------------------------------------------------------------*/
+int GrEngine::FindFontLim(ITextSource * pgts, int ichwMinFont, int * pnDirDepth)
+{
+ int ichwTextLen = (int)pgts->getLength();
+
+ int ichwLimRange; // range that can be rendered without breaking contextualization.
+ int ichwMinNext = ichwMinFont;
+
+ while (true)
+ {
+ std::pair<toffset, toffset> pairRange = pgts->propertyRange(ichwMinNext);
+ // int ichwMinRun = pairRange.first;
+ int ichwLimRun = pairRange.second;
+ *pnDirDepth = pgts->getDirectionDepth(ichwMinNext);
+
+ //if (ichwLim > -1 && ichwLim < ichwLimRun)
+ //{
+ // // Stopping in the middle of a run
+ // return ichwLim;
+ //}
+
+ // We can at least go to the end of this run.
+ ichwLimRange = ichwLimRun;
+ if (ichwLimRun >= ichwTextLen)
+ {
+ // Hit the end of the text-source
+ return ichwLimRange;
+ }
+ else
+ {
+ // If the following run is the same as this run except for color and underlining,
+ // we don't have to break here.
+ if (!pgts->sameSegment(ichwMinNext, ichwLimRun))
+ return ichwLimRange;
+ }
+ ichwMinNext = ichwLimRun;
+ }
+
+ return ichwLimRange;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the version number from the tables, and return false if any are a version this
+ implementation of the engine can't handle.
+----------------------------------------------------------------------------------------------*/
+bool GrEngine::CheckTableVersions(GrIStream * pgrstrm,
+ byte *pSilfTbl, int lSilfStart,
+ byte *pGlobTbl, int lGlocStart,
+ byte *pFeatTbl, int lFeatStart,
+ int * pfxdBadVersion)
+{
+ pgrstrm->OpenBuffer(pSilfTbl, isizeof(int));
+ pgrstrm->SetPositionInFont(lSilfStart);
+ *pfxdBadVersion = ReadVersion(*pgrstrm);
+ pgrstrm->CloseBuffer();
+ if (*pfxdBadVersion > kSilfVersion)
+ return false;
+
+ pgrstrm->OpenBuffer(pGlobTbl, lGlocStart + isizeof(int));
+ pgrstrm->SetPositionInFont(lGlocStart);
+ *pfxdBadVersion = ReadVersion(*pgrstrm);
+ pgrstrm->CloseBuffer();
+ if (*pfxdBadVersion > kGlocVersion)
+ return false;
+
+ pgrstrm->OpenBuffer(pFeatTbl, isizeof(int));
+ pgrstrm->SetPositionInFont(lFeatStart);
+ *pfxdBadVersion = ReadVersion(*pgrstrm);
+ pgrstrm->CloseBuffer();
+ if (*pfxdBadVersion > kFeatVersion)
+ return false;
+
+ *pfxdBadVersion = 0;
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Reinterpret the version number from a font table.
+----------------------------------------------------------------------------------------------*/
+int GrEngine::ReadVersion(GrIStream & grstrm)
+{
+ int fxdVersion = grstrm.ReadIntFromFont();
+
+ if (fxdVersion < 0x00010000)
+ fxdVersion = 0x00010000; // kludge for bug with which some fonts were generated
+
+ return fxdVersion;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the engine from the test file. Used for test procedures.
+----------------------------------------------------------------------------------------------*/
+//:Ignore
+#ifdef OLD_TEST_STUFF
+void GrEngine::InitFromControlFileTest()
+{
+ IStreamPtr qstrm;
+ FileStream::Create(m_stuCtrlFile, STGM_READ, &qstrm);
+
+ int nSilfOffset, nGlocOffset, nGlatOffset, nFeatOffset;
+
+ nSilfOffset = ReadIntFromFont(qstrm);
+ nGlocOffset = ReadIntFromFont(qstrm);
+ nGlatOffset = ReadIntFromFont(qstrm);
+ nFeatOffset = ReadIntFromFont(qstrm);
+ nSill
+
+ // Read the "Silf" table.
+ int chwMaxGlyphID;
+ int fxdVersion;
+ ReadSilfTable(qstrm, nSilOffset, 0, &chwMaxGlyphID, &fxdVersion);
+
+ // Read the "Gloc" and "Glat" tables.
+ ReadGlocAndGlatTables(qstrm, nGlocOffset, qstrm, nGlatOffset, chwMaxGlyphID, fxdVersion);
+
+ // Read the "Feat" table.
+ ReadFeatTable(qstrm, nFeatOffset);
+}
+#endif // OLD_TEST_STUFF
+//:End Ignore
+
+
+/*----------------------------------------------------------------------------------------------
+ Return whether the text is asking for bold and/or italic text.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::GetStyles(Font * pfont, int ichwMin, bool * pfBold, bool * pfItalic)
+{
+ *pfBold = pfont->bold();
+ *pfItalic = pfont->italic();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Switch the Graphics object between the Graphite table file and the base font.
+ Should only be called when we know we are using a base font, or when we are reading
+ the base font to see if it is valid.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SwitchGraphicsFont(bool fBase)
+{
+ Assert(!fBase || m_stuBaseFaceName.size() > 0);
+
+ //LgCharRenderProps chrp;
+ //pgg->get_FontCharProperties(&chrp);
+ //if (fBase)
+ //{
+ // wcsncpy(chrp.szFaceName, m_stuBaseFaceName.data(), m_stuBaseFaceName.size() + 1);
+ // chrp.szFaceName[31] = 0;
+ //}
+ //else
+ //{
+ // wcsncpy(chrp.szFaceName, m_stuFaceName.data(), m_stuFaceName.size() + 1);
+ // chrp.szFaceName[31] = 0;
+ //}
+ //pgg->SetupGraphics(&chrp);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the contents of the "Silf" table from the stream, which is on an extended
+ TrueType font file. Specifically, read the iSubTable-th sub-table (for now there is
+ only one).
+
+ WARNING: any changes to this method must be accompanied by equivalent changes to
+ CreateEmpty().
+----------------------------------------------------------------------------------------------*/
+bool GrEngine::ReadSilfTable(GrIStream & grstrm, long lTableStart, int iSubTable,
+ int * pchwMaxGlyphID, int * pfxdSilfVersion)
+{
+ grstrm.SetPositionInFont(lTableStart);
+
+ // version
+ *pfxdSilfVersion = ReadVersion(grstrm);
+ if (*pfxdSilfVersion > kSilfVersion)
+ // Version we don't know how to handle.
+ return false;
+
+ if (*pfxdSilfVersion >= 0x00030000)
+ // compiler version
+ grstrm.ReadIntFromFont();
+
+ // number of tables
+ unsigned short cSubTables = grstrm.ReadUShortFromFont();
+ Assert(cSubTables == 1); // for now
+ Assert(cSubTables <= kMaxSubTablesInFont);
+ if (cSubTables != 1 || cSubTables > kMaxSubTablesInFont)
+ return false;
+
+ if (*pfxdSilfVersion >= 0x00020000)
+ // reserved
+ grstrm.ReadShortFromFont();
+
+ // subtable offsets
+ int nSubTableOffsets[kMaxSubTablesInFont];
+ int i;
+ for (i = 0; i < cSubTables; i++)
+ {
+ nSubTableOffsets[i] = grstrm.ReadIntFromFont();
+ }
+
+ grstrm.SetPositionInFont(lTableStart + nSubTableOffsets[iSubTable]);
+
+ // Now we are at the beginning of the desired sub-table.
+
+ // Get the position of the start of the table.
+ long lSubTableStart;
+ grstrm.GetPositionInFont(&lSubTableStart);
+
+ // rule version
+ int fxdRuleVersion = (*pfxdSilfVersion >= 0x00030000) ?
+ ReadVersion(grstrm) :
+ *pfxdSilfVersion;
+
+ long lPassBlockPos = -1;
+ long lPseudosPos = -1;
+ if (*pfxdSilfVersion >= 0x00030000)
+ {
+ lPassBlockPos = grstrm.ReadUShortFromFont() + lSubTableStart;
+ lPseudosPos = grstrm.ReadUShortFromFont() + lSubTableStart;
+ }
+
+ // maximum glyph ID
+ data16 chwTmp;
+ *pchwMaxGlyphID = grstrm.ReadUShortFromFont();
+
+ // extra ascent and descent
+ m_mXAscent = grstrm.ReadShortFromFont();
+ m_mXDescent = grstrm.ReadShortFromFont();
+
+ // TODO: decide whether we want these:
+ m_mXAscent = 0;
+ m_mXDescent = 0;
+
+ // number of passes
+ byte cPasses = grstrm.ReadByteFromFont();
+ // index of first substitution pass
+ byte ipassSub1 = grstrm.ReadByteFromFont();
+ // index of first positioning pass
+ byte ipassPos1 = grstrm.ReadByteFromFont();
+ // index of first justification pass
+ byte ipassJust1 = grstrm.ReadByteFromFont();
+ // index of first reordered pass, or 0xFF if no reordering
+ byte ipassReordered1 = grstrm.ReadByteFromFont();
+ if (*pfxdSilfVersion < 0x00020000)
+ {
+ Assert(ipassJust1 == cPasses || ipassJust1 == ipassPos1);
+ ipassJust1 = ipassPos1;
+ }
+
+ // Sanity checks.
+ if (cPasses > kMaxPasses || ipassSub1 > cPasses || ipassPos1 > cPasses)
+ return false; // bad table
+
+ // line-break flag
+ int nLineBreak = grstrm.ReadByteFromFont();
+ if (nLineBreak != 0 && nLineBreak != 1)
+ return false; // bad table
+ m_fLineBreak = (bool)nLineBreak;
+
+ // range of possible cross-line-boundary contextualization
+ m_cchwPreXlbContext = grstrm.ReadByteFromFont();
+ m_cchwPostXlbContext = grstrm.ReadByteFromFont();
+
+ // actual glyph ID for pseudo-glyph (ID of bogus attribute)
+ byte bTmp; // unsigned
+ bTmp = grstrm.ReadByteFromFont();
+ m_chwPseudoAttr = bTmp;
+ // breakweight
+ bTmp = grstrm.ReadByteFromFont();
+ m_chwBWAttr = bTmp;
+ // directionality
+ bTmp = grstrm.ReadByteFromFont();
+ m_chwDirAttr = bTmp;
+
+ // Sanity checks--don't bother with these, I don't seem to be able to know what are reasonable values.
+ //if (m_chwPseudoAttr > 200 || m_chwBWAttr > 200 || m_chwDirAttr > 200)
+ // return false; // bad table
+
+ if (*pfxdSilfVersion >= 0x00020000)
+ {
+ // reserved
+ grstrm.ReadByteFromFont();
+ grstrm.ReadByteFromFont();
+
+ // justification levels
+ m_cJLevels = grstrm.ReadByteFromFont();
+ if (m_cJLevels > kMaxJLevels)
+ return false; // bad table
+ m_fBasicJust = (m_cJLevels == 0);
+ m_chwJStretch0 = 0xffff; // if no justification
+ m_chwJShrink0 = 0xffff;
+ m_chwJStep0 = 0xffff;
+ m_chwJWeight0 = 0xffff;
+ for (int i = 0; i < m_cJLevels; i++)
+ {
+ // justification glyph attribute IDs
+ bTmp = grstrm.ReadByteFromFont();
+ if (i == 0)
+ m_chwJStretch0 = bTmp;
+ bTmp = grstrm.ReadByteFromFont();
+ if (i == 0)
+ m_chwJShrink0 = bTmp;
+ bTmp = grstrm.ReadByteFromFont();
+ if (i == 0)
+ m_chwJStep0 = bTmp;
+ bTmp = grstrm.ReadByteFromFont();
+ if (i == 0)
+ m_chwJWeight0 = bTmp;
+ bTmp = grstrm.ReadByteFromFont(); // runto
+ // reserved
+ grstrm.ReadByteFromFont();
+ grstrm.ReadByteFromFont();
+ grstrm.ReadByteFromFont();
+ }
+ }
+ else
+ {
+ m_cJLevels = 0;
+ m_fBasicJust = true;
+ m_chwJStretch0 = 0xffff;
+ m_chwJShrink0 = 0xffff;
+ m_chwJStep0 = 0xffff;
+ m_chwJWeight0 = 0xffff;
+ }
+
+ // number of component attributes
+ chwTmp = grstrm.ReadUShortFromFont();
+ m_cComponents = chwTmp;
+
+ // number of user-defined slot attributes
+ m_cnUserDefn = grstrm.ReadByteFromFont();
+ if (m_cnUserDefn > kMaxUserDefinableSlotAttrs)
+ return false; // bad table
+
+ // max number of ligature components per glyph
+ m_cnCompPerLig = grstrm.ReadByteFromFont();
+ if (m_cnCompPerLig > 16)
+ return false; // bad table
+
+ // directions supported
+ bTmp = grstrm.ReadByteFromFont();
+ m_grfsdc = bTmp;
+ if (m_grfsdc > kfsdcHorizLtr + kfsdcHorizRtl + kfsdcVertFromLeft + kfsdcVertFromRight)
+ return false; // bad table
+
+ // reserved
+ bTmp = grstrm.ReadByteFromFont();
+ bTmp = grstrm.ReadByteFromFont();
+ bTmp = grstrm.ReadByteFromFont();
+
+ // critical features
+ int cCriticalFeatures;
+ if (*pfxdSilfVersion >= 0x00020000)
+ {
+ // reserved
+ bTmp = grstrm.ReadByteFromFont();
+
+ cCriticalFeatures = grstrm.ReadByteFromFont();
+ Assert(cCriticalFeatures == 0);
+ if (cCriticalFeatures != 0)
+ return false; // bad table
+
+ // reserved
+ bTmp = grstrm.ReadByteFromFont();
+ }
+
+ // rendering behaviors--ignore for now
+ byte cBehaviors = grstrm.ReadByteFromFont();
+ data16 chwBehaviors[kMaxRenderingBehavior];
+ for (i = 0; i < cBehaviors; i++)
+ {
+ chwBehaviors[i] = grstrm.ReadUShortFromFont();
+ }
+
+ // linebreak glyph ID
+ m_chwLBGlyphID = grstrm.ReadUShortFromFont();
+
+ // Jump to the beginning of the pass offset block, if we have this information.
+ if (*pfxdSilfVersion >= 0x00030000)
+ grstrm.SetPositionInFont(lPassBlockPos);
+ else
+ // Otherwise assume that's where we are!
+ Assert(lPassBlockPos == -1);
+
+ // offsets to passes, relative to the start of this subtable;
+ // note that we read (cPasses + 1) of these
+ int nPassOffsets[kMaxPasses];
+ for (i = 0; i <= cPasses; i++)
+ {
+ nPassOffsets[i] = grstrm.ReadIntFromFont();
+ }
+
+ // Jump to the beginning of the pseudo-glyph info block, if we have this information.
+ if (*pfxdSilfVersion >= 0x00030000)
+ grstrm.SetPositionInFont(lPseudosPos);
+ else
+ // Otherwise assume that's where we are!
+ Assert(lPseudosPos == -1);
+
+ // number of pseudo-glyphs and search constants
+ short snTmp;
+ snTmp = grstrm.ReadShortFromFont();
+ m_cpsd = snTmp;
+ snTmp = grstrm.ReadShortFromFont();
+ m_dipsdInit = snTmp;
+ snTmp = grstrm.ReadShortFromFont();
+ m_cPsdLoop = snTmp;
+ snTmp = grstrm.ReadShortFromFont();
+ m_ipsdStart = snTmp;
+
+ // unicode-to-pseudo map
+ m_prgpsd = new GrPseudoMap[m_cpsd];
+ for (i = 0; i < m_cpsd; i++)
+ {
+ if (*pfxdSilfVersion <= 0x00010000)
+ {
+ utf16 chwUnicode = grstrm.ReadUShortFromFont();
+ m_prgpsd[i].SetUnicode(chwUnicode);
+ }
+ else
+ {
+ int nUnicode = grstrm.ReadIntFromFont();
+ m_prgpsd[i].SetUnicode(nUnicode);
+ }
+ gid16 chwPseudo = grstrm.ReadUShortFromFont();
+ m_prgpsd[i].SetPseudoGlyph(chwPseudo);
+ }
+
+ // class table
+ m_pctbl = new GrClassTable();
+ if (!m_pctbl->ReadFromFont(grstrm, *pfxdSilfVersion))
+ return false;
+
+ // passes
+ return m_ptman->CreateAndReadPasses(grstrm, *pfxdSilfVersion, fxdRuleVersion,
+ cPasses, lSubTableStart, nPassOffsets,
+ ipassSub1, ipassPos1, ipassJust1, ipassReordered1);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set up the engine with no Graphite smarts at all, just dummy tables.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::CreateEmpty()
+{
+ // Silf table
+
+ m_mXAscent = 0;
+ m_mXDescent = 0;
+
+ m_fLineBreak = false;
+
+ // range of possible cross-line-boundary contextualization
+ m_cchwPreXlbContext = 0;
+ m_cchwPostXlbContext = 0;
+
+ // Bogus attribute IDs:
+ m_chwPseudoAttr = 1; // actual glyph ID for pseudo-glyph (ID of bogus attribute)
+ m_chwBWAttr = 2; // breakweight
+ m_chwDirAttr = 3; // directionality
+
+ m_cComponents = 0; // number of component attributes
+
+ m_cnUserDefn = 0; // number of user-defined slot attributes
+ m_cnCompPerLig = 0; // max number of ligature components
+
+ m_grfsdc = kfsdcHorizLtr; // supported script direction
+
+ // linebreak glyph ID
+ m_chwLBGlyphID = 0xFFFE;
+
+ // number of pseudo-glyphs and search constants
+ m_cpsd = 0;
+ m_dipsdInit = 0;
+ m_cPsdLoop = 0;
+ m_ipsdStart = 0;
+
+ // class table
+ m_pctbl = new GrClassTable();
+ m_pctbl->CreateEmpty();
+
+ // passes
+ if (m_ptman != 0)
+ m_ptman->CreateEmpty();
+
+ // Gloc and Glat tables
+ m_pgtbl = new GrGlyphTable();
+ m_pgtbl->SetNumberOfGlyphs(0);
+ m_pgtbl->SetNumberOfComponents(0);
+ m_pgtbl->SetNumberOfStyles(1); // for now
+
+ m_pgtbl->CreateEmpty();
+
+ // Feat table
+ m_cfeat = 0;
+ m_rglcidFeatLabelLangs = NULL;
+ m_clcidFeatLabelLangs = 0;
+
+ // Language table
+ m_langtbl.CreateEmpty();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Create the glyph table and fill it in from the font stream.
+----------------------------------------------------------------------------------------------*/
+bool GrEngine::ReadGlocAndGlatTables(GrIStream & grstrmGloc, long lGlocStart,
+ GrIStream & grstrmGlat, long lGlatStart,
+ int chwGlyphIDMax, int fxdSilfVersion)
+{
+ // Determine the highest used glyph ID number.
+// int chwGlyphIDMax = m_chwLBGlyphID;
+// for (int ipsd = 0; ipsd < m_cpsd; ipsd++)
+// {
+// if (m_prgpsd[ipsd].PseudoGlyph() > chwGlyphIDMax)
+// chwGlyphIDMax = m_prgpsd[ipsd].PseudoGlyph();
+// }
+
+ // Create the glyph table.
+ m_pgtbl = new GrGlyphTable();
+ m_pgtbl->SetNumberOfGlyphs(chwGlyphIDMax + 1);
+ m_pgtbl->SetNumberOfComponents(m_cComponents);
+ m_pgtbl->SetNumberOfStyles(1); // for now
+
+ return m_pgtbl->ReadFromFont(grstrmGloc, lGlocStart, grstrmGlat, lGlatStart,
+ m_chwBWAttr, m_chwJStretch0, m_cJLevels, m_cnCompPerLig, fxdSilfVersion);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the contents of the "Feat" table from the stream, which is on an extended
+ TrueType font file.
+----------------------------------------------------------------------------------------------*/
+bool GrEngine::ReadFeatTable(GrIStream & grstrm, long lTableStart)
+{
+ short snTmp;
+ data16 chwTmp;
+ int nTmp;
+
+ grstrm.SetPositionInFont(lTableStart);
+
+ // version
+ int fxdVersion = ReadVersion(grstrm);
+ if (fxdVersion > kFeatVersion)
+ return false;
+
+ // number of features
+ int cfeat;
+ cfeat = grstrm.ReadUShortFromFont();
+ if (cfeat > kMaxFeatures)
+ return false; // bad table;
+
+ // reserved
+ chwTmp = grstrm.ReadUShortFromFont();
+ nTmp = grstrm.ReadIntFromFont();
+
+ std::vector<featid> vnIDs; // unsigned ints
+ std::vector<int> vnOffsets;
+ std::vector<int> vcfset;
+
+ m_cfeat = 0;
+ int ifeat;
+ for (ifeat = 0; ifeat < cfeat; ifeat++)
+ {
+ // ID
+ featid nID;
+ if (fxdVersion >= 0x00020000)
+ nID = (unsigned int)grstrm.ReadIntFromFont();
+ else
+ nID = grstrm.ReadUShortFromFont();
+ vnIDs.push_back(nID);
+ // number of settings
+ data16 cfset = grstrm.ReadUShortFromFont();
+ vcfset.push_back(cfset);
+ if (fxdVersion >= 0x00020000)
+ grstrm.ReadShortFromFont(); // pad bytes
+ // offset to settings list
+ nTmp = grstrm.ReadIntFromFont();
+ vnOffsets.push_back(nTmp);
+ // flags
+ chwTmp = grstrm.ReadUShortFromFont();
+ Assert(chwTmp == 0x8000); // mutually exclusive
+ // index into name table of UI label
+ int nNameId = grstrm.ReadShortFromFont();
+
+ if (fxdVersion <= 0x00020000 && nID == GrFeature::knLangFeatV2)
+ {
+ // Ignore the obsolete "lang" feature which has ID = 1
+ vnIDs.pop_back();
+ vcfset.pop_back();
+ vnOffsets.pop_back();
+ continue;
+ }
+ AddFeature(nID, nNameId, cfset);
+ }
+
+ // default feature setting value and name strings;
+ for (ifeat = 0; ifeat < m_cfeat; ifeat++)
+ {
+ GrFeature * pfeat = m_rgfeat + ifeat;
+ Assert(pfeat->ID() == vnIDs[ifeat]);
+
+ grstrm.SetPositionInFont(lTableStart + vnOffsets[ifeat]);
+
+ // Each feature has been initialized with blank spots for the number of settings
+ // it has.
+ int cfset = vcfset[ifeat];
+ Assert(pfeat->NumberOfSettings() == cfset);
+ for (int ifset = 0; ifset < cfset; ifset++)
+ {
+ snTmp = grstrm.ReadShortFromFont(); // yes, signed (TT feat table spec says unsigned)
+ short snTmp2 = grstrm.ReadShortFromFont();
+ pfeat->AddSetting(snTmp, snTmp2);
+
+ if (ifset == 0)
+ {
+ // default setting value--first in list
+ pfeat->SetDefault(snTmp);
+ }
+ }
+ }
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the contents of the "Sill" table from the stream, which is on an extended
+ TrueType font file.
+----------------------------------------------------------------------------------------------*/
+bool GrEngine::ReadSillTable(GrIStream & grstrm, long lTableStart)
+{
+ grstrm.SetPositionInFont(lTableStart);
+
+ // version
+ int fxdVersion = ReadVersion(grstrm);
+ if (fxdVersion > kSillVersion)
+ return false;
+
+ return m_langtbl.ReadFromFont(&grstrm, fxdVersion);
+}
+
+/*----------------------------------------------------------------------------------------------
+ An error happened in running the tables. Set up temporary dummy tables, and try running
+ with dumb rendering.
+ Return kresUnexpected if even running the empty tables crashed, kresFail otherwise.
+----------------------------------------------------------------------------------------------*/
+GrResult GrEngine::RunUsingEmpty(Segment * psegNew, Font * pfont,
+ GrCharStream * pchstrm, LayoutEnvironment & layout,
+ int ichStop,
+ float dxMaxWidth,
+ bool fNeedFinalBreak, bool fMoreText, bool fInfiniteWidth,
+ int ichwCallerBtLim,
+ int nDirDepth, SegEnd estJ)
+{
+ // Save the current state of the engine.
+ int mXAscentSave = m_mXAscent;
+ int mXDescentSave = m_mXDescent;
+ bool fLineBreakSave = m_fLineBreak;
+ int cchwPreXlbContextSave = m_cchwPreXlbContext;
+ int cchwPostXlbContextSave = m_cchwPostXlbContext;
+ data16 chwPseudoAttrSave = m_chwPseudoAttr;
+ data16 chwBWAttrSave = m_chwBWAttr;
+ data16 chwDirAttrSave = m_chwDirAttr;
+ int cComponentsSave = m_cComponents;
+ int cnUserDefnSave = m_cnUserDefn;
+ int cnCompPerLigSave = m_cnCompPerLig;
+ unsigned int grfsdcSave = m_grfsdc;
+ gid16 chwLBGlyphIDSave = m_chwLBGlyphID;
+ int cpsdSave = m_cpsd;
+ int dipsdInitSave = m_dipsdInit;
+ int cPsdLoopSave = m_cPsdLoop;
+ int ipsdStartSave = m_ipsdStart;
+ GrTableManager * ptmanSave = m_ptman;
+ GrClassTable * pctblSave = m_pctbl;
+ GrGlyphTable * pgtblSave = m_pgtbl;
+ int cfeatSave = m_cfeat;
+ GrResult resFontReadSave = m_resFontRead;
+
+ GrResult res = kresFail;
+
+ pchstrm->Restart();
+
+ // Create dummy versions of the tables and run them.
+ m_pctbl = NULL;
+ m_pgtbl = NULL;
+ m_ptman = new GrTableManager(this);
+ m_ptman->State()->SetFont(pfont);
+ CreateEmpty();
+
+ try
+ {
+ m_ptman->Run(psegNew, pfont, pchstrm, NULL, kjmodiNormal, layout,
+ ichStop, dxMaxWidth, 0,
+ fNeedFinalBreak, fMoreText, -1, fInfiniteWidth, false,
+ ichwCallerBtLim,
+ nDirDepth, estJ);
+ }
+ catch(...)
+ {
+ // Still didn't work. Oh, well, not much we can do.
+ res = kresUnexpected;
+ }
+
+ psegNew->SetErroneous(true);
+
+ if (m_ptman)
+ delete m_ptman;
+ if (m_pctbl)
+ delete m_pctbl;
+ if (m_pgtbl)
+ delete m_pgtbl;
+
+ // Put everything back the way it was.
+ m_mXAscent = mXAscentSave;
+ m_mXDescent = mXDescentSave;
+ m_fLineBreak = fLineBreakSave;
+ m_cchwPreXlbContext = cchwPreXlbContextSave;
+ m_cchwPostXlbContext = cchwPostXlbContextSave;
+ m_chwPseudoAttr = chwPseudoAttrSave;
+ m_chwBWAttr = chwBWAttrSave;
+ m_chwDirAttr = chwDirAttrSave;
+ m_cComponents = cComponentsSave;
+ m_cnUserDefn = cnUserDefnSave;
+ m_cnCompPerLig = cnCompPerLigSave;
+ m_grfsdc = grfsdcSave;
+ m_chwLBGlyphID = chwLBGlyphIDSave;
+ m_cpsd = cpsdSave;
+ m_dipsdInit = dipsdInitSave;
+ m_cPsdLoop = cPsdLoopSave;
+ m_ipsdStart = ipsdStartSave;
+ m_ptman = ptmanSave;
+ m_pctbl = pctblSave;
+ m_pgtbl = pgtblSave;
+ m_cfeat = cfeatSave;
+ m_resFontRead = resFontReadSave;
+
+ return res;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the glyph ID for the given Unicode value.
+----------------------------------------------------------------------------------------------*/
+gid16 GrEngine::GetGlyphIDFromUnicode(int nUnicode)
+{
+ gid16 chwGlyphID = MapToPseudo(nUnicode);
+ if (chwGlyphID != 0)
+ return chwGlyphID; // return a pseudo-glyph
+
+#ifdef OLD_TEST_STUFF
+ if (!m_pCmap31)
+ // test procedures
+ return chwUnicode;
+#endif // OLD_TEST_STUFF
+
+ // Otherwise, get the glyph ID from the font's cmap.
+
+ if (m_pCmap_3_10)
+ return gid16(TtfUtil::Cmap310Lookup(m_pCmap_3_10, nUnicode));
+ else if (m_pCmap_3_1)
+ return gid16(TtfUtil::Cmap31Lookup(m_pCmap_3_1, nUnicode));
+ else
+ return 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the pseudo-glyph corresponding to the given Unicode input, or 0 if none.
+----------------------------------------------------------------------------------------------*/
+gid16 GrEngine::MapToPseudo(int nUnicode)
+{
+ if (m_cpsd == 0)
+ return 0;
+
+#ifdef _DEBUG
+ int nPowerOf2 = 1;
+ while (nPowerOf2 <= m_cpsd)
+ nPowerOf2 <<= 1;
+ nPowerOf2 >>= 1;
+ // Now nPowerOf2 is the max power of 2 <= m_cpds
+ Assert((1 << m_cPsdLoop) == nPowerOf2); // m_cPsdLoop == log2(nPowerOf2)
+ Assert(m_dipsdInit == nPowerOf2);
+ Assert(m_ipsdStart == m_cpsd - m_dipsdInit);
+#endif // _DEBUG
+
+ int dipsdCurr = m_dipsdInit;
+
+ GrPseudoMap * ppsdCurr = m_prgpsd + m_ipsdStart;
+ while (dipsdCurr > 0)
+ {
+ int nTest;
+ if (ppsdCurr < m_prgpsd)
+ nTest = -1;
+ else
+ nTest = ppsdCurr->Unicode() - nUnicode;
+
+ if (nTest == 0)
+ return ppsdCurr->PseudoGlyph();
+
+ dipsdCurr >>= 1; // divide by 2
+ if (nTest < 0)
+ ppsdCurr += dipsdCurr;
+ else // (nTest > 0)
+ ppsdCurr -= dipsdCurr;
+ }
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the actual glyph ID to use for glyph metrics and output. For most glyphs, this
+ is just the glyph ID we're already working with, but for pseudo-glyphs it will something
+ different.
+----------------------------------------------------------------------------------------------*/
+gid16 GrEngine::ActualGlyphForOutput(gid16 chwGlyphID)
+{
+ gid16 chwActual = gid16(GlyphAttrValue(chwGlyphID, m_chwPseudoAttr));
+ if (chwActual == 0)
+ return chwGlyphID; // not a pseudo, we're already working with the actual glyph ID
+ else
+ return chwActual;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Look up name based on lang id and name id in name table.
+ Currently used to look up feature names.
+----------------------------------------------------------------------------------------------*/
+std::wstring GrEngine::StringFromNameTable(int nLangID, int nNameID)
+{
+ std::wstring stuName;
+ stuName.erase();
+ size_t lOffset = 0, lSize = 0;
+
+ // The Graphite compiler stores our names in either
+ // the MS (platform id = 3) Unicode (writing system id = 1) table
+ // or the MS Symbol (writing system id = 0) table. Try MS Unicode first.
+ // lOffset & lSize are in bytes.
+ // new interface:
+ if (!TtfUtil::GetNameInfo(m_pNameTbl, 3, 1, nLangID, nNameID, lOffset, lSize))
+ {
+ if (!TtfUtil::GetNameInfo(m_pNameTbl, 3, 0, nLangID, nNameID, lOffset, lSize))
+ {
+ return stuName;
+ }
+ }
+
+ size_t cchw = (unsigned(lSize) / sizeof(utf16));
+ utf16 * pchwName = new utf16[cchw+1]; // lSize - byte count for Uni str
+ const utf16 *pchwSrcName = reinterpret_cast<const utf16*>(m_pNameTbl + lOffset);
+ std::transform(pchwSrcName, pchwSrcName + cchw, pchwName, std::ptr_fun<utf16,utf16>(lsbf));
+ pchwName[cchw] = 0; // zero terminate
+ #ifdef _WIN32
+ stuName.assign((const wchar_t*)pchwName, cchw);
+ #else
+ wchar_t * pchwName32 = new wchar_t[cchw+1]; // lSize - byte count for Uni str
+ for (int i = 0; i <= signed(cchw); i++) {
+ pchwName32[i] = pchwName[i];
+ }
+ stuName.assign(pchwName32, cchw);
+ delete [] pchwName32;
+ #endif
+
+ delete [] pchwName;
+ return stuName;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Add a feature (eg, when loading from the font).
+----------------------------------------------------------------------------------------------*/
+void GrEngine::AddFeature(featid nID, int nNameId, int cfset, int nDefault)
+{
+ if (m_cfeat >= kMaxFeatures)
+ return;
+
+ int ifeat = m_cfeat;
+ m_rgfeat[ifeat].Initialize(nID, nNameId, cfset, nDefault);
+// m_hmnifeat.Insert(nID, ifeat);
+ m_cfeat++;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the feature with the given ID, or NULL if none.
+----------------------------------------------------------------------------------------------*/
+GrFeature * GrEngine::FeatureWithID(featid nID, int * pifeat)
+{
+ for (int ifeat = 0; ifeat < m_cfeat; ifeat++)
+ {
+ if (m_rgfeat[ifeat].ID() == nID)
+ {
+ *pifeat = ifeat;
+ return m_rgfeat + ifeat;
+ }
+ }
+ *pifeat = -1;
+ return NULL;
+
+
+ // Alternate implementation if we end up with so many features that we need to use
+ // a hash map:
+// int ifeat;
+// if (m_hmnifeat.Retrieve(nID, &ifeat))
+// {
+// Assert(ifeat < kMaxFeatures);
+// return m_rgfeat + ifeat; // may be NULL
+// }
+// else
+// return NULL;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the default for the feature at the given index in the array.
+----------------------------------------------------------------------------------------------*/
+int GrEngine::DefaultForFeatureAt(int ifeat)
+{
+ Assert(ifeat < kMaxFeatures);
+ if (ifeat >= m_cfeat || ifeat < 0)
+ return 0; // undefined feature
+
+ return m_rgfeat[ifeat].DefaultValue();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the default for the feature at the given index in the array.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetDefaultForFeatureAt(int ifeat, int nValue)
+{
+ Assert(ifeat < kMaxFeatures);
+ Assert(ifeat < m_cfeat);
+ if (ifeat >= 0)
+ m_rgfeat[ifeat].SetDefault(nValue);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the default feature settings for the given language.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::DefaultsForLanguage(isocode lgcode,
+ std::vector<featid> & vnFeats, std::vector<int> & vnValues)
+{
+ m_langtbl.LanguageFeatureSettings(lgcode, vnFeats, vnValues);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the directionality and breakweight attributes of a new slot based on its
+ glyph ID.
+ REVIEW: we could optimize by not initializing from the glyph table right away,
+ but waiting until we need the value.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::InitSlot(GrSlotState * pslot, int nUnicode)
+{
+ gid16 chwGlyphID = pslot->GlyphID();
+
+ if (m_ptman->InternalJustificationMode() != kjmodiNormal)
+ {
+ if (m_cJLevels > 0)
+ {
+ Assert(m_cJLevels == 1); // for now
+ // TODO: do this at level 0.
+ pslot->SetJStretch(m_pgtbl->GlyphAttrValue(chwGlyphID, m_chwJStretch0));
+ pslot->SetJShrink( m_pgtbl->GlyphAttrValue(chwGlyphID, m_chwJShrink0));
+ pslot->SetJStep( m_pgtbl->GlyphAttrValue(chwGlyphID, m_chwJStep0));
+ pslot->SetJWeight( m_pgtbl->GlyphAttrValue(chwGlyphID, m_chwJWeight0));
+ }
+ else if (nUnicode == knSpace)
+ {
+ // Basic stretch/shrink for whitespace.
+ // TODO: do this at level 0.
+ Assert(m_fBasicJust);
+ int mAdv = pslot->AdvanceX(m_ptman);
+ pslot->SetJStretch(mAdv * 100); // stretch up to 100 times natural width
+ pslot->SetJShrink(mAdv / 4); // shrink to 75%
+ pslot->SetJWeight(1);
+ }
+ }
+
+ if (m_pgtbl && !m_pgtbl->IsEmpty())
+ {
+ // Initialize from glyph table.
+ pslot->SetBreakWeight(m_pgtbl->GlyphAttrValue(chwGlyphID, m_chwBWAttr));
+
+ DirCode dirc = DirCode(m_pgtbl->GlyphAttrValue(chwGlyphID, m_chwDirAttr));
+ if (BidiCode(nUnicode) && (chwGlyphID == 0 || dirc == kdircNeutral))
+ // A built-in character for the bidi algorithm that is not defined in the font but
+ // must be given a special directionality:
+ goto LDefaults;
+
+ pslot->SetDirectionality(dirc);
+
+ return;
+ }
+
+LDefaults:
+ // Otherwise, in fill defaults for some basic values.
+ if (pslot->BreakWeight() == GrSlotState::kNotYetSet8)
+ {
+ switch (nUnicode)
+ {
+ case knSpace:
+ pslot->SetBreakWeight(klbWordBreak);
+ break;
+ case knHyphen:
+ pslot->SetBreakWeight(klbHyphenBreak);
+ break;
+ default:
+ pslot->SetBreakWeight(klbLetterBreak);
+ }
+ }
+
+ if ((int)pslot->Directionality() == GrSlotState::kNotYetSet8)
+ {
+ switch (nUnicode)
+ {
+ case knSpace:
+ pslot->SetDirectionality(kdircWhiteSpace);
+ break;
+ case knLRM:
+ pslot->SetDirectionality(kdircL);
+ break;
+ case knRLM:
+ pslot->SetDirectionality(kdircR);
+ break;
+ case knLRO:
+ pslot->SetDirectionality(kdircLRO);
+ break;
+ case knRLO:
+ pslot->SetDirectionality(kdircRLO);
+ break;
+ case knLRE:
+ pslot->SetDirectionality(kdircLRE);
+ break;
+ case knRLE:
+ pslot->SetDirectionality(kdircRLE);
+ break;
+ case knPDF:
+ pslot->SetDirectionality(kdircPDF);
+ break;
+ default:
+ if (chwGlyphID == LBGlyphID())
+ pslot->SetDirectionality(kdircNeutral);
+ else
+ pslot->SetDirectionality(kdircL);
+ }
+ }
+ else
+ Assert(false); // currently no way to set directionality ahead of time
+}
+
+/*----------------------------------------------------------------------------------------------
+ We have just changed this slot's glyph ID. Change the directionality and breakweight
+ attributes of a new slot based on its glyph ID.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetSlotAttrsFromGlyphAttrs(GrSlotState * pslot)
+{
+ InitSlot(pslot);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Create a new segment.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::NewSegment(Segment ** ppseg)
+{
+ *ppseg = new Segment;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Methods to pass on to the tables.
+----------------------------------------------------------------------------------------------*/
+gid16 GrEngine::GetClassGlyphIDAt(int nClass, int nIndex)
+{
+ if (nIndex < 0)
+ return 0;
+ if (nClass < 0)
+ return 0;
+
+ try {
+ return m_pctbl->GetGlyphID(nClass, nIndex);
+ }
+ catch (...)
+ {
+ return 0;
+ }
+}
+
+int GrEngine::GetIndexInGlyphClass(int nClass, gid16 chwGlyphID)
+{
+ try {
+ return m_pctbl->FindIndex(nClass, chwGlyphID);
+ }
+ catch (...)
+ {
+ return -1;
+ }
+}
+
+size_t GrEngine::NumberOfGlyphsInClass(int nClass)
+{
+ try {
+ return m_pctbl->NumberOfGlyphsInClass(nClass);
+ }
+ catch (...)
+ {
+ return 0;
+ }
+}
+
+int GrEngine::GlyphAttrValue(gid16 chwGlyphID, int nAttrID)
+{
+#ifdef OLD_TEST_STUFF
+ if (!m_pgtbl) // test procedures
+ return 0;
+#endif // OLD_TEST_STUFF
+
+ return m_pgtbl->GlyphAttrValue(chwGlyphID, nAttrID);
+}
+
+int GrEngine::ComponentIndexForGlyph(gid16 chwGlyphID, int nCompID)
+{
+#ifdef OLD_TEST_STUFF
+ if (!m_pgtbl) // test procedures
+ return -1;
+#endif // OLD_TEST_STUFF
+
+ return m_pgtbl->ComponentIndexForGlyph(chwGlyphID, nCompID);
+}
+
+
+//:>********************************************************************************************
+//:> For test procedures
+//:>********************************************************************************************
+
+//:Ignore
+
+#ifdef OLD_TEST_STUFF
+
+void GrEngine::SetUpPseudoGlyphTest()
+{
+ m_cpsd = 5;
+
+ m_prgpsd = new GrPseudoMap[m_cpsd];
+
+ m_prgpsd[0].SetUnicode(65);
+ m_prgpsd[0].SetPseudoGlyph(1065);
+
+ m_prgpsd[1].SetUnicode(66);
+ m_prgpsd[1].SetPseudoGlyph(1066);
+
+ m_prgpsd[2].SetUnicode(67);
+ m_prgpsd[2].SetPseudoGlyph(1067);
+
+ m_prgpsd[3].SetUnicode(68);
+ m_prgpsd[3].SetPseudoGlyph(1068);
+
+ m_prgpsd[4].SetUnicode(69);
+ m_prgpsd[4].SetPseudoGlyph(1069);
+
+ m_dipsdInit = 4;
+ m_cPsdLoop = 2;
+ m_ipsdStart = 1;
+}
+
+#endif // OLD_TEST_STUFF
+
+
+//:>********************************************************************************************
+//:> New interface
+//:>********************************************************************************************
+/*----------------------------------------------------------------------------------------------
+ Store the default features values as specified by the client.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::AssignDefaultFeatures(int cfeat, FeatureSetting * prgfset)
+{
+ for (int ifeatIn = 0; ifeatIn < cfeat; ifeatIn++)
+ {
+ int ifeat;
+ FeatureWithID(prgfset[ifeatIn].id, &ifeat);
+ if (ifeat >= 0 )
+ SetDefaultForFeatureAt(ifeat, prgfset[ifeatIn].value);
+ }
+}
+
+bool GrEngine::LoggingTransduction()
+{
+ Assert(false);
+ //return m_pfface->getLogging();
+ //return m_fLogXductn;
+ return true;
+}
+
+} // namespace gr
+
+//:End Ignore
+
diff --git a/Build/source/libs/graphite/src/segment/GrEngine.h b/Build/source/libs/graphite/src/segment/GrEngine.h
new file mode 100644
index 00000000000..81b54e805bc
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrEngine.h
@@ -0,0 +1,622 @@
+/*--------------------------------------------------------------------
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrEngine.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Contains the definition of the GrEngine class.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GR_ENGINE_INCLUDED
+#define GR_ENGINE_INCLUDED
+#include <limits>
+
+#ifdef _MSC_VER
+#include <crtdbg.h>
+#endif
+
+namespace gr
+{
+class IGrJustifier;
+class Segment;
+
+
+/*----------------------------------------------------------------------------------------------
+ The GrEngine serves as the top level object that knows how to run Graphite tables
+ and generate Graphite segments.
+
+ Primarily, this class implements IRenderEngine, which allows it to serve as a FW
+ rendering engine. It also implements ISimpleInit, a general interface for initializing
+ using a string. Finally, it implements ITraceControl, a very simple interface which
+ allows a client to flip a flag indicating whether or not we want to output a log of
+ the Graphite transduction process.
+
+ Hungarian: greng
+----------------------------------------------------------------------------------------------*/
+class GrEngine : public GraphiteProcess
+{
+ friend class FontFace;
+ friend class FontMemoryUsage;
+
+public:
+ // Constructors & destructors:
+ GrEngine();
+ void BasicInit();
+ virtual ~GrEngine();
+ void DestroyContents(bool fDestroyCmap = true);
+
+ // ISimpleInit methods:
+ ////GrResult InitNew(const byte * prgb, int cb); -- obsolete
+ ////GrResult get_InitializationData(int cchMax, OLECHAR * rgchw, int * pcch); -- obsolete
+
+ // ITraceControl methods:
+ //GrResult SetTracing(int n);
+ //GrResult GetTracing(int * pnOptions);
+
+ // IRenderingFeatures methods:
+ //GrResult GetFeatureIDs(int cMax, int * prgFids, int * pcfid);
+ //GrResult GetFeatureLabel(int fid, int nLanguage, int cchMax, OLECHAR * rgchw, int * pcch);
+ //GrResult GetFeatureValues(int fid, int cfvalMax,
+ // int * prgfval, int * pcfval, int * pfvalDefault);
+ //GrResult GetFeatureValueLabel(int fid, int fval, int nLanguage,
+ // int cchMax, OLECHAR * rgchw, int * pcch);
+
+ // IRenderEngine methods:
+ ////GrResult InitRenderer(IGrGraphics * pgg, OLECHAR * prgchData, int cchData); -- obsolete
+ ////GrResult FontIsValid(OLECHAR * prgchwErrMsg, int cchMaxErrMsg);
+
+ GrResult get_SegDatMaxLength(int * pcb);
+
+ //GrResult FindBreakPoint(Font * pfont, ITextSource * pgts, DELETE
+ // int ichMin, int ichLim, int ichLimBacktrack,
+ // bool fNeedFinalBreak,
+ // bool fStartLine,
+ // float dxMaxWidth,
+ // LineBrk lbPref, LineBrk lbMax,
+ // TrWsHandling twsh, bool fParaRtoL,
+ // Segment ** ppsegRet,
+ // int * pdichwLimSeg, float * pdxWidth, SegEnd * pest,
+ // int cbPrev, byte * pbPrevSegDat,
+ // int cbNextMax, byte * pbNextSegDat, int * pcbNextSegDat,
+ // int * pdichwContext,
+ // std::ostream * pstrmLog,
+ // OLECHAR * prgchwErrMsg, int cchMaxErrMsg);
+
+ //GrResult FindBreakPointWJust(Font * pfont, ITextSource * pgts, IGrJustifier * pgjus,
+ // int ichMin, int ichLim, int ichLimBacktrack, DELETE
+ // bool fNeedFinalBreak,
+ // bool fStartLine,
+ // float dxMaxWidth,
+ // LineBrk lbPref, LineBrk lbMax,
+ // TrWsHandling twsh, bool fParaRtoL,
+ // Segment ** ppsegRet,
+ // int * pdichwLimSeg, float * pdxWidth, SegEnd * pest,
+ // int cbPrev, byte * pbPrevSegDat,
+ // int cbNextMax, byte * pbNextSegDat, int * pcbNextSegDat,
+ // int * pdichwContext,
+ // std::ostream * pstrmLog,
+ // OLECHAR * prgchwErrMsg, int cchMaxErrMsg);
+
+ GrResult get_ScriptDirection(unsigned int * pgrfsdc, OLECHAR * prgchwErrMsg, int cchMaxErrMsg);
+
+ // DELETE
+ //GrResult MakeJustifiedSegment(Font * pfont, ITextSource * pgts, IGrJustifier * pgj,
+ // int ichMin, int ichLim,
+ // bool fStartLine, bool fEndLine,
+ // float dxUnjustifiedWidth, float dxJustifiedWidth,
+ // TrWsHandling twsh, SegEnd est, LineBrk lb,
+ // bool fParaRtl,
+ // Segment ** ppsegRet, float * pdxWidth,
+ // //int cbPrev, byte * pbPrevSegDat, int cbNextMax, byte * pbNextSegDat, int * pcbNextSegDat, int * pdichwContext,
+ // std::ostream * pstrmLog,
+ // OLECHAR * prgchwErrMsg, int cchwMaxErrMsg);
+
+ // IJustifyingRenderer methods:
+ // These methods return kresInvalidArg if the attribute ID is invalid or inappropriate;
+ // kresFail if the engine is not in an appropriate state to return the information.
+ virtual GrResult getGlyphAttribute(int iGlyph, int jgat, int nLevel, float * pValueRet);
+ virtual GrResult getGlyphAttribute(int iGlyph, int jgat, int nLevel, int * pValueRet);
+ virtual GrResult setGlyphAttribute(int iGlyph, int jgat, int nLevel, float value);
+ virtual GrResult setGlyphAttribute(int iGlyph, int jgat, int nLevel, int value);
+
+ // Interface methods not used by FW:
+
+ ////GrResult IsGraphiteFont(IGrGraphics * pgg); -- obsolete
+
+ ////GrResult FontAscentAndDescent(IGrGraphics * pgg, int * pysAscent, int * pysDescent); -- obsolete
+
+ //GrResult MakeMeasuredSegment(
+ // Font * pfont, ITextSource * pgts,
+ // int ichMin, int ichLim,
+ // bool fParaRtl,
+ // Segment ** ppsegRet, SegEnd * pest,
+ // std::ostream * pstrmLog,
+ // OLECHAR * prgchwErrMsg, int cchMaxErrMsg);
+
+ //GrResult MakeSegmentFromRange(Font * pfont, ITextSource * pgts, IGrJustifier * pgj,
+ // int ichMin, int ichLim,
+ // bool fStartLine, bool fEndLine,
+ // TrWsHandling twsh, bool fParaRtl,
+ // Segment ** ppsegRet, float * pdxWidth, SegEnd * pest,
+ // int cbPrev, byte * pbPrevSegDat, int cbNextMax, byte * pbNextSegDat, int * pcbNextSegDat,
+ // int * pdichwContext,
+ // std::ostream * pstrmLog,
+ // OLECHAR * prgchwErrMsg, int cchwMaxErrMsg);
+
+ // NEW interface
+
+ GrResult ReadFontTables(Font * pfont, bool fItalic);
+
+ FontErrorCode IsValidForGraphite(int * pnVersion, int * pnSubVersion);
+
+ // Other public methods
+
+ GrResult FindBreakPointAux(Font * pfont, ITextSource * pgts, IGrJustifier * pgjus,
+ int ichwMin, int ichwLim, int ichwLimBacktrack,
+ bool fNeedFinalBreakArg, bool fStartLine, bool fEndLine,
+ float dxMaxWidth, bool fWidthIsCharCount,
+ LineBrk lbPref, LineBrk lbMax, TrWsHandling twsh, bool fParaRtl,
+ Segment ** ppsegRet,
+ int * pdichwLimSeg,
+ float * pdxWidth, SegEnd * pest,
+ int cbPrev, byte * pbPrevSegDat,
+ int cbNextMax, byte * pbNextSegDat, int * pcbNextSegDat,
+ int * pdichwContext,
+ std::ostream * pstrmLog,
+ OLECHAR * prgchwErrMsg, int cchMaxErrMsg);
+
+ gid16 GetGlyphIDFromUnicode(int nUnicode);
+ gid16 ActualGlyphForOutput(utf16 chwGlyphID);
+
+ int GetFontEmUnits()
+ {
+ return m_mFontEmUnits;
+ }
+
+ gid16 LBGlyphID()
+ {
+ return m_chwLBGlyphID;
+ }
+
+ gid16 GetClassGlyphIDAt(int nClass, int nIndex);
+ int GetIndexInGlyphClass(int nClass, gid16 chwGlyphID);
+ size_t NumberOfGlyphsInClass(int nClass);
+ int GlyphAttrValue(gid16 chwGlyphID, int nAttrID);
+ int ComponentIndexForGlyph(gid16 chwGlyphID, int nCompID);
+
+ ////void InitFontName(std::wstring stuInitialize, std::wstring & stuFaceName, std::wstring & stuFeatures); -- obsolete
+ void RecordFontLoadError(OLECHAR * prgchwErrMsg, int cchMaxErrMsg);
+ void RecordFontRunError(OLECHAR * prgchwErrMsg, int cchMaxErrMsg, GrResult res);
+ void ClearFontError(OLECHAR * prgchwErrMsg, int cchMaxErrMsg);
+ void GetWritingSystemDirection(ITextSource * pgts, int ichwMin);
+ ////GrResult SetUp(IGrGraphics * pgg, std::wstring stuFeatures); -- obsolete
+ ////GrResult SetUp(IGrGraphics * pgg, std::wstring stuFeaturesArg, bool fBold, bool fItalic); -- obsolete
+
+ GrResult RunUsingEmpty(Segment * psegNew, Font * pfont,
+ GrCharStream * pchstrm, LayoutEnvironment & layout,
+ int ichStop,
+ float dxMaxWidth,
+ bool fNeedFinalBreak, bool fMoreText, bool fInfiniteWidth,
+ int ichwCallerBtLim,
+ int nDirDepth, SegEnd estJ);
+ bool InErrorState()
+ {
+ return m_fInErrorState;
+ }
+
+ std::wstring FaceName()
+ {
+ return m_stuFaceName;
+ }
+ std::wstring BaseFaceName()
+ {
+ Assert(m_stuBaseFaceName.size() == 0 || m_fUseSepBase);
+ return m_stuBaseFaceName; // empty if not using separate base font
+ }
+ bool Bold()
+ {
+ return m_fBold;
+ }
+ bool Italic()
+ {
+ return m_fItalic;
+ }
+
+ void GetStyles(Font * pfont, int ichwMin, bool * pfBold, bool * pfItalic);
+ void SwitchGraphicsFont(bool fBase);
+
+ void AddFeature(featid nID, int nNameId, int cfset, int nDefault = 0);
+ GrFeature * FeatureWithID(featid nID, int * pifeat);
+ int DefaultForFeatureAt(int ifeat);
+ void SetDefaultForFeatureAt(int ifeat, int nValue);
+ GrFeature * Feature(int ifeat)
+ {
+ if (ifeat >= kMaxFeatures)
+ return NULL;
+ return m_rgfeat + ifeat;
+ }
+ void DefaultsForLanguage(isocode lgcode,
+ std::vector<featid> & vnFeats, std::vector<int> & vnValues);
+ std::wstring StringFromNameTable(int nNameId, int nLang);
+
+ void InitSlot(GrSlotState *, int nUnicode = -1);
+ void SetSlotAttrsFromGlyphAttrs(GrSlotState *);
+
+ bool RightToLeft()
+ {
+ return m_fRightToLeft;
+ }
+ int TopDirectionLevel()
+ {
+ return (m_fRightToLeft) ? 1 : 0;
+ }
+
+ GrGlyphTable * GlyphTable()
+ {
+ return m_pgtbl;
+ }
+
+ GrClassTable * ClassTable()
+ {
+ return m_pctbl;
+ }
+
+ int NumFeat()
+ {
+ return m_cfeat;
+ }
+
+ bool LineBreakFlag()
+ {
+ return m_fLineBreak;
+ }
+
+ int PreXlbContext()
+ {
+ return m_cchwPreXlbContext;
+ }
+
+ int PostXlbContext()
+ {
+ return m_cchwPostXlbContext;
+ }
+
+ int ExtraAscent()
+ {
+ return m_mXAscent;
+ }
+
+ int ExtraDescent()
+ {
+ return m_mXDescent;
+ }
+
+ float VerticalOffset()
+ {
+ return m_dysOffset;
+ }
+
+ int NumUserDefn()
+ {
+ return m_cnUserDefn;
+ }
+
+ int NumCompPerLig()
+ {
+ return m_cnCompPerLig;
+ }
+
+ bool BasicJustification()
+ {
+ return m_fBasicJust;
+ }
+
+ bool LoggingTransduction();
+ //{
+ // return m_pfface->getLogging();
+ // //return m_fLogXductn;
+ //}
+
+ bool FakeItalic()
+ {
+ return m_fFakeItalic;
+ }
+
+ void NewSegment(Segment ** ppseg);
+
+ static int ReadVersion(GrIStream & grstrm);
+
+ /*----------------------------------------------------------------------------------------------
+ Function to convert between coordinate systems.
+ This is identical to the built-in MulDiv function except that it rounds with better
+ precision.
+
+ TODO: move these out of GrEngine to someplace more general.
+ ----------------------------------------------------------------------------------------------*/
+ inline static int GrIntMulDiv(const int v, const int n, const int d)
+ {
+ return int(n < 0 ?
+ (double(v * n)/double(d)) - 0.5 :
+ (double(v * n)/double(d)) + 0.5);
+ }
+ inline static float GrFloatMulDiv(const float v, const float n, const float d)
+ {
+ return v * n / d;
+ }
+ inline static float GrIFIMulDiv(const int v, const float n, const int d)
+ {
+ return float(double(v) * n / double(d));
+ }
+ inline static int GrFIFMulDiv(const float v, const int n, const float d)
+ {
+ return int(n < 0 ?
+ (v * double(n) / double(d)) - 0.5 :
+ (v * double(n) / double(d)) + 0.5);
+ }
+ inline static int RoundFloat(const float n)
+ {
+ return int(n < 0 ? n - 0.5 : n + 0.5);
+ }
+
+protected:
+ // Member variables:
+
+ long m_cref;
+
+ //////////// Font information ////////////
+
+ bool m_fBold;
+ bool m_fItalic;
+
+ // do we have the capacity to perform smart rendering for the various styles?
+ bool m_fSmartReg;
+ bool m_fSmartBold;
+ bool m_fSmartItalic;
+ bool m_fSmartBI;
+ // are the italics faked using a slant?
+ bool m_fFakeItalicCache;
+ bool m_fFakeBICache;
+ // control files for styled text; empty means not yet determined
+ std::wstring m_strCtrlFileReg; // regular
+ std::wstring m_strCtrlFileBold; // bold
+ std::wstring m_strCtrlFileItalic; // italic
+ std::wstring m_strCtrlFileBI; // bold-italic
+
+ bool m_fFakeItalic; // true if we are simulating an italic slant in positioning
+
+ std::wstring m_stuCtrlFile; // control file (.ttf file) from which we got
+ // currently loaded files
+
+ std::wstring m_stuInitError; // description of any error that happened while initializing
+ // the engine
+ std::wstring m_stuErrCtrlFile; // file for which the error occurred
+
+ std::wstring m_stuFaceName; // eg, "Times New Roman"
+ std::wstring m_stuFeatures;
+
+ bool m_fUseSepBase;
+ std::wstring m_stuBaseFaceName; // from Sile table; empty if we are not using a separate
+ // control file
+
+ GrResult m_resFontRead; // kresOk if the Graphite font was loaded successfully;
+ // kresFail if the font could not be found or basic tables couldn't be read;
+ // kresFalse if the Silf table is not present;
+ // kresUnexpected if the Graphite tables could not be loaded
+
+ GrResult m_resFontValid; // kresInvalidArg if the engine is not yet initialized
+ // Originally:
+ // kresOk if Graphite font & dc font match cmaps
+ // kresUnexpected/kresFalse if dumb rendering
+ // kresFail if dumb rendering with no cmap
+ // But now it is apparently just = to m_resFontRead otherwise.
+ FontErrorCode m_ferr;
+ int m_fxdBadVersion;
+
+ int m_nFontCheckSum; // when loading a font using the GrGraphics, remember the
+ // check sum as a unique identifer
+
+ int m_nScriptTag; // from the pertinent writing system; currently not used
+ unsigned int m_grfsdc; // supported script directions
+
+ bool m_fRightToLeft; // overall writing-system direction
+
+ int m_mXAscent; // extra ascent, in font's em-units
+ int m_mXDescent; // extra descent, in font's em_units
+
+ float m_dysOffset; // vertical offset, in logical units (eg, for super/subscript)
+
+ bool m_fBasicJust; // true if there are no complex justification tables/rules in the
+ // font, so we use basic whitespace justification
+ int m_cJLevels; // number of justification levels
+
+ GrTableManager * m_ptman;
+ GrClassTable * m_pctbl;
+ GrGlyphTable * m_pgtbl;
+
+ FontFace * m_pfface;
+
+ GrFeature m_rgfeat[kMaxFeatures];
+// HashMap<int, int> m_hmnifeat; // maps from feature IDs to indices in the array
+// // Review: do we need this, or is a linear search adequate?
+ int m_cfeat; // number of features present
+
+ short * m_rglcidFeatLabelLangs; // LCIDs (language IDs) for all the labels in the feature table
+ size_t m_clcidFeatLabelLangs;
+
+ GrLangTable m_langtbl;
+
+ // are line-breaks relevant at all?
+ bool m_fLineBreak;
+ // ranges for possible cross-line-boundary contextualization
+ int m_cchwPreXlbContext;
+ int m_cchwPostXlbContext;
+
+ // magic glyph attribute numbers
+ data16 m_chwPseudoAttr; // actual-for-pseudo fake glyph attribute
+ data16 m_chwBWAttr; // break-weight
+ data16 m_chwDirAttr; // directionality
+ data16 m_chwJStretch0; // justify.0.stretch
+ data16 m_chwJShrink0; // justify.0.shrink
+ data16 m_chwJStep0; // justify.0.step
+ data16 m_chwJWeight0; // justify.0.weight
+
+ gid16 m_chwLBGlyphID; // magic line-break glyph ID
+
+ int m_cComponents; // number of glyph attributes at the beginning of the glyph table
+ // that actually represent ligature components
+
+ int m_cnUserDefn; // number of user-defined slot attributes
+ int m_cnCompPerLig; // max number of components needed per ligature
+
+ int m_mFontEmUnits; // number of design units in the Em square for the font
+
+ // for pseudo-glyph mappings
+ int m_cpsd; // number of psuedo-glyphs
+ GrPseudoMap * m_prgpsd;
+ int m_dipsdInit; // (max power of 2 <= m_cpsd);
+ // size of initial range to consider
+ int m_cPsdLoop; // log2(max power of 2 <= m_cpsd);
+ // indicates how many iterations are necessary
+ int m_ipsdStart; // m_cpsd - m_dipsdInit;
+ // where to start search
+
+ // for Unicode to glyph ID mapping
+ ////TableBuffer m_tbufCmap; // hold the full cmap table
+ void * m_pCmap_3_1; // point to the MS Unicode cmap subtable
+ // uses platform 3 writing system 1 or 0, preferably 1
+ // use for Unicode to Glyph ID conversion
+ void * m_pCmap_3_10;
+ byte * m_pCmapTbl;
+ bool m_fCmapTblCopy;
+ int m_cbCmapTbl; // needed only for memory instrumentation
+
+ // for feature names and maybe other strings from font later
+ ////TableBuffer m_tbufNameTbl; // hold full name table; use Name() method to access
+ byte * m_pNameTbl;
+ bool m_fNameTblCopy;
+ int m_cbNameTbl; // needed only for memory instrumentation
+
+ bool m_fLogXductn; // true if we want to log the transduction process
+
+ bool m_fInErrorState; // true if we are handling a rendering error
+
+ // Other protected methods:
+
+ enum {
+ ksegmodeBreak = 0, // FindBreakPoint
+ ksegmodeJust, // MakeJustifiedSegment
+ //ksegmodeMms, // MakeMeasuredSegment
+ ksegmodeRange // MakeSegmentFromRange
+ };
+
+ void MakeSegment(
+ // Common parameters
+ Segment * psegRet,
+ Font * pfont, ITextSource * pgts, IGrJustifier * pjus,
+ LayoutEnvironment & layout,
+ int ichMin, int ichLim,
+ // for finding a line break
+ float dxMaxWidth,
+ bool fBacktracking,
+ // for making a justified segment
+ bool fJust, float dxJustifiedWidthJ, SegEnd estJ);
+
+ int FindFontLim(ITextSource * pgts, int ichFontMin, int * pnDirDepth);
+
+#ifdef GR_FW
+ ////GrResult InitFromControlFile(IGrGraphics * pgg, std::wstring stuFaceName,
+ //// bool fBold, bool fItalic); -- obsolete
+ ////GrResult ReadFromControlFile(std::wstring stuFontFile); -- obsolete
+// GrResult GetFallBackFont(std::wstring * pstu);
+#endif
+
+ ////GrResult ReadFromGraphicsFont(IGrGraphics * pgg, bool fItalic); -- obsolete
+ void DestroyEverything();
+
+ bool CheckTableVersions(GrIStream * pgrstrm,
+ byte *silf_tbl, int lSilfStart,
+ byte *gloc_tbl, int lGlocStart,
+ byte *feat_tbl, int lFeatStart,
+ int * pfxdBadVersion);
+ //bool ReadSileTable(GrIStream & grstrm, long lTableSTart,
+ // int * pmFontEmUnits, bool * pfMismatchedBase);
+ bool ReadSilfTable(GrIStream & grstrm, long lTableStart, int iSubTable,
+ int * pchwMaxGlyphID, int * pfxdVersion);
+ bool ReadGlocAndGlatTables(GrIStream & grstrm, long lGlocStart, GrIStream & glat_strm, long lGlatStart,
+ int chwMaxGlyphID, int fxdSilfVersion);
+ bool ReadFeatTable(GrIStream & grstrm, long lTableStart);
+ bool ReadSillTable(GrIStream & grstrm, long lTableStart);
+ bool SetCmapAndNameTables(Font * pfont);
+
+ void CreateEmpty();
+
+ bool BadFont(FontErrorCode * pferr = NULL)
+ {
+ if (pferr)
+ *pferr = m_ferr;
+ return (m_resFontValid == kresFail || m_resFontRead == kresFail);
+ }
+ bool DumbFallback(FontErrorCode * pferr = NULL)
+ {
+ if (pferr)
+ *pferr = m_ferr;
+ return (m_resFontValid != kresOk || m_resFontRead != kresOk);
+ }
+
+ gid16 MapToPseudo(int nUnicode);
+
+ // NEW interface
+ void AssignDefaultFeatures(int cfeat, FeatureSetting * prgfset);
+
+ // Feature access for FontFace:
+ size_t NumberOfFeatures_ff();
+ featid FeatureID_ff(size_t ifeat);
+ size_t FeatureWithID_ff(featid id);
+ bool GetFeatureLabel_ff(size_t ifeat, lgid language, utf16 * label);
+ int GetFeatureDefault_ff(size_t ifeat);
+ size_t NumberOfSettings_ff(size_t ifeat);
+ int GetFeatureSettingValue_ff(size_t ifeat, size_t ifset);
+ bool GetFeatureSettingLabel_ff(size_t ifeat, size_t ifset, lgid language, utf16 * label);
+ // Feature-label languages:
+ size_t NumberOfFeatLangs_ff();
+ short GetFeatLabelLang_ff(size_t ilang);
+ // Language access for FontFace:
+ size_t NumberOfLanguages_ff();
+ isocode GetLanguageCode_ff(size_t ilang);
+
+ void SetUpFeatLangList();
+
+//:Ignore
+#ifdef OLD_TEST_STUFF
+ // For test procedures:
+ void SetUpCrossLineContextTest();
+ void SetUpPseudoGlyphTest();
+ void SetUpRuleActionTest();
+ void SetUpRuleAction2Test();
+ void SetUpAssocTest();
+ void SetUpAssoc2Test();
+ void SetUpDefaultAssocTest();
+ void SetUpFeatureTest();
+ void SetUpLigatureTest();
+ void SetUpLigature2Test();
+
+ void InitFromControlFileTest();
+#endif // OLD_TEST_STUFF
+//:End Ignore
+};
+
+} // namespace gr
+
+#if defined(GR_NO_NAMESPACE)
+using namespace gr;
+#endif
+
+
+#endif // !GR_ENGINE_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/GrFSM.cpp b/Build/source/libs/graphite/src/segment/GrFSM.cpp
new file mode 100644
index 00000000000..53182edab0d
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrFSM.cpp
@@ -0,0 +1,526 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrFSM.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Implements the finite state machine.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+#include <cstring>
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+// any other headers (not precompiled)
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Fill in the FSM by reading from the font stream.
+ Assumes the stream is in the correct position.
+----------------------------------------------------------------------------------------------*/
+bool GrFSM::ReadFromFont(GrIStream & grstrm, int fxdVersion)
+{
+ short snTmp;
+
+ // number of FSM states
+ snTmp = grstrm.ReadShortFromFont();
+ m_crow = snTmp;
+ // number of transitional states
+ snTmp = grstrm.ReadShortFromFont();
+ int crowTransitional = snTmp;
+ // number of success states
+ snTmp = grstrm.ReadShortFromFont();
+ int crowSuccess = snTmp;
+ m_crowFinal = m_crow - crowTransitional;
+ m_crowNonAcpt = m_crow - crowSuccess;
+ m_rowFinalMin = crowTransitional;
+ // number of columns
+ snTmp = grstrm.ReadShortFromFont();
+ m_ccol = snTmp;
+
+ // Sanity checks.
+ if (crowTransitional > m_crow || crowSuccess > m_crow)
+ return false; // bad table
+ // TODO: add a sanity check for m_ccol.
+
+ // number of FSM glyph ranges and search constants
+ snTmp = grstrm.ReadShortFromFont();
+ m_cmcr = snTmp;
+ snTmp = grstrm.ReadShortFromFont();
+ m_dimcrInit = snTmp;
+ snTmp = grstrm.ReadShortFromFont();
+ m_cLoop = snTmp;
+ snTmp = grstrm.ReadShortFromFont();
+ m_imcrStart = snTmp;
+
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ for (int imcr = 0; imcr < m_cmcr; imcr++)
+ {
+ m_prgmcr[imcr].m_chwFirst = grstrm.ReadUShortFromFont();
+ m_prgmcr[imcr].m_chwLast = grstrm.ReadUShortFromFont();
+ m_prgmcr[imcr].m_col = grstrm.ReadUShortFromFont();
+ }
+
+ // rule map and offsets (extra item at end gives final offset, ie, total)
+ m_prgirulnMin = new data16[crowSuccess + 1];
+ data16 * pchw = m_prgirulnMin;
+ int i;
+ for (i = 0; i < (crowSuccess + 1); i++, pchw++)
+ {
+ *pchw = grstrm.ReadUShortFromFont();
+ }
+
+ // Last offset functions as the total length of the rule list.
+ // Note that the number of rules in the map is not necessarily equal to the number of
+ // rules in the pass; some rules may be listed multiply, if they are matched by more
+ // than one state.
+ int crulInMap = m_prgirulnMin[crowSuccess];
+ m_prgrulnMatched = new data16[crulInMap];
+ m_crulnMatched = crulInMap;
+ pchw = m_prgrulnMatched;
+ for (i = 0; i < crulInMap; i++, pchw++)
+ {
+ *pchw = grstrm.ReadUShortFromFont();
+ }
+
+ // min rule pre-context number of items
+ byte bTmp = grstrm.ReadByteFromFont();
+ m_critMinRulePreContext = bTmp;
+ // max rule pre-context number of items
+ bTmp = grstrm.ReadByteFromFont();
+ m_critMaxRulePreContext = bTmp;
+
+ if (m_critMinRulePreContext > kMaxSlotsPerRule || m_critMaxRulePreContext > kMaxSlotsPerRule)
+ return false; // bad table
+
+ int cStartStates = m_critMaxRulePreContext - m_critMinRulePreContext + 1;
+
+ // start states
+ m_prgrowStartStates = new short[cStartStates];
+ short * psn = m_prgrowStartStates;
+ for (int ic = 0; ic < cStartStates; ic++, psn++)
+ {
+ *psn = grstrm.ReadShortFromFont();
+ }
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Fill in the FSM's state table by reading from the font stream.
+ Assumes the stream is in the correct position.
+----------------------------------------------------------------------------------------------*/
+bool GrFSM::ReadStateTableFromFont(GrIStream & grstrm, int fxdVersion)
+{
+ int cCells = ((m_crow - m_crowFinal) * m_ccol);
+ m_prgrowTransitions = new short[cCells];
+ short * psn = m_prgrowTransitions;
+ for (int iCell = 0; iCell < cCells; iCell++, psn++)
+ {
+ *psn = grstrm.ReadShortFromFont();
+ }
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Use the transition table to find a rule or rules that match; then run the contraint
+ code to see if the rule is active. Return the rule number of the rule to be applied.
+
+ @param ppass - pass, which knows how to run constraint code
+ @param psstrmIn - input stream
+ @param psstrmOut - output stream (from which to get recently output slots)
+----------------------------------------------------------------------------------------------*/
+int GrFSM::GetRuleToApply(GrTableManager * ptman, GrPass * ppass,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ // List of accepting states and corresponding count of slots that were
+ // matched by each.
+ int prgrowAccepting[kMaxSlotsPerRule];
+ int prgcslotMatched[kMaxSlotsPerRule];
+
+ // Run the transition table until it jams.
+ int crowAccepting = RunTransitionTable(ppass, psstrmIn, psstrmOut,
+ prgrowAccepting, prgcslotMatched);
+
+ // Nothing matched; fail quickly.
+ if (crowAccepting == 0)
+ return -1;
+
+ int * prow = prgrowAccepting + crowAccepting - 1;
+ int * pcslot = prgcslotMatched + crowAccepting - 1; // # of slots matched AFTER the curr pos
+
+ // Quick test for common case of exactly one rule matched.
+ if (crowAccepting == 1 &&
+ (m_prgirulnMin[*prow - m_crowNonAcpt + 1] - m_prgirulnMin[*prow - m_crowNonAcpt]) == 1)
+ {
+ int iruln = m_prgirulnMin[*prow - m_crowNonAcpt];
+ int ruln = m_prgrulnMatched[iruln];
+ if (RunConstraintAndRecordLog(ptman, ppass, ruln, psstrmIn, psstrmOut,
+ ppass->PreModContextForRule(ruln), *pcslot))
+ {
+ return ruln;
+ }
+ else
+ return -1;
+ }
+
+ // Several rules were matched. We need to sort them and then run the constraints
+ // for each rule, accepting the first one whose constraints succeed.
+
+ // Count up the number of rules that matched and allocate a buffer of the right size.
+ int crulMatched = 0;
+ while (prow >= prgrowAccepting)
+ {
+ crulMatched +=
+ m_prgirulnMin[*prow - m_crowNonAcpt + 1] - m_prgirulnMin[*prow - m_crowNonAcpt];
+ --prow;
+ }
+ MatchedRule * prgmr = new MatchedRule[crulMatched];
+
+ prow = prgrowAccepting + crowAccepting - 1;
+
+ // Do a dumb insertion sort, ordering primarily by sort key (largest first)
+ // and secondarily by the order in the original file (rule number).
+ // Review: is this kind of sort fast enough? We assuming that we usually only
+ // have a handful of matched rules.
+ int cmr = 0;
+ while (prow >= prgrowAccepting)
+ {
+ int iruln = m_prgirulnMin[*prow - m_crowNonAcpt];
+ // Get all the rules matches by a single state.
+ while (iruln < m_prgirulnMin[*prow - m_crowNonAcpt + 1])
+ {
+ int ruln = m_prgrulnMatched[iruln];
+ int nSortKey = ppass->SortKeyForRule(ruln);
+ int cslot = *pcslot;
+ int imr;
+ for (imr = 0; imr < cmr; imr++)
+ {
+ if (nSortKey > prgmr[imr].nSortKey ||
+ (nSortKey == prgmr[imr].nSortKey && ruln < prgmr[imr].ruln))
+ {
+ // Insert here.
+ memmove(prgmr+imr+1, prgmr+imr, (isizeof(MatchedRule) * (cmr - imr)));
+ prgmr[imr].ruln = ruln;
+ prgmr[imr].nSortKey = nSortKey;
+ prgmr[imr].cslot = cslot;
+ break;
+ }
+ }
+ if (imr >= cmr)
+ {
+ prgmr[cmr].ruln = ruln;
+ prgmr[cmr].nSortKey = nSortKey;
+ prgmr[cmr].cslot = cslot;
+ }
+ cmr++;
+
+ iruln++;
+ }
+ --prow;
+ --pcslot;
+ }
+
+
+ for (int imr = 0; imr < cmr; imr++)
+ {
+ int ruln = prgmr[imr].ruln;
+ if (RunConstraintAndRecordLog(ptman, ppass, ruln, psstrmIn, psstrmOut,
+ ppass->PreModContextForRule(ruln), prgmr[imr].cslot))
+ {
+ // Success!
+ delete[] prgmr;
+ return ruln;
+ }
+ }
+
+ // No rule matched or the constraints failed.
+ delete[] prgmr;
+ return -1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Run the transition table, generating a list of rows corresponding to accepting states.
+
+ @param psstrmIn - input stream
+ @param prgrowAccepting - array to fill in with accepting rows
+ @param prgcslotMatched - corresponding array with number of slots matched
+----------------------------------------------------------------------------------------------*/
+int GrFSM::RunTransitionTable(GrPass * ppass, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int * prgrowAccepting, int * prgcslotMatched)
+{
+ int ipass = ppass->PassNumber();
+
+ // Remember we're reading the pre-context items from the output stream, not the input.
+ int cslotPreContextAvail = psstrmOut->WritePos();
+
+ if (cslotPreContextAvail < m_critMinRulePreContext)
+ return 0; // not enough input to match any rule
+
+ // Look backwards by the number of pre-context items for this pass, but not earlier
+ // than the beginning of the stream.
+ int cslot = -1 * min(cslotPreContextAvail, m_critMaxRulePreContext);
+
+ // Normally the start state is state 0. But if we are near the beginning of the stream,
+ // we may need to adjust due to the fact that we don't have enough input yet to
+ // match the pre-context items in all the rules. So in effect we skip some states
+ // corresponding to the earlier items that aren't present.
+ int row = m_prgrowStartStates[max(0, m_critMaxRulePreContext - cslotPreContextAvail)];
+
+ int * prowTop = prgrowAccepting;
+ int * pcslotTop = prgcslotMatched;
+ while (true)
+ {
+ if (row >= m_rowFinalMin)
+ // final state--jammed
+ return (prowTop - prgrowAccepting);
+
+ if (psstrmIn->SlotsPendingInContext() <= cslot)
+ // no more input
+ return (prowTop - prgrowAccepting);
+
+ // Figure out what column the input glyph belong in.
+ // Since this is a time-critical routine, we cache the results for the current pass.
+ GrSlotState * pslot = (cslot < 0) ?
+ psstrmOut->PeekBack(cslot) :
+ psstrmIn->Peek(cslot);
+ int col;
+ if (pslot->PassNumberForColumn() == ipass)
+ {
+ col = pslot->FsmColumn();
+ }
+ else
+ {
+ gid16 chwGlyphID = (cslot < 0) ?
+ psstrmOut->PeekBack(cslot)->GlyphID() :
+ psstrmIn->Peek(cslot)->GlyphID();
+ col = FindColumn(chwGlyphID);
+ pslot->CacheFsmColumn(ipass, col);
+ }
+ int rowNext;
+ if (col < 0)
+ rowNext = 0;
+ else
+ rowNext = m_prgrowTransitions[(row * m_ccol) + col];
+
+ if (rowNext == 0) // jammed
+ return (prowTop - prgrowAccepting);
+
+ cslot++;
+ if (rowNext >= m_crowNonAcpt) // or (rowNext < 0)
+ {
+ // Accepting state--push it on the stack.
+ //rowNext *= -1;
+ gAssert((prowTop - prgrowAccepting) < kMaxSlotsPerRule);
+ *prowTop++ = rowNext;
+ *pcslotTop++ = cslot;
+ }
+ row = rowNext;
+
+ gAssert((prowTop - prgrowAccepting) == (pcslotTop - prgcslotMatched));
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Run the transition table, generating a list of rows corresponding to accepting states.
+ Optimized to avoid matrix arithmetic for non-accepting states.
+
+ Review: do we need to use this version?
+
+ @param psstrmIn - input stream
+ @param prgrowAccepting - array to fill in with accepting rows
+ @param prgcslotMatched - corresponding array with number of slots matched
+----------------------------------------------------------------------------------------------*/
+#if 0
+
+int GrFSM::RunTransitionTableOptimized(GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int * prgrowAccepting, int * prgcslotMatched)
+{
+ int cslot = 0;
+ int ichwRowOffset = 0;
+ int ichwRowOffsetLim = m_crowFinal * m_ccol; // number of cells
+ int * prowTop = prgrowAccepting;
+ int * pcslotTop = prgcslotMatched;
+ while (true)
+ {
+ if (ichwRowOffset >= ichwRowOffsetLim)
+ // final state--jammed
+ return (prowTop - prgrowAccepting);
+
+ if (psstrmIn->SlotsPendingInContext() < cslot)
+ // no more input
+ return (prowTop - prgrowAccepting);
+
+ gid16 chwGlyphID = psstrmIn->Peek(cslot)->GlyphID();
+ int col = FindColumn(chwGlyphID);
+ short cellValue = *(m_prgprgrowXitions + ichwRowOffset + col);
+
+ if (cellValue == 0) // jammed
+ return (prowTop - prgrowAccepting);
+
+ cslot++;
+ if (cellValue < 0)
+ {
+ // Accepting state--push it on the stack.
+ int rowNext = cellValue * -1;
+ gAssert((prowTop - prgrowAccepting) < kMaxSlotsPerRule);
+ *prowTop++ = rowNext;
+ *pcslotTop++ = cslot;
+ ichwRowOffset = rowNext * m_ccol;
+ }
+ else
+ ichwRowOffset = cellValue;
+
+ gAssert((prowTop - prgrowAccepting) == (pcslotTop - prgcslotMatched));
+ }
+}
+
+#endif // 0
+
+
+/*----------------------------------------------------------------------------------------------
+ Run all the constraints for the rules matched by the state that we have reached.
+ The rules are ordered as they were in the GDL file. When we hit a constraint that
+ matches, return the corresponding rule number. Return -1 if no rule passed.
+
+ @param ppass - pass, which knows how to actually run the constraints
+ @param psstrmIn - input stream
+ @param cslotMatched - number of slots matched; constraints must be run for each of these
+----------------------------------------------------------------------------------------------*/
+//:Ignore
+int GrFSM::RunConstraints_Obsolete(GrTableManager * ptman, GrPass * ppass, int row,
+ GrSlotStream * psstrmIn, int cslotMatched)
+{
+ int iruln = m_prgirulnMin[row - m_crowNonAcpt];
+ while (iruln < m_prgirulnMin[row - m_crowNonAcpt + 1])
+ {
+ int ruln = m_prgrulnMatched[iruln];
+ bool fSuccess = ppass->RunConstraint(ptman, ruln, psstrmIn, NULL, 0, cslotMatched);
+ if (fSuccess)
+ {
+ if (ptman->LoggingTransduction())
+ ppass->RecordRuleFired(psstrmIn->ReadPosForNextGet(), ruln);
+ return ruln;
+ }
+ else
+ {
+ if (ptman->LoggingTransduction())
+ ppass->RecordRuleFailed(psstrmIn->ReadPosForNextGet(), ruln);
+ }
+
+ iruln++;
+ }
+ return -1; // no rule succeeded
+}
+//:End Ignore
+
+/*----------------------------------------------------------------------------------------------
+ Run the constraints for the given rule, and record whether it failed or succeeded in the
+ transduction log.
+
+ @param ppass - pass, which knows how to actually run the constraints
+ @param psstrmIn - input stream
+ @param cslotPreModContext - number of slots before the current position that must be tested
+ @param islotLimMatched - number of slots matched AFTER the current position
+
+ @return True if the constraints succeeded.
+----------------------------------------------------------------------------------------------*/
+bool GrFSM::RunConstraintAndRecordLog(GrTableManager * ptman, GrPass * ppass, int ruln,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int cslotPreModContext, int islotLimMatched)
+{
+ bool fSuccess = ppass->RunConstraint(ptman, ruln, psstrmIn, psstrmOut,
+ cslotPreModContext, islotLimMatched);
+
+ if (ptman->LoggingTransduction())
+ {
+ if (fSuccess)
+ ppass->RecordRuleFired(psstrmIn->ReadPosForNextGet(), ruln);
+ else
+ ppass->RecordRuleFailed(psstrmIn->ReadPosForNextGet(), ruln);
+ }
+
+ return fSuccess;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Search for the class range containing the glyph ID, and return the matching FSM column.
+ Does a fast binary search that uses only shifts, no division.
+----------------------------------------------------------------------------------------------*/
+int GrFSM::FindColumn(gid16 chwGlyphID)
+{
+ #ifdef _DEBUG
+ // Check that the pre-calculated constants are correct.
+ int nPowerOf2 = 1;
+ while (nPowerOf2 <= m_cmcr)
+ nPowerOf2 <<= 1;
+ nPowerOf2 >>= 1;
+ // Now nPowerOf2 is the max power of 2 <= m_cclsrg.
+ // m_cLoop is not needed for our purposes, but it is included because it is part of
+ // the TrueType standard.
+ gAssert(1 << m_cLoop == nPowerOf2); // m_cloop == log2(nPowerOf2)
+ gAssert(m_dimcrInit == nPowerOf2);
+ gAssert(m_imcrStart == m_cmcr - m_dimcrInit);
+ #endif
+
+ int dimcrCurr = m_dimcrInit;
+
+ GrFSMClassRange * pmcrCurr = m_prgmcr + m_imcrStart;
+ while (dimcrCurr > 0)
+ {
+ int nTest;
+ if (pmcrCurr < m_prgmcr)
+ nTest = -1;
+ else
+ {
+ nTest = pmcrCurr->m_chwFirst - chwGlyphID;
+ if (nTest < 0 && chwGlyphID <= pmcrCurr->m_chwLast)
+ //nTest = 0;
+ // This is a tiny bit more efficient:
+ return pmcrCurr->m_col;
+ }
+
+ if (nTest == 0)
+ // found it
+ return pmcrCurr->m_col;
+
+ dimcrCurr >>= 1; // divide by 2
+ if (nTest < 0)
+ pmcrCurr += dimcrCurr;
+ else // (nTest > 0)
+ pmcrCurr -= dimcrCurr;
+ }
+
+ return -1;
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/GrFSM.h b/Build/source/libs/graphite/src/segment/GrFSM.h
new file mode 100644
index 00000000000..b1909553daa
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrFSM.h
@@ -0,0 +1,245 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrFSM.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ The GrFSM class, which is the mechanism that examines input in a glyph stream and
+ determines which rule matches and should be run.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef FSM_INCLUDED
+#define FSM_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+class GrPass;
+
+/*----------------------------------------------------------------------------------------------
+ A machine class range consists of a range of contiguous glyph IDs that map to
+ a single column in the FSM (a machine class). (Note that there might be more than one
+ range mapping to a given column.)
+
+ Keep in mind that these "classes" are completely different from the classes that
+ are used for substitution. These are used only for matching by the FSM.
+
+ Hungarian: mcr
+----------------------------------------------------------------------------------------------*/
+class GrFSMClassRange
+{
+ friend class GrFSM;
+
+protected:
+ gid16 m_chwFirst; // first glyph ID in range
+ gid16 m_chwLast; // last glyph ID in range
+ data16 m_col; // column (machine class) to which this range maps
+};
+
+/*----------------------------------------------------------------------------------------------
+ The finite state machine that is used to match sequences of glyphs and
+ determine which rule to apply. There is one FSM per pass.
+
+ The states in the FSM are grouped and ordered in the following way:
+ - non-accepting states (no rule completely matched)
+ - accepting non-final states (a rule matched, but a longer rule is possible)
+ - final states (a rule matched and no longer rule is possible)
+ In other words, we have:
+ - transition, non-accepting
+ - transition, accepting
+ - non-transition, accepting
+ The transition states have information about the next state to transition to;
+ the accepting states have information about the rule(s) that matched.
+
+ There are three main data structures that are part of the finite state machine:
+
+ (1) the transition matrix: m_prgprgrowXitions. It contains a row for each transition
+ state (non-accepting states plus accepting non-final states), and a column for each
+ machine class. The cell values indicate the next state to transition to for the
+ matched input. A positive number indicates that the next state is a non-accepting state;
+ a negative value indicates an accepting state. Zero means there is no next state;
+ no more matches are possible; machine has "jammed."
+
+ (2) the matched-rule list: m_prgrulnMatched. This is a list of rule numbers,
+ which are indices into the pass's action- and constraint-code arrays.
+ It contains the numbers of the rules matched by the first accepting state,
+ followed by those matched by the second accepting state, etc. For each state,
+ the rules must be ordered using the same order of the rules in the RDL file.
+
+ (3) the matched-rule-offsets list: m_prgirulnMin. This gives the starting index into
+ the matched-rule list for each accepting state. (Non-accepting states are not included,
+ so the first item is for state m_crowNonAcpt.)
+
+ In addition, the FSM interacts with the action- and constraint-code lists in the pass
+ itself. These lists are indexed by rule number (the values of m_prgrulnMatched).
+ When some input matches the rule, the constraint-code is run; if it succeeds,
+ the rule number is returned to the caller and that rule is applied (ie, the action-code
+ is run).
+
+ Hungarian: fsm
+
+ Other hungarian:
+ row - row (state)
+ col - column (machine class)
+ ruln - rule number
+
+ REVIEW: This is quite a time-critical class, and there are two potential optimizations
+ that have been proposed for the value of a cell:
+
+ (1) use a negative cell number to indicate an accepting state and a positive number
+ to indicate a non-accepting state. So this gives a comparison with zero rather than
+ some arbitrary number
+
+ (2) have the positive numbers--the most common case--be the actual byte offset into the
+ table rather than the row number. This saves matrix multiplication at each step,
+ ie, "m_prgsnTransitions[(row * m_ccol) + col]".
+
+ The two versions are implemented in RunTransitionTable and RunTransitionTableOptimized.
+ Do these seem to be worth the inconvenience of added complexity in understanding
+ and debugging?
+----------------------------------------------------------------------------------------------*/
+class GrFSM
+{
+ friend class FontMemoryUsage;
+
+public:
+ GrFSM() :
+ m_prgirulnMin(NULL),
+ m_prgrulnMatched(NULL),
+ m_prgrowTransitions(NULL),
+ m_prgibStateDebug(NULL),
+ m_prgmcr(NULL),
+ m_prgrowStartStates(NULL)
+ {
+ }
+
+ ~GrFSM()
+ {
+ delete[] m_prgirulnMin;
+ delete[] m_prgrulnMatched;
+
+ delete[] m_prgrowTransitions;
+
+ delete[] m_prgibStateDebug;
+
+ delete[] m_prgmcr;
+
+ delete[] m_prgrowStartStates;
+ }
+
+ bool ReadFromFont(GrIStream & grstrm, int fxdVersion);
+ bool ReadStateTableFromFont(GrIStream & grstrm, int fxdVersion);
+
+ int GetRuleToApply(GrTableManager *, GrPass * ppass,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+
+ int RunTransitionTable(GrPass * ppass, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int * prgrowAccepting, int * prgcslotMatched);
+ int RunTransitionTableOptimized(GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int * prgrowAccepting, int * prgcslotMatched);
+ bool RunConstraintAndRecordLog(GrTableManager *, GrPass * ppass, int ruln,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int cslotPreModContext, int cslotMatched);
+
+ int RunConstraints_Obsolete(GrTableManager *, GrPass * ppass, int row, GrSlotStream * psstrmIn,
+ int cslotMatched);
+
+ // For sorting matched rules
+ struct MatchedRule // mr
+ {
+ int ruln;
+ int nSortKey;
+ int cslot; // number of slots matched AFTER the current stream position
+ };
+
+ int MaxRulePreContext()
+ {
+ return m_critMaxRulePreContext;
+ }
+
+protected:
+ int FindColumn(gid16 chwGlyphID);
+protected:
+ // Instance variables:
+ int m_crow; // number of rows (states)
+ int m_crowFinal; // number of final states; no transitions for these
+ int m_rowFinalMin; // index of first final row
+ int m_crowNonAcpt; // number of non-accepting states; no rule indices for these
+
+ int m_ccol; // number of columns (machine classes)
+
+ data16 * m_prgirulnMin; // m_crow-m_crowNonAcpt+1 of these;
+ // index within m_prgrulnMatched, start of matched
+ // rules for each accepting state
+
+ data16 * m_prgrulnMatched; // long ordered list of rule indices matched by
+ // subsequent states; total length is sum of number
+ // of rules matched for each accepting state
+ int m_crulnMatched; // needed only for memory instrumentation
+
+ // Transition matrix--for optimized version:
+// short ** m_prgprgrowXitions; // ((m_crow-m_crowFinal) * m_ccol) of these;
+ // positive number indicates
+ // next state is non-accepting; negative number is
+ // negative of accepting state.
+
+ // Transition matrix--for current version:
+ short * m_prgrowTransitions; // ((m_crow-m_crowFinal) * m_ccol) of these
+
+ // debugger string offsets
+ data16 * m_prgibStateDebug; // for transition states; (m_crow-m_crul+1) of these
+
+ // constants for fast binary search; these are generated by the compiler so that the
+ // engine doesn't have to take time to do it
+ data16 m_dimcrInit; // (max power of 2 <= m_cmcr);
+ // size of initial range to consider
+ data16 m_cLoop; // log2(max power of 2 <= m_cmcr);
+ // indicates how many iterations are necessary
+ data16 m_imcrStart; // m_cmcr - m_dimcrInit;
+ // where to start search
+
+ int m_cmcr; // number of machine-class-ranges
+ GrFSMClassRange * m_prgmcr; // array of class ranges; we search these to find the
+ // mapping to the machine-class-column
+
+ // minimum and maximum number of items in the rule contexts before the first modified
+ // item.
+ int m_critMinRulePreContext;
+ int m_critMaxRulePreContext;
+
+ // start states--row in the FSM to start on depending on how many bogus slots we
+ // are skipping; (max rule-precontext - min rule-precontext + 1) of these;
+ // first always = zero
+ short * m_prgrowStartStates;
+
+//:Ignore
+#if OLD_TEST_STUFF
+public:
+ // For test procedures:
+ void SetUpSimpleFSMTest();
+ void SetUpRuleActionTest();
+ void SetUpRuleAction2Test(int);
+ void SetUpAssocTest(int);
+ void SetUpAssoc2Test(int);
+ void SetUpDefaultAssocTest();
+ void SetUpFeatureTest();
+ void SetUpLigatureTest(int);
+ void SetUpLigature2Test(int);
+#endif // OLD_TEST_STUFF
+//:End Ignore
+
+};
+
+} // namespace gr
+
+
+#endif // !FSM_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/GrFeature.cpp b/Build/source/libs/graphite/src/segment/GrFeature.cpp
new file mode 100644
index 00000000000..61970d56949
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrFeature.cpp
@@ -0,0 +1,321 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrFeature.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Implements the GrFeature class.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+#include <cstring>
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> GrFeature Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the feature.
+----------------------------------------------------------------------------------------------*/
+void GrFeature::Initialize(featid nID, int nNameId, int cfset, int nDefault)
+{
+ m_nID = nID;
+ m_nNameId = nNameId;
+ m_nDefault = nDefault;
+
+ m_vnVal.resize(cfset);
+ for (unsigned int ifset = 0; ifset < m_vnVal.size(); ifset++)
+ m_vnVal[ifset] = INT_MAX;
+ m_vnNameId.resize(cfset);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the feature settings.
+----------------------------------------------------------------------------------------------*/
+int GrFeature::Settings(int cMax, int * prgnVal)
+{
+ int cRet = min(cMax, signed(m_vnVal.size()));
+ for (int ifset = 0; ifset < cRet; ifset++)
+ prgnVal[ifset] = m_vnVal[ifset];
+ return cRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Add a feature setting.
+----------------------------------------------------------------------------------------------*/
+void GrFeature::AddSetting(int nVal, int nNameId)
+{
+ Assert(nVal != INT_MAX);
+ unsigned int ifset;
+ for (ifset = 0; ifset < m_vnVal.size(); ifset++)
+ {
+ if (m_vnVal[ifset] == nVal)
+ return; // already there
+ }
+ for (ifset = 0; ifset < m_vnVal.size(); ifset++)
+ {
+ if (m_vnVal[ifset] == INT_MAX)
+ {
+ m_vnVal[ifset] = nVal;
+ m_vnNameId[ifset] = nNameId;
+ return;
+ }
+ }
+ m_vnVal.push_back(nVal);
+ m_vnNameId.push_back(nNameId);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the given setting is valid according to the font's feature table.
+----------------------------------------------------------------------------------------------*/
+bool GrFeature::IsValidSetting(int nVal)
+{
+ for (unsigned int ifset = 0; ifset < m_vnVal.size(); ifset++)
+ {
+ if (m_vnVal[ifset] == nVal)
+ return true;
+ }
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the feature label from the name table.
+----------------------------------------------------------------------------------------------*/
+std::wstring GrFeature::Label(GrEngine * pgreng, int nLang)
+{
+ std::wstring stu = pgreng->StringFromNameTable(nLang, m_nNameId);
+ if (stu == L"NoName")
+ stu.erase();
+ return stu;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the feature value label from the name table.
+----------------------------------------------------------------------------------------------*/
+std::wstring GrFeature::SettingLabel(GrEngine * pgreng, int nVal, int nLang)
+{
+ for (unsigned int ifset = 0; ifset < m_vnVal.size(); ifset++)
+ {
+ if (m_vnVal[ifset] == nVal)
+ {
+ std::wstring stu = pgreng->StringFromNameTable(nLang, m_vnNameId[ifset]);
+ if (stu == L"NoName")
+ stu.erase();
+ return stu;
+ }
+ }
+ Assert(false); // setting is not valid
+ return L"";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the given setting value.
+----------------------------------------------------------------------------------------------*/
+int GrFeature::NthSetting(int ifset)
+{
+ if (ifset >= (int)m_vnVal.size())
+ return -1;
+ else
+ return m_vnVal[ifset];
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the feature value label for the given index.
+----------------------------------------------------------------------------------------------*/
+std::wstring GrFeature::NthSettingLabel(GrEngine * pgreng, int ifset, int nLang)
+{
+ std::wstring stu;
+
+ if (ifset >= (int)m_vnVal.size())
+ stu.erase();
+ else
+ {
+ stu = pgreng->StringFromNameTable(nLang, m_vnNameId[ifset]);
+ if (stu == L"NoName")
+ stu.erase();
+ }
+ return stu;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the feature setting label.
+----------------------------------------------------------------------------------------------*/
+// void GrFeature::SetSettingLabel(int nVal, std::wstring stuLabel, int nLang)
+// {
+// for (int ifset = 0; ifset < m_vfset.size(); ifset++)
+// {
+// if (m_vfset[ifset].m_nVal == nVal)
+// {
+// m_vfset[ifset].m_hmnstuLabels.Insert(nLang, stuLabel, true);
+// return;
+// }
+// }
+// Assert(false); // setting is not valid
+// }
+
+
+//:>********************************************************************************************
+//:> GrLangTable Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Read the languages from the font.
+----------------------------------------------------------------------------------------------*/
+bool GrLangTable::ReadFromFont(GrIStream * pgrstrm, int fxdVersion)
+{
+ GrIStream & grstrm = *pgrstrm;
+
+ // number of languages
+ m_clang = (size_t)grstrm.ReadUShortFromFont();
+
+ // search constants
+ m_dilangInit = grstrm.ReadUShortFromFont();
+ m_cLoop = grstrm.ReadUShortFromFont();
+ m_ilangStart = grstrm.ReadUShortFromFont();
+
+ // Slurp the data into the buffers. The "+1" represents a bogus ending entry that quickly
+ // gives us the size of the feature list. Note that the resulting data is all big-endian.
+ int cb = (m_clang + 1) * sizeof(LangEntry);
+ m_prglang = new LangEntry[m_clang + 1];
+ grstrm.ReadBlockFromFont(m_prglang, cb);
+
+ m_cbOffset0 = (lsbf)(m_prglang[0].cbOffsetBIG);
+
+ Assert((lsbf)(m_prglang[m_clang].cFeaturesBIG) == 0); // bogus entry has no settings
+ cb = (lsbf)(m_prglang[m_clang].cbOffsetBIG) - m_cbOffset0;
+ Assert(cb % sizeof(FeatSet) == 0); // # of bytes fits nicely into FeatSet class
+ int cfset = cb / sizeof(FeatSet);
+ m_prgfset = new FeatSet[cfset];
+ m_cfset = cfset;
+ grstrm.ReadBlockFromFont(m_prgfset, cb);
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Create an empty language table to use for dumb rendering, or when there is no valid
+ Sill table.
+----------------------------------------------------------------------------------------------*/
+void GrLangTable::CreateEmpty()
+{
+ m_prglang = NULL;
+ m_prgfset = NULL;
+ m_clang = 0;
+ m_dilangInit = 0;
+ m_cLoop = 0;
+ m_ilangStart = 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return information about the language with the given ID by filling in the given vectors
+ with the feature ids and values. Will wipe out any data in the vectors already.
+----------------------------------------------------------------------------------------------*/
+void GrLangTable::LanguageFeatureSettings(isocode lgcode,
+ std::vector<featid> & vnFeatId, std::vector<int> & vnValues)
+{
+ vnFeatId.clear();
+ vnValues.clear();
+
+ int ilang = FindIndex(lgcode);
+ if (ilang == -1)
+ return; // no such language: leave vectors empty
+
+ LangEntry * plang = m_prglang + ilang;
+ int cbOffset = lsbf(plang->cbOffsetBIG) - m_cbOffset0;
+ Assert(cbOffset % sizeof(FeatSet) == 0);
+ byte * pbFeatSet = reinterpret_cast<byte*>(m_prgfset) + cbOffset;
+ FeatSet * pfset = reinterpret_cast<FeatSet*>(pbFeatSet);
+ for (int ifset = 0; ifset < lsbf(plang->cFeaturesBIG); ifset++)
+ {
+ vnFeatId.push_back(lsbf(pfset[ifset].featidBIG));
+ vnValues.push_back(lsbf(pfset[ifset].valueBIG));
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the code for the language at the given index.
+----------------------------------------------------------------------------------------------*/
+isocode GrLangTable::LanguageCode(size_t ilang)
+{
+ isocode lgcodeRet;
+ if (ilang > m_clang)
+ {
+ std::fill_n(lgcodeRet.rgch, 4, '\0');
+ return lgcodeRet;
+ }
+ LangEntry * plang = m_prglang + ilang;
+ std::copy(plang->rgchCode, plang->rgchCode + 4, lgcodeRet.rgch);
+ return lgcodeRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the index of the language in the list.
+----------------------------------------------------------------------------------------------*/
+int GrLangTable::FindIndex(isocode lgcode)
+{
+ if (m_clang == 0)
+ return -1;
+#ifdef _DEBUG
+ int nPowerOf2 = 1;
+ while (nPowerOf2 <= signed(m_clang))
+ nPowerOf2 <<= 1;
+ nPowerOf2 >>= 1;
+ // Now nPowerOf2 is the max power of 2 <= m_clang
+ gAssert((1 << m_cLoop) == nPowerOf2); // m_cLoop == log2(nPowerOf2)
+ gAssert(m_dilangInit == nPowerOf2);
+ gAssert(m_ilangStart == m_clang - m_dilangInit);
+#endif // _DEBUG
+
+ int dilangCurr = m_dilangInit;
+
+ int ilangCurr = m_ilangStart; // may become < 0
+ while (dilangCurr > 0)
+ {
+ int nTest;
+ if (ilangCurr < 0)
+ nTest = -1;
+ else
+ {
+ LangEntry * plangCurr = m_prglang + ilangCurr;
+ nTest = strcmp(plangCurr->rgchCode, lgcode.rgch);
+ }
+
+ if (nTest == 0)
+ return ilangCurr;
+
+ dilangCurr >>= 1; // divide by 2
+ if (nTest < 0)
+ ilangCurr += dilangCurr;
+ else // (nTest > 0)
+ ilangCurr -= dilangCurr;
+ }
+
+ return -1;
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/GrFeatureValues.h b/Build/source/libs/graphite/src/segment/GrFeatureValues.h
new file mode 100644
index 00000000000..de9eda0f03f
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrFeatureValues.h
@@ -0,0 +1,71 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999 - 2008 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrFeatureValues.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+
+
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GR_FEATVAL_INCLUDED
+#define GR_FEATVAL_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+ A convenient way to group together style and feature information that interacts
+ with the rules.
+
+ Hungarian: fval
+----------------------------------------------------------------------------------------------*/
+class GrFeatureValues
+{
+ friend class GrCharStream;
+ friend class GrSlotAbstract;
+ friend class GrSlotState;
+
+public:
+ // Standard constructor:
+ GrFeatureValues()
+ {
+ m_nStyleIndex = 0;
+ std::fill(m_rgnFValues, m_rgnFValues + kMaxFeatures, 0);
+ }
+
+ // Copy constructor:
+ GrFeatureValues(const GrFeatureValues & fval)
+ {
+ m_nStyleIndex = fval.m_nStyleIndex;
+ std::copy(fval.m_rgnFValues, fval.m_rgnFValues + kMaxFeatures, m_rgnFValues);
+ }
+
+ bool FeatureValue(size_t ifeat)
+ {
+ return m_rgnFValues[ifeat];
+ }
+
+ // For transduction logging:
+#ifdef TRACING
+ void WriteXductnLog(GrTableManager * ptman, std::ostream &);
+#endif // TRACING
+
+protected:
+ int m_nStyleIndex;
+ int m_rgnFValues[kMaxFeatures];
+};
+
+} // namespace gr
+
+
+#endif // !GR_FEATVAL_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/GrGlyphTable.cpp b/Build/source/libs/graphite/src/segment/GrGlyphTable.cpp
new file mode 100644
index 00000000000..8643eae8cb8
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrGlyphTable.cpp
@@ -0,0 +1,650 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrGlyphTable.cpp
+Responsibility: Sharon Correll
+Last reviewed: 10Aug99, JT, quick look over
+
+Description:
+ Implements the GrGlyphTable class and related classes.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Fill in the glyph table from the font stream.
+----------------------------------------------------------------------------------------------*/
+bool GrGlyphTable::ReadFromFont(GrIStream & grstrmGloc, long lGlocStart,
+ GrIStream & grstrmGlat, long lGlatStart,
+ data16 chwBWAttr, data16 chwJStrAttr, int cJLevels, int cnCompPerLig,
+ int fxdSilfVersion)
+{
+ // Create the glyph sub-table for the single style.
+ GrGlyphSubTable * pgstbl = new GrGlyphSubTable();
+
+ // Gloc table--offsets into Glat table
+ grstrmGloc.SetPositionInFont(lGlocStart);
+
+ // version
+ int fxdGlocVersion = GrEngine::ReadVersion(grstrmGloc);
+ if (fxdGlocVersion > kGlocVersion)
+ return false;
+
+ // flags
+ short snFlags = grstrmGloc.ReadShortFromFont();
+
+ // number of attributes
+ unsigned short cAttrs = grstrmGloc.ReadUShortFromFont();
+
+ // Create a single sub-table for the single style.
+ pgstbl->Initialize(fxdSilfVersion, snFlags, chwBWAttr, chwJStrAttr, data16(chwJStrAttr + cJLevels),
+ m_cglf, cAttrs, cnCompPerLig);
+
+ SetSubTable(0, pgstbl);
+
+ return pgstbl->ReadFromFont(grstrmGloc, m_cglf, grstrmGlat, lGlatStart);
+}
+
+bool GrGlyphSubTable::ReadFromFont(GrIStream & grstrmGloc, int cGlyphs,
+ GrIStream & grstrmGlat, long lGlatStart)
+{
+ // attribute value offsets--slurp
+ if (m_fGlocShort)
+ {
+ grstrmGloc.ReadBlockFromFont(m_prgibBIGAttrValues, ((cGlyphs + 1) * sizeof(data16)));
+ }
+ else
+ {
+ grstrmGloc.ReadBlockFromFont(m_prgibBIGAttrValues, ((cGlyphs + 1) * sizeof(data32)));
+ }
+
+ // length of buffer needed for glyph attribute values:
+ int cbBufLen = GlocLookup(data16(cGlyphs));
+
+ // TODO: slurp debugger offsets: 'm_prgibBIGGlyphAttrDebug'
+
+ m_pgatbl = new GrGlyphAttrTable();
+ m_pgatbl->Initialize(m_fxdSilfVersion, cbBufLen);
+
+ // Glat table
+ grstrmGlat.SetPositionInFont(lGlatStart);
+
+ // version
+ int fxdGlatVersion = grstrmGlat.ReadIntFromFont();
+ if (fxdGlatVersion > kGlatVersion)
+ return false;
+
+ // Back up over the version number and include it right in the attribute value entry
+ // buffer, since the offsets take it into account.
+ grstrmGlat.SetPositionInFont(lGlatStart);
+
+ // Slurp the entire block of entries.
+ grstrmGlat.ReadBlockFromFont(m_pgatbl->m_prgbBIGEntries, cbBufLen);
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Create an empty glyph table with no glyph attributes.
+----------------------------------------------------------------------------------------------*/
+void GrGlyphTable::CreateEmpty()
+{
+ // Create the glyph sub-table for the single style.
+ GrGlyphSubTable * pgstbl = new GrGlyphSubTable();
+
+ // Create a single sub-table for the single style.
+ pgstbl->Initialize(0, 0, 0, 0, 0, m_cglf, 0, 0);
+
+ SetSubTable(0, pgstbl);
+
+ pgstbl->CreateEmpty();
+}
+
+void GrGlyphSubTable::CreateEmpty()
+{
+ m_pgatbl = new GrGlyphAttrTable();
+ m_pgatbl->Initialize(0, 0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialization.
+----------------------------------------------------------------------------------------------*/
+void GrGlyphSubTable::Initialize(int fxdSilfVersion, utf16 chwFlags,
+ data16 chwBWAttr, data16 chwJStrAttr, data16 chwJStrHWAttr,
+ int cGlyphs, int cAttrs, int cnCompPerLig)
+{
+ m_fxdSilfVersion = fxdSilfVersion;
+ m_fHasDebugStrings = HasAttrNames(chwFlags);
+ m_nAttrIDLim = cAttrs;
+ m_chwBWAttr = chwBWAttr;
+ m_chwJStrAttr = chwJStrAttr;
+ m_chwJStrHWAttr = chwJStrHWAttr;
+ m_fGlocShort = !LongFormat(chwFlags);
+
+ if (m_fGlocShort)
+ { // item # cGlyphs holds length, which is convenient for dealing with last item
+ m_prgibBIGAttrValues = new byte[(cGlyphs + 1) * sizeof(data16)];
+ }
+ else
+ {
+ m_prgibBIGAttrValues = new byte[(cGlyphs + 1) * sizeof(data32)];
+ }
+
+
+ if (m_fHasDebugStrings)
+ {
+ m_prgibBIGGlyphAttrDebug = new data16[cAttrs + 1];
+ }
+
+ // Make a cache to hold a list of defined components for each glyph. This is
+ // calculated lazily, as needed, so we also include (as the first item) a flag to
+ // indicate whether or not it has been calculated; hence the "+1".
+ m_cnCompPerLig = cnCompPerLig;
+ m_prgnDefinedComponents = new int[(m_cnCompPerLig + 1) * cGlyphs];
+ std::fill_n(m_prgnDefinedComponents, (m_cnCompPerLig + 1) * cGlyphs, 0);
+
+ // Now the instance is ready to have the locations and the debug strings
+ // read from the file.
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the attribute value for the given glyph.
+----------------------------------------------------------------------------------------------*/
+int GrGlyphSubTable::GlyphAttrValue(gid16 chwGlyphID, int nAttrID)
+{
+ if (m_nAttrIDLim == 0)
+ {
+ // No attributes defined (eg, invalid font)
+ return 0;
+ }
+ if (nAttrID >= m_nAttrIDLim || nAttrID >= 0xFF)
+ {
+ gAssert(false);
+ return 0;
+ }
+ int ibMin = GlocLookup(chwGlyphID); // where this glyph's attrs start
+ int ibLim = GlocLookup(chwGlyphID + 1); // where next glyph starts
+
+ int nRet = m_pgatbl->GlyphAttr16BitValue(ibMin, ibLim, byte(nAttrID));
+ if ((data16)nAttrID == m_chwJStrAttr)
+ {
+ // For justify.stretch, which can be a 32-bit value, add on the high word.
+ unsigned int nRetHW = m_pgatbl->GlyphAttr16BitValue(ibMin, ibLim, byte(m_chwJStrHWAttr));
+ nRet = (nRetHW << 16) | nRet;
+ }
+ return ConvertValueForVersion(nRet, nAttrID);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert the glyph attribute value from the version of the font table to what is
+ expected by the engine.
+----------------------------------------------------------------------------------------------*/
+int GrGlyphSubTable::ConvertValueForVersion(int nValue, int nAttrID)
+{
+ return ConvertValueForVersion(nValue, nAttrID, (int)m_chwBWAttr, m_fxdSilfVersion);
+}
+
+int GrGlyphSubTable::ConvertValueForVersion(int nValue, int nAttrID, int nBWAttr, int fxdVersion)
+{
+ if ((nBWAttr >= 0 && nAttrID == (int)nBWAttr) ||
+ (nBWAttr == -1 && nAttrID == (int)kslatBreak))
+ {
+ if (fxdVersion < 0x00020000)
+ {
+ //switch (nValue)
+ //{
+ //case klbv1WordBreak: return klbWordBreak;
+ //case klbv1HyphenBreak: return klbHyphenBreak;
+ //case klbv1LetterBreak: return klbLetterBreak;
+ //case klbv1ClipBreak: return klbClipBreak;
+ //default:
+ // break;
+ //}
+ //switch (nValue * -1)
+ //{
+ //case klbv1WordBreak: return (klbWordBreak * -1);
+ //case klbv1HyphenBreak: return (klbHyphenBreak * -1);
+ //case klbv1LetterBreak: return (klbLetterBreak * -1);
+ //case klbv1ClipBreak: return (klbClipBreak * -1);
+ //default:
+ // break;
+ //}
+
+ // Breakweight values in version 2 are 10 times what they were in version 1.
+ if (abs(nValue) <= 7)
+ return nValue * 10;
+ }
+ }
+ return nValue;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the attribute value a glyph. Loop through the attribute runs, looking
+ for the one containing the given attribute. Assume the value is 0 if not found.
+
+ @param ibMin - byte offset of first run for the glyph of interest
+ @param ibLim - byte offset of first run for the following glyph
+ @param bAttrID - attribute to find
+----------------------------------------------------------------------------------------------*/
+int GrGlyphAttrTable::GlyphAttr16BitValue(int ibMin, int ibLim, byte bAttrID)
+{
+ GrGlyphAttrRun gatrun;
+ byte * pbBIGEnt = m_prgbBIGEntries + ibMin;
+
+ while (pbBIGEnt < m_prgbBIGEntries + ibLim)
+ {
+ // Suck the run of attribute values into the instance, so we can see
+ // what's there.
+ gatrun.CopyFrom(pbBIGEnt);
+
+ if (bAttrID < gatrun.m_bMinAttrID)
+ // Attribute not found--assume value is 0.
+ return 0;
+ else if (gatrun.m_bMinAttrID + gatrun.m_cAttrs > bAttrID)
+ {
+ // Found the value in this run.
+ data16 chw = lsbf(gatrun.m_rgchwBIGValues[bAttrID - gatrun.m_bMinAttrID]);
+ if ((chw & 0x8000) == 0)
+ return (int)chw;
+ else
+ return 0xFFFF0000 | chw; // sign extension
+ }
+ else
+ // Go to next run.
+ pbBIGEnt += gatrun.ByteCount();
+ }
+
+ // Attribute not found--assume value is 0;
+ return 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Given a point on the glyph, determine which component (if any) the point is in, and return
+ its index relative to the components that are defined for this glyph; ie, the index within
+ the compRef array.
+ Return -1 if the click with not inside any component, or if there are no components
+ defined for this glyph.
+ CURRENTLY NOT USED - if ever used, need to incorporate floating point
+----------------------------------------------------------------------------------------------*/
+int GrGlyphSubTable::ComponentContainingPoint(gid16 chwGlyphID, int x, int y)
+{
+ int i = CalculateDefinedComponents(chwGlyphID);
+ for (int inComp = 0; inComp < m_cnCompPerLig; inComp++)
+ {
+ // The m_pnComponents list holds a list of the component attributes that are defined
+ // for this glyph, padded with -1's.
+ int nCompID = m_prgnDefinedComponents[i + inComp];
+ if (nCompID == -1)
+ break; // hit the end of the list
+
+ // The value of the component attribute is actually the attribute ID for the
+ // first of the component box fields--the top. There should a contiguous group of
+ // four fields: top, bottom, left, right.
+ int nFieldIDMin = GlyphAttrValue(chwGlyphID, nCompID);
+ gAssert(nFieldIDMin != 0);
+ int nTop = GlyphAttrValue(chwGlyphID, nFieldIDMin);
+ int nBottom = GlyphAttrValue(chwGlyphID, nFieldIDMin + 1);
+ int nLeft = GlyphAttrValue(chwGlyphID, nFieldIDMin + 2);
+ int nRight = GlyphAttrValue(chwGlyphID, nFieldIDMin + 3);
+
+ if (nLeft <= x && x < nRight &&
+ nBottom <= y && y < nTop)
+ {
+ return inComp;
+ }
+ }
+ return -1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Fill in the box with the source-device coordinates corresponding to the given component.
+ The rectangle is relative to the top-left of the glyph.
+ Return false if the component is not defined.
+
+ @param xysEmSquare - of the font, in logical units
+ @param chwGlyphID - the glyph of interest
+ @param icomp - the component of interest (eg, for the "oe" ligature,
+ the index for component.o would be 0,
+ and the index for component.e would be 1);
+ these is as defined by the glyph, not as used in the rules
+ @param mFontEmUnits - the number of em-units in the font, for scaling
+ @param dysFontAscent - ascent of the font, for adjusting coordinate systems
+ @param pxsLeft, pxsRight, pysTop, pysBottom
+ - return values, in source device coordinates
+ @param fTopOrigin - convert values to a coordinate system where the origin is the
+ top of the line, not the baseline
+----------------------------------------------------------------------------------------------*/
+bool GrGlyphSubTable::ComponentBoxLogUnits(float xysEmSquare,
+ gid16 chwGlyphID, int icomp, int mFontEmUnits, float dysFontAscent,
+ float * pxsLeft, float * pysTop, float * pxsRight, float * pysBottom,
+ bool fTopOrigin)
+{
+ int i = CalculateDefinedComponents(chwGlyphID);
+
+ // The m_pnComponents list holds a list of the component attributes that are defined
+ // for this glyph, padded with -1's.
+ int nCompID = m_prgnDefinedComponents[i + icomp];
+ if (nCompID == -1)
+ {
+ // Ooops, the component is undefined for this glyph.
+ *pxsLeft = 0;
+ *pxsRight = 0;
+ *pysTop = 0;
+ *pysBottom = 0;
+ return false;
+ }
+
+ // The value of the component attribute is actually the attribute ID for the
+ // first of the component box fields--the top. There should a contiguous group of
+ // four fields: top, bottom, left, right.
+ int nFieldIDMin = GlyphAttrValue(chwGlyphID, nCompID);
+ if (nFieldIDMin == 0)
+ {
+ // Component inadequately defined. This can happen when we defined components
+ // for a glyph and then substituted another glyph for it.
+ *pxsLeft = 0;
+ *pxsRight = 0;
+ *pysTop = 0;
+ *pysBottom = 0;
+ return false;
+ }
+ int mTop = GlyphAttrValue(chwGlyphID, nFieldIDMin);
+ int mBottom = GlyphAttrValue(chwGlyphID, nFieldIDMin + 1);
+ int mLeft = GlyphAttrValue(chwGlyphID, nFieldIDMin + 2);
+ int mRight = GlyphAttrValue(chwGlyphID, nFieldIDMin + 3);
+
+ ////int xysFontEmUnits;
+ ////// ysHeight should correspond to the pixels in the font's em square
+ ////GrResult res = pgg->GetFontEmSquare(&xysFontEmUnits);
+ ////if (ResultFailed(res))
+ //// return false;
+
+ *pxsLeft = GrEngine::GrIFIMulDiv(mLeft, xysEmSquare, mFontEmUnits);
+ *pxsRight = GrEngine::GrIFIMulDiv(mRight, xysEmSquare, mFontEmUnits);
+ *pysTop = GrEngine::GrIFIMulDiv(mTop, xysEmSquare, mFontEmUnits);
+ *pysBottom = GrEngine::GrIFIMulDiv(mBottom, xysEmSquare, mFontEmUnits);
+
+ if (*pxsLeft > *pxsRight)
+ {
+ float xsTmp = *pxsLeft;
+ *pxsLeft = *pxsRight;
+ *pxsRight = xsTmp;
+ }
+ if (*pysTop < *pysBottom)
+ {
+ float ysTmp = *pysTop;
+ *pysTop = *pysBottom;
+ *pysBottom = ysTmp;
+ }
+
+ if (fTopOrigin)
+ {
+ // Currently top and bottom coordinates are such that 0 is the baseline and positive is
+ // upwards, while for the box we want to return, 0 is the top of the glyph and positive
+ // is downwards. So switch systems.
+ *pysTop = (dysFontAscent - *pysTop);
+ *pysBottom = (dysFontAscent - *pysBottom);
+ }
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Calculate the list of defined components for the given glyph, if any.
+ Return the index to the first relevant item in the array.
+ Private.
+ TODO: With the current implementation that stores the glyph ids in each slot, this
+ mechanism is redundant and obsolete, and should be removed.
+----------------------------------------------------------------------------------------------*/
+int GrGlyphSubTable::CalculateDefinedComponents(gid16 chwGlyphID)
+{
+ // The first item is a flag indicating whether the list has been calculated.
+ int iFlag = chwGlyphID * (m_cnCompPerLig + 1); // index of has-been-calculated flag
+ int iMin = iFlag + 1; // first actual value; +1 in order to skip the flag
+ if (m_prgnDefinedComponents[iFlag] == 0)
+ {
+ int iTmp = iMin;
+ for (int nCompID = 0; nCompID < m_cComponents; nCompID++)
+ {
+ if (ComponentIsDefined(chwGlyphID, nCompID))
+ m_prgnDefinedComponents[iTmp++] = nCompID;
+ if (iTmp - iMin >= m_cnCompPerLig)
+ break; // ignore any components beyond the maximum allowed
+ }
+ // Fill in the rest of the list with -1.
+ for( ; iTmp < iMin + m_cnCompPerLig; iTmp++)
+ m_prgnDefinedComponents[iTmp] = -1;
+
+ m_prgnDefinedComponents[iFlag] = 1; // has been calculated
+ }
+ return iMin;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the given attr ID, which is a component definition attribute, indicates
+ that that component is defined for the given glyph.
+
+ @param chwGlyphID - the glyph of interest
+ @param nAttrID - the attribute of interest, assumed to be a component glyph
+ attribute (eg. component.e.top)
+----------------------------------------------------------------------------------------------*/
+bool GrGlyphSubTable::ComponentIsDefined(gid16 chwGlyphID, int nAttrID)
+{
+ gAssert(nAttrID < m_cComponents);
+ if (nAttrID >= m_cComponents)
+ return false;
+
+ return (GlyphAttrValue(chwGlyphID, nAttrID) != 0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the index of the given component as defined for the given glyph ID. that is,
+ convert the global ID for the component to the one within this glyph. Return -1
+ if the component is not defined for the given glyph.
+ For instance, given the glyph ID "oe" (the oe ligature) and the attr ID for component.o,
+ the result would be 0; for component.e the result would be 1.
+----------------------------------------------------------------------------------------------*/
+int GrGlyphSubTable::ComponentIndexForGlyph(gid16 chwGlyphID, int nCompID)
+{
+ int i = CalculateDefinedComponents(chwGlyphID);
+
+ for (int iLp = 0; iLp < m_cnCompPerLig; iLp++)
+ {
+ if (m_prgnDefinedComponents[i + iLp] == nCompID)
+ return iLp;
+ }
+ return -1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the ID of the nth defined component attribute for the given glyph.
+----------------------------------------------------------------------------------------------*/
+//int GrGlyphSubTable::NthComponentID(gid16 chwGlyphID, int n)
+//{
+// int i = CalculateDefinedComponents(chwGlyphID);
+// return m_pnComponents[i + 1 + n];
+//}
+
+
+//:>********************************************************************************************
+//:> For test procedures
+//:>********************************************************************************************
+
+//:Ignore
+#ifdef OLD_TEST_STUFF
+
+void GrGlyphTable::SetUpTestData()
+{
+ SetNumberOfGlyphs(5);
+ SetNumberOfStyles(1);
+
+ GrGlyphSubTable * pgstbl = new GrGlyphSubTable();
+ gAssert(pgstbl);
+
+ pgstbl->Initialize(1, 0, 5, 10, 4);
+ SetSubTable(0, pgstbl);
+
+ pgstbl->SetUpTestData();
+}
+
+/***********************************************************************************************
+ TODO: This method is BROKEN because m_prgibBIGAttrValues has been changed. It is no
+ longer a utf16 *. The Gloc table can contain 16-bit or 32-bit entries and must be
+ accessed accordingly.
+***********************************************************************************************/
+void GrGlyphSubTable::SetUpTestData()
+{
+ m_pgatbl = new GrGlyphAttrTable();
+ m_pgatbl->Initialize(0, 48);
+
+ m_prgibBIGAttrValues[0] = byte(msbf(data16(0)));
+ m_prgibBIGAttrValues[1] = byte(msbf(data16(6))));
+ m_prgibBIGAttrValues[2] = byte(msbf(data16(20)));
+ m_prgibBIGAttrValues[3] = byte(msbf(data16(20)));
+ m_prgibBIGAttrValues[4] = byte(msbf(data16(40)));
+ m_prgibBIGAttrValues[5] = byte(msbf(data16(48)));
+
+ m_pgatbl->SetUpTestData();
+}
+
+void GrGlyphAttrTable::SetUpTestData()
+{
+ // Glyph 0 (1 run; offset = 0):
+ // 1 = 11 = 0x0B
+ // 2 = 22 = 0x16
+ // 0102 000B 0016
+ //
+ // Glyph 1 (2 runs; offset = 3*2 = 6):
+ // 0 = 5
+ // 1 = 6
+ // 2 = 7
+ // 8 = 8
+ // 9 = 9
+ // 0003 0005 0006 0007
+ // 0802 0008 0009
+ //
+ // Glyph 2 (0 runs; offset = 6 + 7*2 = 20):
+ // all values = 0
+ //
+ // Glyph 3 (5 runs; offset = 20):
+ // 1 = 111 = 0x006F
+ // 3 = 333 = 0x00DE
+ // 5 = 555 = 0x022B
+ // 7 = 777 = 0x0309
+ // 9 = 999 = 0x03E7
+ // 0101 006F
+ // 0301 00DE
+ // 0501 022B
+ // 0701 0309
+ // 0901 03E7
+ //
+ // Glyph 4 (1 run; offset = 20 + 10*2 = 40):
+ // 5 = 4
+ // 6 = 4
+ // 7 = 4
+ // 0503 0004 0004 0004
+ //
+ // Glyph 5 (offset = 40 + 4*2 = 48)
+
+ byte * pbBIG = m_prgbBIGEntries;
+
+ GrGlyphAttrRun gatrun;
+
+ // Glyph 0
+ gatrun.m_bMinAttrID = 1;
+ gatrun.m_cAttrs = 2;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(11));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(22));
+ memcpy(pbBIG, &gatrun, 6);
+ pbBIG += 6;
+
+ // Glyph 1
+ gatrun.m_bMinAttrID = 0;
+ gatrun.m_cAttrs = 3;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(5));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(6));
+ gatrun.m_rgchwBIGValues[2] = msbf(data16(7));
+ memcpy(pbBIG, &gatrun, 8);
+ pbBIG += 8;
+ gatrun.m_bMinAttrID = 8;
+ gatrun.m_cAttrs = 2;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(8));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(9));
+ memcpy(pbBIG, &gatrun, 6);
+ pbBIG += 6;
+
+ // Glyph 2: no data
+
+ // Glyph 3
+ gatrun.m_bMinAttrID = 1;
+ gatrun.m_cAttrs = 1;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(111));
+ memcpy(pbBIG, &gatrun, 4);
+ pbBIG += 4;
+ gatrun.m_bMinAttrID = 3;
+ gatrun.m_cAttrs = 1;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(333));
+ memcpy(pbBIG, &gatrun, 4);
+ pbBIG += 4;
+ gatrun.m_bMinAttrID = 5;
+ gatrun.m_cAttrs = 1;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(555));
+ memcpy(pbBIG, &gatrun, 4);
+ pbBIG += 4;
+ gatrun.m_bMinAttrID = 7;
+ gatrun.m_cAttrs = 1;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(777));
+ memcpy(pbBIG, &gatrun, 4);
+ pbBIG += 4;
+ gatrun.m_bMinAttrID = 9;
+ gatrun.m_cAttrs = 1;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(999));
+ memcpy(pbBIG, &gatrun, 4);
+ pbBIG += 4;
+
+ // Glyph 4
+ gatrun.m_bMinAttrID = 5;
+ gatrun.m_cAttrs = 3;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(4));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(4));
+ gatrun.m_rgchwBIGValues[2] = msbf(data16(4));
+ memcpy(pbBIG, &gatrun, 8);
+ pbBIG += 8;
+
+ gAssert(pbBIG == m_prgbBIGEntries + 48);
+}
+
+#endif // OLD_TEST_STUFF
+
+} // namespace gr
+
+//:End Ignore
diff --git a/Build/source/libs/graphite/src/segment/GrGlyphTable.h b/Build/source/libs/graphite/src/segment/GrGlyphTable.h
new file mode 100644
index 00000000000..bec0e518dee
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrGlyphTable.h
@@ -0,0 +1,429 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrGlyphTable.h
+Responsibility: Sharon Correll
+Last reviewed: 10Aug99, JT, quick look over
+
+Description:
+ The GrGlyphTable and related classes that store the values of glyph attributes.
+
+ For each glyph in a TrueType font, Graphite has a list of glyph attributes (which
+ are defined in the GDL script file). Since most of the values will be zero, we save space
+ by only storing the non-zero values.
+
+ Eventually it may be possible to have more than one TrueType font compiled into a single
+ glyph table, hence the need for multiple sub-tables. For now we assume that there is only
+ one font file and only one sub-table.
+
+ Note that BIG in a variable name means that the data is in big-endian format, or is a range
+ of bytes that must be interpreted as a run of wide chars or ints in big-endian format.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:Ignore
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GR_GTABLE_INCLUDED
+#define GR_GTABLE_INCLUDED
+//:End Ignore
+
+namespace gr
+{
+
+class Font;
+
+/*----------------------------------------------------------------------------------------------
+ A run of non-zero attribute values for a single glyph, where the attribute IDs
+ are contiguous.
+
+ NOTE: it is assumed that the format of this class matches the byte order of the data as it
+ is read directly from the TTF/ECF file--that is, it is big-endian.
+
+ Hungarian: gatrun
+----------------------------------------------------------------------------------------------*/
+
+class GrGlyphAttrRun
+{
+ friend class GrGlyphTable;
+ friend class GrGlyphSubTable;
+ friend class GrGlyphAttrTable;
+
+ enum {
+ kMaxAttrsPerRun = 255
+ };
+
+ /*------------------------------------------------------------------------------------------
+ Copy the raw memory (starting at the given byte) into the instance. This method must
+ reflect the format of the "Glat_entry" as it is stored in the file and slurped into
+ memory.
+ ------------------------------------------------------------------------------------------*/
+ void CopyFrom(byte * pbBIGEnt)
+ {
+ m_bMinAttrID = *pbBIGEnt;
+ m_cAttrs = *(pbBIGEnt + 1);
+ if (m_cAttrs >= kMaxAttrsPerRun)
+ {
+ gAssert(false);
+ m_cAttrs = kMaxAttrsPerRun;
+ }
+ #ifdef _DEBUG
+ // Probably not strictly necessary to zero the array, but convenient for debugging.
+ // Removed from release build for optimization
+ std::fill(m_rgchwBIGValues, m_rgchwBIGValues + kMaxAttrsPerRun, 0);
+ #endif
+ // this is mixing types of data16 and byte pointers!
+ const data16 * prgchw = reinterpret_cast<const data16*>(pbBIGEnt + 2);
+ std::copy(prgchw, prgchw + m_cAttrs, m_rgchwBIGValues);
+ }
+
+ int ByteCount()
+ {
+ return (2 + (m_cAttrs * isizeof(data16)));
+ }
+
+protected:
+ byte m_bMinAttrID; // ID of first attribute in the run
+ byte m_cAttrs; // number of attributes in the run
+ data16 m_rgchwBIGValues[kMaxAttrsPerRun];
+};
+
+/*----------------------------------------------------------------------------------------------
+ Contains runs of attribute values for all the glyphs in the font; corresponds to
+ the "Glat" table in the font.
+
+ Hungarian: gatbl
+----------------------------------------------------------------------------------------------*/
+
+class GrGlyphAttrTable
+{
+ friend class GrGlyphTable;
+ friend class GrGlyphSubTable;
+ friend class FontMemoryUsage;
+
+protected:
+ // Constructor:
+ GrGlyphAttrTable()
+ {
+ m_prgbBIGEntries = NULL;
+ }
+
+ // Destructor:
+ ~GrGlyphAttrTable()
+ {
+ delete[] m_prgbBIGEntries;
+ }
+
+ // Initialization:
+ void Initialize(int fxdSilfVersion, int cbBufLen)
+ {
+ m_fxdSilfVersion = fxdSilfVersion;
+ m_cbEntryBufLen = cbBufLen;
+ m_prgbBIGEntries = new byte[cbBufLen];
+ // Now the instance is ready to have all the glyph attr entries slurped into
+ // the byte array from the file.
+ }
+
+ int GlyphAttr16BitValue(int ibMin, int ibLim, byte bAttrID);
+
+protected:
+ int m_fxdSilfVersion; // version number of the Silf table, which is used
+ // to interpret the attribute values
+
+ // Block of variable-length glyph attribute runs, matching the format of
+ // GrGlyphAttrRun. We don't store instances of that class here because they
+ // are variable length, and it would be too slow to read them individually from the
+ // font. Instead, we set up a single instance in the method that accesses the values;
+ // having this instance will help debugging. Eventually we may want to do without it,
+ // if it would help efficiency.
+ int m_cbEntryBufLen; // needed only for memory instrumentation
+ byte * m_prgbBIGEntries;
+
+//:Ignore
+#ifdef OLD_TEST_STUFF
+public:
+ // For test procedures:
+ void SetUpTestData();
+ void SetUpLigatureTest();
+ void SetUpLigature2Test();
+#endif // OLD_TEST_STUFF
+
+//:End Ignore
+
+};
+
+/*----------------------------------------------------------------------------------------------
+ One glyph table per font (style) file; corresponds to the "Gloc" table in the font.
+ Currently there is only considered to be one style per file, so there is only one of
+ these. It holds the (non-zero) glyph attribute values for every glyph in the font.
+
+ Hungarian: gstbl
+
+ Review: Eventually we may need to make a subclass that uses 32-bit values for the offsets,
+ or just use a separate array pointer in this class. Which would be preferable?
+----------------------------------------------------------------------------------------------*/
+
+class GrGlyphSubTable
+{
+ friend class GrGlyphTable;
+ friend class FontMemoryUsage;
+
+public:
+ // Constructor:
+ GrGlyphSubTable() :
+ m_pgatbl(NULL),
+ m_prgibBIGAttrValues(NULL),
+ m_prgibBIGGlyphAttrDebug(NULL),
+ m_prgnDefinedComponents(NULL)
+ {
+ }
+ // Destructor:
+ ~GrGlyphSubTable()
+ {
+ delete m_pgatbl;
+ delete[] m_prgibBIGAttrValues;
+ if (m_fHasDebugStrings)
+ delete[] m_prgibBIGGlyphAttrDebug;
+ delete[] m_prgnDefinedComponents;
+ }
+
+ // Initialization:
+ bool ReadFromFont(GrIStream & gloc_strm, int cGlyphs,
+ GrIStream & glat_strm, long lGlatStart);
+ void Initialize(int fxdSilfVersion, data16 chwFlags,
+ data16 chwBWAttr, data16 chwJStrAttr, data16 chwJStrHWAttr,
+ int cGlyphs, int cAttrs, int cnCompPerLig);
+
+ void CreateEmpty();
+
+ void SetNumberOfComponents(int c)
+ {
+ m_cComponents = c;
+ }
+
+ // General:
+ int NumberOfGlyphAttrs() { return m_nAttrIDLim; } // 0..(m_nAttrIDLim-1)
+
+ int GlyphAttrValue(gid16 chwGlyphID, int nAttrID);
+
+ // Ligatures:
+ int ComponentContainingPoint(gid16 chwGlyphID, int x, int y);
+ bool ComponentBoxLogUnits(float xysEmSquare, gid16 chwGlyphID, int icomp,
+ int mFontEmUnits, float dysAscent,
+ float * pxsLeft, float * pysTop, float * pxsRight, float * pysBottom,
+ bool fTopOrigin = true);
+protected:
+ int CalculateDefinedComponents(gid16 chwGlyphID);
+ bool ComponentIsDefined(gid16 chwGlyphID, int nAttrID);
+ int ComponentIndexForGlyph(gid16 chwGlyphID, int nCompID);
+// int NthComponentID(gid16 chwGlyphID, int n);
+ int ConvertValueForVersion(int nRet, int nAttrID);
+
+public:
+ static int ConvertValueForVersion(int nRet, int nAttrID, int nBWAttr, int fxdVersion);
+
+ // Flags:
+ bool LongFormat(data16 chwFlags) // 32-bit values?
+ {
+ return ((chwFlags & 0x01) == 0x01); // bit 0
+ }
+ bool HasAttrNames(data16 chwFlags)
+ {
+ return ((chwFlags & 0x02) == 0x02); // bit 1
+ }
+ int GlocLookup(data16 chwGlyphId)
+ {
+ if (m_fGlocShort)
+ {
+ unsigned short su = ((unsigned short *)m_prgibBIGAttrValues)[chwGlyphId];
+ return lsbf(su);
+ }
+ else
+ { unsigned int u = ((unsigned int *)m_prgibBIGAttrValues)[chwGlyphId];
+ return lsbf((int)u);
+ }
+ }
+
+protected:
+ int m_fxdSilfVersion; // version number of the Silf table, which is used
+ // to interpret the attribute values
+ bool m_fHasDebugStrings; // are debugging strings loaded into memory?
+
+ int m_nAttrIDLim; // number of glyph attributes
+ int m_cComponents; // number of initial glyph attributes that
+ // represent ligature components
+ int m_cnCompPerLig;
+
+ GrGlyphAttrTable * m_pgatbl;
+ byte * m_prgibBIGAttrValues; // byte offsets for glyph attr values - BIG endian
+ bool m_fGlocShort; // flag for Gloc table format
+ data16 * m_prgibBIGGlyphAttrDebug; // byte offsets for glyph attr debug strings - BIG endian
+
+ data16 m_chwBWAttr; // breakweight attr ID; needed for converting
+ // between versions
+
+ // Attr IDs for justify.0.stretch and justify.0.stretchHW; these must always be looked
+ // up in tandem.
+ data16 m_chwJStrAttr;
+ data16 m_chwJStrHWAttr;
+
+ int * m_prgnDefinedComponents; // for each glyph, cache list of component attributes that
+ // are defined
+
+//:Ignore
+#ifdef OLD_TEST_STUFF
+public:
+ // For test procedures:
+ void SetUpTestData();
+ void SetUpLigatureTest();
+ void SetUpLigature2Test();
+#endif // OLD_TEST_STUFF
+
+//:End Ignore
+};
+
+/*----------------------------------------------------------------------------------------------
+ Holds all the information about glyph attributes.
+
+ Hungarian: gtbl
+----------------------------------------------------------------------------------------------*/
+
+class GrGlyphTable
+{
+ friend class GrGlyphSubTable;
+ friend class FontMemoryUsage;
+
+public:
+ // Constructor:
+ GrGlyphTable()
+ {
+ m_cglf = 0;
+ m_cComponents = 0;
+ m_cgstbl = 0;
+ m_vpgstbl.clear();
+ }
+
+ // Destructor:
+ ~GrGlyphTable()
+ {
+ for (int i = 0; i < m_cgstbl; ++i)
+ delete m_vpgstbl[i];
+ }
+
+ bool ReadFromFont(GrIStream & gloc_strm, long lGlocStart,
+ GrIStream & glat_strm, long lGlatStart,
+ data16 chwBWAttr, data16 chwJStrAttr, int cJLevels, int cnCompPerLig,
+ int fxdSilfVersion);
+
+ void CreateEmpty();
+
+ // Setters:
+ void SetNumberOfGlyphs(int c)
+ {
+ m_cglf = c;
+ }
+ void SetNumberOfStyles(int c)
+ {
+ m_cgstbl = c;
+ m_vpgstbl.resize(c);
+ }
+ void SetNumberOfComponents(int c)
+ {
+ m_cComponents = c;
+ for (unsigned int ipgstbl = 0; ipgstbl < m_vpgstbl.size(); ipgstbl++)
+ m_vpgstbl[ipgstbl]->SetNumberOfComponents(c);
+ }
+ void SetSubTable(int i, GrGlyphSubTable * pgstbl)
+ {
+ if (signed(m_vpgstbl.size()) <= i)
+ {
+ gAssert(false);
+ m_vpgstbl.resize(i+1);
+ }
+ m_vpgstbl[i] = pgstbl;
+ m_vpgstbl[i]->SetNumberOfComponents(m_cComponents);
+ }
+
+ // Getters:
+ int NumberOfGlyphs() { return m_cglf; }
+ int NumberOfStyles() { return m_cgstbl; }
+
+ int NumberOfGlyphAttrs()
+ {
+ // All of the sub-tables should have the same number of glyph attributes,
+ // so just ask the first.
+ return m_vpgstbl[0]->NumberOfGlyphAttrs();
+ }
+
+ int GlyphAttrValue(gid16 chwGlyphID, int nAttrID)
+ {
+ gAssert(m_cgstbl == 1);
+ return m_vpgstbl[0]->GlyphAttrValue(chwGlyphID, nAttrID);
+ }
+ // Eventually:
+ //int GlyphAttrValue(gid16 chwGlyphID, int nAttrID, int nStyleIndex)
+ //{
+ // return m_vpgstbl[nStyleIndex]->GlyphAttrValue(chwGlyphID, nAttrID);
+ //}
+
+ int ComponentContainingPoint(gid16 chwGlyphID, int x, int y)
+ {
+ gAssert(m_cgstbl == 1);
+ return m_vpgstbl[0]->ComponentContainingPoint(chwGlyphID, x, y);
+ }
+ // Eventually:
+ //int ComponentContainingPoint(gid16 chwGlyphID, int nStyleIndex, int x, int y)
+ //{
+ // gAssert(m_cgstbl == 1);
+ // return m_vpgstbl[nStyleIndex]->ComponentContainingPoint(chwGlyphID, nAttrID);
+ //}
+
+ bool ComponentBoxLogUnits(float xysEmSquare, gid16 chwGlyphID, int icomp,
+ int mFontEmUnits, float dysAscent,
+ float * pxsLeft, float * pysTop, float * pxsRight, float * pysBottom,
+ bool fTopOrigin = true)
+ {
+ gAssert(m_cgstbl == 1);
+ return m_vpgstbl[0]->ComponentBoxLogUnits(xysEmSquare,
+ chwGlyphID, icomp, mFontEmUnits, dysAscent,
+ pxsLeft, pysTop, pxsRight, pysBottom,
+ fTopOrigin);
+ }
+
+ int ComponentIndexForGlyph(gid16 chwGlyphID, int nCompID)
+ {
+ gAssert(m_cgstbl == 1);
+ return m_vpgstbl[0]->ComponentIndexForGlyph(chwGlyphID, nCompID);
+ }
+
+ bool IsEmpty()
+ {
+ return (m_cglf == 0);
+ }
+
+protected:
+ int m_cglf; // number of glyphs
+ int m_cComponents; // number of defined components
+ int m_cgstbl; // number of sub-tables, corresponding to font files;
+ // for now there is only one
+
+ std::vector<GrGlyphSubTable *> m_vpgstbl;
+
+//:Ignore
+#ifdef OLD_TEST_STUFF
+public:
+ // For test procedures:
+ void SetUpTestData();
+ void SetUpLigatureTest();
+ void SetUpLigature2Test();
+#endif // OLD_TEST_STUFF
+//:End Ignore
+
+};
+
+} // namespace gr
+
+#endif // !GR_GTABLE_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/GrPass.cpp b/Build/source/libs/graphite/src/segment/GrPass.cpp
new file mode 100644
index 00000000000..26eb3a3deb6
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrPass.cpp
@@ -0,0 +1,1995 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrPass.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Implements the GrPass class and subclasses.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+/*----------------------------------------------------------------------------------------------
+ Constructors and initializers
+----------------------------------------------------------------------------------------------*/
+GrPass::GrPass(int i)
+ : m_ipass(i),
+ m_fxdVersion(0),
+ m_nMaxRuleContext(0),
+ m_pfsm(NULL),
+ m_nMaxRuleLoop(0),
+ m_nMaxBackup(0),
+ m_crul(0),
+ m_prgchwRuleSortKeys(NULL),
+ m_prgcritRulePreModContext(NULL),
+ m_cbPassConstraint(0),
+ m_prgibConstraintStart(NULL),
+ m_prgibActionStart(NULL),
+ m_prgbPConstraintBlock(NULL),
+ m_prgbConstraintBlock(NULL),
+ m_prgbActionBlock(NULL),
+ m_cbConstraints(0),
+ m_cbActions(0),
+ m_prgibConstraintDebug(NULL),
+ m_prgibRuleDebug(NULL),
+ m_fCheckRules(false),
+ m_prgfRuleOkay(NULL),
+ m_vnStack(128),
+ m_pzpst(NULL)
+{
+}
+
+void PassState::InitForNewSegment(int ipass, int nMaxChunk)
+{
+ m_ipass = ipass;
+ m_nRulesSinceAdvance = 0;
+ m_nMaxChunk = nMaxChunk;
+ m_cslotSkipToResync = 0;
+ m_fDidResyncSkip = false;
+ InitializeLogInfo();
+}
+
+void PassState::InitializeLogInfo()
+{
+ m_crulrec = 0;
+ std::fill_n(m_rgcslotDeletions, 128, 0);
+ std::fill_n(m_rgfInsertion, 128, false);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Destructors
+----------------------------------------------------------------------------------------------*/
+GrPass::~GrPass()
+{
+ delete m_pfsm;
+
+ delete[] m_prgchwRuleSortKeys;
+
+ delete[] m_prgcritRulePreModContext;
+
+ delete[] m_prgibConstraintStart;
+ delete[] m_prgibActionStart;
+
+ delete[] m_prgbPConstraintBlock;
+ delete[] m_prgbConstraintBlock;
+ delete[] m_prgbActionBlock;
+
+ delete[] m_prgfRuleOkay;
+
+ delete[] m_prgibConstraintDebug;
+ delete[] m_prgibRuleDebug;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Fill in the pass by reading from the font stream.
+----------------------------------------------------------------------------------------------*/
+bool GrPass::ReadFromFont(GrIStream & grstrm, int fxdSilfVersion, int fxdRuleVersion,
+ int nOffset)
+{
+ long lPassInfoStart;
+ grstrm.GetPositionInFont(&lPassInfoStart);
+
+ m_fxdVersion = fxdSilfVersion;
+
+ m_fCheckRules = (fxdRuleVersion > kRuleVersion);
+
+// Assert(nOffset == lPassInfoStart);
+ if (lPassInfoStart != nOffset)
+ {
+ grstrm.SetPositionInFont(nOffset);
+ }
+
+ // flags - ignore for now
+ //byte bTmp = grstrm.ReadByteFromFont();
+ grstrm.ReadByteFromFont();
+
+ // MaxRuleLoop
+ m_nMaxRuleLoop = grstrm.ReadByteFromFont();
+
+ // max rule context
+ m_nMaxRuleContext = grstrm.ReadByteFromFont();
+
+ // MaxBackup
+ m_nMaxBackup = grstrm.ReadByteFromFont();
+
+ // number of rules
+ m_crul = grstrm.ReadShortFromFont();
+ // TODO: add a sanity check for the number of rules.
+
+ // offset to pass constraint code, relative to start of subtable
+ int nPConstraintOffset = 0;
+ long lFsmPos = -1;
+ if (fxdSilfVersion >= 0x00020000)
+ {
+ if (fxdSilfVersion >= 0x00030000)
+ lFsmPos = grstrm.ReadUShortFromFont() + nOffset; // offset to row info
+ else
+ grstrm.ReadShortFromFont(); // pad bytes
+ nPConstraintOffset = grstrm.ReadIntFromFont();
+ }
+ // offset to rule constraint code, relative to start of subtable
+ //int nConstraintOffset = grstrm.ReadIntFromFont();
+ grstrm.ReadIntFromFont();
+ // offset to action code, relative to start of subtable
+ //int nActionOffset = grstrm.ReadIntFromFont();
+ grstrm.ReadIntFromFont();
+ // offset to debug strings; 0 if stripped
+ //int nDebugOffset = grstrm.ReadIntFromFont();
+ grstrm.ReadIntFromFont();
+
+ // Jump to beginning of FSM, if we have this information.
+ if (fxdSilfVersion >= 0x00030000)
+ grstrm.SetPositionInFont(lFsmPos);
+ else
+ // Otherwise assume that's where we are!
+ Assert(lFsmPos == -1);
+
+ m_pfsm = new GrFSM();
+
+ m_pfsm->ReadFromFont(grstrm, fxdSilfVersion);
+
+ // rule sort keys
+ m_prgchwRuleSortKeys = new data16[m_crul];
+ data16 * pchw = m_prgchwRuleSortKeys;
+ int irul;
+ for (irul = 0; irul < m_crul; irul++, pchw++)
+ {
+ *pchw = grstrm.ReadUShortFromFont();
+ }
+
+ // rule pre-mod-context item counts
+ m_prgcritRulePreModContext = new byte[m_crul];
+ byte * pb = m_prgcritRulePreModContext;
+ for (irul = 0; irul < m_crul; irul++, pb++)
+ {
+ *pb = grstrm.ReadByteFromFont();
+ }
+
+ // constraint offset for pass-level constraints
+ if (fxdSilfVersion >= 0x00020000)
+ {
+ // reserved - pad byte
+ grstrm.ReadByteFromFont();
+ // Note: pass constraints have not been fully implemented.
+ m_cbPassConstraint = grstrm.ReadUShortFromFont();
+ }
+ else
+ m_cbPassConstraint = 0;
+
+ // constraint and action offsets for rules
+ m_prgibConstraintStart = new data16[m_crul + 1];
+ pchw = m_prgibConstraintStart;
+ for (irul = 0; irul <= m_crul; irul++, pchw++)
+ {
+ *pchw = grstrm.ReadUShortFromFont();
+ }
+
+ m_prgibActionStart = new data16[m_crul + 1];
+ pchw = m_prgibActionStart;
+ for (irul = 0; irul <= m_crul; irul++, pchw++)
+ {
+ *pchw = grstrm.ReadUShortFromFont();
+ }
+
+ // FSM state table
+ m_pfsm->ReadStateTableFromFont(grstrm, fxdSilfVersion);
+
+ if (fxdSilfVersion >= 0x00020000)
+ // reserved - pad byte
+ grstrm.ReadByteFromFont();
+
+ // Constraint and action blocks
+ int cb = m_cbPassConstraint;
+ m_prgbPConstraintBlock = new byte[cb];
+ grstrm.ReadBlockFromFont(m_prgbPConstraintBlock, cb);
+ m_cbConstraints = cb;
+
+ cb = m_prgibConstraintStart[m_crul];
+ m_prgbConstraintBlock = new byte[cb];
+ grstrm.ReadBlockFromFont(m_prgbConstraintBlock, cb);
+ m_cbConstraints += cb;
+
+ cb = m_prgibActionStart[m_crul];
+ m_prgbActionBlock = new byte[cb];
+ grstrm.ReadBlockFromFont(m_prgbActionBlock, cb);
+ m_cbActions = cb;
+
+ // Rule-validity flags
+ m_prgfRuleOkay = new bool[m_crul];
+ for (irul = 0; irul < m_crul; irul++)
+ m_prgfRuleOkay[irul] = !m_fCheckRules;
+
+ // TODO SharonC/AlanW: debuggers
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize a bogus pass with no rules. Currently this is used to make a single positioning
+ pass if there was none in the font.
+----------------------------------------------------------------------------------------------*/
+void GrPass::InitializeWithNoRules()
+{
+ m_crul = 0;
+ m_nMaxRuleContext = 1;
+ m_nMaxRuleLoop = 1;
+ m_nMaxBackup = 0;
+ m_pfsm = NULL;
+ m_prgchwRuleSortKeys = NULL;
+ m_prgcritRulePreModContext = NULL;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Extend the output stream by the given number of characters.
+ (Overridden by GrBidiPass.)
+
+ @param ptman - table manager
+ @param psstrmIn/Out - streams being processed
+ @param cslotNeededByNext - the number of slots being requested by the following pass
+ @param twsh - how we are handling trailing white-space
+ @param pnRet - return value
+ @param pcslotGot - return the number of slots gotten
+ @param pislotFinalBreak - return the index of the final slot, when we are removing
+ the trailing white-space and so the end of the segment
+ will be before the any actual line-break slot
+
+ @return kNextPass if we were able to generated the number requested, or processing is
+ complete; otherwise return the number of slots needed from the previous pass.
+----------------------------------------------------------------------------------------------*/
+void GrPass::ExtendOutput(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int cslotNeededByNext, TrWsHandling twsh,
+ int * pnRet, int * pcslotGot, int * pislotFinalBreak)
+{
+ // Kludge to generate an error in rendering:
+ //int z = 50;
+ //int t = ((5 * 10) / z) - 1;
+ //if (this->m_ipass == 4)
+ //{
+ // int x; x = z / t;
+ //}
+
+ int islotInitReadPos = psstrmIn->ReadPos();
+ int islotInitWritePos = psstrmOut->WritePos();
+
+ int cslotToGet = max(cslotNeededByNext,
+ m_pzpst->NeededToResync() - psstrmOut->WritePos());
+ int cslotGot = 0;
+
+ gid16 chwLB = ptman->LBGlyphID();
+
+ // While we haven't got the number of slot we've been asked for, and there is enough
+ // available in the input, run rules, filling up the output.
+
+ while ((cslotToGet > 0 && cslotGot < cslotToGet)
+ // Don't leave this pass until we've got the index offset. This is especially
+ // needed for input to the positioning pass, but it doesn't hurt to make it a
+ // general rule.
+ || !psstrmOut->GotIndexOffset()
+ // Don't leave this pass until all the slots to reprocess have been
+ // completely handled.
+ || (psstrmIn->SlotsToReprocess() > 0)
+ // Don't leave this pass until there is a complete cluster in the output
+ || (islotInitWritePos == psstrmOut->WritePos())
+ || (psstrmOut->MaxClusterSlot(islotInitWritePos, psstrmOut->WritePos()) > 0))
+ {
+ int cslotAvailable = psstrmIn->TotalSlotsPending();
+ int cslotNeedMore = MaxRuleContext() - cslotAvailable + ptman->PrevPassMaxBackup(m_ipass);
+
+ // This test should not be necessary, but just in case.
+ if (psstrmIn->PastEndOfPositioning(false))
+ cslotNeedMore = 0; // the input stream is done
+
+ if (// Not enough available in the input:
+ (cslotNeedMore > 0 && !psstrmIn->FullyWritten())
+
+ // && psstrmIn->SegLimIfKnown() == -1) && -- no, because substitution passes may need
+ // to consider slots beyond the seg limit
+
+ // Positioning passes need to know where they are in relation to the initial
+ // line-break.
+ || (IsPosPass() && !psstrmIn->GotIndexOffset())
+
+ // The following can happen on backtracking, when we undo stuff before the
+ // beginning of the segment:
+ || !ptman->Pass(m_ipass - 1)->DidResyncSkip())
+ {
+ // Ask previous pass for more input.
+ *pnRet = max(cslotNeedMore, 1);
+ *pnRet = max(*pnRet, cslotNeededByNext - cslotGot);
+ *pcslotGot = cslotGot;
+ return;
+ }
+
+ Assert(ptman->Pass(m_ipass - 1)->DidResyncSkip());
+
+ bool fDoneThisPass = (cslotAvailable == 0);
+ if (psstrmIn->SlotsToReprocess() == 0)
+ {
+ fDoneThisPass = fDoneThisPass ||
+ psstrmIn->PastEndOfPositioning(false) ||
+ psstrmOut->PastEndOfPositioning(true);
+ }
+
+ if (fDoneThisPass)
+ {
+ // No more input to process--this pass is done.
+ Assert(psstrmIn->SlotsToReprocess() == 0);
+ psstrmIn->ClearReprocBuffer();
+
+ if (twsh == ktwshNoWs && m_ipass == ptman->NumberOfLbPasses())
+ {
+ *pnRet = RemoveTrailingWhiteSpace(ptman, psstrmOut, twsh, pislotFinalBreak);
+ if (*pnRet == kBacktrack) // entire segment was white-space:
+ return; // backtrack, which will fail
+ }
+ DoResyncSkip(psstrmOut);
+ DoCleanUpSegMin(ptman, psstrmIn, islotInitReadPos, psstrmOut);
+ psstrmOut->MarkFullyWritten();
+ *pnRet = kNextPass;
+ *pcslotGot = cslotGot;
+ return;
+ }
+
+ if (twsh == ktwshOnlyWs && m_ipass == ptman->NumberOfLbPasses() + 1)
+ {
+ // Note that this is the first pass after the linebreak pass, so psstrmInput
+ // is the output of the linebreak pass.
+ GrSlotState * pslotNext = psstrmIn->Peek();
+ if (!pslotNext->IsLineBreak(chwLB) &&
+ pslotNext->Directionality() != kdircWhiteSpace &&
+ psstrmIn->SegMin() > -1 && psstrmIn->SegMin() <= psstrmIn->ReadPos())
+ {
+ // We are only allowing white-space in this segment and we hit
+ // something else. Don't process any further.
+ if (psstrmIn->SegLimIfKnown() > -1 &&
+ psstrmIn->SegLimIfKnown() <= psstrmIn->ReadPos())
+ {
+ // Already inserted a line-break; we're done.
+ DoResyncSkip(psstrmOut);
+ psstrmOut->MarkFullyWritten();
+ *pnRet = kNextPass;
+ *pcslotGot = cslotGot;
+ return;
+ }
+ while (psstrmIn->SlotsToReprocess() > 0)
+ {
+ psstrmOut->CopyOneSlotFrom(psstrmIn);
+ psstrmOut->SetPosForNextRule(0, psstrmIn, IsPosPass());
+ }
+ psstrmIn->ClearReprocBuffer();
+ *pnRet = kBacktrack;
+ return;
+ }
+ }
+
+ // Otherwise, we have enough input to run a rule.
+
+ psstrmIn->SetRuleStartReadPos();
+ psstrmOut->SetRuleStartWritePos();
+
+ int ruln = -1;
+ if (m_pfsm)
+ ruln = m_pfsm->GetRuleToApply(ptman, this, psstrmIn, psstrmOut);
+ ruln = CheckRuleValidity(ruln);
+ RunRule(ptman, ruln, psstrmIn, psstrmOut);
+
+ cslotGot = psstrmOut->WritePos() - islotInitWritePos;
+ psstrmOut->CalcIndexOffset(ptman);
+ }
+
+ DoResyncSkip(psstrmOut);
+ DoCleanUpSegMin(ptman, psstrmIn, islotInitReadPos, psstrmOut);
+
+ // We're past the point where we care about anything in the reprocessing buffer.
+ Assert(psstrmIn->NoReproc());
+ psstrmIn->ClearReprocBuffer();
+
+ if (psstrmOut->PastEndOfPositioning(true))
+ psstrmOut->MarkFullyWritten();
+
+ *pnRet = kNextPass;
+ *pcslotGot = cslotGot;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Extend the output stream by the given number of characters.
+ For a GrBidiPass, if we are at a direction change, get the entire
+ range of upstream glyphs, reverse them, and treat them as one chunk.
+ Otherwise just pass one slot through.
+
+ @param ptman - table manager
+ @param psstrmInput/Output - streams being processed
+ @param cslotNeededByNext - the number of slots being requested by the following pass
+ @param twsh - how we are handling trailing white-space
+ @param pnRet - return value
+ @param pcslotGot - return the number of slots gotten
+ @param pislotFinalBreak - not used in this version
+
+ @return 1 if we need more glyphs from the previous pass
+----------------------------------------------------------------------------------------------*/
+void GrBidiPass::ExtendOutput(GrTableManager * ptman,
+ GrSlotStream* psstrmIn, GrSlotStream* psstrmOut,
+ int cslotNeededByNext, TrWsHandling twsh,
+ int * pnRet, int * pcslotGot, int * pislotFinalBreak)
+{
+ Assert(psstrmIn->SlotsToReprocess() == 0);
+
+ int islotInitReadPos = psstrmIn->ReadPos();
+ int islotInitWritePos = psstrmOut->WritePos();
+
+ Assert(m_pzpst->NeededToResync() == 0);
+
+ int cslotToGet = max(cslotNeededByNext,
+ m_pzpst->NeededToResync() - psstrmOut->WritePos());
+ int cslotGot = 0;
+ int nTopDir;
+ if (twsh == ktwshOnlyWs)
+ nTopDir = (ptman->State()->ParaRightToLeft()) ? 1 : 0;
+ else
+ nTopDir = ptman->TopDirectionLevel();
+
+ while (cslotToGet > 0 && cslotGot < cslotToGet)
+ {
+ int islotChunkO = psstrmOut->WritePos();
+ int islotChunkI = psstrmIn->ReadPos();
+
+ // Need at least one character to test.
+ if (psstrmIn->SlotsPending() < 1 || !ptman->Pass(m_ipass-1)->DidResyncSkip())
+ {
+ if (!psstrmIn->FullyWritten())
+ {
+ // Ask previous pass for more input.
+ *pnRet = max(cslotToGet - psstrmIn->SlotsPending(), 1);
+ *pnRet = max(*pnRet, cslotNeededByNext - cslotGot);
+ *pcslotGot = cslotGot;
+ return;
+ }
+ else
+ {
+ Assert(ptman->Pass(m_ipass-1)->DidResyncSkip());
+ Assert(psstrmIn->SlotsToReprocess() == 0);
+ psstrmIn->ClearReprocBuffer();
+ DoResyncSkip(psstrmOut);
+ DoCleanUpSegMin(ptman, psstrmIn, islotInitReadPos, psstrmOut);
+ psstrmOut->MarkFullyWritten();
+ *pnRet = kNextPass;
+ *pcslotGot = cslotGot;
+ return;
+ }
+ }
+
+ std::vector<int> vislotStarts;
+ std::vector<int> vislotStops;
+ int islotReverseLim = psstrmIn->DirLevelRange(ptman->State(),
+ psstrmIn->ReadPos(), nTopDir,
+ vislotStarts, vislotStops);
+ //int islotReverseLim = psstrmIn->OldDirLevelRange(pengst, psstrmIn->ReadPos(), nTopDir);
+ if (islotReverseLim == -1)
+ {
+ // We haven't got the full range of reversed text yet--
+ // ask for more input.
+ *pnRet = max(1, cslotNeededByNext - cslotGot);
+ *pcslotGot = cslotGot;
+ return;
+ }
+
+ // Okay, we have enough input to do the reversal, if any.
+
+ int cslotToReverse = islotReverseLim - psstrmIn->ReadPos();
+
+ // Never reverse the final linebreak; leave it at the end.
+ if (cslotToReverse > 0 && islotReverseLim > 0)
+ {
+ GrSlotState * pslotLast = psstrmIn->SlotAt(islotReverseLim - 1);
+ if (pslotLast->IsFinalLineBreak(ptman->LBGlyphID()))
+ {
+ for (size_t i = 0; i < vislotStops.size(); i++)
+ if (vislotStops.back() == islotReverseLim - 1)
+ vislotStops.back() = islotReverseLim - 2;
+ islotReverseLim--;
+ cslotToReverse--;
+ }
+ }
+
+ psstrmIn->SetRuleStartReadPos();
+ psstrmOut->SetRuleStartWritePos();
+
+ if (cslotToReverse == 0)
+ {
+ psstrmOut->CopyOneSlotFrom(psstrmIn);
+ }
+ else
+ {
+ int islotNextWritePos = psstrmOut->WritePos() + cslotToReverse;
+ int islotNextReadPos = psstrmIn->ReadPos() + cslotToReverse;
+ if (vislotStarts.size() == 0)
+ {
+ Assert(false); // this should have been done by DirLevelRange
+ vislotStarts.push_back(psstrmIn->ReadPos());
+ vislotStops.push_back(islotNextReadPos - 1);
+ }
+ Assert(vislotStarts.back() == psstrmIn->ReadPos());
+ Assert(vislotStops.back() == islotNextReadPos - 1);
+ int cslotNotCopied = Reverse(ptman, psstrmIn, psstrmOut, vislotStarts, vislotStops);
+ //Reverse(nTopDir + 1,
+ // psstrmIn, psstrmIn->ReadPos(), islotReverseLim,
+ // psstrmOut, psstrmOut->WritePos() + cslotToReverse - 1, psstrmOut->WritePos()-1);
+
+ islotNextWritePos -= cslotNotCopied; // bidi markers that are not passed through
+
+ psstrmIn->SetReadPos(islotNextReadPos);
+ psstrmOut->SetWritePos(islotNextWritePos);
+
+ // It's quite strange to have the segment start or end in the middle of stuff to
+ // reverse (because the LB forms a natural terminator), but at any rate,
+ // if that happens, record the segment lim at the corresponding place in the
+ // output stream.
+ int islotSegMinIn = psstrmIn->SegMin();
+ if (islotSegMinIn > -1 &&
+ psstrmIn->ReadPos() - cslotToReverse <= islotSegMinIn &&
+ islotSegMinIn < psstrmIn->ReadPos())
+ {
+ Assert(islotSegMinIn == psstrmIn->ReadPos() - cslotToReverse); // normal situation
+ psstrmOut->SetSegMin(
+ psstrmOut->WritePos() - (psstrmIn->ReadPos() - islotSegMinIn));
+ }
+ int islotSegLimIn = psstrmIn->SegLimIfKnown();
+ if (islotSegLimIn > -1 &&
+ psstrmIn->ReadPos() - cslotToReverse <= islotSegLimIn &&
+ islotSegLimIn < psstrmIn->ReadPos())
+ {
+ Assert(islotSegLimIn == psstrmIn->ReadPos() - cslotToReverse); // normal situation
+ psstrmOut->SetSegLim(
+ psstrmOut->WritePos() - (psstrmIn->ReadPos() - islotSegLimIn));
+ }
+ }
+
+ psstrmOut->SetPosForNextRule(0, psstrmIn, false);
+
+ // Record the chunk mappings:
+ MapChunks(psstrmIn, psstrmOut, islotChunkI, islotChunkO, 0);
+
+ cslotGot = psstrmOut->WritePos() - islotInitWritePos;
+ psstrmOut->CalcIndexOffset(ptman);
+ }
+
+ DoResyncSkip(psstrmOut);
+ DoCleanUpSegMin(ptman, psstrmIn, islotInitReadPos, psstrmOut);
+
+ // We're past the point where we care about anything in the reprocessing buffer.
+ Assert(psstrmIn->NoReproc());
+ psstrmIn->ClearReprocBuffer();
+
+ Assert(psstrmIn->SlotsToReprocess() == 0);
+
+ if (psstrmOut->PastEndOfPositioning(true))
+ psstrmOut->MarkFullyWritten();
+
+ *pnRet = kNextPass;
+ *pcslotGot = cslotGot;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Generate slots containing glyph IDs for the underlying character data,
+ incrementing the input pointer as we go.
+
+ @param ptman - table manager
+ @param pchstrm - input character stream
+ @param psstrmOutput - output slot stream
+ @param ichSegLim - known end of segment, index into the text; or -1;
+ the lim of the of char-stream itself represents
+ the end of the text-source; this lim is the
+ known desired end of the segment
+ @param cchwPostXlbContext - number of characters that may be needed from the following line;
+ valid when ichSegLim > -1
+ @param lb - breakweight to use for inserted LB
+ @param cslotToGet - the number of slots being requested by the following pass
+ @param fNeedFinalBreak - true if the end of the segment needs to be a valid break point
+ @param pislotFinalBreak - the end of this segment
+----------------------------------------------------------------------------------------------*/
+int GrPass::ExtendGlyphIDOutput(GrTableManager * ptman,
+ GrCharStream * pchstrm, GrSlotStream * psstrmOut, int ichSegLim, int cchwPostXlbContext,
+ LineBrk lb, int cslotToGet, bool fNeedFinalBreak, TrWsHandling twsh,
+ int * pislotFinalBreak)
+{
+ EngineState * pengst = ptman->State();
+
+ // This pass should be the glyph-generation pass.
+ Assert(dynamic_cast<GrGlyphGenPass*>(this));
+ Assert(m_pzpst->m_cslotSkipToResync == 0);
+ m_pzpst->m_fDidResyncSkip = true;
+
+ for (int islot = 0; islot < cslotToGet; ++islot)
+ {
+ int islotChunkO = psstrmOut->WritePos();
+ int islotChunkI = pchstrm->SegOffset();
+
+ if (pchstrm->AtEnd()
+ || (ichSegLim > -1 && pchstrm->Pos() == ichSegLim))
+ {
+ if (psstrmOut->SegLimIfKnown() > -1 &&
+ psstrmOut->SegLimIfKnown() <= psstrmOut->WritePos())
+ {
+ // Already found the end of this stream.
+ }
+ else
+ {
+ if (pchstrm->EndLine() && !fNeedFinalBreak)
+ // (if we need a good final break, don't just append an LB;
+ // make it backtrack and find a valid break point)
+ {
+ // Only need to get a good break when we're backtracking; otherwise we
+ // already know it.
+ Assert(ichSegLim == -1 || !fNeedFinalBreak);
+ // Notice that we're cheating here: we're putting the LB in the zeroth
+ // stream instead of in the output of the linebreak table.
+ psstrmOut->AppendLineBreak(ptman, pchstrm,
+ (pchstrm->AtEnd() ? klbWordBreak : lb),
+ ((ptman->RightToLeft()) ? kdircRlb : kdircLlb), -1, false,
+ pchstrm->SegOffset());
+ if (pchstrm->AtEnd())
+ pengst->SetFinalLB();
+ else
+ pengst->SetInsertedLB(true);
+ }
+ else
+ {
+ // Don't actually insert a line-break glyph.
+ psstrmOut->SetSegLimToWritePos();
+ }
+ *pislotFinalBreak = psstrmOut->WritePos() - 1;
+ if (ptman->NumberOfLbPasses() > 0 && pengst->HasInitialLB())
+ {
+ // Because we cheated above: the output stream of the linekbreak table
+ // has an initial LB, which this stream doesn't have. Adjust the position
+ // of the final break to match what it will be in the output of the
+ // lb table.
+ *pislotFinalBreak += 1;
+ }
+ }
+
+ if (twsh == ktwshNoWs && m_ipass == ptman->NumberOfLbPasses())
+ {
+ int nRet = RemoveTrailingWhiteSpace(ptman, psstrmOut, twsh, pislotFinalBreak);
+ if (nRet == kBacktrack) // entire segment was white-space:
+ return kBacktrack; // backtrack, which will fail
+ }
+ if (pchstrm->AtEnd())
+ {
+ psstrmOut->MarkFullyWritten();
+ return kNextPass;
+ }
+ // otherwise we may need a few more characters for line-boundary contextualization.
+ }
+
+ int ichwSegOffset; // offset from the official start of the segment
+ int cchw; // number of 16-bit chars consumed
+ GrFeatureValues fval;
+ int nUnicode = pchstrm->NextGet(ptman, &fval, &ichwSegOffset, &cchw);
+ gid16 chwGlyphID = ptman->GetGlyphIDFromUnicode(nUnicode);
+
+ if (nUnicode == knCR || nUnicode == knLF || nUnicode == knLineSep || nUnicode == knParaSep ||
+ nUnicode == knORC)
+ {
+ // Hard line-break: we're done.
+ // Note that we don't include the hard-break character in this segment.
+ pchstrm->HitHardBreak();
+ pengst->SetHitHardBreak();
+ psstrmOut->MarkFullyWritten();
+ return kNextPass;
+ }
+
+ GrSlotState * pslotNew;
+ ptman->State()->NewSlot(chwGlyphID, fval, 0, ichwSegOffset, nUnicode, &pslotNew);
+
+ psstrmOut->NextPut(pslotNew);
+ psstrmOut->MapInputChunk(islotChunkI, islotChunkO, pchstrm->SegOffset(), false, false);
+ // Mapping the output chunks of the char stream has already been handled by the
+ // char stream.
+
+ }
+
+ psstrmOut->CalcIndexOffset(ptman);
+
+ if (psstrmOut->PastEndOfPositioning(true)
+ || (ichSegLim > -1 && pchstrm->Pos() > ichSegLim + cchwPostXlbContext))
+ {
+ // We have enough for this segment.
+ psstrmOut->MarkFullyWritten();
+ }
+
+ return kNextPass;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Extend the output stream until it is using up the allotted amount of
+ physical space. Return kNextPass when all data has been processed successfully.
+ Return kBacktrack when space overflows, indicating that we need to backtrack
+ and find a break point. Otherwise, return the number of slots we
+ need from the previous pass.
+
+ @param fWidthIsCharCount - kludge for test procedures
+ @param fInfiniteWidth - don't test for more space
+ @param fMustBacktrack - true if we need a good final break and haven't found one yet
+ @param lbMax - max allowed for the final slot
+ @param twsh - how we are handling trailing white-space
+----------------------------------------------------------------------------------------------*/
+int GrPass::ExtendFinalOutput(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput,
+ float xsSpaceAllotted, bool fWidthIsCharCount, bool fInfiniteWidth,
+ bool fHaveLineBreak, bool fMustBacktrack, LineBrk lbMax, TrWsHandling twsh,
+ int * pislotLB, float * pxsWidth)
+{
+ EngineState * pengst = ptman->State();
+
+ // This pass should be the final positioning pass.
+ Assert(dynamic_cast<GrPosPass*>(this));
+
+ // It would be very strange to be positioning based on something that happened in
+ // previous line. -- not true any more, since this will include the max-precontext-length.
+// Assert(m_cslotSkipToResync == 0);
+
+ int islotOutputLB = -1;
+ //int islotInitWritePos = psstrmOutput->WritePos();
+ int islotNoLbUpTo = psstrmOutput->WritePos();;
+
+ while (true)
+ {
+ // Do this right up front, so we are only measuring actual output.
+ if (m_pzpst->CanResyncSkip(psstrmOutput))
+ m_pzpst->DoResyncSkip(psstrmOutput);
+
+ bool fMoreSpace;
+ if (!m_pzpst->DidResyncSkip())
+ fMoreSpace = true;
+ else if (fInfiniteWidth)
+ fMoreSpace = true;
+ else
+ fMoreSpace = psstrmOutput->MoreSpace(ptman,
+ xsSpaceAllotted, fWidthIsCharCount,
+ true, // always ignore trailing white space when we are first making the segment
+ twsh,
+ pxsWidth);
+ if (!fMoreSpace)
+ {
+ // Overflowed available space; backtrack and find a line break.
+ while (psstrmInput->SlotsToReprocess() > 0)
+ {
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+ psstrmOutput->SetPosForNextRule(0, psstrmInput, IsPosPass());
+ }
+ psstrmInput->ClearReprocBuffer();
+
+ *pislotLB = -1;
+ pengst->SetExceededSpace();
+ pengst->SetHitHardBreak(false);
+ return kBacktrack;
+ }
+
+ if (islotOutputLB != -1 && psstrmInput->SlotsToReprocess() == 0)
+ {
+ // Hit the inserted line break--we're done.
+ psstrmInput->ClearReprocBuffer();
+ *pislotLB = islotOutputLB;
+ return kNextPass;
+ }
+
+ int nslotAvailable = psstrmInput->SlotsPending();
+ if ((nslotAvailable - ptman->PrevPassMaxBackup(m_ipass)
+ < MaxRuleContext() && !psstrmInput->FullyWritten())
+ || !ptman->Pass(m_ipass-1)->DidResyncSkip())
+ {
+ // Not enough available in the input--ask previous pass for more input.
+ // Ten is an arbitrary value--we ask for more that we really need to cut down
+ // on the number of times we loop between passes.
+ return max(MaxRuleContext() - (nslotAvailable - 10), 1);
+ }
+
+ Assert(ptman->Pass(m_ipass - 1)->DidResyncSkip());
+
+ if (nslotAvailable == 0)
+ {
+ // No more input to process. If we have a valid line-break, or we don't care,
+ // we're done. Otherwise backtrack to find a valid break point.
+ Assert(psstrmInput->SlotsToReprocess() == 0);
+ psstrmInput->ClearReprocBuffer();
+ if (fMustBacktrack)
+ {
+ *pislotLB = -1;
+ return kBacktrack;
+ }
+ else
+ {
+ psstrmOutput->MarkFullyWritten();
+ return kNextPass;
+ }
+ }
+
+ // Otherwise, we have enough input to run a rule.
+
+ psstrmInput->SetRuleStartReadPos();
+ psstrmOutput->SetRuleStartWritePos();
+
+ int ruln = -1;
+ if (m_pfsm)
+ ruln = m_pfsm->GetRuleToApply(ptman, this, psstrmInput, psstrmOutput);
+ ruln = CheckRuleValidity(ruln);
+ RunRule(ptman, ruln, psstrmInput, psstrmOutput);
+
+ if (fHaveLineBreak)
+ {
+ islotOutputLB =
+ psstrmOutput->FindFinalLineBreak(ptman->LBGlyphID(),
+ islotNoLbUpTo, psstrmOutput->WritePos());
+ islotNoLbUpTo = psstrmOutput->WritePos();
+ }
+
+ psstrmOutput->CalcIndexOffset(ptman);
+ }
+
+ Assert(false);
+
+ psstrmInput->ClearReprocBuffer();
+ *pislotLB = -1;
+ return kNextPass;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Remove undesirable trailing white-space.
+----------------------------------------------------------------------------------------------*/
+int GrPass::RemoveTrailingWhiteSpace(GrTableManager * ptman, GrSlotStream * psstrmOut,
+ TrWsHandling twsh, int * pislotFinalBreak)
+{
+ EngineState * pengst = ptman->State();
+
+ Assert(twsh == ktwshNoWs);
+ Assert(m_ipass == ptman->NumberOfLbPasses()); // output of (final) lb pass
+
+ int islotTmp = psstrmOut->FinalSegLim();
+ if (islotTmp <= 0)
+ return kNextPass;
+
+ GrSlotState * pslotLast = psstrmOut->SlotAt(islotTmp-1);
+ if (islotTmp > 0 && pslotLast->IsFinalLineBreak(ptman->LBGlyphID()))
+ {
+ islotTmp--;
+ pslotLast = (islotTmp > 0) ? psstrmOut->SlotAt(islotTmp-1) : NULL;
+ }
+ bool fRemovedWs = false;
+ while (islotTmp > 0 && pslotLast->Directionality() == kdircWhiteSpace)
+ {
+ islotTmp--;
+ pslotLast = (islotTmp > 0) ? psstrmOut->SlotAt(islotTmp-1) : NULL;
+ fRemovedWs = true;
+ }
+ if (fRemovedWs)
+ {
+ if (islotTmp <= 0)
+ {
+ // Entire segment was white-space: backtrack, which will fail.
+ return kBacktrack;
+ }
+ psstrmOut->SetSegLim(islotTmp);
+ *pislotFinalBreak = islotTmp - 1;
+ pengst->SetFinalLB(false);
+ pengst->SetRemovedTrWhiteSpace();
+ ptman->UnwindAndReinit(islotTmp - 1);
+ }
+
+ return kNextPass;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Keep track of whether we're advancing through the input satisfactorily;
+ if not, forcibly advance. This is a safety net to avoid infinite loops; it
+ should never be necessary if they've set up their tables right.
+----------------------------------------------------------------------------------------------*/
+void GrPass::CheckInputProgress(GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput,
+ int islotOrigInput)
+{
+ int islotInput = psstrmInput->ReadPosForNextGet();
+// Assert(islotInput >= islotOrigInput); -- no longer true now that we can back up
+
+ if (islotInput <= psstrmInput->ReadPosMax())
+ {
+ // Didn't advance.
+ if (m_pzpst->m_nRulesSinceAdvance >= m_nMaxRuleLoop)
+ {
+ bool fAdvanced = false;
+ // Forcibly advance. First try to advance to where we backed up from.
+ while (!psstrmInput->AtEnd() &&
+ psstrmInput->ReadPosForNextGet() < psstrmInput->ReadPosMax())
+ {
+ RecordHitMaxRuleLoop(psstrmInput->ReadPosForNextGet());
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+ fAdvanced = true;
+ }
+ // If that didn't do anything productive, just advance one slot.
+ if (!fAdvanced && !psstrmInput->AtEndOfContext())
+ {
+ RecordHitMaxRuleLoop(psstrmInput->ReadPosForNextGet());
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+ }
+
+ m_pzpst->m_nRulesSinceAdvance = 0;
+ }
+ else m_pzpst->m_nRulesSinceAdvance++;
+ }
+ else m_pzpst->m_nRulesSinceAdvance = 0;
+
+ psstrmInput->SetReadPosMax(islotInput);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Record the chunks in the streams' chunk maps.
+
+ psstrmIn/Out - streams being processed
+ islotChunkIn/Out - start of chunks
+ cslotReprocessed - number of slots to reprocess before the rule was run
+----------------------------------------------------------------------------------------------*/
+void GrPass::MapChunks(GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int islotChunkIn, int islotChunkOut, int cslotReprocessed)
+{
+ if (islotChunkOut > psstrmOut->WritePos())
+ {
+ // backing up
+ int islotReadPosTmp = psstrmIn->ReadPosForNextGet();
+/// Assert((islotChunkIn - islotReadPosTmp) == (islotChunkOut - psstrmOut->WritePos()));
+// psstrmIn->MapOutputChunk(psstrmOut->WritePos() - 1, islotReadPosTmp - 1,
+// islotChunkOut, true, 0, true);
+// psstrmOut->MapInputChunk(islotReadPosTmp - 1, psstrmOut->WritePos() - 1,
+// islotChunkIn, true, true);
+
+ // Resync.
+ if (psstrmOut->WritePos() == 0)
+ {
+ // Clear all the chunks.
+ psstrmIn->MapOutputChunk(-1, -1, 0, true, 0, true);
+ psstrmOut->MapInputChunk(-1, -1, islotReadPosTmp, true, true);
+ psstrmIn->AssertChunkMapsValid(psstrmOut);
+ return;
+ }
+ else if (islotReadPosTmp == 0)
+ {
+ // Clear all the chunks.
+ psstrmIn->MapOutputChunk(-1, -1, psstrmOut->WritePos(), true, 0, true);
+ psstrmOut->MapInputChunk(-1, -1, 0, true, true);
+ psstrmIn->AssertChunkMapsValid(psstrmOut);
+ return;
+ }
+ // Find the beginning of the current chunk.
+ int islotChunkOutAdj = min(islotChunkOut, psstrmOut->WritePos() - 1);
+ int islotChunkInAdj = psstrmOut->ChunkInPrev(islotChunkOutAdj);
+ while (islotChunkInAdj == -1 && islotChunkOutAdj > 0)
+ islotChunkInAdj = psstrmOut->ChunkInPrev(--islotChunkOutAdj);
+
+ if (islotChunkInAdj == -1)
+ {
+ // Couldn't find the beginning of any chunk; zap them all.
+ psstrmIn->MapOutputChunk(-1, -1, psstrmOut->WritePos(), true, 0, true);
+ psstrmOut->MapInputChunk(-1, -1, psstrmOut->ReadPos(), true, true);
+ psstrmIn->AssertChunkMapsValid(psstrmOut);
+ return;
+ }
+
+ if (psstrmIn->ChunkInNext(islotChunkInAdj) != islotChunkOutAdj)
+ {
+ islotChunkOutAdj = psstrmIn->ChunkInNext(islotChunkInAdj);
+ while (islotChunkOutAdj == -1 && islotChunkInAdj > 0)
+ islotChunkOutAdj = psstrmIn->ChunkInNext(--islotChunkInAdj);
+ }
+
+ psstrmIn->MapOutputChunk(islotChunkOutAdj, islotChunkInAdj,
+ psstrmOut->WritePos(), false, 0, true);
+ psstrmOut->MapInputChunk(islotChunkInAdj, islotChunkOutAdj,
+ psstrmIn->ReadPos(), false, true);
+ }
+ else if (islotChunkOut == psstrmOut->WritePos())
+ // no output generated--continue the previous chunk
+ ;
+ else if (islotChunkIn == psstrmIn->ReadPos())
+ // no input consumed
+ ;
+ else
+ {
+ psstrmIn->MapOutputChunk(islotChunkOut, islotChunkIn, psstrmOut->WritePos(),
+ (cslotReprocessed > 0), cslotReprocessed, false);
+ psstrmOut->MapInputChunk(islotChunkIn, islotChunkOut, psstrmIn->ReadPos(),
+ (cslotReprocessed > 0), false);
+ }
+
+ psstrmIn->AssertChunkMapsValid(psstrmOut);
+
+ m_pzpst->m_nMaxChunk = max(m_pzpst->m_nMaxChunk, psstrmIn->LastNextChunkLength());
+}
+
+/*----------------------------------------------------------------------------------------------
+ This method is something of a kludge. During the course of running the rules we try to
+ keep track of the seg-min location, but sometimes that gets confused due to insertions
+ and deletions at the segment boundaries.
+----------------------------------------------------------------------------------------------*/
+void GrSubPass::DoCleanUpSegMin(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, int islotInitReadPos, GrSlotStream * psstrmOut)
+{
+ int islotSegMinIn = psstrmIn->SegMin();
+ if (islotSegMinIn == -1)
+ return; // input doesn't even know it
+ if (islotInitReadPos > islotSegMinIn)
+ return; // should already have figured it out
+
+ // Otherwise this batch of processing likely set the seg-min on the output stream,
+ // so check it out.
+
+ // First, if the seg-min of the input stream is zero, it should be zero on the output.
+ if (islotSegMinIn == 0)
+ {
+ psstrmOut->SetSegMin(0, true);
+ return;
+ }
+
+ // If there is an initial line-break, the seg-min should be just before it.
+ int islot;
+ if (ptman->State()->HasInitialLB())
+ {
+ gid16 chwLB = ptman->LBGlyphID();
+
+ // Unfortunately, the seg-min from the previous segment can get off, too. :-(
+ // Fix it, while we're at it.
+ if (!psstrmIn->SlotAt(islotSegMinIn)->IsInitialLineBreak(chwLB))
+ {
+ for (islot = 0; islot < psstrmIn->ReadPos(); islot++)
+ if (psstrmIn->SlotAt(islot)->IsInitialLineBreak(chwLB))
+ {
+ psstrmIn->SetSegMin(islot, true);
+ break;
+ }
+ }
+ if (psstrmOut->SegMin() > -1
+ && psstrmOut->SlotAt(psstrmOut->SegMin())->IsInitialLineBreak(chwLB))
+ {
+ return; // already okay
+ }
+ for (islot = 0; islot < psstrmOut->WritePos(); islot++)
+ if (psstrmOut->SlotAt(islot)->IsInitialLineBreak(chwLB))
+ {
+ psstrmOut->SetSegMin(islot, true);
+ return;
+ }
+ Assert(false); // couldn't find it
+ }
+
+ // Otherwise, figure it out using the associations. First observe that the seg-min
+ // will be in the corresponding chunk to the seg-min of the previous pass.
+ int islotChunkMinIn = psstrmIn->ChunkInNextMin(islotSegMinIn);
+ int islotChunkLimIn = psstrmIn->ChunkInNextLim(islotSegMinIn);
+ if (islotChunkMinIn == -1) islotChunkMinIn = 0;
+ if (islotChunkLimIn == -1) islotChunkLimIn = 1;
+
+ int islotChunkMinOut = psstrmIn->ChunkInNext(islotChunkMinIn);
+ int islotChunkLimOut = psstrmIn->ChunkInNext(islotChunkLimIn);
+ if (islotChunkMinOut == -1) islotChunkMinOut = 0;
+ if (islotChunkLimOut == -1) islotChunkLimOut = 1;
+
+ int islotSegMinOut = psstrmOut->SegMin();
+ if (islotSegMinOut == -1)
+ {
+ // No reasonable guess; try to figure it out.
+ for (islot = islotChunkMinOut; islot < islotChunkLimOut; islot++)
+ {
+// GrSlotState * pslotOut = psstrmOut->SlotAt(islot);
+ if (psstrmOut->SlotAt(islot)->BeforeAssoc() == 0)
+ {
+ islotSegMinOut = islot;
+ break;
+ }
+ }
+ if (islotSegMinOut == -1)
+ {
+ // Ick, couldn't figure it out. Let's hope we set it to something reasonable earlier.
+ Assert(psstrmOut->SegMin() > -1);
+ return;
+ }
+ }
+ // else we have a reasonable guess
+
+ // islotSegMinOut is the best or at leastfirst slot in the chunk that maps into the segment.
+ // But if there is an adjacent slot inserted before it and it is in the chunk,
+ // we want to include that also.
+ while (islotSegMinOut > islotChunkMinOut
+ && psstrmOut->SlotAt(islotSegMinOut-1)->BeforeAssoc() >= 0)
+ {
+ islotSegMinOut--;
+ }
+ psstrmOut->SetSegMin(islotSegMinOut, true);
+}
+
+/*----------------------------------------------------------------------------------------------
+ If we are in a state where we are supposed to skip some of the initial output,
+ do so. The purpose of this is to resync when restarting for a segment other than the
+ first. Caller should ensure that there are enough slots to skip.
+----------------------------------------------------------------------------------------------*/
+int PassState::DoResyncSkip(GrSlotStream * psstrmOutput)
+{
+ if (m_fDidResyncSkip)
+ return 0;
+
+ if (m_cslotSkipToResync == 0)
+ {
+ m_fDidResyncSkip = true;
+ return 0;
+ }
+
+ if (!CanResyncSkip(psstrmOutput))
+ {
+ Assert(false); // caller makes sure this doesn't happen
+ return (m_cslotSkipToResync - psstrmOutput->WritePos());
+ }
+
+ psstrmOutput->ResyncSkip(m_cslotSkipToResync);
+ m_fDidResyncSkip = true;
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Run a constraint for a single rule.
+
+ @param ruln - rule to test
+ @param psstrmIn - input stream
+ @param psstrmOut - for accessing items in the pre-context
+ @param cslotPreModContext - the number of items that need to be tested prior to the
+ current stream position
+ @param cslotMatched - the number of items matched after the current stream position
+----------------------------------------------------------------------------------------------*/
+bool GrPass::RunConstraint(GrTableManager * ptman, int ruln,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int cslotPreModContext, int cslotMatched)
+{
+ int nRet = 0;
+
+ if (m_prgibConstraintStart == NULL)
+ return true;
+
+ int biStart = int(m_prgibConstraintStart[ruln]);
+ if (biStart == 0)
+ return true; // no constraints
+
+ for (int islot = -cslotPreModContext; islot < cslotMatched; islot++)
+ {
+ nRet = RunCommandCode(ptman, m_prgbConstraintBlock + biStart, true,
+ psstrmIn, psstrmOut, islot);
+
+ if (nRet == 0) // one slot failed
+ return false;
+ }
+
+ return (nRet != 0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Check that we can interpret all the commands in the rule. If not, return -1 indicating
+ that we don't want to run a rule after all. This can happen when the version of the compiler
+ that generated the font is later than this engine.
+----------------------------------------------------------------------------------------------*/
+int GrPass::CheckRuleValidity(int ruln)
+{
+ if (ruln == -1)
+ return -1;
+
+ if (m_prgfRuleOkay[ruln])
+ return ruln;
+
+ int biStart = m_prgibActionStart[ruln];
+ byte * pbNext = m_prgbActionBlock + biStart;
+
+ // General purpose variables:
+// int arg1, arg2, arg3, arg4;
+ int nSlotRef;
+ int nInputClass;
+ int nOutputClass;
+ int c;
+ int islotArg;
+ int nIndex;
+ int nGlyphAttr;
+ int nAttLevel;
+ int nFeat;
+ int nPState;
+// SlotAttrName slat;
+
+ int i;
+
+// int nRet = 0;
+
+ while (true) // exit by encountering PopRet or RetTrue or RetZero
+ {
+ ActionCommand op = ActionCommand(*pbNext++);
+
+ switch (op)
+ {
+ case kopNop:
+ break;
+
+ case kopPushByte:
+ pbNext++;
+ break;
+ case kopPushByteU:
+ pbNext++;
+ break;
+ case kopPushShort:
+ pbNext++;
+ pbNext++;
+ break;
+ case kopPushShortU:
+ pbNext++;
+ pbNext++;
+ break;
+ case kopPushLong:
+ pbNext++;
+ pbNext++;
+ pbNext++;
+ pbNext++;
+ break;
+
+ case kopNeg:
+ case kopTrunc8: case kopTrunc16:
+ case kopNot:
+ break;
+
+ case kopAdd: case kopSub:
+ case kopMul: case kopDiv:
+ case kopMin: case kopMax:
+ case kopAnd: case kopOr:
+ case kopEqual: case kopNotEq:
+ case kopLess: case kopGtr:
+ case kopLessEq: case kopGtrEq:
+ break;
+
+ case kopCond:
+ break;
+
+ case kopNext:
+ break;
+ case kopNextN:
+ c = *pbNext; pbNext++; // count
+ break;
+ case kopPutGlyph8bitObs:
+ nOutputClass = *pbNext++;
+ break;
+ case kopPutGlyph:
+ pbNext += 2;
+ break;
+ case kopPutCopy:
+ nSlotRef = *pbNext++;
+ break;
+ case kopPutSubs8bitObs:
+ nSlotRef = *pbNext++;
+ nInputClass = *pbNext++;
+ nOutputClass = *pbNext++;
+ break;
+ case kopPutSubs:
+ nSlotRef = *pbNext++;
+ pbNext += 4; // 2 bytes each for classes
+ break;
+ case kopCopyNext:
+ break;
+ case kopInsert:
+ break;
+ case kopDelete:
+ break;
+ case kopAssoc:
+ c = *pbNext; pbNext++;
+ for (i = 0; i < c; i++)
+ pbNext++;
+ break;
+ case kopCntxtItem:
+ islotArg = *pbNext++;
+ c = *pbNext++;
+ break;
+
+ case kopAttrSet:
+ case kopAttrAdd:
+ case kopAttrSub:
+ case kopAttrSetSlot:
+ pbNext++; // slot attribute ID
+ break;
+ case kopIAttrSet:
+ case kopIAttrAdd:
+ case kopIAttrSub:
+ case kopIAttrSetSlot:
+ pbNext++; // slot attribute ID
+ nIndex = *pbNext++; // index; eg, global ID for component
+ break;
+
+ case kopPushSlotAttr:
+ pbNext++;
+ nSlotRef = *pbNext++;
+ break;
+ case kopPushISlotAttr:
+ pbNext++;
+ nSlotRef = *pbNext++;
+ nIndex = *pbNext++;
+ break;
+
+ case kopPushGlyphAttrObs:
+ case kopPushAttToGAttrObs:
+ nGlyphAttr = *pbNext++;
+ nSlotRef = *pbNext++;
+ break;
+ case kopPushGlyphAttr:
+ case kopPushAttToGlyphAttr:
+ *pbNext += 3;
+ break;
+ case kopPushGlyphMetric:
+ case kopPushAttToGlyphMetric:
+ nGlyphAttr = *pbNext++;
+ nSlotRef = *pbNext++;
+ nAttLevel = *pbNext++;
+ break;
+ case kopPushFeat:
+ nFeat = *pbNext++;
+ nSlotRef = *pbNext++;
+ break;
+
+ case kopPushProcState:
+ nPState = *pbNext++;
+ break;
+ case kopPushVersion:
+ break;
+
+ case kopPopRet:
+ case kopRetZero:
+ case kopRetTrue:
+ m_prgfRuleOkay[ruln] = true;
+ return ruln;
+
+ default:
+ // Uninterpretable command:
+ return -1;
+ }
+ }
+
+ return ruln; // to keep compiler from griping
+}
+
+/*----------------------------------------------------------------------------------------------
+ Runs the rule, if any, otherwise just passes one character through.
+ The rule does nothing but set the line-break weights for the slots.
+
+ @param ptman - the table manager that allocates slots
+ @param ruln - number of rule to run; -1 if none applies
+ @param psstrmIn/Out - input/output stream
+----------------------------------------------------------------------------------------------*/
+void GrLineBreakPass::RunRule(GrTableManager * ptman, int ruln,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ // Remember the beginnings of the new chunk:
+ int islotIn = psstrmIn->ReadPos();
+ int islotOut = psstrmOut->WritePos();
+ int cslotReprocessed = psstrmIn->SlotsToReprocess();
+
+ if (ruln == -1)
+ {
+#ifdef OLD_TEST_STUFF
+ if (RunTestRules(ptman, ruln, psstrmIn, psstrmOut))
+#else
+ if (false)
+#endif // OLD_TEST_STUFF
+ {}
+ else
+ // Just pass one glyph through.
+ {
+ psstrmOut->CopyOneSlotFrom(psstrmIn);
+ psstrmOut->SetPosForNextRule(0, psstrmIn, false);
+ }
+ }
+ else
+ {
+ // Run the rule.
+#ifdef OLD_TEST_STUFF
+ if (RunTestRules(ptman, ruln, psstrmIn, psstrmOut))
+#else
+ if (false)
+#endif // OLD_TEST_STUFF
+ {}
+ else
+ {
+ int biStart = m_prgibActionStart[ruln];
+ int iResult = RunCommandCode(ptman, m_prgbActionBlock + biStart, false,
+ psstrmIn, psstrmOut, 0);
+ psstrmOut->SetPosForNextRule(iResult, psstrmIn, false);
+ }
+ }
+
+ CheckInputProgress(psstrmIn, psstrmOut, islotIn);
+
+ MapChunks(psstrmIn, psstrmOut, islotIn, islotOut, cslotReprocessed);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Runs the rule, if any, otherwise just passes one character through.
+ Keeps track of the association information in the slots and chunk
+ mappings for backtracking.
+
+ @param ptman - the table manager that allocates slots
+ @param ruln - number of rule to run; -1 if none applies
+ @param psstrmIn/Out - input / output streams
+----------------------------------------------------------------------------------------------*/
+void GrSubPass::RunRule(GrTableManager * ptman, int ruln,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ // Remember the beginnings of the new chunk:
+ int islotIn = psstrmIn->ReadPosForNextGet();
+ int islotOut = psstrmOut->WritePos();
+ int cslotReprocessed = psstrmIn->SlotsToReprocess();
+
+ if (ruln == -1)
+ {
+#ifdef OLD_TEST_STUFF
+ if (RunTestRules(ptman, ruln, psstrmIn, psstrmOut))
+#else
+ if (false)
+#endif // OLD_TEST_STUFF
+ {}
+ else
+ // Just pass one glyph through.
+ {
+ psstrmOut->CopyOneSlotFrom(psstrmIn);
+ psstrmOut->SetPosForNextRule(0, psstrmIn, false);
+ }
+ }
+ else
+ {
+ // Run the rule.
+#ifdef OLD_TEST_STUFF
+ if (RunTestRules(ptman, ruln, psstrmIn, psstrmOut))
+#else
+ if (false)
+#endif // OLD_TEST_STUFF
+ {}
+ else
+ /****************************/
+ {
+ int biStart = m_prgibActionStart[ruln];
+ int iResult = RunCommandCode(ptman, m_prgbActionBlock + biStart, false,
+ psstrmIn, psstrmOut, 0);
+ psstrmOut->SetPosForNextRule(iResult, psstrmIn, false);
+
+ // Restore if we need line-boundary contextualization based on physical locations
+ ////psstrmOut->SetLBContextFlag(ptman, islotOut);
+ }
+ }
+
+ CheckInputProgress(psstrmIn, psstrmOut, islotIn);
+
+ MapChunks(psstrmIn, psstrmOut, islotIn, islotOut, cslotReprocessed);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Runs the rule, if any, otherwise just positions one character in the standard way.
+ Keeps track of (among other things) the overall physical size of the output
+ and chunk mappings.
+
+ @param ptman - the table manager that allocates slots
+ @param ruln - number of rule to run; -1 if none applies
+ @param psstrmIn / Out - input / output streams
+----------------------------------------------------------------------------------------------*/
+void GrPosPass::RunRule(GrTableManager * ptman, int ruln,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ // Remember the beginnings of the new chunk:
+ int islotIn = psstrmIn->ReadPosForNextGet();
+ int islotOut = psstrmOut->WritePos();
+ int cslotReprocessed = psstrmIn->SlotsToReprocess();
+
+ int iResult = 0;
+
+ Assert(psstrmIn->GotIndexOffset());
+ // Don't do any positioning in anything being processed from the previous line.
+ if (psstrmIn->ReadPosForNextGet() < psstrmIn->IndexOffset())
+ ruln = -1;
+
+ if (ruln == -1)
+ {
+ // Just position one glyph in the standard way.
+ psstrmOut->CopyOneSlotFrom(psstrmIn);
+ iResult = 0;
+ }
+ else
+ {
+ // Run the rule.
+#ifdef OLD_TEST_STUFF
+ if (RunTestRules(ptman, ruln, psstrmIn, psstrmOut))
+#else
+ if (false)
+#endif // OLD_TEST_STUFF
+ {}
+ else
+ {
+ int biStart = m_prgibActionStart[ruln];
+ iResult = RunCommandCode(ptman, m_prgbActionBlock + biStart, false,
+ psstrmIn, psstrmOut, 0);
+ }
+ }
+
+ // Make sure an entire cluster is present in the output stream. Actually there might be
+ // interleaved clusters, which is the purpose for the loop.
+ int dislotClusterMax = 0;
+ do {
+ dislotClusterMax = psstrmIn->MaxClusterSlot(islotIn, psstrmIn->ReadPos());
+ Assert(dislotClusterMax >= 0);
+ for (int islot = 0; islot < dislotClusterMax; islot++)
+ psstrmOut->CopyOneSlotFrom(psstrmIn);
+ iResult -= dislotClusterMax;
+ } while (dislotClusterMax > 0);
+
+ psstrmOut->SetPosForNextRule(iResult, psstrmIn, true);
+
+ // Restore if we need line-boundary contextualization based on physical locations
+ ////psstrmOut->SetLBContextFlag(ptman, islotOut);
+
+ if (ruln > -1)
+ {
+ psstrmOut->CalcIndexOffset(ptman);
+ // Update the attachment trees and cluster metrics for slots modified by this rule.
+ // Note that this loop assumes that the reprocess buffer points to the identical
+ // slot objects as the output stream (not copies of the slots).
+ for (int islot = islotIn - psstrmIn->SlotsSkippedToResync();
+ islot < psstrmOut->WritePos() + psstrmIn->SlotsToReprocess();
+ islot++)
+ {
+ psstrmOut->SlotAt(islot)->HandleModifiedPosition(ptman, psstrmIn, psstrmOut, islot);
+ }
+ }
+
+ CheckInputProgress(psstrmIn, psstrmOut, islotIn);
+
+ MapChunks(psstrmIn, psstrmOut, islotIn, islotOut, cslotReprocessed);
+
+ psstrmOut->AssertStreamIndicesValid(psstrmIn);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Perform the reversal for internal bidirectionality.
+ Caller is responsible for updating the read- and write-positions.
+ Private.
+
+ OBSOLETE
+
+ @param nCurrDirection - direction level of range of reverse
+ @param psstrmIn, psstrmOut - streams
+ @param islotInMin, islotInLim - range to reverse
+ @param islotOutMin,islotOutLim - corresponding output positions; note that islotOutMin
+ will be greater than islotOutLim if we are reversing
+ reversing the slots (direction is odd)
+----------------------------------------------------------------------------------------------*/
+#if 0
+void GrBidiPass::OldReverse(int nCurrDirection,
+ GrSlotStream * psstrmIn, int islotInMin, int islotInLim,
+ GrSlotStream * psstrmOut, int islotOutMin, int islotOutLim)
+{
+ int oInc = (islotOutLim > islotOutMin)? 1: -1; // which direction output is moving in
+ // buffer (if dir is even, oInc == 1;
+ // if odd, oInc == -1)
+
+ int islotITmp = islotInMin;
+ int islotOTmp = islotOutMin;
+
+ while (islotITmp != islotInLim) {
+ // Find end of sub-range at current level to reverse.
+ int islotSubLim = psstrmIn->OldDirLevelRange(NULL, islotITmp, nCurrDirection);
+ Assert(islotSubLim >= 0);
+
+ if (islotSubLim == islotITmp) {
+ // Current slot is at this level--just copy it.
+ psstrmOut->SimpleCopyFrom(psstrmIn, islotITmp, islotOTmp);
+ islotOTmp += oInc;
+ islotITmp++;
+ }
+ else {
+ // There is a sub-range that needs to be reversed.
+ int islotONext = islotOTmp + ((islotSubLim-islotITmp) * oInc);
+ OldReverse(nCurrDirection+1,
+ psstrmIn, islotITmp, islotSubLim,
+ psstrmOut, islotONext - oInc, islotOTmp - oInc);
+ islotOTmp = islotONext;
+ islotITmp = islotSubLim;
+ }
+ }
+}
+#endif
+
+/*----------------------------------------------------------------------------------------------
+ Perform the reversal for internal bidirectionality.
+ Caller is responsible for updating the read- and write-positions.
+ Return the number of slots NOT copied because they were markers.
+ Private.
+
+ @param psstrmIn, psstrmOut - streams
+ @param vislotStarts, vislotStops - indices of ranges to reverse, from inner to outer
+----------------------------------------------------------------------------------------------*/
+int GrBidiPass::Reverse(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ std::vector<int> & vislotStarts, std::vector<int> & vislotStops)
+{
+ Assert(vislotStarts.size() == vislotStops.size());
+
+ std::vector<int> vislotMap; // list of slot indices in the order they should be copied
+ // into the output
+
+ int islotOuterStart = vislotStarts.back();
+ int islotOuterStop = vislotStops.back();
+
+ // Initialize map as if nothing is reversed; eg for [2, 9]: (2 3 4 5 6 7 8 9)
+ int islot;
+ for (islot = 0; islot <= (islotOuterStop - islotOuterStart); islot++)
+ vislotMap.push_back(islot + islotOuterStart);
+
+ // Do the inner reversals first, followed by the outer reversals.
+ size_t iislot;
+ for (iislot = 0; iislot < vislotStarts.size(); iislot++)
+ {
+ // Reverse the run.
+ int islotStart = vislotStarts[iislot] - islotOuterStart;
+ int islotStop = vislotStops[iislot] - islotOuterStart;
+ int islot1, islot2;
+ for (islot1 = islotStart, islot2 = islotStop; islot1 < islot2; islot1++, islot2--)
+ {
+ int islotTmp = vislotMap[islot1];
+ vislotMap[islot1] = vislotMap[islot2];
+ vislotMap[islot2] = islotTmp;
+ }
+ }
+
+ // With vislotStarts = [7, 5, 2] and vislotStops = [8, 8, 9], we get
+ // first: (2 3 4 5 6 8 7 9)
+ // then: (2 3 4 7 8 5 6 9)
+ // and finally: (9 6 5 8 7 4 3 2)
+
+ // Now copy the slots.
+
+ int islotOutStart = psstrmOut->WritePos();
+ int cslotNotCopied = 0;
+ for (iislot = 0; iislot < vislotMap.size(); iislot++)
+ {
+ GrSlotState * pslot = psstrmIn->SlotAt(vislotMap[iislot]);
+ // Don't copy bidi markers unless they have been set to use a specific glyph.
+ if (pslot->IsBidiMarker() && pslot->ActualGlyphForOutput(ptman) == 0)
+ cslotNotCopied++;
+ else
+ psstrmOut->SimpleCopyFrom(psstrmIn, vislotMap[iislot],
+ iislot + islotOutStart - cslotNotCopied);
+ }
+ return cslotNotCopied;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Unwind the output for this pass, given that a change was assumed to have occurred
+ in the input at the given position. Return the position to which we unwound.
+----------------------------------------------------------------------------------------------*/
+int GrPass::Unwind(GrTableManager * ptman,
+ int islotChanged, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ bool fFirst)
+{
+ // Back up the number of slots required for the longest rule context,
+ // but if we land in the middle of a chunk, go forward to its boundary.
+ int islotIn = max(islotChanged - m_pzpst->MaxChunk(), 0);
+ if (!psstrmIn->NoReproc())
+ islotIn = min(islotIn, psstrmIn->ReprocMin());
+ psstrmIn->ClearReprocBuffer();
+ int islotOut = 0;
+ if (islotIn < psstrmIn->SlotsSkippedToResync() ||
+ islotIn == 0 ||
+ psstrmIn->ReadPos() == 0)
+ {
+ // The next-chunk-map is invalid. The beginning of the chunk is 0.
+ islotIn = 0;
+ islotOut = 0;
+ }
+ else if (islotIn >= psstrmIn->ReadPos())
+ {
+ // No need to unwind.
+ Assert(psstrmIn->NoReproc());
+ return psstrmOut->WritePos();
+ }
+ else
+ {
+ Assert(islotIn < psstrmIn->ReadPos());
+ islotIn = min(islotIn, psstrmIn->ReadPos() - 1);
+ while (islotIn < psstrmIn->ReadPos() &&
+ (islotOut = psstrmIn->ChunkInNext(islotIn)) == -1)
+ {
+ ++islotIn;
+ }
+ if (islotIn == psstrmIn->ReadPos())
+ islotOut = psstrmOut->WritePos();
+ }
+
+ Assert(islotOut != -2); // because the chunk size must be <= than the max-chunk,
+ // so we should never hit the end of the output stream
+
+ // Now we've found a chunk boundary.
+
+// if (fFirst)
+// Unattach(psstrmIn, islotIn, psstrmOut, islotOut, islotChanged);
+// else
+// Unattach(psstrmIn, islotIn, psstrmOut, islotOut, -1);
+
+ psstrmIn->UnwindInput(islotIn, PreBidiPass());
+ psstrmOut->UnwindOutput(islotOut, IsPosPass());
+
+ if (psstrmIn->ReadPos() < psstrmIn->SlotsSkippedToResync())
+ {
+ ptman->Pass(m_ipass - 1)->UndoResyncSkip();
+ psstrmIn->ClearSlotsSkippedToResync();
+ }
+ if (psstrmOut->WritePos() < psstrmOut->SlotsSkippedToResync())
+ {
+ Assert(psstrmOut->SlotsSkippedToResync() == m_pzpst->m_cslotSkipToResync);
+ UndoResyncSkip();
+ psstrmOut->ClearSlotsSkippedToResync();
+ }
+
+ if (ptman->LoggingTransduction())
+ m_pzpst->UnwindLogInfo(islotIn, islotOut);
+
+ return islotOut;
+}
+
+/*----------------------------------------------------------------------------------------------
+ For a GrBidiPass, just unwind to the beginning of the reordered chunk.
+----------------------------------------------------------------------------------------------*/
+int GrBidiPass::Unwind(GrTableManager * ptman,
+ int islotChanged, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ bool fFirst)
+{
+ int islotIn;
+ int islotOut;
+
+ if (islotChanged == 0)
+ {
+ islotIn = 0;
+ islotOut = 0;
+ }
+ else {
+ islotIn = min(islotChanged, psstrmIn->ReadPos());
+ islotIn = max(islotIn - 1, 0);
+ while (islotIn > 0 && !StrongDir(psstrmIn->SlotAt(islotIn)->Directionality()))
+ {
+ psstrmIn->SlotAt(islotIn)->ZapDirLevel();
+ islotIn--;
+ }
+ Assert(islotIn == 0 || psstrmIn->SlotAt(islotIn)->DirHasBeenProcessed());
+ islotOut = 0;
+ while (islotIn > 0 && (islotOut = psstrmIn->ChunkInNext(islotIn)) == -1)
+ --islotIn;
+ }
+
+ if (islotOut == -1 || islotOut == -2)
+ islotOut = 0;
+
+ // Now we've found a chunk boundary; islotI and islotO are the positions in the
+ // input and output streams, respectively.
+
+ psstrmIn->UnwindInput(islotIn, false);
+ psstrmOut->UnwindOutput(islotOut, false);
+
+ if (psstrmOut->WritePos() < m_pzpst->m_cslotSkipToResync)
+ {
+ Assert(false); // shouldn't be any of this mess for the Bidi pass
+ m_pzpst->m_fDidResyncSkip = false;
+ }
+
+ if (ptman->LoggingTransduction())
+ m_pzpst->UnwindLogInfo(islotIn, islotOut);
+
+ return islotOut;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Reinitialize part of the transduction logging information when we unwind the pass.
+----------------------------------------------------------------------------------------------*/
+void PassState::UnwindLogInfo(int islotIn, int islotOut)
+{
+ while (m_crulrec > 0 && m_rgrulrec[m_crulrec-1].m_islot >= islotIn)
+ {
+ m_crulrec--;
+ m_rgrulrec[m_crulrec].m_islot = 0;
+ m_rgrulrec[m_crulrec].m_irul = 0;
+ m_rgrulrec[m_crulrec].m_fFired = false;
+ }
+
+ for (int islot = islotOut; islot < 128; islot++)
+ {
+ m_rgcslotDeletions[islot] = 0;
+ m_rgfInsertion[islot] = false;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Undo the side effects of attachments, ie, fix up the attachment trees as we unwind.
+
+ @param islotLB the index of the line-break that was just inserted, or -1 if this is
+ not the first pass to include line-breaks; we want to skip this slot
+ in the processing in this method
+
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+//:Ignore
+void GrPosPass::Unattach(GrSlotStream * psstrmIn, int islotIn,
+ GrSlotStream * psstrmOut, int islotOut, int islotLB)
+{
+ // Because this is a positioning pass, there is a one-to-one correspondence between
+ // the slots in the input and the slots in the output. Thus we can make simplifying
+ // assumptions. Specifically, the chunk sizes are equal, except for the possiblity
+ // of a LB slot that we just inserted in the input stream.
+#if 0
+
+#ifdef _DEBUG
+ int islotDiff = (psstrmIn->ReadPos() - islotIn) - (psstrmOut->WritePos() - islotOut);
+ if (islotLB == -1)
+ Assert(islotDiff == 0);
+ else
+ Assert(islotDiff == 1);
+#endif // _DEBUG
+
+ int islotInLp = psstrmIn->ReadPos();
+ int islotOutLp = psstrmOut->WritePos();
+ for ( ; islotInLp-- > islotIn && islotOutLp-- > islotOut; )
+ {
+ if (islotLB == islotInLp)
+ {
+ GrSlotState * pslotTmp = psstrmIn->SlotAt(islotInLp);
+ islotInLp--;
+ }
+
+ GrSlotState * pslotIn = psstrmIn->SlotAt(islotInLp);
+ GrSlotState * pslotOut = psstrmOut->SlotAt(islotOutLp);
+
+ if (pslotIn != pslotOut)
+ {
+ GrSlotState * pslotInRoot = pslotIn->AttachRoot();
+ GrSlotState * pslotOutRoot = pslotOut->AttachRoot();
+
+ if (pslotOutRoot)
+ pslotOutRoot->RemoveLeaf(pslotOut);
+ if (pslotInRoot)
+ pslotInRoot->AddLeaf(pslotIn);
+ }
+ }
+#endif // 0
+}
+//:End Ignore
+
+
+/*----------------------------------------------------------------------------------------------
+ Record the fact that the given rule's constraint failed, for the purpose of logging
+ the transduction process.
+----------------------------------------------------------------------------------------------*/
+void GrPass::RecordRuleFailed(int islot, int irul)
+{
+ m_pzpst->RecordRule(islot, irul, false);
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Record the fact that the given rule fired, for the purpose of logging
+ the transduction process.
+----------------------------------------------------------------------------------------------*/
+void GrPass::RecordRuleFired(int islot, int irul)
+{
+ m_pzpst->RecordRule(islot, irul, true);
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Record the fact that we forcibly advanced due to the max-rule-loop.
+----------------------------------------------------------------------------------------------*/
+void GrPass::RecordHitMaxRuleLoop(int islot)
+{
+ m_pzpst->RecordRule(islot, PassState::kHitMaxRuleLoop);
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Record the fact that we forcibly advanced due to the max-backup.
+
+ In theory it should be possible to call this, but in reality, it is pretty hard to be
+ able to say that there is a rule that would have fired except it was prevent by
+ MaxBackup. So currently this method is not called.
+----------------------------------------------------------------------------------------------*/
+void GrPass::RecordHitMaxBackup(int islot)
+{
+ m_pzpst->RecordRule(islot, PassState::kHitMaxBackup);
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Record some rule-related activity on a slot.
+----------------------------------------------------------------------------------------------*/
+void PassState::RecordRule(int islot, int irul, bool fFired)
+{
+ if (m_crulrec >= 128)
+ return;
+
+ m_rgrulrec[m_crulrec].m_irul = irul;
+ m_rgrulrec[m_crulrec].m_islot = islot;
+ m_rgrulrec[m_crulrec].m_fFired = true;
+ m_rgrulrec[m_crulrec].m_fFired = fFired;
+ m_crulrec++;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Record the fact that a slot was deleted before the given slot (in the output).
+----------------------------------------------------------------------------------------------*/
+void PassState::RecordDeletionBefore(int islot)
+{
+ if (islot >= 128)
+ return;
+
+ (m_rgcslotDeletions[islot])++;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Record the fact that the given slot was inserted into the output.
+----------------------------------------------------------------------------------------------*/
+void PassState::RecordInsertionAt(int islot)
+{
+ if (islot >= 128)
+ return;
+
+ m_rgfInsertion[islot] = true;
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/GrPass.h b/Build/source/libs/graphite/src/segment/GrPass.h
new file mode 100644
index 00000000000..d4d6a16a9dc
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrPass.h
@@ -0,0 +1,748 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999 - 2008 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrPass.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ The GrPass class and subclasses.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef PASS_INCLUDED
+#define PASS_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+ This class stores the state of processing in a single pass.
+
+ Hungarian: zpst
+----------------------------------------------------------------------------------------------*/
+
+class PassState {
+ friend class GrPass;
+ friend class GrGlyphGenPass;
+ friend class GrLineBreakPass;
+ friend class GrSubPass;
+ friend class GrBidiPass;
+ friend class GrPosPass;
+ friend class FontMemoryUsage;
+
+public:
+ PassState()
+ {
+ }
+
+ void InitForNewSegment(int ipass, int nMaxChunk);
+ void InitializeLogInfo();
+
+ int MaxChunk()
+ {
+ return m_nMaxChunk;
+ }
+
+ void SetResyncSkip(int c)
+ {
+ m_cslotSkipToResync = c;
+ m_fDidResyncSkip = false;
+ }
+ int NeededToResync()
+ {
+ if (m_fDidResyncSkip)
+ return 0;
+ return m_cslotSkipToResync;
+ }
+ bool DidResyncSkip()
+ {
+ return m_fDidResyncSkip;
+ }
+ bool CanResyncSkip(GrSlotStream * psstrmOutput)
+ {
+ if (m_fDidResyncSkip)
+ return true; // already did it
+ // Are we in the position to do the resync-skip?
+ return m_cslotSkipToResync <= psstrmOutput->WritePos();
+ }
+ int DoResyncSkip(GrSlotStream * psstrmOutput);
+ void UndoResyncSkip()
+ {
+ m_fDidResyncSkip = false;
+ }
+
+ void UnwindLogInfo(int islotIn, int islotOut);
+ void RecordRule(int islot, int irul, bool fFired = false);
+ void RecordDeletionBefore(int islot);
+ void RecordInsertionAt(int islot);
+#ifdef TRACING
+ void LogRulesFiredAndFailed(std::ostream & strmOut, GrSlotStream * psstrmIn);
+ void LogInsertionsAndDeletions(std::ostream & strmOut, GrSlotStream * psstrmOut);
+ void LogXmlRules(std::ostream & strmOut, GrTableManager *, GrSlotStream * psstrmIn, int nIndent);
+ void LogXmlGlyphs(std::ostream & strmOut, GrTableManager * ptman, GrSlotStream * psstrmOut,
+ int ipassJust1, bool fPreJust, bool fPostJust, bool fBidi, bool fBidiNext, int cslotsSkipped,
+ int nIndent);
+#endif // TRACING
+
+protected:
+ int m_ipass;
+
+ // Used to avoid infinite loops. If m_nRulesSinceAdvance > m_nMaxRuleLoop,
+ // and we have not passed the stream's ReadPosMax, forcibly advance.
+ int m_nRulesSinceAdvance;
+
+ // Maximum length of chunk, used when unwinding the streams during backtracking. This
+ // must be initialized to m_nMaxRuleContext, but that is not always adequate, because
+ // when there is reprocessing going on the chunks may be longer.
+ int m_nMaxChunk;
+
+ // Indicates how much of the pass's initial output should be automatically
+ // skipped over in order to resync with a chunk boundary. This handles the situation
+ // where we are reprocessing a little of the previous segment in order to handle
+ // cross-line-boundary contextuals. The goal is to skip over the output until we hit
+ // what we know (from processing the previous segment) is a chunk boundary.
+ //
+ // In most cases (and always when this is the first segment of the
+ // writing system) this number is 0.
+ int m_cslotSkipToResync;
+ bool m_fDidResyncSkip;
+
+ enum {
+ kHitMaxBackup = -1,
+ kHitMaxRuleLoop = -2
+ };
+
+ // For logging transduction process: record of one rule matched or fired
+ struct RuleRecord
+ {
+ int m_irul; // rule index, or kHitMaxBackup or kHitMaxRuleLoop
+ int m_islot; // slot index of input stream
+ bool m_fFired;
+ };
+ RuleRecord m_rgrulrec[128];
+ int m_crulrec;
+
+ int m_rgcslotDeletions[128]; // number of deletions before slot i in output
+ bool m_rgfInsertion[128]; // true if slot i in output was inserted
+};
+
+/*----------------------------------------------------------------------------------------------
+ This class handles finding and applying rules from the pass and storing
+ the results in the appropriate stream.
+
+ Hungarian: pass
+----------------------------------------------------------------------------------------------*/
+class GrPass {
+ friend class FontMemoryUsage;
+
+protected:
+ // Action command codes; these MUST match the corresponding definitions in the compiler:
+ enum ActionCommand {
+ kopNop = 0,
+
+ kopPushByte, kopPushByteU, kopPushShort, kopPushShortU, kopPushLong,
+
+ kopAdd, kopSub, kopMul, kopDiv,
+ kopMin, kopMax,
+ kopNeg,
+ kopTrunc8, kopTrunc16,
+
+ kopCond,
+
+ kopAnd, kopOr, kopNot,
+ kopEqual, kopNotEq,
+ kopLess, kopGtr, kopLessEq, kopGtrEq,
+
+ kopNext, kopNextN, kopCopyNext,
+ kopPutGlyph8bitObs, kopPutSubs8bitObs, kopPutCopy,
+ kopInsert, kopDelete,
+ kopAssoc,
+ kopCntxtItem,
+
+ kopAttrSet, kopAttrAdd, kopAttrSub,
+ kopAttrSetSlot,
+ kopIAttrSetSlot,
+ kopPushSlotAttr, kopPushGlyphAttrObs,kopPushGlyphMetric, kopPushFeat,
+ kopPushAttToGAttrObs, kopPushAttToGlyphMetric,
+ kopPushISlotAttr,
+
+ kopPushIGlyphAttr, // not implemented
+
+ kopPopRet, kopRetZero, kopRetTrue,
+ kopIAttrSet, kopIAttrAdd, kopIAttrSub,
+ kopPushProcState, kopPushVersion,
+ kopPutSubs, kopPutSubs2, kopPutSubs3,
+ kopPutGlyph, kopPushGlyphAttr, kopPushAttToGlyphAttr
+
+ };
+
+ enum StackMachineFlag {
+ ksmfDone = 0,
+ ksmfContinue,
+ ksmfUnderflow,
+ ksmfStackNotEmptied
+ };
+
+public:
+ // Constructor:
+ GrPass(int i);
+ // Destructor:
+ virtual ~GrPass();
+
+ int PassNumber() { return m_ipass; }
+
+ bool ReadFromFont(GrIStream & grstrm, int fxdSilfVersion, int fxdRuleVersion, int nOffset);
+ void InitializeWithNoRules();
+
+ virtual void SetTopDirLevel(int n)
+ { // only GrBidiPass does anything interesting
+ }
+
+ void SetPassState(PassState * pzpst)
+ {
+ m_pzpst = pzpst;
+ }
+
+ virtual void ExtendOutput(GrTableManager *,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput, int nslotToGet,
+ TrWsHandling twsh,
+ int * pnRet, int * pcslotGot, int * pislotFinalBreak);
+
+ int ExtendGlyphIDOutput(GrTableManager *, GrCharStream *,
+ GrSlotStream *, int ichSegLim, int cchwPostXlbContext,
+ LineBrk lb, int cslotToGet, bool fNeedFinalBreak,
+ TrWsHandling twsh, int * pislotFinalBreak);
+
+ int ExtendFinalOutput(GrTableManager *, GrSlotStream * psstrmInput,
+ GrSlotStream * psstrmOutput,
+ float xsSpaceAllotted, bool fWidthIsCharCount, bool fInfiniteWidth,
+ bool fHaveLineBreak, bool fMustBacktrack,
+ LineBrk lbMax, TrWsHandling twsh,
+ int * pislotLB, float * pxsWidth);
+
+ int RemoveTrailingWhiteSpace(GrTableManager * ptman, GrSlotStream * psstrmOut,
+ TrWsHandling twsh, int * pislotFinalBreak);
+
+ virtual int Unwind(GrTableManager * ptman,
+ int islotChanged, GrSlotStream *psstrmInput, GrSlotStream * psstrmOutput,
+ bool fFirst);
+
+ int MaxBackup()
+ {
+ return m_nMaxBackup;
+ }
+
+ bool DidResyncSkip()
+ {
+ return m_pzpst->DidResyncSkip();
+ }
+ int DoResyncSkip(GrSlotStream * psstrmOutput)
+ {
+ return m_pzpst->DoResyncSkip(psstrmOutput);
+ }
+
+ void UndoResyncSkip()
+ {
+ m_pzpst->UndoResyncSkip();
+ }
+ void SetResyncSkip(int n)
+ {
+ m_pzpst->SetResyncSkip(n);
+ }
+
+ virtual void DoCleanUpSegMin(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, int islotInitReadPos, GrSlotStream * psstrmOut)
+ {
+ }
+
+ virtual bool IsPosPass()
+ {
+ return false;
+ }
+
+ virtual bool PreBidiPass() = 0;
+
+ bool RunConstraint(GrTableManager *, int ruln,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int cslotPreModContext, int cslotMatched);
+
+ int RunCommandCode(GrTableManager * ptman,
+ byte * pbStart, bool fConstraints,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islot);
+
+protected:
+ int RunOneCommand(GrTableManager * ptman, bool fConstraints,
+ ActionCommand op, byte ** ppbArg, bool * pfMustGet, bool * pfInserting,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islot,
+ std::vector<int> & vnStack, StackMachineFlag * psmf);
+ void DoStackArithmetic2Args(ActionCommand op, std::vector<int> & vnStack,
+ StackMachineFlag * psmf);
+ void DoStackArithmetic1Arg(ActionCommand op, std::vector<int> & vnStack,
+ StackMachineFlag * psmf);
+ void DoConditional(std::vector<int> & vnStack, StackMachineFlag * psmf);
+ StackMachineFlag CheckStack(std::vector<int> & vnStack, int cn);
+ void DoNext(GrTableManager * ptman,
+ int cslot, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPutGlyph(GrTableManager * ptman, bool fInserting, int nReplacementClass,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPutCopy(GrTableManager * ptman, bool fInserting, int cslotCopyFrom,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPutSubs(GrTableManager * ptman, bool fInserting,
+ int cslotSel, int nSelClass, int nReplacementClass,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPutSubs2(GrTableManager * ptman, bool fInserting,
+ int cslotSel1, int nSelClass1, int cslotSel2, int nSelClass2, int nReplacementClass,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPutSubs3(GrTableManager * ptman, bool fInserting,
+ int cslotSel1, int nSelClass1, int cslotSel2, int nSelClass2, int cslotSel3, int nSelClass3,
+ int nReplacementClass, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPutSubsInit(GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, bool fInserting,
+ GrSlotState ** ppslotNextPut, bool * pfAtSegMin, bool * pfAtSegLim);
+ void DoPutSubsAux(GrTableManager * ptman, bool fInserting, gid16 nGlyphReplacement,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, GrSlotState * pslotNextInput,
+ bool fAtSegMin, bool fAtSegLim);
+ void SetNeutralAssocs(GrSlotState * pslotNew, GrSlotStream * psstrmIn);
+ void DoDelete(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoAssoc(int cnAssocs, std::vector<int> & vnAssocs, bool fInserting,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoSetAttr(GrTableManager * ptman,
+ ActionCommand op, bool fInserrting,
+ SlotAttrName slat, int slati, std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPushSlotAttr(GrTableManager * ptman,
+ int nSlotRef, bool fInserting,
+ SlotAttrName slat, int slati, std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPushGlyphAttr(GrTableManager * ptman, int nSlotRef, bool fInserting,
+ int nGlyphAttr, std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPushAttToGlyphAttr(GrTableManager * ptman, int nSlotRef, bool fInserting,
+ int nGlyphAttr, std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPushGlyphMetric(GrTableManager * ptman, int nSlotRef, bool fInserting,
+ int nGlyphAttr, int nAttLevel, std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPushAttToGlyphMetric(GrTableManager * ptman, int nSlotRef, bool fInserting,
+ int nGlyphAttr, int nAttLevel, std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPushFeatValue(GrTableManager * ptman, int islot, bool fInsering,
+ int nFeat, std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ void DoPushProcState(GrTableManager * ptman, int nPState, std::vector<int> & vnStack);
+protected:
+ void DoPushGlyphMetricAux(GrTableManager * ptman,
+ GrSlotState * pslot, int nGlyphAttr, int nAttLevel,
+ std::vector<int> & vnStack, GrSlotStream * psstrmIn);
+public:
+ int SortKeyForRule(int ruln)
+ {
+ Assert(ruln < m_crul);
+ return m_prgchwRuleSortKeys[ruln];
+ }
+ int PreModContextForRule(int ruln)
+ {
+ Assert(ruln < m_crul);
+ return m_prgcritRulePreModContext[ruln];
+ }
+
+ int MaxRulePreContext()
+ {
+ if (m_pfsm)
+ return m_pfsm->MaxRulePreContext();
+ else
+ return 0;
+ }
+
+ void RecordRuleFailed(int islot, int irul);
+ void RecordRuleFired(int islot, int irul);
+ void RecordHitMaxRuleLoop(int islot);
+ void RecordHitMaxBackup(int islot);
+#ifdef TRACING
+ void LogRulesFiredAndFailed(std::ostream & strmOut, GrSlotStream * psstrmIn);
+ void LogInsertionsAndDeletions(std::ostream & strmOut, GrSlotStream * psstrmOut);
+ void LogXmlRules(std::ostream & strmOut, GrTableManager * ptman,
+ GrSlotStream * psstrmIn, int nIndent);
+ void LogXmlGlyphs(std::ostream & strmOut, GrTableManager * ptman, GrSlotStream * psstrmOut,
+ int ipassJust1, bool fPreJust, bool fPostJust, int cslotsSkipped, int nIndent);
+#endif // TRACING
+
+protected:
+ int CheckRuleValidity(int ruln);
+
+ virtual void RunRule(GrTableManager *, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput) = 0;
+
+ void CheckInputProgress(GrSlotStream* input, GrSlotStream* psstrmOutput,
+ int islotOrigInput);
+
+ void MapChunks(GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ int islotChunkI, int islotChunkO, int cslotReprocessed);
+
+ virtual void Unattach(GrSlotStream * psstrmIn, int islotIn, // GrPosPass overrides
+ GrSlotStream * psstrmOut, int islotOut, int islotLB)
+ {
+ }
+
+ friend class EngineState; // let it call the method below
+ virtual int MaxRuleContext() // GrBidiPass overrides
+ {
+ return m_nMaxRuleContext;
+ }
+
+protected:
+ // Instance variables:
+
+ int m_ipass; // index of pass
+
+ int m_fxdVersion;
+
+ // number of items required from previous pass; don't access directly, use the getter
+ // method, because GrBidiPass overrides to always use 1.
+ int m_nMaxRuleContext;
+
+ GrFSM * m_pfsm; // Finite State Machine to give next rule
+
+ int m_nMaxRuleLoop; // maximum number of rules to process before forcibly
+ // advancing input position
+
+ int m_nMaxBackup;
+
+ int m_crul; // number of rules
+
+ // rule sort keys, indicating precedence of rules; m_crul of these
+ data16 * m_prgchwRuleSortKeys;
+
+ // for each rule, the number of items in the context before the first modified item
+ // that the constraints need to be tested on
+ byte * m_prgcritRulePreModContext;
+
+ // offset for pass-level constraints; just 1 of these
+ data16 m_cbPassConstraint;
+ // offsets for constraint and action code; m_crul+1 of each of these (the last
+ // indicates the total byte count)
+ data16 * m_prgibConstraintStart;
+ data16 * m_prgibActionStart;
+
+ // blocks of constraint and action code
+ byte * m_prgbPConstraintBlock; // pass-level constraints
+ byte * m_prgbConstraintBlock; // rule constraints
+ byte * m_prgbActionBlock;
+
+ int m_cbConstraints; // needed for memory instrumentation only
+ int m_cbActions; // needed for memory instrumentation only
+
+ bool m_fHasDebugStrings;
+ data16 * m_prgibConstraintDebug; // m_crul+1 of these
+ data16 * m_prgibRuleDebug; // m_crul+1 of these
+
+ bool m_fCheckRules;
+ bool * m_prgfRuleOkay;
+
+ std::vector<int> m_vnStack; // for stack machine processing (more efficient than creating the
+ // vector each time)
+
+ // state of process for this pass
+ PassState * m_pzpst;
+
+public:
+#ifdef OLD_TEST_STUFF
+ // For test procedures:
+ StrAnsi m_staBehavior;
+
+ virtual void SetUpTestData();
+
+ // overridden on appropriate subclasses:
+ virtual void SetUpReverseNumbersTest() { Assert(false); }
+ virtual void SetUpBidiNumbersTest() { Assert(false); }
+
+ virtual void SetUpCrossLineContextTest() { Assert(false); }
+ virtual void SetUpReprocessTest() { Assert(false); }
+ virtual void SetUpLineEdgeContextTest(int ipass) { Assert(false); }
+ virtual void SetUpBidiAlgorithmTest() { Assert(false); }
+ virtual void SetUpPseudoGlyphsTest() { Assert(false); }
+ virtual void SetUpSimpleFSMTest() { Assert(false); }
+ virtual void SetUpRuleActionTest() { Assert(false); }
+ virtual void SetUpRuleAction2Test() { Assert(false); }
+ virtual void SetUpAssocTest() { Assert(false); }
+ virtual void SetUpAssoc2Test() { Assert(false); }
+ virtual void SetUpDefaultAssocTest() { Assert(false); }
+ virtual void SetUpFeatureTest() { Assert(false); }
+ virtual void SetUpLigatureTest() { Assert(false); }
+ virtual void SetUpLigature2Test() { Assert(false); }
+#endif // OLD_TEST_STUFF
+
+}; // end of class GrPass
+
+
+/*----------------------------------------------------------------------------------------------
+ The initial pass that generates glyph IDs from Unicode input.
+
+ Hungarian: pass
+----------------------------------------------------------------------------------------------*/
+class GrGlyphGenPass : public GrPass
+{
+ friend class FontMemoryUsage;
+
+public:
+ GrGlyphGenPass(int ipass) : GrPass(ipass)
+ {
+ }
+
+ virtual bool PreBidiPass()
+ {
+ return true;
+ }
+
+protected:
+ // Irrelevant when generating glyphs.
+ virtual void RunRule(GrTableManager *, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+ {
+ Assert(false);
+ }
+
+}; // end of class GrGlyphGenPass
+
+
+/*----------------------------------------------------------------------------------------------
+ A pass containing rules that set the break weight values.
+
+ Hungarian: pass
+----------------------------------------------------------------------------------------------*/
+class GrLineBreakPass : public GrPass
+{
+ friend class FontMemoryUsage;
+
+public:
+ GrLineBreakPass(int ipass) : GrPass(ipass)
+ {
+ }
+
+ virtual bool PreBidiPass()
+ {
+ return true;
+ }
+
+protected:
+ virtual void RunRule(GrTableManager *, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput);
+
+public:
+#ifdef OLD_TEST_STUFF
+ // For test procedures:
+ bool RunTestRules(GrTableManager *, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+ bool RunTestRules(GrTableManager *, int ruln, GrSlotStream * psstrmIn,
+ GrSlotStream * psstrmOut);
+
+ virtual void SetUpCrossLineContextTest();
+ bool RunCrossLineContextTest(GrTableManager*, GrSlotStream* psstrmIn,
+ GrSlotStream* psstrmOut);
+
+ virtual void SetUpReprocessTest();
+ bool RunReprocessTest(GrTableManager *, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut);
+
+ virtual void SetUpAssocTest();
+ virtual void SetUpLigatureTest();
+#endif // OLD_TEST_STUFF
+
+}; // end of class GrLineBreakPass
+
+
+/*----------------------------------------------------------------------------------------------
+ A pass containing substitution rules.
+
+ Hungarian: pass
+----------------------------------------------------------------------------------------------*/
+class GrSubPass : public GrPass
+{
+ friend class FontMemoryUsage;
+
+public:
+ GrSubPass(int ipass) : GrPass(ipass)
+ {
+ }
+
+ virtual bool PreBidiPass()
+ {
+ return true;
+ }
+
+protected:
+ virtual void RunRule(GrTableManager *, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput);
+
+ virtual void DoCleanUpSegMin(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, int islotInitReadPos, GrSlotStream * psstrmOut);
+
+public:
+#ifdef OLD_TEST_STUFF
+ // For test procedures:
+ bool RunTestRules(GrTableManager *, GrSlotStream * psstrmIn,
+ GrSlotStream * psstrmOut);
+ bool RunTestRules(GrTableManager *, int ruln, GrSlotStream * psstrmIn,
+ GrSlotStream * psstrmOut);
+
+ virtual void SetUpReverseNumbersTest();
+ bool RunReverseNumbersTest(GrTableManager*, GrSlotStream* psstrmIn,
+ GrSlotStream* psstrmOut);
+
+ virtual void SetUpBidiNumbersTest();
+ bool RunBidiNumbersTest(GrTableManager*, GrSlotStream* psstrmIn,
+ GrSlotStream* psstrmOut);
+
+ virtual void SetUpCrossLineContextTest();
+ bool RunCrossLineContextTest(GrTableManager*, GrSlotStream* psstrmIn,
+ GrSlotStream* psstrmOut);
+
+ virtual void SetUpReprocessTest();
+ bool RunReprocessTest(GrTableManager *, GrSlotStream * psstrmIn,
+ GrSlotStream * psstrmOut);
+
+ virtual void SetUpLineEdgeContextTest(int ipass);
+ bool RunLineEdgeContextTest(GrTableManager *, GrSlotStream * psstrmIn,
+ GrSlotStream * psstrmOut);
+
+ virtual void SetUpBidiAlgorithmTest();
+ bool RunBidiAlgorithmTest(GrTableManager *, GrSlotStream * psstrmIn,
+ GrSlotStream * psstrmOut);
+
+ virtual void SetUpPseudoGlyphsTest();
+ bool RunPseudoGlyphsTest(GrTableManager *, GrSlotStream * psstrmIn,
+ GrSlotStream * psstrmOut);
+
+ virtual void SetUpSimpleFSMTest();
+ bool RunSimpleFSMTest(GrTableManager *, int ruln, GrSlotStream * psstrmIn,
+ GrSlotStream * psstrmOut);
+ virtual void SetUpRuleActionTest();
+ virtual void SetUpRuleAction2Test();
+ virtual void SetUpAssocTest();
+ virtual void SetUpAssoc2Test();
+ virtual void SetUpDefaultAssocTest();
+ virtual void SetUpFeatureTest();
+ virtual void SetUpLigatureTest();
+ virtual void SetUpLigature2Test();
+#endif // OLD_TEST_STUFF
+
+}; // end of class GrSubPass
+
+
+/*----------------------------------------------------------------------------------------------
+ This class is the one the knows how to handle bidi reordering, including backtracking.
+
+ Hungarian: pass
+----------------------------------------------------------------------------------------------*/
+class GrBidiPass : public GrSubPass
+{
+ friend class FontMemoryUsage;
+
+public:
+ // Constructor:
+ GrBidiPass(int ipass)
+ : GrSubPass(ipass),
+ m_nTopDirection(0)
+ {
+ }
+
+ virtual void SetTopDirLevel(int n)
+ {
+ m_nTopDirection = n;
+ }
+
+ virtual bool PreBidiPass()
+ {
+ return false;
+ }
+
+ virtual void ExtendOutput(GrTableManager *,
+ GrSlotStream * psstrmI, GrSlotStream * psstrmO, int nslotToGet,
+ TrWsHandling twsh,
+ int * pnRet, int * pcslotGot, int * pislotFinalBreak);
+
+ virtual int Unwind(GrTableManager * ptman,
+ int islotChanged, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ bool fFirst);
+protected:
+ virtual int MaxRuleContext()
+ {
+ return 1;
+ }
+
+private:
+ //void OldReverse(int nCurrDirection,
+ // GrSlotStream * psstrmI, int islotI1, int islotI2,
+ // GrSlotStream * psstrmO, int islotO1, int islotO2);
+
+ int Reverse(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut,
+ std::vector<int> & vislotStarts, std::vector<int> & vislotStops);
+
+protected:
+ // Instance variables:
+ int m_nTopDirection; // 0 for LTR, 1 for RTL -- CURRENTLY NOT USED; need to
+ // initialize it when we set the writing system direction
+
+#ifdef OLD_TEST_STUFF
+public:
+ // For test procedures:
+ ////virtual void SetUpTestData();
+ virtual void SetUpBidiNumbersTest();
+ virtual void SetUpBidiAlgorithmTest();
+#endif // OLD_TEST_STUFF
+
+}; // end of class GrBidiPass
+
+
+/*----------------------------------------------------------------------------------------------
+ A pass containing positioning rules.
+
+ Hungarian: pass
+----------------------------------------------------------------------------------------------*/
+class GrPosPass : public GrPass
+{
+ friend class FontMemoryUsage;
+
+public:
+ GrPosPass(int ipass) : GrPass(ipass)
+ {
+ }
+
+ virtual bool IsPosPass()
+ {
+ return true;
+ }
+
+ virtual bool PreBidiPass()
+ {
+ return false;
+ }
+
+protected:
+ virtual void RunRule(GrTableManager *, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput);
+
+ virtual void Unattach(GrSlotStream * psstrmIn, int islotIn,
+ GrSlotStream * psstrmOut, int islotOut, int islotLB);
+
+public:
+#ifdef OLD_TEST_STUFF
+ // For test procedures:
+ bool RunTestRules(GrTableManager *, GrSlotStream * psstrmIn,
+ GrSlotStream * psstrmOut);
+ bool RunTestRules(GrTableManager *, int ruln, GrSlotStream * psstrmIn,
+ GrSlotStream * psstrmOut);
+#endif // OLD_TEST_STUFF
+
+}; // end of class GrPosPass
+
+} // namespace gr
+
+
+#endif // PASS_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/GrPassActionCode.cpp b/Build/source/libs/graphite/src/segment/GrPassActionCode.cpp
new file mode 100644
index 00000000000..83c58b27e48
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrPassActionCode.cpp
@@ -0,0 +1,1492 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrPassActionCode.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ A continution of the GrPass file, including functions to run the action commands.
+
+This comment could create a merge conflict. It can be removed.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local type definitions
+//:>********************************************************************************************
+
+typedef signed char Int8; // signed value
+typedef unsigned char Uint8; // unsigned value
+
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ The main function to run a block of action or constraint code and return a result.
+
+ @param ptman - table manager, for generating new slots; NULL when
+ running constraints
+ @param pbStart - address of the first command
+ @param fConstraints - true if we are running constraint tests;
+ false if we are running rule actions
+ @param psstrmIn - input stream
+ @param psstrmOut - output stream; when running constraints, used to access items
+ in the precontext
+ @param islot - slot being processed relative to the start of the rule;
+ used only for constraints; must be 0 for rule actions
+----------------------------------------------------------------------------------------------*/
+int GrPass::RunCommandCode(GrTableManager * ptman,
+ byte * pbStart, bool fConstraints,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islot)
+{
+ byte * pbNext = pbStart;
+
+// std::vector<int> vnStack;
+// vnStack.EnsureSpace(128); // make it nice and big
+ m_vnStack.clear();
+
+ gAssert(fConstraints || islot == 0);
+
+ // There are two states: fMustGet = true means we need to get a slot to work on from
+ // the input; fMustGet = false means we have a slot and we need to do a Next before
+ // we can get the next one.
+ bool fMustGet = !fConstraints;
+
+ bool fInserting = false; // set to true by an Insert command
+
+ int nRet = 0;
+
+ while (true)
+ {
+ ActionCommand op = ActionCommand(*pbNext++);
+ StackMachineFlag smf;
+ nRet = RunOneCommand(ptman, fConstraints, op,
+ &pbNext, &fMustGet, &fInserting,
+ psstrmIn, psstrmOut, islot,
+ m_vnStack, &smf);
+
+ if (smf == ksmfDone)
+ return nRet;
+
+ if (smf == ksmfUnderflow)
+ {
+ Warn("Underflow in Graphite stack machine");
+ gAssert(false);
+ FontException fexptn;
+ fexptn.version = -1;
+ fexptn.subVersion = -1;
+ fexptn.errorCode = kferrUnknown;
+ throw fexptn; // disastrous error in rendering; fall back to dumb rendering
+ }
+ }
+ return nRet; // not needed, but to avoid compiler warning
+}
+
+/*----------------------------------------------------------------------------------------------
+ Perform a single command. Specifically, read the arguments from the byte buffer and the
+ run the appropriate functions.
+
+ @param ptman - table manager, for generating new slots; or NULL
+ @param fConstraints - true if we are running constraints; false if we are running
+ rule actions
+ @param op - command operator
+ @param ppbArg - pointer to first argument
+ @param pfMustGet - state: getting input or processing it; when running constraints,
+ always false
+ @param pfInserting - true if current item is to be inserted, or was inserted
+ @param psstrmIn - input stream
+ @param psstrmOut - output stream
+ @param islot - the slot being processed relative to the beginning of the rule;
+ only relevant for constraint testing, must be 0 for rule actions
+ @param vnStack - the stack of values being manipulated
+ @param psmf - error code, done flag, or continue flag
+----------------------------------------------------------------------------------------------*/
+int GrPass::RunOneCommand(GrTableManager * ptman, bool fConstraints,
+ ActionCommand op, byte ** ppbArg, bool * pfMustGet, bool * pfInserting,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islot,
+ std::vector<int> & vnStack, StackMachineFlag * psmf)
+{
+ *psmf = ksmfContinue;
+
+ // General purpose variables:
+ int arg1, arg2, arg3, arg4;
+ int nSlotRef;
+ int nInputClass;
+ int nOutputClass;
+ int c;
+ int islotArg;
+ int nIndex;
+ int nGlyphAttr;
+ int nAttLevel;
+ int nFeat;
+ int nPState;
+ SlotAttrName slat;
+
+ int i;
+ std::vector<int> vnTmp;
+
+ byte * pbNext = *ppbArg;
+
+ int nRet = 0;
+
+ switch (op)
+ {
+ case kopNop:
+ break;
+
+ case kopPushByte:
+ arg1 = Int8(*pbNext++);
+ vnStack.push_back(arg1);
+ break;
+ case kopPushByteU:
+ arg1 = Uint8(*pbNext++);
+ vnStack.push_back(arg1);
+ break;
+ case kopPushShort:
+ arg1 = Int8(*pbNext++);
+ arg2 = Uint8(*pbNext++);
+ vnStack.push_back((arg1 << 8) + arg2);
+ break;
+ case kopPushShortU:
+ arg1 = Uint8(*pbNext++);
+ arg2 = Uint8(*pbNext++);
+ vnStack.push_back((arg1 << 8) + arg2);
+ break;
+ case kopPushLong:
+ arg1 = Int8(*pbNext++);
+ arg2 = Uint8(*pbNext++);
+ arg3 = Uint8(*pbNext++);
+ arg4 = Uint8(*pbNext++);
+ vnStack.push_back((arg1 << 24) + (arg2 << 16) + (arg3 << 8) + arg4);
+ break;
+
+ case kopNeg:
+ case kopTrunc8: case kopTrunc16:
+ case kopNot:
+ DoStackArithmetic1Arg(op, vnStack, psmf);
+ if (*psmf != ksmfContinue)
+ return 0;
+ break;
+
+ case kopAdd: case kopSub:
+ case kopMul: case kopDiv:
+ case kopMin: case kopMax:
+ case kopAnd: case kopOr:
+ case kopEqual: case kopNotEq:
+ case kopLess: case kopGtr:
+ case kopLessEq: case kopGtrEq:
+ DoStackArithmetic2Args(op, vnStack, psmf);
+ if (*psmf != ksmfContinue)
+ return 0;
+ break;
+
+ case kopCond:
+ DoConditional(vnStack, psmf);
+ if (*psmf != ksmfContinue)
+ return 0;
+ break;
+
+ case kopNext:
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(!*pfMustGet);
+ DoNext(ptman, 1, psstrmIn, psstrmOut);
+ *pfMustGet = true;
+ *pfInserting = false;
+ }
+ break;
+ case kopNextN:
+ c = Int8(*pbNext++);
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(false); // for now we don't allow anything other than moving one slot
+ gAssert(!*pfMustGet); // forward at a time
+ DoNext(ptman, c, psstrmIn, psstrmOut);
+ *pfMustGet = true;
+ }
+ break;
+ case kopPutGlyph8bitObs:
+ case kopPutGlyph:
+ if (op == kopPutGlyph8bitObs)
+ nOutputClass = Uint8(*pbNext++);
+ else
+ {
+ nOutputClass = (Uint8(*pbNext++) << 8);
+ nOutputClass += Uint8(*pbNext++);
+ }
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(*pfMustGet);
+ DoPutGlyph(ptman, *pfInserting, nOutputClass, psstrmIn, psstrmOut);
+ *pfMustGet = false;
+ }
+ break;
+ case kopPutCopy:
+ nSlotRef = Int8(*pbNext++);
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(*pfMustGet);
+ DoPutCopy(ptman, *pfInserting, nSlotRef, psstrmIn, psstrmOut);
+ *pfMustGet = false;
+ }
+ break;
+ case kopPutSubs8bitObs:
+ case kopPutSubs:
+ nSlotRef = Int8(*pbNext++);
+ if (op == kopPutSubs8bitObs)
+ {
+ nInputClass = Uint8(*pbNext++);
+ nOutputClass = Uint8(*pbNext++);
+ }
+ else
+ {
+ nInputClass = (Uint8(*pbNext++) << 8);
+ nInputClass += Uint8(*pbNext++);
+ nOutputClass = (Uint8(*pbNext++) << 8);
+ nOutputClass += Uint8(*pbNext++);
+ }
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(*pfMustGet);
+ DoPutSubs(ptman, *pfInserting, nSlotRef, nInputClass, nOutputClass,
+ psstrmIn, psstrmOut);
+ *pfMustGet = false;
+ }
+ break;
+ case kopCopyNext:
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(*pfMustGet);
+ gAssert(!*pfInserting); // 0 means copy this slot
+ DoPutCopy(ptman, *pfInserting, 0, psstrmIn, psstrmOut);
+ DoNext(ptman, 1, psstrmIn, psstrmOut);
+ // *pfMustGet still = true
+ }
+ break;
+ case kopInsert:
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(*pfMustGet);
+ *pfInserting = true;
+ // *pfMustGet still = true
+
+ if (ptman->LoggingTransduction())
+ m_pzpst->RecordInsertionAt(psstrmOut->WritePos());
+ }
+ break;
+ case kopDelete:
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(*pfMustGet);
+ DoDelete(ptman, psstrmIn, psstrmOut);
+ *pfMustGet = false;
+ }
+ break;
+ case kopAssoc:
+ c = Uint8(*pbNext++);
+ // std::vector<int> vnTmp;
+ for (i = 0; i < c; i++)
+ vnTmp.push_back(Int8(*pbNext++));
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(!*pfMustGet);
+ DoAssoc(c, vnTmp, *pfInserting, psstrmIn, psstrmOut);
+ }
+ break;
+ case kopCntxtItem:
+ islotArg = Int8(*pbNext++);
+ c = Uint8(*pbNext++);
+ if (fConstraints)
+ {
+ // Old approach:
+ // If this is NOT the relevant item, push TRUE, which causes the subsequent tests
+ // (which are eventually ORed with it) to become irrelevant.
+ //vnStack.Push((int)(islotArg != islot));
+
+ // If this is not the relevant item, skip the specified number of bytes.
+ if (islotArg != islot)
+ {
+ pbNext += c;
+ vnStack.push_back(1);
+ }
+ }
+ else
+ {
+ gAssert(false);
+ }
+ break;
+
+ case kopAttrSet:
+ case kopAttrAdd:
+ case kopAttrSub:
+ case kopAttrSetSlot:
+ slat = SlotAttrName(Uint8(*pbNext++)); // slot attribute ID
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(!*pfMustGet);
+ DoSetAttr(ptman, op, *pfInserting, slat, -1, vnStack, psstrmIn, psstrmOut);
+ if (*psmf != ksmfContinue)
+ return 0;
+ }
+ break;
+ case kopIAttrSet:
+ case kopIAttrAdd:
+ case kopIAttrSub:
+ case kopIAttrSetSlot:
+ slat = SlotAttrName(Uint8(*pbNext++)); // slot attribute ID
+ nIndex = Uint8(*pbNext++); // index; eg, global ID for component
+ if (fConstraints)
+ {
+ gAssert(false);
+ }
+ else
+ {
+ gAssert(!*pfMustGet);
+ DoSetAttr(ptman, op, *pfInserting, slat, nIndex, vnStack,
+ psstrmIn, psstrmOut);
+ if (*psmf != ksmfContinue)
+ return 0;
+ }
+ break;
+
+ case kopPushSlotAttr:
+ slat = SlotAttrName(Uint8(*pbNext++));
+ nSlotRef = Int8(*pbNext++);
+ if (fConstraints)
+ nSlotRef += islot + 1; // +1 to peek ahead to a slot we haven't "got" yet
+ DoPushSlotAttr(ptman, nSlotRef, *pfInserting, slat, -1, vnStack, psstrmIn, psstrmOut);
+ if (*psmf != ksmfContinue)
+ return 0;
+ break;
+ case kopPushISlotAttr:
+ slat = SlotAttrName(Uint8(*pbNext++));
+ nSlotRef = Int8(*pbNext++);
+ nIndex = Uint8(*pbNext++);
+ if (fConstraints)
+ nSlotRef += islot + 1; // +1 to peek ahead to a slot we haven't "got" yet
+ DoPushSlotAttr(ptman, nSlotRef, *pfInserting, slat, nIndex, vnStack, psstrmIn, psstrmOut);
+ if (*psmf != ksmfContinue)
+ return 0;
+ break;
+
+ case kopPushGlyphAttrObs:
+ case kopPushAttToGAttrObs:
+ case kopPushGlyphAttr:
+ case kopPushAttToGlyphAttr:
+ if (op == kopPushGlyphAttrObs || op == kopPushAttToGAttrObs)
+ nGlyphAttr = Uint8(*pbNext++);
+ else {
+ nGlyphAttr = (Uint8(*pbNext++) << 8);
+ nGlyphAttr += Uint8(*pbNext++);
+ }
+ nSlotRef = Int8(*pbNext++);
+ if (fConstraints)
+ nSlotRef += islot + 1; // +1 to peek ahead to a slot we haven't "got" yet
+ if (op == kopPushAttToGlyphAttr || op == kopPushAttToGAttrObs)
+ DoPushAttToGlyphAttr(ptman, nSlotRef, *pfInserting, nGlyphAttr,
+ vnStack, psstrmIn, psstrmOut);
+ else
+ DoPushGlyphAttr(ptman, nSlotRef, *pfInserting, nGlyphAttr, vnStack,
+ psstrmIn, psstrmOut);
+ if (*psmf != ksmfContinue)
+ return 0;
+ break;
+ case kopPushGlyphMetric:
+ case kopPushAttToGlyphMetric:
+ nGlyphAttr = Uint8(*pbNext++);
+ nSlotRef = Int8(*pbNext++);
+ nAttLevel = Int8(*pbNext++);
+ if (fConstraints)
+ nSlotRef += islot + 1; // +1 to peek ahead to a slot we haven't "got" yet
+ if (op == kopPushAttToGlyphMetric)
+ DoPushAttToGlyphMetric(ptman, nSlotRef, *pfInserting, nGlyphAttr, nAttLevel,
+ vnStack, psstrmIn, psstrmOut);
+ else
+ DoPushGlyphMetric(ptman, nSlotRef, *pfInserting, nGlyphAttr, nAttLevel,
+ vnStack, psstrmIn, psstrmOut);
+ if (*psmf != ksmfContinue)
+ return 0;
+ break;
+ case kopPushFeat:
+ nFeat = Uint8(*pbNext++);
+ nSlotRef = Int8(*pbNext++);
+ if (fConstraints)
+ nSlotRef += islot + 1; // +1 to peek ahead to a slot we haven't "got" yet
+// else
+// nSlotRef = 0;
+ DoPushFeatValue(ptman, nSlotRef, *pfInserting, nFeat, vnStack, psstrmIn, psstrmOut);
+ if (*psmf != ksmfContinue)
+ return 0;
+ break;
+ case kopPushProcState:
+ nPState = Uint8(*pbNext++);
+ gAssert(fConstraints);
+ DoPushProcState(ptman, nPState, vnStack);
+ break;
+ case kopPushVersion:
+ vnStack.push_back(kRuleVersion);
+ break;
+ case kopPopRet:
+ if ((*psmf = CheckStack(vnStack, 1)) != ksmfContinue)
+ return 0;
+ nRet = vnStack.back();
+ vnStack.pop_back();
+ if (vnStack.size() != 0)
+ {
+ gAssert(false);
+ *psmf = ksmfStackNotEmptied;
+ }
+ else
+ *psmf = ksmfDone;
+ break;
+ case kopRetZero:
+ nRet = 0;
+ if (vnStack.size() != 0)
+ {
+ gAssert(false);
+ *psmf = ksmfStackNotEmptied;
+ }
+ else
+ *psmf = ksmfDone;
+ break;
+ case kopRetTrue:
+ nRet = 1;
+ if (vnStack.size() != 0)
+ {
+ gAssert(false);
+ *psmf = ksmfStackNotEmptied;
+ }
+ else
+ *psmf = ksmfDone;
+ break;
+
+ default:
+ gAssert(false);
+ }
+
+ *ppbArg = pbNext;
+ return nRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Perform arithmetic functions that take two arguments.
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoStackArithmetic2Args(ActionCommand op, std::vector<int> & vnStack,
+ StackMachineFlag * psmf)
+{
+ if ((*psmf = CheckStack(vnStack, 2)) != ksmfContinue)
+ return;
+
+ int nArg2 = vnStack.back();
+ vnStack.pop_back();
+ int nArg1 = vnStack.back();
+ vnStack.pop_back();
+
+ int nResult;
+
+ switch (op)
+ {
+ case kopAdd: nResult = nArg1 + nArg2; break;
+ case kopSub: nResult = nArg1 - nArg2; break;
+ case kopMul: nResult = nArg1 * nArg2; break;
+ case kopDiv: nResult = nArg1 / nArg2; break;
+ case kopMin: nResult = min(nArg1, nArg2); break;
+ case kopMax: nResult = max(nArg1, nArg2); break;
+ case kopAnd: nResult = (nArg1 != 0 && nArg2 != 0)? 1: 0; break;
+ case kopOr: nResult = (nArg1 != 0 || nArg2 != 0)? 1: 0; break;
+ case kopEqual: nResult = (nArg1 == nArg2)? 1: 0; break;
+ case kopNotEq: nResult = (nArg1 != nArg2)? 1: 0; break;
+ case kopLess: nResult = (nArg1 < nArg2)? 1: 0; break;
+ case kopLessEq: nResult = (nArg1 <= nArg2)? 1: 0; break;
+ case kopGtr: nResult = (nArg1 > nArg2)? 1: 0; break;
+ case kopGtrEq: nResult = (nArg1 >= nArg2)? 1: 0; break;
+ default:
+ Assert(false);
+ }
+
+ vnStack.push_back(nResult);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Perform arithmetic functions that take one argument.
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoStackArithmetic1Arg(ActionCommand op, std::vector<int> & vnStack,
+ StackMachineFlag * psmf)
+{
+ if ((*psmf = CheckStack(vnStack, 1)) != ksmfContinue)
+ return;
+
+ int nArg = vnStack.back();
+ vnStack.pop_back();
+ int nResult;
+
+ switch (op)
+ {
+ case kopNeg: nResult = nArg * -1; break;
+ case kopTrunc8: nResult = nArg & 0xFF; break;
+ case kopTrunc16: nResult = nArg & 0xFFFF; break;
+ case kopNot: nResult = (nArg == 0)? 1: 0; break;
+ default:
+ Assert(false);
+ }
+
+ vnStack.push_back(nResult);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Perform the conditional statement.
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoConditional(std::vector<int> & vnStack, StackMachineFlag * psmf)
+{
+ if ((*psmf = CheckStack(vnStack, 3)) != ksmfContinue)
+ return;
+
+ int nArg3 = vnStack.back();
+ vnStack.pop_back();
+ int nArg2 = vnStack.back();
+ vnStack.pop_back();
+ int nArg1 = vnStack.back();
+ vnStack.pop_back();
+
+ if (nArg1 == 0)
+ vnStack.push_back(nArg3);
+ else
+ vnStack.push_back(nArg2);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Check to make sure the stack has the appropriate number of items on it; if not,
+ return a stack error flag.
+----------------------------------------------------------------------------------------------*/
+GrPass::StackMachineFlag GrPass::CheckStack(std::vector<int> & vnStack, int cn)
+{
+ if (signed(vnStack.size()) < cn)
+ return ksmfUnderflow;
+ else
+ return ksmfContinue;
+}
+
+/*----------------------------------------------------------------------------------------------
+ We are finished processing a slot; go on to the next slot, or possibly go backwards.
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoNext(GrTableManager * ptman,
+ int cslot, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ gAssert(cslot == 1); // for now anyway
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the next glyph to be the given class. There should only be one member of the class,
+ but if there happens to be more than one, just use the first member.
+ All the slot attributes remain unchanged from the current input slot; associations are
+ neutralized.
+
+ @param ptman - table manager, for generating new slots
+ @param fInserting - true if this slot is being inserted, not copied
+ @param nReplacementClass - class from which to take replacement glyph (corresponding to
+ selector slot's glyph's index in selector class)
+ @param psstrmIn / Out - input/output streams
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPutGlyph(GrTableManager * ptman, bool fInserting, int nReplacementClass,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ EngineState * pengst = ptman->State();
+
+ // If we are exactly at the segment boundary, pass the information on to the output stream.
+ // Note that inserted items always go outside the segment, if they are at the boundary
+ // (you DON'T want them between the segment boundary and the LB slot!).
+ bool fSetSegMin = psstrmIn->AtSegMin() && !fInserting;
+ bool fSetSegLim = psstrmIn->AtSegLim();
+
+ // Slot to copy features and text properties from:
+ GrSlotState * pslotNextInput;
+ if (psstrmIn->AtEndOfContext())
+ {
+ gAssert(fInserting);
+ pslotNextInput = psstrmIn->RuleInputSlot(0, psstrmOut);
+ }
+ else
+ pslotNextInput = (fInserting)? psstrmIn->Peek(): psstrmIn->NextGet();
+
+ gid16 nGlyphReplacement = ptman->GetClassGlyphIDAt(nReplacementClass, 0);
+
+ GrSlotState * pslotNew;
+ if (fInserting)
+ {
+ pengst->NewSlot(nGlyphReplacement, pslotNextInput, m_ipass, &pslotNew);
+ // leave associations empty; eventually they will be "neutralized"
+ }
+ else
+ {
+ pengst->NewSlotCopy(pslotNextInput, m_ipass, &pslotNew);
+ pslotNew->SetGlyphID(nGlyphReplacement);
+ ptman->SetSlotAttrsFromGlyphAttrs(pslotNew);
+ }
+
+ if (fSetSegMin)
+ psstrmOut->SetSegMinToWritePos(false);
+ if (fSetSegLim)
+ psstrmOut->SetSegLimToWritePos(false);
+ psstrmOut->NextPut(pslotNew);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy a glyph from the given slot in the input to the output. All the associations and slot
+ attributes are copied from the specified slot as well. Consume a slot from the input
+ (which may or may not be the slot we're copying).
+
+ @param ptman - table manager, for generating new slots
+ @param fInserting - true if this slot is being inserted, not copied
+ @param cslotCopyFrom - slot to copy from
+ @param psstrmIn / Out - input/output streams
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPutCopy(GrTableManager * ptman, bool fInserting, int cslotCopyFrom,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ EngineState * pengst = ptman->State();
+
+ // If we are exactly at the segment boundary, pass the information on to the output stream.
+ // Note that inserted items always go outside the segment, if they are at the boundary.
+ bool fSetSegMin = psstrmIn->AtSegMin() && !fInserting;
+ bool fSetSegLim = psstrmIn->AtSegLim();
+
+ if (!fInserting)
+ {
+ gAssert(!psstrmIn->AtEndOfContext());
+ // Absorb next slot
+ psstrmIn->NextGet();
+ }
+
+ GrSlotState * pslotCopyFrom = psstrmIn->RuleInputSlot(cslotCopyFrom, psstrmOut);
+
+ GrSlotState * pslotNew;
+ pengst->NewSlotCopy(pslotCopyFrom, m_ipass, &pslotNew);
+
+ if (fSetSegMin)
+ psstrmOut->SetSegMinToWritePos(false);
+ if (fSetSegLim)
+ psstrmOut->SetSegLimToWritePos(false);
+ psstrmOut->NextPut(pslotNew);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy the current slot from the input to the output, substituting the corresponding glyph
+ in the output class. All the associations and slot attributes remain unchanged from the
+ current input slot.
+
+ @param ptman - table manager, for generating new slots
+ @param fInserting - true if this slot is being inserted, not copied
+ @param cslotSel - selector slot, relative to current slot
+ @param nSelectorClass - class of selector slot
+ @param nReplacementClass - class from which to take replacement glyph (corresponding to
+ selector slot's glyph's index in selector class)
+ @param psstrmIn / Out - input/output streams
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPutSubs(GrTableManager * ptman, bool fInserting,
+ int cslotSel, int nSelClass, int nReplacementClass,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ bool fAtSegMin, fAtSegLim;
+ GrSlotState * pslotNextInput;
+ DoPutSubsInit(psstrmIn, psstrmOut, fInserting, &pslotNextInput, &fAtSegMin, &fAtSegLim);
+
+ GrSlotState * pslotInSelector = psstrmIn->RuleInputSlot(cslotSel, psstrmOut);
+
+ gid16 gidSelector = pslotInSelector->GlyphID();
+ int nSelIndex = ptman->GetIndexInGlyphClass(nSelClass, gidSelector);
+ gAssert(nSelIndex != -1);
+ gid16 gidReplacement = (nSelIndex == -1)?
+ gidSelector:
+ ptman->GetClassGlyphIDAt(nReplacementClass, nSelIndex);
+
+ DoPutSubsAux(ptman, fInserting, gidReplacement, psstrmIn, psstrmOut, pslotNextInput,
+ fAtSegMin, fAtSegLim);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy the current slot from the input to the output, substituting the corresponding glyph
+ in the output class based on 2 input classes. All the associations and slot attributes
+ remain unchanged from the current input slot.
+
+ @param ptman - table manager, for generating new slots
+ @param fInserting - true if this slot is being inserted, not copied
+ @param cslotSel - selector slot, relative to current slot
+ @param nSelectorClass - class of selector slot
+ @param nReplacementClass - class from which to take replacement glyph (corresponding to
+ selector slot's glyph's index in selector class)
+ @param psstrmIn / Out - input/output streams
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPutSubs2(GrTableManager * ptman, bool fInserting,
+ int cslotSel1, int nSelClass1, int cslotSel2, int nSelClass2, int nReplacementClass,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ bool fAtSegMin, fAtSegLim;
+ GrSlotState * pslotNextInput;
+ DoPutSubsInit(psstrmIn, psstrmOut, fInserting, &pslotNextInput, &fAtSegMin, &fAtSegLim);
+
+ GrSlotState * pslotInSelector1 = psstrmIn->RuleInputSlot(cslotSel1, psstrmOut);
+ gid16 gidSelector1 = pslotInSelector1->GlyphID();
+ int nSelIndex1 = ptman->GetIndexInGlyphClass(nSelClass1, gidSelector1);
+ gAssert(nSelIndex1 != -1);
+ //size_t cClassLen1 = ptman->NumberOfGlyphsInClass(nSelClass1);
+
+ GrSlotState * pslotInSelector2 = psstrmIn->RuleInputSlot(cslotSel2, psstrmOut);
+ gid16 gidSelector2 = pslotInSelector2->GlyphID();
+ int nSelIndex2 = ptman->GetIndexInGlyphClass(nSelClass2, gidSelector2);
+ gAssert(nSelIndex2 != -1);
+ size_t cClassLen2 = ptman->NumberOfGlyphsInClass(nSelClass2);
+
+ int nSelIndex = (nSelIndex1 == -1 || nSelIndex2 == -1) ?
+ -1 :
+ (nSelIndex1 * static_cast<int>(cClassLen2)) + nSelIndex2;
+
+ gid16 gidReplacement = (nSelIndex == -1)?
+ gidSelector1:
+ ptman->GetClassGlyphIDAt(nReplacementClass, nSelIndex);
+
+ DoPutSubsAux(ptman, fInserting, gidReplacement, psstrmIn, psstrmOut, pslotNextInput,
+ fAtSegMin, fAtSegLim);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy the current slot from the input to the output, substituting the corresponding glyph
+ in the output class based on 2 input classes. All the associations and slot attributes
+ remain unchanged from the current input slot.
+
+ @param ptman - table manager, for generating new slots
+ @param fInserting - true if this slot is being inserted, not copied
+ @param cslotSel - selector slot, relative to current slot
+ @param nSelectorClass - class of selector slot
+ @param nReplacementClass - class from which to take replacement glyph (corresponding to
+ selector slot's glyph's index in selector class)
+ @param psstrmIn / Out - input/output streams
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPutSubs3(GrTableManager * ptman, bool fInserting,
+ int cslotSel1, int nSelClass1, int cslotSel2, int nSelClass2, int cslotSel3, int nSelClass3,
+ int nReplacementClass,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ bool fAtSegMin, fAtSegLim;
+ GrSlotState * pslotNextInput;
+ DoPutSubsInit(psstrmIn, psstrmOut, fInserting, &pslotNextInput, &fAtSegMin, &fAtSegLim);
+
+ GrSlotState * pslotInSelector1 = psstrmIn->RuleInputSlot(cslotSel1, psstrmOut);
+ gid16 gidSelector1 = pslotInSelector1->GlyphID();
+ int nSelIndex1 = ptman->GetIndexInGlyphClass(nSelClass1, gidSelector1);
+ gAssert(nSelIndex1 != -1);
+ //size_t cClassLen1 = ptman->NumberOfGlyphsInClass(nSelClass1);
+
+ GrSlotState * pslotInSelector2 = psstrmIn->RuleInputSlot(cslotSel2, psstrmOut);
+ gid16 gidSelector2 = pslotInSelector2->GlyphID();
+ int nSelIndex2 = ptman->GetIndexInGlyphClass(nSelClass2, gidSelector2);
+ gAssert(nSelIndex2 != -1);
+ size_t cClassLen2 = ptman->NumberOfGlyphsInClass(nSelClass2);
+
+// GrSlotState * pslotInSelector3 = psstrmIn->RuleInputSlot(cslotSel3, psstrmOut);
+// gid16 gidSelector3 = pslotInSelector3->GlyphID();
+ int nSelIndex3 = ptman->GetIndexInGlyphClass(nSelClass3, gidSelector2);
+ gAssert(nSelIndex3 != -1);
+ size_t cClassLen3 = ptman->NumberOfGlyphsInClass(nSelClass3);
+
+ int nSelIndex = (nSelIndex1 == -1 || nSelIndex2 == -1 || nSelIndex3 == -1) ?
+ -1 :
+ (((nSelIndex1 * static_cast<int>(cClassLen2)) + nSelIndex2) * static_cast<int>(cClassLen3)) + nSelIndex3;
+
+ gid16 gidReplacement = (nSelIndex == -1)?
+ gidSelector1:
+ ptman->GetClassGlyphIDAt(nReplacementClass, nSelIndex);
+
+ DoPutSubsAux(ptman, fInserting, gidReplacement, psstrmIn, psstrmOut, pslotNextInput,
+ fAtSegMin, fAtSegLim);
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Initial common part of all the DoPutSubs... methods.
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPutSubsInit(GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, bool fInserting,
+ GrSlotState ** ppslotNextInput, bool * pfAtSegMin, bool * pfAtSegLim)
+{
+ // Do this before reading from stream.
+ *pfAtSegMin = psstrmIn->AtSegMin();
+ *pfAtSegLim = psstrmIn->AtSegLim();
+
+ // Slot to copy features and text properties from:
+ if (psstrmIn->AtEndOfContext())
+ {
+ gAssert(fInserting);
+ *ppslotNextInput = psstrmIn->RuleInputSlot(0, psstrmOut);
+ }
+ else
+ *ppslotNextInput = (fInserting)? psstrmIn->Peek(): psstrmIn->NextGet();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Common part of all the DoPutSubs... methods.
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPutSubsAux(GrTableManager * ptman, bool fInserting, gid16 nGlyphReplacement,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, GrSlotState * pslotNextInput,
+ bool fAtSegMin, bool fAtSegLim)
+{
+ EngineState * pengst = ptman->State();
+
+ // If we are exactly at the segment boundary, pass the information on to the output stream.
+ // Note that inserted items always go outside the segment, if they are at the boundary.
+ bool fSetSegMin = fAtSegMin && !fInserting;
+ bool fSetSegLim = fAtSegLim;
+
+ GrSlotState * pslotNew;
+ if (fInserting)
+ {
+ pengst->NewSlot(nGlyphReplacement, pslotNextInput, m_ipass, &pslotNew);
+ // leave associations empty; eventually they will be "neutralized"
+ }
+ else
+ {
+ pengst->NewSlotCopy(pslotNextInput, m_ipass, &pslotNew);
+ pslotNew->SetGlyphID(nGlyphReplacement);
+ ptman->SetSlotAttrsFromGlyphAttrs(pslotNew);
+ }
+
+ if (fSetSegMin)
+ psstrmOut->SetSegMinToWritePos(false);
+ if (fSetSegLim)
+ psstrmOut->SetSegLimToWritePos(false);
+ psstrmOut->NextPut(pslotNew);
+}
+
+/*----------------------------------------------------------------------------------------------
+ A slot has just been inserted. Clear all the associations; eventually (unless we go on
+ to set the associations explicitly) we will set its before-assoc to the slot after it
+ and its after-assoc to the slot before it. This makes it basically unselectable.
+ OBSOLETE - handled by slot initialization code
+----------------------------------------------------------------------------------------------*/
+void GrPass::SetNeutralAssocs(GrSlotState * pslotNew, GrSlotStream * psstrmIn)
+{
+ pslotNew->ClearAssocs();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Delete the next slot in the input.
+
+ @param psstrmIn - input stream
+ @param psstrmOut - output stream
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoDelete(GrTableManager * ptman, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ if (psstrmIn->AtSegMin())
+ psstrmOut->SetSegMinToWritePos();
+ if (psstrmIn->AtSegLim())
+ psstrmOut->SetSegLimToWritePos();
+
+ GrSlotState * pslot = psstrmIn->NextGet();
+ pslot->MarkDeleted();
+
+ if (ptman->LoggingTransduction())
+ m_pzpst->RecordDeletionBefore(psstrmOut->WritePos());
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the associations for the current slot. Any previous associations will be overwritten.
+
+ @param cn - number of associations
+ @param vnAssoc - list of associations
+ @param fInserting - whether current slot was inserted
+ @param psstrmIn / Out - input/output streams
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoAssoc(int cnAssocs, std::vector<int> & vnAssocs, bool fInserting,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ gAssert((unsigned)cnAssocs == vnAssocs.size());
+
+ // Sort the list of associations. It's okay to use a simple bubble sort
+ // since we expect the list to be very short. Ideally we should remove duplicates
+ // too but I don't think duplicates actually hurt anything.
+ for (int i1 = 0; i1 < cnAssocs - 1; i1++)
+ {
+ for (int i2 = i1 + 1; i2 < cnAssocs; i2++)
+ {
+ if (vnAssocs[i2] < vnAssocs[i1])
+ {
+ int nTmp = vnAssocs[i2];
+ vnAssocs[i2] = vnAssocs[i1];
+ vnAssocs[i1] = nTmp;
+ }
+ }
+ }
+
+ std::vector<GrSlotState *> vpslotAssocs;
+ vpslotAssocs.resize(cnAssocs);
+ for (int i = 0; i < cnAssocs; i++)
+ vpslotAssocs[i] = psstrmIn->RuleInputSlot(vnAssocs[i], psstrmOut);
+
+ GrSlotState * pslot = psstrmOut->RuleOutputSlot();
+ pslot->Associate(vpslotAssocs);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set a slot attribute for the current slot; the value is on the stack.
+
+ @param op - command
+ @param fInserting - whether current slot was inserted
+ @param slat - slot attribute to set
+ @param slati - slot attribute index, or -1 for non-indexed attribute
+ @param vnStack - stack to read value from
+ @param psstrmIn / Out - input/output streams
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoSetAttr(GrTableManager * ptman, ActionCommand op, bool fInserting,
+ SlotAttrName slat, int slati, std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ int nVal = vnStack.back();
+ vnStack.pop_back();
+
+ if (slat == kslatUserDefnV1)
+ slat = kslatUserDefn;
+
+ if (slati != -1 && slat != kslatCompRef && slat != kslatUserDefn)
+ {
+ // Invalid slot attribute index.
+ gAssert(false);
+ slati = -1;
+ }
+
+ if (slati == -1 && (slat == kslatCompRef || slat == kslatUserDefn))
+ {
+ // Missing slot attribute index.
+ gAssert(false);
+ slati = 0;
+ }
+
+ if (slat == kslatPosX || slat == kslatPosY)
+ {
+ // Doesn't make sense to set the pos attribute.
+ gAssert(false);
+ return;
+ }
+
+ GrSlotState * pslotIn = psstrmIn->RuleInputSlot(0, psstrmOut);
+
+ GrSlotState * pslotComp;
+
+ int nOldVal;
+
+ if (op == kopAttrAdd || op == kopAttrSub || op == kopIAttrAdd || op == kopIAttrSub)
+ {
+ // Incrementing or decrementing.
+
+ gAssert(!fInserting);
+
+ switch (slat)
+ {
+ case kslatAdvX: nOldVal = pslotIn->AdvanceX(ptman); break;
+ case kslatAdvY: nOldVal = pslotIn->AdvanceY(ptman); break;
+ case kslatShiftX: nOldVal = pslotIn->ShiftX(); break;
+ case kslatShiftY: nOldVal = pslotIn->ShiftY(); break;
+
+ case kslatAttAtX: nOldVal = pslotIn->AttachAtX(ptman, psstrmIn); break;
+ case kslatAttAtY: nOldVal = pslotIn->AttachAtY(); break;
+ case kslatAttAtXoff: nOldVal = pslotIn->AttachAtXOffset(); break;
+ case kslatAttAtYoff: nOldVal = pslotIn->AttachAtYOffset(); break;
+
+ case kslatAttWithX: nOldVal = pslotIn->AttachWithX(ptman, psstrmIn); break;
+ case kslatAttWithY: nOldVal = pslotIn->AttachWithY(); break;
+ case kslatAttWithXoff: nOldVal = pslotIn->AttachWithXOffset(); break;
+ case kslatAttWithYoff: nOldVal = pslotIn->AttachWithYOffset(); break;
+
+ case kslatUserDefn: nOldVal = pslotIn->UserDefn(slati); break;
+
+ case kslatMeasureSol: nOldVal = pslotIn->MeasureSol(); break;
+ case kslatMeasureEol: nOldVal = pslotIn->MeasureEol(); break;
+
+ case kslatJStretch: nOldVal = pslotIn->JStretch(); break;
+ case kslatJShrink: nOldVal = pslotIn->JShrink(); break;
+ case kslatJStep: nOldVal = pslotIn->JStep(); break;
+ case kslatJWeight: nOldVal = pslotIn->JWeight(); break;
+ case kslatJWidth: nOldVal = pslotIn->JWidth(); break;
+
+ // These are kind of odd, but maybe.
+ case kslatAttLevel: nOldVal = pslotIn->AttachLevel(); break;
+ case kslatBreak: nOldVal = pslotIn->BreakWeight(); break;
+ case kslatDir: nOldVal = pslotIn->Directionality(); break;
+
+ default:
+ // Kind of attribute that it makes no sense to increment.
+ gAssert(false);
+ return;
+ }
+
+ if (op == kopAttrAdd || op == kopIAttrAdd)
+ nVal = nOldVal + nVal;
+ else
+ {
+ gAssert(op == kopAttrSub || op == kopIAttrSub);
+ nVal = nOldVal - nVal;
+ }
+ }
+
+ GrSlotState * pslotOut = psstrmOut->RuleOutputSlot();
+
+ if (pslotOut->IsLineBreak(ptman->LBGlyphID()))
+ {
+ switch (slat)
+ {
+ case kslatAdvX:
+ case kslatAdvY:
+ case kslatShiftX:
+ case kslatShiftY:
+
+ case kslatAttTo:
+ case kslatAttLevel:
+ case kslatAttAtX:
+ case kslatAttAtY:
+ case kslatAttAtGpt:
+ case kslatAttAtXoff:
+ case kslatAttAtYoff:
+ case kslatAttWithX:
+ case kslatAttWithY:
+ case kslatAttWithGpt:
+ case kslatAttWithXoff:
+ case kslatAttWithYoff:
+
+ case kslatMeasureSol:
+ case kslatMeasureEol:
+
+ case kslatJStretch:
+ case kslatJShrink:
+ case kslatJStep:
+ case kslatJWeight:
+ case kslatJWidth:
+ slat = kslatNoEffect;
+ break;
+ default:
+ ; // okay, do nothing
+ }
+ }
+
+ nVal = GrGlyphSubTable::ConvertValueForVersion(nVal, slat, -1, m_fxdVersion);
+
+ switch (slat)
+ {
+ case kslatAdvX: pslotOut->SetAdvanceX(nVal); break;
+ case kslatAdvY: pslotOut->SetAdvanceY(nVal); break;
+ case kslatShiftX: pslotOut->SetShiftX(nVal); break;
+ case kslatShiftY: pslotOut->SetShiftY(nVal); break;
+
+ case kslatAttTo: pslotOut->SetAttachTo(nVal); break;
+ case kslatAttLevel: pslotOut->SetAttachLevel(nVal); break;
+ case kslatAttAtX: pslotOut->SetAttachAtX(nVal); break;
+ case kslatAttAtY: pslotOut->SetAttachAtY(nVal); break;
+ case kslatAttAtGpt: pslotOut->SetAttachAtGpoint(nVal); break;
+ case kslatAttAtXoff: pslotOut->SetAttachAtXOffset(nVal); break;
+ case kslatAttAtYoff: pslotOut->SetAttachAtYOffset(nVal); break;
+ case kslatAttWithX: pslotOut->SetAttachWithX(nVal); break;
+ case kslatAttWithY: pslotOut->SetAttachWithY(nVal); break;
+ case kslatAttWithGpt: pslotOut->SetAttachWithGpoint(nVal); break;
+ case kslatAttWithXoff: pslotOut->SetAttachWithXOffset(nVal); break;
+ case kslatAttWithYoff: pslotOut->SetAttachWithYOffset(nVal); break;
+
+ case kslatUserDefn: pslotOut->SetUserDefn(slati, nVal); break;
+
+ case kslatCompRef:
+ gAssert(nVal - 1 >= psstrmIn->RuleStartReadPos() - psstrmIn->ReadPosForNextGet());
+ pslotComp = psstrmIn->RuleInputSlot(nVal, psstrmOut);
+ pslotOut->SetCompRefSlot(ptman, slati, pslotComp);
+ break;
+
+ case kslatMeasureSol: pslotOut->SetMeasureSol(nVal); break;
+ case kslatMeasureEol: pslotOut->SetMeasureEol(nVal); break;
+
+ case kslatJStretch: pslotOut->SetJStretch(nVal); break;
+ case kslatJShrink: pslotOut->SetJShrink(nVal); break;
+ case kslatJStep: pslotOut->SetJStep(nVal); break;
+ case kslatJWeight: pslotOut->SetJWeight(nVal); break;
+ case kslatJWidth: pslotOut->SetJWidth(nVal); break;
+
+ case kslatBreak: pslotOut->SetBreakWeight(nVal); break;
+ case kslatDir: pslotOut->SetDirectionality(DirCode(nVal)); break;
+ case kslatInsert: pslotOut->SetInsertBefore(bool(nVal)); break;
+
+ case kslatNoEffect:
+ // Do nothing.
+ break;
+
+ default:
+ // Kind of attribute that it makes no sense to set.
+ gAssert(false);
+ return;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Push value of a slot attribute onto the stack.
+
+ @param nSlotRef - slot whose attribute we are interested in
+ @param fInserting - whether current slot was inserted
+ @param slat - slot attribute to get
+ @param slati - slot attribute index, or -1 for non-indexed attribute
+ @param vnStack - stack to push onto
+ @param psstrmIn - input stream
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPushSlotAttr(GrTableManager * ptman,
+ int nSlotRef, bool fInserting,
+ SlotAttrName slat, int slati, std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ GrSlotState * pslot = psstrmIn->RuleInputSlot(nSlotRef, psstrmOut, true);
+ if (pslot == NULL)
+ {
+ // Non-existent pre-context item.
+ vnStack.push_back(0);
+ return;
+ }
+
+ int nVal;
+ int xyBogus;
+
+ if (slat == kslatUserDefnV1)
+ slat = kslatUserDefn;
+
+ if (slati != -1 && slat != kslatCompRef && slat != kslatUserDefn)
+ {
+ // Invalid slot attribute index.
+ gAssert(false);
+ slati = -1;
+ }
+
+ if (slati == -1 && (slat == kslatCompRef || slat == kslatUserDefn))
+ {
+ // Missing slot attribute index.
+ gAssert(false);
+ slati = 0;
+ }
+
+ switch (slat)
+ {
+ case kslatAdvX: nVal = pslot->AdvanceX(ptman); break;
+ case kslatAdvY: nVal = pslot->AdvanceY(ptman); break;
+ case kslatShiftX: nVal = pslot->ShiftX(); break;
+ case kslatShiftY: nVal = pslot->ShiftY(); break;
+
+ case kslatPosX: pslot->Position(ptman, psstrmIn, &nVal, &xyBogus); break;
+ case kslatPosY: pslot->Position(ptman, psstrmIn, &xyBogus, &nVal); break;
+
+ case kslatAttTo: nVal = pslot->AttachTo(); break;
+ case kslatAttLevel: nVal = pslot->AttachLevel(); break;
+ case kslatAttAtX: nVal = pslot->AttachAtX(ptman, psstrmIn); break;
+ case kslatAttAtY: nVal = pslot->AttachAtY(); break;
+ case kslatAttAtGpt: nVal = pslot->AttachAtGpoint(); break;
+ case kslatAttAtXoff: nVal = pslot->AttachAtXOffset(); break;
+ case kslatAttAtYoff: nVal = pslot->AttachAtYOffset(); break;
+ case kslatAttWithX: nVal = pslot->AttachWithX(ptman, psstrmIn); break;
+ case kslatAttWithY: nVal = pslot->AttachWithY(); break;
+ case kslatAttWithGpt: nVal = pslot->AttachWithGpoint(); break;
+ case kslatAttWithXoff: nVal = pslot->AttachWithXOffset(); break;
+ case kslatAttWithYoff: nVal = pslot->AttachWithYOffset(); break;
+
+ case kslatMeasureSol: nVal = pslot->MeasureSol(); break;
+ case kslatMeasureEol: nVal = pslot->MeasureEol(); break;
+
+ case kslatJStretch: nVal = pslot->JStretch(); break;
+ case kslatJShrink: nVal = pslot->JShrink(); break;
+ case kslatJStep: nVal = pslot->JStep(); break;
+ case kslatJWeight: nVal = pslot->JWeight(); break;
+ case kslatJWidth: nVal = pslot->JWidth(); break;
+
+ case kslatBreak: nVal = pslot->BreakWeight(); break;
+ case kslatDir: nVal = pslot->Directionality(); break;
+ case kslatInsert: nVal = pslot->InsertBefore(); break;
+
+ case kslatUserDefn: nVal = pslot->UserDefn(slati); break;
+
+ // Currently no way to look up component.X.ref.
+
+ default:
+ // Invalid attribute.
+ gAssert(false);
+ nVal = 0;
+ }
+
+ vnStack.push_back(nVal);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Push value of a glyph attribute onto the stack.
+
+ @param nSlotRef - slot whose attribute we are interested in
+ @param fInserting - whether current slot was inserted
+ @param nGlyphAttr - glyph attribute to get
+ @param vnStack - stack to push onto
+ @param psstrmIn - input stream
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPushGlyphAttr(GrTableManager * ptman, int nSlotRef, bool fInserting,
+ int nGlyphAttr,
+ std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ GrSlotState * pslot = psstrmIn->RuleInputSlot(nSlotRef, psstrmOut, true);
+ if (pslot == NULL)
+ {
+ // Non-existent pre-context item.
+ vnStack.push_back(0);
+ return;
+ }
+ int nVal = pslot->GlyphAttrValueEmUnits(ptman, nGlyphAttr);
+ vnStack.push_back(nVal);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Push value of a glyph attribute onto the stack. The slot of interest is the slot to
+ which the current slot is attached.
+
+ @param nSlotRef - leaf slot
+ @param fInserting - whether current slot was inserted
+ @param nGlyphAttr - glyph attribute to get
+ @param vnStack - stack to push onto
+ @param psstrmIn - input stream
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPushAttToGlyphAttr(GrTableManager * ptman, int nSlotRef, bool fInserting,
+ int nGlyphAttr, std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ // Note that it is the slot in the output stream that has
+ // the relevant attach.to attribute set.
+ GrSlotState * pslotLeaf = psstrmOut->RuleOutputSlot(0);
+ int srAttTo = pslotLeaf->AttachTo();
+ if (srAttTo == 0)
+ {
+ gAssert(false);
+ vnStack.push_back(0);
+ return;
+ }
+
+ GrSlotState * pslotRoot = psstrmIn->RuleInputSlot(nSlotRef + srAttTo, psstrmOut);
+ int nVal = pslotRoot->GlyphAttrValueEmUnits(ptman, nGlyphAttr);
+ vnStack.push_back(nVal);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Push value of a glyph metric onto the stack.
+
+ @param nSlotRef - slot whose attribute we are interested in
+ @param fInserting - whether current slot was inserted
+ @param nGlyphAttr - glyph attribute to get
+ @param nAttLevel - for accessing composite metrics
+ @param vnStack - stack to push onto
+ @param psstrmIn - input stream
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPushGlyphMetric(GrTableManager * ptman, int nSlotRef, bool fInserting,
+ int nGlyphAttr, int nAttLevel,
+ std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ GrSlotState * pslot = psstrmIn->RuleInputSlot(nSlotRef, psstrmOut, true);
+ if (pslot == NULL)
+ {
+ // Non-existent pre-context item.
+ vnStack.push_back(0);
+ return;
+ }
+
+ DoPushGlyphMetricAux(ptman, pslot, nGlyphAttr, nAttLevel, vnStack, psstrmIn);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Push value of a glyph metric onto the stack. The slot of interest is the slot to
+ which the current slot is attached.
+
+ @param nSlotRef - slot whose attribute we are interested in
+ @param fInserting - whether current slot was inserted
+ @param nGlyphAttr - glyph attribute to get
+ @param nAttLevel - for accessing composite metrics
+ @param vnStack - stack to push onto
+ @param psstrmIn - input stream
+ @param psstrmOut - output stream
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPushAttToGlyphMetric(GrTableManager * ptman, int nSlotRef, bool fInserting,
+ int nGlyphAttr, int nAttLevel,
+ std::vector<int> & vnStack,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ // Note that it is the slot in the output stream that has
+ // the relevant attach.to attribute set.
+ GrSlotState * pslotLeaf = psstrmOut->RuleOutputSlot(0);
+ int srAttTo = pslotLeaf->AttachTo();
+ if (srAttTo == 0)
+ {
+ gAssert(false);
+ vnStack.push_back(0);
+ return;
+ }
+
+ GrSlotState * pslot = psstrmIn->RuleInputSlot(nSlotRef + srAttTo, psstrmOut);
+
+ DoPushGlyphMetricAux(ptman, pslot, nGlyphAttr, nAttLevel, vnStack, psstrmIn);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+void GrPass::DoPushGlyphMetricAux(GrTableManager * ptman,
+ GrSlotState * pslot, int nGlyphAttr, int nAttLevel,
+ std::vector<int> & vnStack, GrSlotStream * psstrmIn)
+{
+ int mVal;
+ GlyphMetric gmet = GlyphMetric(nGlyphAttr);
+ if (nAttLevel == 0 || gmet == kgmetAscent || gmet == kgmetDescent)
+ {
+ mVal = pslot->GlyphMetricEmUnits(ptman, nGlyphAttr);
+ }
+ else
+ {
+ pslot->CalcCompositeMetrics(ptman, psstrmIn, nAttLevel, true);
+
+ float xy;
+ switch (gmet)
+ {
+ case kgmetLsb: xy = pslot->ClusterLsb(psstrmIn); break;
+ case kgmetRsb: xy = pslot->ClusterRsb(psstrmIn); break;
+ case kgmetBbTop: xy = pslot->ClusterBbTop(psstrmIn); break;
+ case kgmetBbBottom: xy = pslot->ClusterBbBottom(psstrmIn); break;
+ case kgmetBbLeft: xy = pslot->ClusterBbLeft(psstrmIn); break;
+ case kgmetBbRight: xy = pslot->ClusterBbRight(psstrmIn); break;
+ case kgmetBbHeight: xy = pslot->ClusterBbHeight(psstrmIn); break;
+ case kgmetBbWidth: xy = pslot->ClusterBbWidth(psstrmIn); break;
+// case kgmetAdvHeight: xy = pslot->ClusterAdvHeight(psstrmIn); break;
+ case kgmetAdvWidth: xy = pslot->ClusterAdvWidth(psstrmIn); break;
+ default:
+ gAssert(false);
+ xy = 0;
+ }
+ mVal = ptman->LogToEmUnits(xy);
+ }
+
+ vnStack.push_back(mVal);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Push a feature value onto the stack. For rule actions, the slot of interest is the
+ current slot.
+
+ @param nSlotRef - slot being examined
+ @param fInserting - whether current slot was inserted
+ @param nFeat - feature of interest
+ @param vnStack - stack to push onto
+ @param psstrmIn - input stream
+ @param psstrmOut - output stream
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPushFeatValue(GrTableManager * ptman, int nSlotRef, bool fInserting,
+ int nFeat, std::vector<int> & vnStack, GrSlotStream * psstrmIn, GrSlotStream * psstrmOut)
+{
+ gAssert(!fInserting);
+
+ GrSlotState * pslot = psstrmIn->RuleInputSlot(nSlotRef, psstrmOut, true);
+ if (pslot == NULL)
+ {
+ // Non-existent pre-context item.
+ vnStack.push_back(0);
+ return;
+ }
+
+ int nVal = pslot->FeatureValue(nFeat);
+ vnStack.push_back(nVal);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Push a processing-state value onto the stack.
+
+ @param nFeat - feature of interest
+ @param vnStack - stack to push onto
+----------------------------------------------------------------------------------------------*/
+void GrPass::DoPushProcState(GrTableManager * ptman, int nPState, std::vector<int> & vnStack)
+{
+ int nValue;
+ if (nPState == kpstatJustifyMode)
+ {
+ // Convert from internal modes to user modes.
+ int jmodi = ptman->InternalJustificationMode();
+ switch (jmodi)
+ {
+ case kjmodiNormal:
+ case kjmodiCanShrink:
+ nValue = kjmoduNormal;
+ break;
+ case kjmodiMeasure:
+ nValue = kjmoduMeasure;
+ break;
+ case kjmodiJustify:
+ nValue = kjmoduJustify;
+ break;
+ default:
+ gAssert(false);
+ nValue = kjmoduNormal;
+ }
+ }
+ else if (nPState == kpstatJustifyLevel)
+ nValue = 1; // TODO: get justify level from ptman
+ vnStack.push_back(nValue);
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/GrPseudoMap.h b/Build/source/libs/graphite/src/segment/GrPseudoMap.h
new file mode 100644
index 00000000000..c6fec210808
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrPseudoMap.h
@@ -0,0 +1,48 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrPseudoMap.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ The GrPseudoMap class.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GR_PSEUDOMAP_INCLUDED
+#define GR_PSEUDOMAP_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+/*----------------------------------------------------------------------------------------------
+ A mapping between a Unicode value and a pseudo-glyph.
+
+ Hungarian: psd
+----------------------------------------------------------------------------------------------*/
+
+class GrPseudoMap
+{
+public:
+ unsigned int Unicode() { return m_nUnicode; }
+ gid16 PseudoGlyph() { return m_chwPseudo; }
+
+ void SetUnicode(int n) { m_nUnicode = n; }
+ void SetPseudoGlyph(gid16 chw) { m_chwPseudo = chw; }
+
+protected:
+ // Instance variables:
+ unsigned int m_nUnicode;
+ gid16 m_chwPseudo;
+};
+
+} // namespace gr
+
+#endif // !GR_PSEUDOMAP_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/GrSlotState.cpp b/Build/source/libs/graphite/src/segment/GrSlotState.cpp
new file mode 100644
index 00000000000..f2d61e45eed
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrSlotState.cpp
@@ -0,0 +1,1481 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrSlotState.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ GrSlotState class implementation.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Initialize slots.
+----------------------------------------------------------------------------------------------*/
+// standard for pass 0 slots
+void GrSlotState::Initialize(gid16 chw, GrEngine * pgreng,
+ GrFeatureValues fval, int ipass, int ichwSegOffset, int nUnicode)
+{
+ Assert(ipass == 0);
+ m_chwGlyphID = chw;
+ m_chwActual = kInvalidGlyph;
+ m_xysGlyphWidth = -1;
+ m_bStyleIndex = byte(fval.m_nStyleIndex);
+ u_intslot nullSlot;
+ nullSlot.pslot = NULL;
+ std::fill_n(PUserDefnBuf(), m_cnUserDefn, nullSlot);
+ std::fill_n(PCompRefBuf(), m_cnCompPerLig, nullSlot);
+ std::fill_n(PSlatiBuf(), m_cnCompPerLig, nullSlot);
+ u_intslot * pFeatBuf = PFeatureBuf();
+ for (size_t i = 0; i < m_cnFeat; i++)
+ pFeatBuf[i].nValue = fval.m_rgnFValues[i];
+ m_ipassFsmCol = -1;
+ m_colFsm = -1;
+
+ m_ipassModified = ipass;
+ m_ichwSegOffset = ichwSegOffset;
+ m_nUnicode = nUnicode;
+ m_vpslotAssoc.clear();
+ pgreng->InitSlot(this, nUnicode);
+
+ switch (nUnicode)
+ {
+ case knLRM: m_spsl = kspslLRM; break;
+ case knRLM: m_spsl = kspslRLM; break;
+ case knLRO: m_spsl = kspslLRO; break;
+ case knRLO: m_spsl = kspslRLO; break;
+ case knLRE: m_spsl = kspslLRE; break;
+ case knRLE: m_spsl = kspslRLE; break;
+ case knPDF: m_spsl = kspslPDF; break;
+ default:
+ Assert(m_spsl == kspslNone);
+ m_spsl = kspslNone;
+ break;
+ }
+}
+
+// line-break slots
+void GrSlotState::Initialize(gid16 chw, GrEngine * pgreng,
+ GrSlotState * pslotFeat, int ipass, int ichwSegOffset)
+{
+ m_chwGlyphID = chw;
+ m_chwActual = kInvalidGlyph;
+ m_xysGlyphWidth = -1;
+ u_intslot nullSlot;
+ nullSlot.pslot = NULL;
+ std::fill_n(PUserDefnBuf(), m_cnUserDefn, nullSlot);
+ std::fill_n(PCompRefBuf(), m_cnCompPerLig, nullSlot);
+ std::fill_n(PSlatiBuf(), m_cnCompPerLig, nullSlot);
+ CopyFeaturesFrom(pslotFeat);
+ m_ipassModified = ipass;
+ m_ichwSegOffset = ichwSegOffset;
+ m_nUnicode = -1;
+ m_vpslotAssoc.clear();
+ pgreng->InitSlot(this);
+ // Caller is responsible for setting m_spsl.
+ m_ipassFsmCol = -1;
+ m_colFsm = -1;
+}
+
+// for inserting new slots after pass 0 (under-pos and unicode are irrelevant)
+void GrSlotState::Initialize(gid16 chw, GrEngine * pgreng,
+ GrSlotState * pslotFeat, int ipass)
+{
+ m_chwGlyphID = chw;
+ m_chwActual = kInvalidGlyph;
+ m_xysGlyphWidth = -1;
+ u_intslot nullSlot;
+ nullSlot.pslot = NULL;
+ std::fill_n(PUserDefnBuf(), m_cnUserDefn, nullSlot);
+ std::fill_n(PCompRefBuf(), m_cnCompPerLig, nullSlot);
+ std::fill_n(PSlatiBuf(), m_cnCompPerLig, nullSlot);
+ CopyFeaturesFrom(pslotFeat);
+ m_ipassModified = ipass;
+ m_ichwSegOffset = kInvalid;
+ m_nUnicode = kInvalid;
+ m_vpslotAssoc.clear();
+ pgreng->InitSlot(this);
+ m_spsl = kspslNone;
+ m_ipassFsmCol = -1;
+ m_colFsm = -1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ The slot has been modified by the given pass and therefore is in a new state;
+ make a new SlotState initialized from the old one.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::InitializeFrom(GrSlotState * pslotOld, int ipass)
+{
+ CopyFrom(pslotOld, false);
+
+ m_ipassModified = ipass;
+ m_pslotPrevState = pslotOld;
+ m_ichwSegOffset = kInvalid;
+ m_vpslotAssoc.clear();
+ m_vpslotAssoc.push_back(pslotOld);
+
+ m_dircProc = pslotOld->m_dircProc;
+ m_fDirProcessed = pslotOld->m_fDirProcessed;
+
+ // Since we're going on to a new pass, no point in copying these:
+ m_ipassFsmCol = -1;
+ m_colFsm = -1;
+
+ ////FixAttachmentTree(pslotOld);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy the features and style information from the given slot.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::CopyFeaturesFrom(GrSlotState * pslotSrc)
+{
+ m_bStyleIndex = pslotSrc->m_bStyleIndex;
+ Assert(m_cnFeat == pslotSrc->m_cnFeat);
+ std::copy(pslotSrc->PFeatureBuf(), pslotSrc->PFeatureBuf() + m_cnFeat, PFeatureBuf());
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy the basic information.
+ Warning: the functions below will break if GrSlotState and subclasses are given virtual
+ methods. In that case, we will need to copy from the address of the first variable in
+ GrSlotAbstract.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::CopyFrom(GrSlotState * pslot, bool fCopyEverything)
+{
+ GrSlotAbstract::CopyAbstractFrom(pslot);
+ std::copy(pslot->m_prgnVarLenBuf, pslot->m_prgnVarLenBuf + CExtraSpace(), m_prgnVarLenBuf);
+
+ if (fCopyEverything)
+ {
+ Assert(false);
+ m_ipassModified = pslot->m_ipassModified;
+ m_pslotPrevState = pslot->m_pslotPrevState;
+ m_ichwSegOffset = pslot->m_ichwSegOffset;
+ m_colFsm = pslot->m_colFsm;
+ m_ipassFsmCol = pslot->m_ipassFsmCol;
+ // TODO: copy m_vpslotAssocs.
+ m_fNeutralAssocs = pslot->m_fNeutralAssocs;
+ }
+
+ m_dislotRootFixed = pslot->m_dislotRootFixed;
+
+ m_vdislotAttLeaves.resize(pslot->m_vdislotAttLeaves.size());
+ for (size_t i = 0; i < pslot->m_vdislotAttLeaves.size(); i++)
+ m_vdislotAttLeaves[i] = pslot->m_vdislotAttLeaves[i];
+
+ m_islotPosPass = pslot->m_islotPosPass;
+ m_nUnicode = pslot->m_nUnicode;
+ m_dircProc = pslot->m_dircProc;
+ m_fDirProcessed = pslot->m_fDirProcessed;
+ m_cnUserDefn = pslot->m_cnUserDefn;
+ m_cnFeat = pslot->m_cnFeat;
+ m_bStyleIndex = pslot->m_bStyleIndex;
+ m_mAdvanceX = pslot->m_mAdvanceX;
+ m_mAdvanceY = pslot->m_mAdvanceY;
+ m_mShiftX = pslot->m_mShiftX;
+ m_mShiftY = pslot->m_mShiftY;
+ m_srAttachTo = pslot->m_srAttachTo;
+ m_nAttachLevel = pslot->m_nAttachLevel;
+ m_mAttachAtX = pslot->m_mAttachAtX;
+ m_mAttachAtY = pslot->m_mAttachAtY;
+ m_mAttachAtXOffset = pslot->m_mAttachAtXOffset;
+ m_mAttachAtYOffset = pslot->m_mAttachAtYOffset;
+ m_mAttachWithX = pslot->m_mAttachWithX;
+ m_mAttachWithY = pslot->m_mAttachWithY;
+ m_mAttachWithXOffset = pslot->m_mAttachWithXOffset;
+ m_mAttachWithYOffset = pslot->m_mAttachWithYOffset;
+ m_nAttachAtGpoint = pslot->m_nAttachAtGpoint;
+ m_nAttachWithGpoint = pslot->m_nAttachWithGpoint;
+ m_fAttachMod = pslot->m_fAttachMod;
+ m_fShiftMod = pslot->m_fShiftMod;
+ m_fIgnoreAdvance = pslot->m_fIgnoreAdvance;
+
+ m_nCompositeLevel = kNegInfinity; // uncalculated, so don't need to copy the positions??
+}
+
+void GrSlotAbstract::CopyAbstractFrom(GrSlotState * pslot)
+{
+ u_intslot * pnBufSave = m_prgnVarLenBuf;
+ *this = *pslot;
+ m_prgnVarLenBuf = pnBufSave;
+ Assert(m_prgnVarLenBuf);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the output slot from the one use within the passes, with the basic information.
+ Warning: this function will break if GrSlotState and subclasses are given virtual
+ methods. In that case, we will need to copy from the address of the first variable in
+ GrSlotAbstract.
+----------------------------------------------------------------------------------------------*/
+void GrSlotOutput::InitializeOutputFrom(GrSlotState * pslot)
+{
+ CopyAbstractFrom(pslot);
+
+ // Copy just the component information, which is of length (m_cnCompPerLig * 2)
+ //std::copy(pslot->PCompRefBuf(),
+ // pslot->PCompRefBuf() + (m_cnCompPerLig * 2),
+ // this->PCompRefBufSlout());
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the ID of the actual glyph that will be used for output and metrics. This is the
+ same for most glyphs, but will be different for pseudo-glyphs.
+----------------------------------------------------------------------------------------------*/
+gid16 GrSlotAbstract::ActualGlyphForOutput(GrTableManager * ptman)
+{
+ if (m_chwActual == kInvalidGlyph)
+ m_chwActual = ptman->ActualGlyphForOutput(m_chwGlyphID);
+ return m_chwActual;
+}
+/*----------------------------------------------------------------------------------------------
+ We are replacing the old slot with the recipient. Replace the pointers in any attachment
+ root or attached leaf slots.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::FixAttachmentTree(GrSlotState * pslotOld)
+{
+#if 0
+ pslotOld->m_vpslotAttLeaves.CopyTo(m_vpslotAttLeaves);
+ for (int islot = 0; islot < m_vpslotAttLeaves.Size(); islot++)
+ {
+ Assert(m_vpslotAttLeaves[islot]->m_pslotAttRoot == pslotOld);
+ m_vpslotAttLeaves[islot]->m_pslotAttRoot = this;
+ }
+
+ m_pslotAttRoot = pslotOld->m_pslotAttRoot;
+ if (m_pslotAttRoot)
+ {
+ for (int islot = 0; islot < m_pslotAttRoot->m_vpslotAttLeaves.Size(); islot++)
+ {
+ if (m_pslotAttRoot->m_vpslotAttLeaves[islot] == pslotOld)
+ {
+ m_pslotAttRoot->m_vpslotAttLeaves.Delete(islot);
+ m_pslotAttRoot->m_vpslotAttLeaves.Push(this);
+ return;
+ }
+ }
+ Assert(false); // didn't find old slot in the list
+ }
+#endif // 0
+}
+
+/*----------------------------------------------------------------------------------------------
+ Make sure all the values are cached that are needed to be copied to the output slots
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::EnsureCacheForOutput(GrTableManager * ptman)
+{
+ // Make sure the actual glyph ID is set.
+ gid16 gidActual = ActualGlyphForOutput(ptman);
+
+ // Make sure the glyph metrics are stored.
+ Font * pfont = ptman->State()->GetFont();
+ if (IsLineBreak(ptman->LBGlyphID()))
+ {
+ GetGlyphMetric(pfont, kgmetAscent, 0);
+ GetGlyphMetric(pfont, kgmetDescent, 0);
+ m_xysGlyphX = 0;
+ m_xysGlyphY = 0;
+ m_xysGlyphHeight = 0;
+ m_xysGlyphWidth = 0;
+ m_xysAdvX = 0;
+ m_xysAdvY = 0;
+ m_bIsSpace = true;
+ }
+ else
+ {
+ //IsSpace(ptman); // cache this flag--doing bb-top below will do it
+
+ GetGlyphMetric(pfont, kgmetAscent, gidActual);
+ GetGlyphMetric(pfont, kgmetDescent, gidActual);
+ GetGlyphMetric(pfont, kgmetBbTop, gidActual);
+ // call above will also cache all the values below
+ //GetGlyphMetric(pfont, kgmetBbBottom, gidActual);
+ //GetGlyphMetric(pfont, kgmetBbLeft, gidActual);
+ //GetGlyphMetric(pfont, kgmetBbRight, gidActual);
+ //GetGlyphMetric(pfont, kgmetAdvWidth, gidActual);
+ //GetGlyphMetric(pfont, kgmetAdvHeight, gidActual);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the associations for the slot.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::Associate(GrSlotState * pslot)
+{
+ m_vpslotAssoc.clear();
+ m_vpslotAssoc.push_back(pslot);
+}
+
+void GrSlotState::Associate(GrSlotState * pslotBefore, GrSlotState * pslotAfter)
+{
+ m_vpslotAssoc.clear();
+ m_vpslotAssoc.push_back(pslotBefore);
+ m_vpslotAssoc.push_back(pslotAfter);
+}
+
+void GrSlotState::Associate(std::vector<GrSlotState*> & vpslot)
+{
+ m_vpslotAssoc.clear();
+ ///vpslot.CopyTo(m_vpslotAssoc); -- bug in CopyTo, so we do it ourselves:
+ for (size_t islot = 0; islot < vpslot.size(); ++islot)
+ {
+ m_vpslotAssoc.push_back(vpslot[islot]);
+ }
+
+ // Set its character styles and features from the associated slot.
+ if (vpslot.size() > 0) // && !m_pslotPrevState
+ {
+ std::copy(m_vpslotAssoc[0]->PFeatureBuf(),
+ m_vpslotAssoc[0]->PFeatureBuf() + m_cnFeat, PFeatureBuf());
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Clear the associations for the slot.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::ClearAssocs()
+{
+ m_vpslotAssoc.clear();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return a list of (ie, add into the vector) all the underlying associations, relative
+ to the official beginning of the segment.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::AllAssocs(std::vector<int> & vichw)
+{
+ if (PassModified() == 0)
+ {
+ Assert(m_ichwSegOffset != kInvalid);
+ vichw.push_back(m_ichwSegOffset);
+ }
+ else
+ {
+ for (size_t i = 0; i < m_vpslotAssoc.size(); ++i)
+ m_vpslotAssoc[i]->AllAssocs(vichw);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the underlying position of the before-association, relative to the official
+ beginning of the segment. May be -1, if this slot maps to a character in the previous
+ segment, or >= the length of the segment, if it maps to a character in the following
+ segment.
+----------------------------------------------------------------------------------------------*/
+int GrSlotState::BeforeAssoc()
+{
+ GrSlotState * pslot = this;
+ while (pslot->PassModified() > 0)
+ {
+ pslot = pslot->RawBeforeAssocSlot();
+ if (pslot == NULL)
+ {
+ return kPosInfinity;
+ }
+ }
+ Assert(pslot->m_ichwSegOffset != kInvalid);
+ return pslot->m_ichwSegOffset;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the underlying position of the after-association, relative to the official
+ beginning of the segment. May be -1, if this slot maps to a character in the previous
+ segment, or >= the length of the segment, if it maps to a character in the following
+ segment.
+----------------------------------------------------------------------------------------------*/
+int GrSlotState::AfterAssoc()
+{
+ GrSlotState * pslot = this;
+ while (pslot->PassModified() > 0)
+ {
+ pslot = pslot->RawAfterAssocSlot();
+ if (pslot == NULL)
+ {
+ return kNegInfinity;
+ }
+ }
+ Assert(pslot->m_ichwSegOffset != kInvalid);
+ return pslot->m_ichwSegOffset;
+}
+
+/*----------------------------------------------------------------------------------------------
+ It is possible to get into a state where we are associated with an invalid state.
+ For instance, slot C may be associated with slots B1 and B2, but slot B1 is not associated
+ with any earlier slot, in which case slot C should remove the association with B1 and just
+ be associated with B2.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::CleanUpAssocs()
+{
+ for (size_t i = 0; i < m_vpslotAssoc.size(); i++)
+ m_vpslotAssoc[i]->CleanUpAssocs();
+
+ GrSlotState * pslot;
+
+ pslot = RawBeforeAssocSlot();
+ while (pslot && BeforeAssoc() == kPosInfinity)
+ {
+ // The before association is bogus--delete it.
+ m_vpslotAssoc.erase(m_vpslotAssoc.begin());
+ pslot = RawBeforeAssocSlot();
+ }
+
+ pslot = RawAfterAssocSlot();
+ while (pslot && AfterAssoc() == kNegInfinity)
+ {
+ // The after association is bogus--delete it.
+ m_vpslotAssoc.pop_back();
+ pslot = RawAfterAssocSlot();
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Fill in the array of the given output slot with the underlying positions of the
+ ligature components, relative to the official beginning of the segment.
+ Positions may be < 0, if this slot maps to a character in the previous segment,
+ or >= the length of the segment, if it maps to a character in the following segment.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::SetComponentRefsFor(GrSlotOutput * pslout, int slatiArg)
+{
+ if (PassModified() > 0)
+ {
+ GrSlotState * pslot;
+ int slati;
+ if (HasComponents())
+ {
+ for (int iComponent = 0; iComponent < m_cnCompPerLig; iComponent++)
+ {
+ pslot = CompRefSlot(iComponent);
+ slati = Slati(iComponent);
+ if (pslot)
+ {
+ Assert(slati != -1);
+ Assert(PassModified() >= pslot->PassModified());
+ pslot->SetComponentRefsFor(pslout, slati);
+ }
+ }
+ }
+ else
+ {
+ // Follow the chain back through the passes.
+ pslot = RawBeforeAssocSlot();
+ if (pslot)
+ {
+ Assert(PassModified() >= pslot->PassModified());
+ // Passing slati here is definitely needed for our Arabic font: for instance when
+ // you type something like "mla", so the l is transformed into a temporary glyph
+ // before creating the ligature. However, this seems to have broken something,
+ // which I will probably find eventually. :-(
+ pslot->SetComponentRefsFor(pslout, slatiArg);
+ //pslot->SetComponentRefsFor(pslout, -1);
+ }
+ }
+ }
+ else
+ {
+ Assert(m_ichwSegOffset != kInvalid);
+ pslout->AddComponentReference(m_ichwSegOffset, slatiArg);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Fill in the vector with the underlying positions of the
+ ligature components, relative to the official beginning of the segment.
+ Positions may be < 0, if this slot maps to a character in the previous segment,
+ or >= the length of the segment, if it maps to a character in the following segment.
+ ENHANCE: merge with method above.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::AllComponentRefs(std::vector<int> & vichw)
+{
+ if (PassModified() > 0)
+ {
+ GrSlotState * pslot;
+ if (HasComponents())
+ {
+ for (int iComponent = 0; iComponent < m_cnCompPerLig; iComponent++)
+ {
+ pslot = CompRefSlot(iComponent);
+ if (pslot)
+ {
+ Assert(PassModified() >= pslot->PassModified());
+ pslot->AllComponentRefs(vichw);
+ }
+ }
+ }
+ else
+ {
+ // ENHANCE: Strictly speaking we should probably have separate before-
+ // and after-lists for the components, but I think it would be pretty
+ // rare to have both deletion and ligatures overlapping, so I'm not
+ // going to bother with it for now.
+ //for (int islot = 0; islot < AssocsSize(); islot++)
+ for (int islot = 0; islot < 1; islot++)
+ {
+ m_vpslotAssoc[islot]->AllComponentRefs(vichw);
+ }
+ }
+ }
+ else
+ {
+ Assert(m_ichwSegOffset != kInvalid);
+ vichw.push_back(m_ichwSegOffset);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the value of the component.???.ref attribute for the slot.
+ Note that 'i' is the local index for the component as defined for this glyph.
+----------------------------------------------------------------------------------------------*/
+GrSlotState * GrSlotState::CompRefSlot(int i)
+{
+ Assert(i < m_cnCompPerLig);
+ if (i < m_cnCompPerLig)
+ return CompRef(i);
+ else
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the value of the component.???.ref attribute for the slot.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::SetCompRefSlot(GrTableManager * ptman, int slati, GrSlotState * pslotComp)
+{
+ // Convert the global identifer for the component to the index for this glyph.
+ int icomp = ptman->ComponentIndexForGlyph(GlyphID(), slati);
+ Assert(icomp != -1);
+ if (icomp == -1)
+ // Component not defined for this glyph--ignore.
+ return;
+ Assert(icomp < m_cnCompPerLig);
+
+ if (m_fHasComponents == false)
+ {
+ // None have been set yet; initialize them.
+ for (int iLoop = 0; iLoop < m_cnCompPerLig; iLoop++)
+ {
+ SetCompRef(iLoop, NULL);
+ SetSlati(iLoop, -1);
+ }
+ }
+
+ m_fHasComponents = true;
+ int iLoop;
+ for (iLoop = 0; iLoop < m_cnCompPerLig; iLoop++)
+ {
+ if (Slati(iLoop) == slati)
+ break;
+ if (Slati(iLoop) == -1)
+ break;
+ }
+ //if (icomp < m_cnCompPerLig)
+ if (iLoop < m_cnCompPerLig)
+ {
+ //SetCompRef(icomp, pslotComp);
+ SetCompRef(iLoop, pslotComp);
+ SetSlati(iLoop, slati);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the underlying position for the slot, relative to the official beginning of the
+ segment.
+----------------------------------------------------------------------------------------------*/
+int GrSlotState::SegOffset()
+{
+ if (m_ichwSegOffset == kInvalid)
+ {
+ Assert(m_pslotPrevState);
+ Assert(m_ipassModified > 0);
+ return m_pslotPrevState->SegOffset();
+ }
+ else
+ {
+ Assert(m_pslotPrevState == NULL);
+ Assert(m_ipassModified == 0);
+ return m_ichwSegOffset;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the value of the glyph attribute (in design units, if this is a measurement).
+----------------------------------------------------------------------------------------------*/
+int GrSlotState::GlyphAttrValueEmUnits(GrTableManager * ptman, int nAttrID)
+{
+ return ptman->GlyphAttrValue(m_chwGlyphID, nAttrID);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the value of the glyph metric, in design coordinates (ie, based on the font's
+ em-square).
+----------------------------------------------------------------------------------------------*/
+int GrSlotState::GlyphMetricEmUnits(GrTableManager * ptman, int nMetricID)
+{
+ int mValue;
+ if (ptman->State()->GetFont())
+ {
+ // Get the actual metric, possibly adjusted for hinting, then convert back to
+ // design units.
+ float xysValue = GlyphMetricLogUnits(ptman, nMetricID);
+ mValue = ptman->LogToEmUnits(xysValue);
+ }
+ else
+ // Ask the font directly.
+ ////mValue = ???
+ mValue = 0;
+
+ return mValue;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the value of the glyph attribute, converted to source device coordinates.
+ The attribute is assumed to be one whose value is a measurement.
+----------------------------------------------------------------------------------------------*/
+float GrSlotState::GlyphAttrValueLogUnits(GrTableManager * ptman, int nAttrID)
+{
+ int mValue = GlyphAttrValueEmUnits(ptman, nAttrID);
+ float xysRet = ptman->EmToLogUnits(mValue);
+ return xysRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the value of the glyph metric, in the source device's logical units.
+----------------------------------------------------------------------------------------------*/
+float GrSlotState::GlyphMetricLogUnits(GrTableManager * ptman, int nMetricID)
+{
+#ifdef OLD_TEST_STUFF
+ if (ptman->GlyphTable() == NULL)
+ return 0;
+#endif // OLD_TEST_STUFF
+
+#ifdef _DEBUG
+ if (IsLineBreak(ptman->LBGlyphID()))
+ {
+ Warn("Getting metrics of line-break slot");
+ }
+#endif // _DEBUG
+ if (IsLineBreak(ptman->LBGlyphID()))
+ {
+ return 0;
+ }
+
+ return GetGlyphMetric(ptman->State()->GetFont(), nMetricID,
+ ActualGlyphForOutput(ptman));
+}
+
+
+float GrSlotOutput::GlyphMetricLogUnits(Font * pfont, int nMetricID)
+{
+ Assert(m_chwActual != kInvalidGlyph);
+ if (m_chwActual == kInvalidGlyph)
+ return 0;
+
+ return GetGlyphMetric(pfont, nMetricID, m_chwActual);
+}
+
+//float GrSlotOutput::GlyphMetricLogUnits(int gmet) -- obsolete: no longer caching these values
+//{
+// // When the font is not passed as an argument, the values better be cached!
+//
+// switch (gmet)
+// { // There may be off by one errors below, depending on what width and height mean
+// case kgmetLsb:
+// return m_xysGlyphX;
+// case kgmetRsb:
+// return (m_xysAdvX - m_xysGlyphX - m_xysGlyphWidth);
+// case kgmetBbTop:
+// return m_xysGlyphY;
+// case kgmetBbBottom:
+// return (m_xysGlyphY - m_xysGlyphHeight);
+// case kgmetBbLeft:
+// return m_xysGlyphX;
+// case kgmetBbRight:
+// return (m_xysGlyphX + m_xysGlyphWidth);
+// case kgmetBbHeight:
+// return m_xysGlyphHeight;
+// case kgmetBbWidth:
+// return m_xysGlyphWidth;
+// case kgmetAdvWidth:
+// return m_xysAdvX;
+// case kgmetAdvHeight:
+// return m_xysAdvY;
+// default:
+// Warn("GetGlyphMetric was asked for an illegal metric.");
+// };
+//
+// return 0;
+//}
+
+
+float GrSlotAbstract::GetGlyphMetric(Font * pfont, int nMetricID, gid16 chwGlyphID)
+{
+ GlyphMetric gmet = GlyphMetric(nMetricID);
+
+ float yAscent, yDescent;
+ gr::Point ptAdvances;
+ gr::Rect rectBb;
+
+ if (kgmetAscent == gmet)
+ {
+ //if (m_xysFontAscent != -1)
+ // return m_xysFontAscent;
+ pfont->getFontMetrics(&yAscent);
+ //m_xysFontAscent = xysRet;
+ //if (pfont)
+ // m_xysFontAscent = yAscent;
+ return yAscent;
+ }
+
+ if (kgmetDescent == gmet)
+ {
+ //if (m_xysFontDescent != -1)
+ // return m_xysFontDescent;
+ pfont->getFontMetrics(NULL, &yDescent);
+ //m_xysFontDescent = xysRet;
+ //if (pfont)
+ // m_xysFontDescent = yDescent;
+ return yDescent;
+ }
+
+ float xysGlyphX, xysGlyphY, xysGlyphWidth, xysGlyphHeight, xysAdvX, xysAdvY;
+ //if (m_xysGlyphWidth == -1)
+ //{
+ pfont->getGlyphMetrics(chwGlyphID, rectBb, ptAdvances);
+
+ xysGlyphX = rectBb.left;
+ xysGlyphY = rectBb.top;
+ xysGlyphWidth = (rectBb.right - rectBb.left);
+ xysGlyphHeight = (rectBb.top - rectBb.bottom);
+ xysAdvX = ptAdvances.x;
+ xysAdvY = ptAdvances.y;
+
+ m_bIsSpace = (0 == xysGlyphX && 0 == xysGlyphY); // should agree with test done in IsSpace() below
+
+ if (m_bIsSpace == 1)
+ {
+ // White space glyph - only case where nGlyphX == nGlyphY == 0
+ // nGlyphWidth & nGlyphHeight are always set to 16 for unknown reasons, so correct.
+ xysGlyphWidth = xysGlyphHeight = 0;
+ }
+ //}
+
+ switch (gmet)
+ { // There may be off-by-one errors below, depending on what width and height mean
+ case kgmetLsb:
+ return xysGlyphX;
+ case kgmetRsb:
+ return (xysAdvX - xysGlyphX - xysGlyphWidth);
+ case kgmetBbTop:
+ return xysGlyphY;
+ case kgmetBbBottom:
+ return (xysGlyphY - xysGlyphHeight);
+ case kgmetBbLeft:
+ return xysGlyphX;
+ case kgmetBbRight:
+ return (xysGlyphX + xysGlyphWidth);
+ case kgmetBbHeight:
+ return xysGlyphHeight;
+ case kgmetBbWidth:
+ return xysGlyphWidth;
+ case kgmetAdvWidth:
+ return xysAdvX;
+ case kgmetAdvHeight:
+ return xysAdvY;
+ default:
+ Warn("GetGlyphMetric was asked for an illegal metric.");
+ };
+
+ return 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Test the glyph id to see if it is a white space glyph.
+----------------------------------------------------------------------------------------------*/
+int GrSlotState::IsSpace(GrTableManager * ptman)
+{
+ gid16 gidActual = ActualGlyphForOutput(ptman);
+
+ ////if (m_xysGlyphWidth == -1)
+ ////{
+ //// res = ptman->State()->GraphicsObject()->GetGlyphMetrics(gidActual,
+ //// &m_xysGlyphWidth, &m_xysGlyphHeight,
+ //// &m_xysGlyphX, &m_xysGlyphY, &m_xysAdvX, &m_xysAdvY);
+ //// if (ResultFailed(res))
+ //// {
+ //// WARN(res);
+ //// return 2; // will test as true but can be distinguished by separate value
+ //// }
+
+ //// gr::Point ptAdvances;
+ //// gr::Rect rectBb;
+ //// ptman->State()->Font()->getGlyphMetrics(gidActual, rectBb, ptAdvances);
+ ////}
+
+ if (m_bIsSpace == -1)
+ GetGlyphMetric(ptman->State()->GetFont(), kgmetBbLeft, gidActual);
+ // One call is enough to cache the information.
+ //GetGlyphMetric(ptman->State()->Font(), kgmetBbBottom, gidActual);
+
+ // should agree with test done in GetGlyphMetric() above
+ //////m_bIsSpace = (0 == m_xysGlyphX && 0 == m_xysGlyphY);
+
+ Assert(m_bIsSpace == 0 || m_bIsSpace == 1);
+
+ return m_bIsSpace;
+}
+
+bool GrSlotOutput::IsSpace()
+{
+ Assert(m_bIsSpace == 0 || m_bIsSpace == 1);
+ return m_bIsSpace;
+}
+
+/*----------------------------------------------------------------------------------------------
+ If any of the attach attributes have been modified, fix things up. Set up the attachment
+ tree, and set any needed default positions. Zap the cached positions of any following
+ glyphs in the stream.
+
+ @param psstrm - the stream in which the modifications were made
+ @param islotThis - the index of the attached (leaf) slot in the stream;
+ -1 if we don't know
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::HandleModifiedPosition(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis)
+{
+ if (!m_fAttachMod && !m_fShiftMod)
+ return;
+
+ if (islotThis == -1)
+ {
+ for (int islot = 0; islot < psstrmOut->WritePos(); islot++)
+ {
+ if (psstrmOut->SlotAt(islot) == this)
+ {
+ islotThis = islot;
+ break;
+ }
+ }
+ Assert(islotThis > -1);
+ }
+
+ if (m_fAttachMod)
+ {
+ // Attachments.
+
+ // Note that it doesn't make sense to attach a slot to itself, so if the value of
+ // the attach.to attribute is 0, that means clear the attachment.
+ GrSlotState * pslotNewRoot = AttachRoot(psstrmOut);
+
+ AttachToRoot(ptman, psstrmOut, pslotNewRoot);
+
+ if (pslotNewRoot)
+ {
+ // If this is an attachment with no positions, attach the two glyphs side by side
+ // in the appropriate order.
+ bool fRtl = ((pslotNewRoot->PostBidiDirLevel(ptman) % 2) != 0);
+ if ((fRtl && m_srAttachTo < 0) || (!fRtl && m_srAttachTo > 0))
+ {
+ // The root is on the right, the leaf is on the left.
+ if (m_mAttachAtX == kNotYetSet && m_nAttachAtGpoint == kNotYetSet)
+ m_mAttachAtX = 0;
+ if (m_mAttachWithX == kNotYetSet && m_nAttachWithGpoint == kNotYetSet)
+ m_mAttachWithX = short(AdvanceX(ptman));
+ }
+ else
+ {
+ // The root is on the left, the leaf is on the right.
+ if (m_mAttachAtX == kNotYetSet && m_nAttachAtGpoint == kNotYetSet)
+ m_mAttachAtX = short(pslotNewRoot->AdvanceX(ptman));
+ if (m_mAttachWithX == kNotYetSet && m_nAttachWithGpoint == kNotYetSet)
+ m_mAttachWithX = 0;
+ }
+ }
+ }
+ else
+ {
+ // Shifting, or changing the advance width.
+ Assert(m_fShiftMod);
+ EnsureLocalAttachmentTree(ptman, psstrmIn, psstrmOut, islotThis);
+ ZapMetricsAndPositionDownToBase(psstrmOut);
+ ZapMetricsOfLeaves(psstrmOut);
+ }
+
+ if (psstrmOut->m_ipass == ptman->NumberOfPasses() - 1)
+ ptman->InitPosCache(); // cached position is most likely no longer valid
+
+ // Invalidate the positions of this and any following glyphs.
+ for (int islot = islotThis + 1; islot < psstrmOut->WritePos(); islot++)
+ psstrmOut->SlotAt(islot)->ZapPosition();
+
+ m_fAttachMod = false;
+ m_fShiftMod = false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ The shift attribute of a slot has been modified. Make sure any slots that are part of the
+ same attachment cluster are local to this stream. The reason for this is so that the
+ position calculations stay consistent within the stream.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::EnsureLocalAttachmentTree(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis)
+{
+ if (m_dislotRootFixed)
+ {
+ GrSlotState * pslotRoot = SlotAtOffset(psstrmOut, m_dislotRootFixed);
+ psstrmOut->EnsureLocalCopy(ptman, pslotRoot, psstrmIn);
+ pslotRoot = SlotAtOffset(psstrmOut, m_dislotRootFixed); // get the new one!
+ pslotRoot->EnsureLocalAttachmentTree(ptman, psstrmIn, psstrmOut, islotThis + m_dislotRootFixed);
+ }
+ for (size_t islot = 0; islot < m_vdislotAttLeaves.size(); islot++)
+ {
+ GrSlotState * pslotLeaf = SlotAtOffset(psstrmOut, m_vdislotAttLeaves[islot]);
+ psstrmOut->EnsureLocalCopy(ptman, pslotLeaf, psstrmIn);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ The recipient slot is being attached to the argument slot.
+ NOTE: the caller is responsible to zap the cached positions of following glyphs
+ in the stream.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::AttachToRoot(GrTableManager * ptman, GrSlotStream * psstrm,
+ GrSlotState * pslotNewRoot)
+{
+ GrSlotState * pslotOldRoot = (m_dislotRootFixed == 0) ?
+ NULL :
+ SlotAtOffset(psstrm, m_dislotRootFixed);
+
+ if (pslotOldRoot)
+ {
+ if (pslotOldRoot != pslotNewRoot)
+ pslotOldRoot->RemoveLeaf(m_dislotRootFixed);
+ pslotOldRoot->ZapMetricsAndPositionDownToBase(psstrm);
+ pslotOldRoot->ZapMetricsOfLeaves(psstrm);
+ }
+
+ ZapCompositeMetrics();
+
+ if (pslotNewRoot && pslotNewRoot != pslotOldRoot)
+ {
+ pslotNewRoot->AddLeaf(m_srAttachTo);
+ pslotNewRoot->ZapMetricsAndPositionDownToBase(psstrm);
+ pslotNewRoot->ZapMetricsOfLeaves(psstrm);
+ }
+
+ m_dislotRootFixed = m_srAttachTo;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the absolute position of the glyph, relative to the start of the segment,
+ in font design units.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::Position(GrTableManager * ptman,
+ GrSlotStream * psstrmOut, int * pmXPos, int * pmYPos)
+{
+ Assert(!m_fAttachMod); // the attachment tree should be set up
+ Assert(!m_fShiftMod);
+
+ float xsWidth, xsVisWidth;
+ if (m_xsPositionX == kNegInfFloat || m_ysPositionY == kNegInfFloat)
+ ptman->CalcPositionsUpTo(psstrmOut->m_ipass, this, &xsWidth, &xsVisWidth);
+
+ *pmXPos = ptman->LogToEmUnits(m_xsPositionX);
+ *pmYPos = ptman->LogToEmUnits(m_ysPositionY);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Recalculate the metrics for this slot, which has attachments on it (or possibly
+ did in the past).
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::AdjustRootMetrics(GrTableManager * ptman, GrSlotStream * psstrm)
+{
+ Assert(m_dislotRootFixed == m_srAttachTo);
+ GrSlotState * pslotRoot = AttachRoot(psstrm);
+ CalcRootMetrics(ptman, psstrm, kPosInfinity);
+ if (pslotRoot)
+ pslotRoot->AdjustRootMetrics(ptman, psstrm);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Calculate the composite metrics for this slot.
+
+ @param psstrm - stream for which we are calculating it
+ @param nLevel - attachment level we are asking for; kPosInifinity means all levels
+ @param fThorough - true: do a thorough recalculation; false: don't recalculate
+ metrics for leaves (are they assumed to be accurate???)
+ --currently not used
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::CalcCompositeMetrics(GrTableManager * ptman, GrSlotStream * psstrm,
+ int nLevel, bool fThorough)
+{
+ if (m_nCompositeLevel == nLevel)
+ return;
+
+ if (fThorough)
+ {
+ Assert(m_dislotRootFixed == m_srAttachTo);
+ GrSlotState * pslotRoot = AttachRoot(psstrm);
+
+ InitMetrics(ptman, pslotRoot);
+
+ for (size_t islot = 0; islot < m_vdislotAttLeaves.size(); islot++)
+ {
+ GrSlotState * pslotLeaf = SlotAtOffset(psstrm, m_vdislotAttLeaves[islot]);
+ if (pslotLeaf->AttachLevel() <= nLevel)
+ pslotLeaf->CalcCompositeMetrics(ptman, psstrm, nLevel, fThorough);
+ else
+ // this slot will be ignored in the composite metrics
+ pslotLeaf->ZapRootMetrics();
+ }
+ CalcRootMetrics(ptman, psstrm, nLevel);
+
+ m_nCompositeLevel = nLevel;
+ }
+ else
+ {
+ Assert(false); // for now
+
+ // Don't bother with the leaves.
+ InitRootMetrics(ptman);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Calculate the metrics for this node and all its leaf nodes.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::CalcRootMetrics(GrTableManager * ptman, GrSlotStream * psstrm, int nLevel)
+{
+ for (size_t idislot = 0; idislot < m_vdislotAttLeaves.size(); idislot++)
+ {
+ GrSlotState * pslot = SlotAtOffset(psstrm, m_vdislotAttLeaves[idislot]);
+ if (pslot->AttachLevel() > nLevel)
+ continue;
+
+ m_xsClusterXOffset = min(m_xsClusterXOffset, pslot->m_xsClusterXOffset);
+ if (!pslot->m_fIgnoreAdvance)
+ {
+ m_xsClusterAdv = max(
+ m_xsClusterAdv,
+ pslot->m_xsClusterAdv + m_xsRootShiftX);
+ }
+ m_xsClusterBbLeft = min(m_xsClusterBbLeft, pslot->m_xsClusterBbLeft);
+ m_xsClusterBbRight = max(m_xsClusterBbRight, pslot->m_xsClusterBbRight);
+ m_ysClusterBbTop = max(m_ysClusterBbTop, pslot->m_ysClusterBbTop);
+ m_ysClusterBbBottom = min(m_ysClusterBbBottom, pslot->m_ysClusterBbBottom);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Reset the cluster metrics of this slot.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::InitMetrics(GrTableManager * ptman, GrSlotState * pslotRoot)
+{
+ InitLeafMetrics(ptman, pslotRoot);
+ InitRootMetrics(ptman);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the variables that store the offsets of just this node (ignoring any of its
+ leaves) relative to the cluster base.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::InitLeafMetrics(GrTableManager * ptman, GrSlotState * pslotRoot)
+{
+ float xsShiftX = ptman->EmToLogUnits(ShiftX());
+ float ysShiftY = ptman->EmToLogUnits(ShiftY());
+
+ if (ptman->RightToLeft())
+ xsShiftX *= -1;
+
+ if (IsBase())
+ {
+ // The x-value below has to be zero because the shift is incorporated into
+ // m_xsRootShiftX. (m_ysRootShiftY, on the other hand, isn't used anywhere.)
+ m_xsOffsetX = 0;
+ m_ysOffsetY = ysShiftY;
+
+ m_xsRootShiftX = xsShiftX;
+ m_ysRootShiftY = ysShiftY;
+ Assert(!IsLineBreak(ptman->LBGlyphID())
+ || (m_xsRootShiftX == 0 && m_ysRootShiftY == 0));
+ return;
+ }
+
+ Assert(!IsLineBreak(ptman->LBGlyphID()));
+
+ // Hint-adjusted logical coordinates equivalent to attach.at and attach.with attributes.
+ // If attach.at or attach.with attributes were unset, the defaults for a side-by-side
+ // attachment should have been supplied in HandleModifiedPosition().
+ float xsAttAtX, ysAttAtY, xsAttWithX, ysAttWithY;
+ AttachLogUnits(ptman, pslotRoot, &xsAttAtX, &ysAttAtY, &xsAttWithX, &ysAttWithY);
+
+ m_xsOffsetX = xsAttAtX - xsAttWithX;
+ m_xsOffsetX += pslotRoot->m_xsOffsetX;
+ m_xsOffsetX += xsShiftX;
+
+ m_ysOffsetY = ysAttAtY - ysAttWithY;
+ m_ysOffsetY += pslotRoot->m_ysOffsetY;
+ m_ysOffsetY += ysShiftY;
+
+ // Cumulative effect of shifts on this and all base nodes:
+ m_xsRootShiftX = pslotRoot->m_xsRootShiftX + xsShiftX;
+ m_ysRootShiftY = pslotRoot->m_ysRootShiftY + ysShiftY;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the variables that store the offsets of this node taking into account its
+ leaves; these are relative to the cluster base.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::InitRootMetrics(GrTableManager * ptman)
+{
+ if (IsLineBreak(ptman->LBGlyphID()))
+ {
+ m_fIgnoreAdvance = true;
+ m_xsClusterXOffset = 0;
+ m_xsClusterAdv = 0;
+ m_xsClusterBbLeft = 0;
+ m_xsClusterBbRight = 0;
+ m_ysClusterBbTop = 0;
+ m_ysClusterBbBottom = 0;
+ return;
+ }
+
+ float xsAdvanceX = ptman->EmToLogUnits(AdvanceX(ptman));
+
+ // If the glyph's advance width is zero, then we NEVER want it to have any affect,
+ // even if the glyph is attached way out to the right of its base's advance.
+ m_fIgnoreAdvance = (xsAdvanceX == 0);
+
+ float xsBbLeft = GlyphMetricLogUnits(ptman, kgmetBbLeft);
+ float xsBbRight = GlyphMetricLogUnits(ptman, kgmetBbRight);
+ float ysBbTop = GlyphMetricLogUnits(ptman, kgmetBbTop);
+ float ysBbBottom = GlyphMetricLogUnits(ptman, kgmetBbBottom);
+
+ // Any shifts should be ignored for the sake of calculating actual position or width,
+ // hence we subtract the cumulative effect of the shifts.
+ m_xsClusterXOffset = m_xsOffsetX - m_xsRootShiftX;
+ m_xsClusterAdv = m_xsOffsetX + xsAdvanceX - m_xsRootShiftX;
+
+ m_xsClusterBbLeft = m_xsOffsetX + xsBbLeft;
+ m_xsClusterBbRight = m_xsOffsetX + xsBbRight;
+ m_ysClusterBbTop = m_ysOffsetY + ysBbTop;
+ m_ysClusterBbBottom = m_ysOffsetY + ysBbBottom;
+}
+
+/*----------------------------------------------------------------------------------------------
+ X-offset of a single glyph relative to the previous advance position.
+----------------------------------------------------------------------------------------------*/
+float GrSlotState::GlyphXOffset(GrSlotStream * psstrm, float fakeItalicRatio)
+{
+ float xsRet = Base(psstrm)->ClusterRootOffset() + m_xsOffsetX;
+
+ // fake an italic slant
+ xsRet += m_ysOffsetY * fakeItalicRatio;
+
+ return xsRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Y-offsets of a single glyph relative to the previous advance position.
+----------------------------------------------------------------------------------------------*/
+float GrSlotState::GlyphYOffset(GrSlotStream * psstrm)
+{
+ return m_ysOffsetY;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the offset of the last leaf of the cluster, relative to this slot, which is
+ the base. Return kNegInfinity if there are not enough slots in the stream to tell.
+----------------------------------------------------------------------------------------------*/
+int GrSlotState::LastLeafOffset(GrSlotStream * psstrm)
+{
+ int islotRet = 0;
+ for (size_t idislot = 0; idislot < m_vdislotAttLeaves.size(); idislot++)
+ {
+ int dislot = m_vdislotAttLeaves[idislot];
+ Assert(dislot != 0);
+ if (!psstrm->HasSlotAtPosPassIndex(PosPassIndex() + dislot))
+ return kNegInfinity;
+ GrSlotState * pslotLeaf = SlotAtOffset(psstrm, dislot);
+ int islotTmp = pslotLeaf->LastLeafOffset(psstrm);
+ if (islotTmp == kNegInfinity)
+ return kNegInfinity;
+ islotRet = max(islotRet, (dislot + islotTmp));
+ }
+ return islotRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the attach positions in the device context's logical units,
+ adjusted for hinting if possible.
+
+ Note that m_nAttachAt/WithGpoint = 0 is always an invalid value (resulting from a
+ glyph attribute that was defined in terms of x/y coordinates that didn't map to an
+ actual on-curve point). Therefore the x/y coordinates should be used to do the
+ attachment. In the case where we actually want point #0 on the curve,
+ m_nAttachAt/WithGpoint will have the special value 'kGpointZero' (the glyph attribute
+ is defined this way).
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::AttachLogUnits(GrTableManager * ptman, GrSlotState * pslotRoot,
+ float * pxsAttAtX, float * pysAttAtY,
+ float * pxsAttWithX, float * pysAttWithY)
+{
+ if (m_nAttachAtGpoint == kNotYetSet || m_nAttachAtGpoint == 0)
+ {
+ // Use x- and y-coordinates; no adjustment for hinting is done.
+ int mX = m_mAttachAtX + m_mAttachAtXOffset;
+ int mY = m_mAttachAtY + m_mAttachAtYOffset;
+
+ *pxsAttAtX = ptman->EmToLogUnits(mX);
+ *pysAttAtY = ptman->EmToLogUnits(mY);
+ }
+ else
+ {
+ // Look up the actual on-curve point.
+ int nGpoint = m_nAttachAtGpoint;
+ if (nGpoint == kGpointZero)
+ nGpoint = 0;
+ bool fImpl = ptman->GPointToXY(pslotRoot->GlyphID(), nGpoint, pxsAttAtX, pysAttAtY);
+
+ // Debuggers:
+ //int mXTmpAt = m_mAttachAtX + m_mAttachAtXOffset;
+ //int mYTmpAt = m_mAttachAtY + m_mAttachAtYOffset;
+ //int xsAttAtXTmp = ptman->EmToLogUnits(mXTmpAt);
+ //int ysAttAtYTmp = ptman->EmToLogUnits(mYTmpAt);
+ //fImpl = false;
+
+ if (!fImpl)
+ {
+ // Fall back to using x- and y-coordinates; no adjustment for hinting.
+ int mX = m_mAttachAtX + m_mAttachAtXOffset;
+ int mY = m_mAttachAtY + m_mAttachAtYOffset;
+ *pxsAttAtX = ptman->EmToLogUnits(mX);
+ *pysAttAtY = ptman->EmToLogUnits(mY);
+ }
+ else
+ {
+ // Adjust by offsets.
+ *pxsAttAtX += ptman->EmToLogUnits(m_mAttachAtXOffset);
+ *pysAttAtY += ptman->EmToLogUnits(m_mAttachAtYOffset);
+ }
+ }
+
+ if (m_nAttachWithGpoint == kNotYetSet || m_nAttachWithGpoint == 0)
+ {
+ // Use x- and y-coordinates; no adjustment for hinting is done.
+ int mX = m_mAttachWithX + m_mAttachWithXOffset;
+ int mY = m_mAttachWithY + m_mAttachWithYOffset;
+
+ *pxsAttWithX = ptman->EmToLogUnits(mX);
+ *pysAttWithY = ptman->EmToLogUnits(mY);
+ }
+ else
+ {
+ // Look up the actual on-curve point.
+ int nGpoint = m_nAttachWithGpoint;
+ if (nGpoint == kGpointZero)
+ nGpoint = 0;
+ bool fImpl = ptman->GPointToXY(m_chwGlyphID, nGpoint, pxsAttWithX, pysAttWithY);
+
+ // Debuggers:
+ //int mXTmpWith = m_mAttachWithX + m_mAttachWithXOffset;
+ //int mYTmpWith = m_mAttachWithY + m_mAttachWithYOffset;
+ //int xsAttWithXTmp = ptman->EmToLogUnits(mXTmpWith);
+ //int ysAttWithYTmp = ptman->EmToLogUnits(mYTmpWith);
+ //fImpl = false;
+
+ if (!fImpl)
+ {
+ // Fall back to using x- and y-coordinates; no adjustment for hinting.
+ int mX = m_mAttachWithX + m_mAttachWithXOffset;
+ int mY = m_mAttachWithY + m_mAttachWithYOffset;
+ *pxsAttWithX = ptman->EmToLogUnits(mX);
+ *pysAttWithY = ptman->EmToLogUnits(mY);
+ }
+ else
+ {
+ // Adjust by offsets.
+ *pxsAttWithX += ptman->EmToLogUnits(m_mAttachWithXOffset);
+ *pysAttWithY += ptman->EmToLogUnits(m_mAttachWithYOffset);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the slot that is 'dislot' slots away from this slot in the given stream.
+ Only valid for streams that are the input to or output of positioning passes.
+----------------------------------------------------------------------------------------------*/
+GrSlotState * GrSlotState::SlotAtOffset(GrSlotStream * psstrm, int dislot)
+{
+ Assert(psstrm->m_fUsedByPosPass);
+ return psstrm->SlotAtPosPassIndex(PosPassIndex() + dislot);
+}
+
+/*----------------------------------------------------------------------------------------------
+ If the direction level has not been calculated at this point, assume it is the
+ top direction. This should only happen if there was no bidi pass to set it.
+ This method should only be called by the positioning passes; it assumes any bidi
+ pass has been run.
+----------------------------------------------------------------------------------------------*/
+int GrSlotState::PostBidiDirLevel(GrTableManager * ptman)
+{
+ if (m_nDirLevel == -1)
+ {
+ Assert(!ptman->HasBidiPass());
+ return ptman->TopDirectionLevel();
+ }
+ return m_nDirLevel;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if this glyph represents a LRM code.
+----------------------------------------------------------------------------------------------*/
+bool GrSlotState::IsLrm()
+{
+ if (PassModified() == 0)
+ return (m_nUnicode == knLRM);
+ return m_pslotPrevState->IsLrm();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if this glyph represents a RLM code.
+----------------------------------------------------------------------------------------------*/
+bool GrSlotState::IsRlm()
+{
+ if (PassModified() == 0)
+ return (m_nUnicode == knRLM);
+ return m_pslotPrevState->IsRlm();
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Used by GlyphInfo
+----------------------------------------------------------------------------------------------*/
+//float GrSlotOutput::AdvanceX(Segment * pseg)
+//{
+// return pseg->EmToLogUnits(m_mAdvanceX);
+//}
+//float GrSlotOutput::AdvanceY(Segment * pseg)
+//{
+// return pseg->EmToLogUnits(m_mAdvanceY);
+//}
+float GrSlotOutput::MaxStretch(Segment * pseg, int level)
+{
+ Assert(level == 0);
+ return (level == 0) ? pseg->EmToLogUnits(m_mJStretch0) : 0;
+}
+float GrSlotOutput::MaxShrink(Segment * pseg, int level)
+{
+ Assert(level == 0);
+ return (level == 0) ? pseg->EmToLogUnits(m_mJShrink0) : 0;
+}
+float GrSlotOutput::StretchStep(Segment * pseg, int level)
+{
+ Assert(level == 0);
+ return (level == 0) ? pseg->EmToLogUnits(m_mJStep0) : 0;
+}
+int GrSlotOutput::JustWeight(int level)
+{
+ Assert(level == 0);
+ return (level == 0) ? m_nJWeight0 : 0;
+}
+float GrSlotOutput::JustWidth(Segment * pseg, int level)
+{
+ Assert(level == 0);
+ return (level == 0) ? pseg->EmToLogUnits(m_mJWidth0) : 0;
+}
+float GrSlotOutput::MeasureSolLogUnits(Segment * pseg)
+{
+ return pseg->EmToLogUnits(m_mMeasureSol);
+}
+float GrSlotOutput::MeasureEolLogUnits(Segment * pseg)
+{
+ return pseg->EmToLogUnits(m_mMeasureEol);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Make a copy of the GrSlotOutput. This is used in making an identical copy of the segment.
+ Warning: this function will break if GrSlotState and subclasses are given virtual
+ methods. In that case, we will need to copy from the address of the first variable in
+ GrSlotAbstract.
+----------------------------------------------------------------------------------------------*/
+void GrSlotOutput::ExactCopyFrom(GrSlotOutput * pslout, u_intslot * pnVarLenBuf, int cnExtraPerSlot)
+{
+ // The chunk of the object from GrSlotAbstract can be copied exactly,
+ // except for the variable-length buffer.
+ *this = *pslout;
+ m_prgnVarLenBuf = pnVarLenBuf;
+ std::copy(pslout->m_prgnVarLenBuf, pslout->m_prgnVarLenBuf + cnExtraPerSlot,
+ m_prgnVarLenBuf);
+
+ // Now copy the stuff specific to GrSlotOutput.
+ m_ichwBeforeAssoc = pslout->m_ichwBeforeAssoc;
+ m_ichwAfterAssoc = pslout->m_ichwAfterAssoc;
+ m_cComponents = pslout->m_cComponents;
+
+ m_isloutClusterBase = pslout->m_isloutClusterBase;
+ m_disloutCluster = pslout->m_disloutCluster;
+ m_xsClusterXOffset = pslout->m_xsClusterXOffset;
+ m_xsClusterAdvance = pslout->m_xsClusterAdvance;
+ m_igbb = pslout->m_igbb;
+ m_xsAdvanceX = pslout->m_xsAdvanceX;
+// m_ysAdvanceY = pslout->m_ysAdvanceY;
+// m_rectBB = pslout->m_rectBB;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Shift the glyph to the opposite end of the segment. This is needed for white-space-only
+ segments whose direction is being changed.
+----------------------------------------------------------------------------------------------*/
+void GrSlotOutput::ShiftForDirDepthChange(float dxsSegWidth)
+{
+ float dxsShift = dxsSegWidth - m_xsAdvanceX - (2 * m_xsPositionX);
+ int tmp; tmp = (int) dxsShift;
+ m_xsPositionX += dxsShift;
+// m_rectBB.left += dxsShift;
+// m_rectBB.right += dxsShift;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the indices of all the glyphs attached to this cluster, in logical order.
+ Return an empty vector if this glyph is not the base glyph or if there are no
+ attached glyphs.
+ This method return glyph indices, not slot indices.
+----------------------------------------------------------------------------------------------*/
+void GrSlotOutput::ClusterMembers(Segment * pseg, int isloutThis, std::vector<int> & visloutRet)
+{
+ if (m_isloutClusterBase == -1 || m_isloutClusterBase == isloutThis) // yes, a base
+ pseg->ClusterMembersForGlyph(isloutThis, m_disloutCluster, visloutRet);
+ else
+ {
+ Assert(visloutRet.size() == 0);
+ }
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/GrSlotState.h b/Build/source/libs/graphite/src/segment/GrSlotState.h
new file mode 100644
index 00000000000..d000927d1a4
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrSlotState.h
@@ -0,0 +1,1287 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999 - 2008 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrSlotState.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Copyright (C) 1999 by SIL International. All rights reserved.
+
+Description:
+ Classes GrSlotAbstract, GrSlotState, and GrSlotOutput
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef SLOTSTATE_INCLUDED
+#define SLOTSTATE_INCLUDED
+
+namespace gr
+{
+
+class GrSlotAbstract;
+class GrSlotState;
+class GrSlotOutput;
+class GrSlotStream;
+class Font;
+
+//:End Ignore
+
+
+/*----------------------------------------------------------------------------------------------
+ Subsumes GrSlotState and GrSlotOutput, both of which represent a single glyph
+ and its slot attributes and features.
+
+ Hungarian: slab
+----------------------------------------------------------------------------------------------*/
+class GrSlotAbstract
+{
+ friend class GrSlotStream;
+ friend class GlyphInfo;
+
+public:
+ // Constructor:
+ GrSlotAbstract()
+ {
+ }
+
+ ~GrSlotAbstract()
+ {
+ // the table manager is responsible for destroying the contents of m_prgnVarLenBuf
+ }
+
+ void BasicInitializeAbstract(int cnCompPerLig, u_intslot * pnBuf)
+ {
+ m_dirc = kNotYetSet8;
+ m_lb = kNotYetSet8;
+ m_fInsertBefore = true;
+ m_nDirLevel = -1;
+
+ m_bIsSpace = -1; // unknown
+
+ m_fInsertBefore = true;
+
+ m_mMeasureSol = 0;
+ m_mMeasureEol = 0;
+
+ m_mJStretch0 = 0;
+ m_mJShrink0 = 0;
+ m_mJStep0 = 0;
+ m_nJWeight0 = 0;
+ m_mJWidth0 = 0;
+
+ m_cnCompPerLig = byte(cnCompPerLig);
+ m_prgnVarLenBuf = pnBuf;
+ }
+
+ void CopyAbstractFrom(GrSlotState * pslot);
+
+ void SetBufferPtr(u_intslot * pn)
+ {
+ m_prgnVarLenBuf = pn;
+ }
+
+ gid16 GlyphID() { return m_chwGlyphID; }
+ gid16 RawActualGlyph() { return m_chwActual; }
+ float GetGlyphMetric(Font * pfont, int nGlyphMetricID, gid16 chwGlyphID);
+
+ //GrSlotState * CompRefSlot(int i);
+
+ int BreakWeight()
+ {
+ return (int)m_lb;
+ }
+ DirCode Directionality()
+ {
+ return DirCode(int(m_dirc));
+ }
+ int InsertBefore()
+ {
+ return m_fInsertBefore;
+ }
+ int MeasureSol()
+ {
+ return m_mMeasureSol;
+ }
+ int MeasureEol()
+ {
+ return m_mMeasureEol;
+ }
+
+ int DirLevel()
+ {
+ return m_nDirLevel;
+ }
+
+ int SpecialSlotFlag()
+ {
+ return m_spsl;
+ }
+ void SetSpecialSlotFlag(int spsl)
+ {
+ m_spsl = sdata8(spsl);
+ }
+
+ enum {
+ kNotYetSet = 0x7FFF,
+ kNotYetSet8 = 0x7F,
+ kInvalidGlyph = 0xFFFF
+ };
+
+ gid16 ActualGlyphForOutput(GrTableManager * ptman);
+
+ // Needed for GlyphInfo:
+ float XPosition()
+ {
+ return m_xsPositionX;
+ }
+ float YPosition()
+ {
+ return m_ysPositionY; // relative to baseline (positive is up)
+ }
+
+protected:
+ gid16 m_chwGlyphID;
+ gid16 m_chwActual; // actual glyph to output (which is a different glyph for pseudos)
+
+ sdata8 m_spsl; // special slot flag: LB, bidi marker
+
+// bool m_fInitialLB; // for LB slots: true if this is the initial LB;
+ // false if it is the terminating LB
+ // TODO: remove
+
+ sdata8 m_dirc; // default = kNotYetSet8 (read from glyph attr)
+ sdata8 m_lb; // default = kNotYetSet8 (read from glyph attr)
+
+ sdata8 m_nDirLevel;
+
+ // Slot attributes that are used by GrSlotOutput:
+ short m_mMeasureSol;
+ short m_mMeasureEol;
+
+ unsigned short m_mJStretch0;
+ unsigned short m_mJShrink0;
+ unsigned short m_mJStep0;
+ int m_mJWidth0;
+ byte m_nJWeight0;
+
+ bool m_fInsertBefore; // default = true
+
+ sdata8 m_bIsSpace; // 0 = false, 1 = true, -1 = unknown
+
+ byte m_cnCompPerLig;
+ // There is a large block managed by either the GrTableManager (for GrSlotState)
+ // or the segment (for GrSlotOutput); this variable points at the sub-buffer for this
+ // particular slot:
+ u_intslot * m_prgnVarLenBuf;
+
+ float m_xsPositionX;
+ float m_ysPositionY;
+
+}; // end of class GrSlotAbstract
+
+
+/*----------------------------------------------------------------------------------------------
+ A GrSlotState represents one slot as modified by a pass in the table.
+ Each time a slot state is modified, a new instance is created, copying the relevant
+ information.
+
+ Hungarian: slot
+
+ Other hungarian:
+ m - integer indicating glyph design units ("em-units")
+ sr - integer indicating slot reference
+----------------------------------------------------------------------------------------------*/
+class GrSlotState : public GrSlotAbstract
+{
+ friend class GrSlotStream;
+ friend class FontMemoryUsage;
+
+public:
+ enum { kNeutral = 99 };
+
+ // Constructors:
+ GrSlotState()
+ : GrSlotAbstract(),
+ m_pslotPrevState(NULL)
+ {
+ m_vpslotAssoc.clear();
+ //m_fInitialLB = false; // TODO: remove
+ m_spsl = kspslNone;
+ m_fNeutralAssocs = false;
+ m_dircProc = kdircUnknown;
+ m_fDirProcessed = false;
+
+ m_vdislotAttLeaves.clear();
+ m_fAttachMod = false;
+ m_fShiftMod = false;
+ m_dislotRootFixed = 0;
+ ZapCompositeMetrics();
+ }
+
+ ~GrSlotState()
+ {
+ }
+
+ void BasicInitialize(int cnUserDefn, int cnCompPerLig, int cnFeat, u_intslot * pnBuf)
+ {
+ BasicInitializeAbstract(cnCompPerLig, pnBuf);
+
+ m_xysGlyphWidth = -1;
+ m_xysFontAscent = -1;
+ m_xysFontDescent = -1;
+
+ m_mAdvanceX = kNotYetSet;
+ m_mAdvanceY = kNotYetSet;
+ m_mShiftX = 0;
+ m_mShiftY = 0;
+
+ m_fAdvXSet = false; // for transduction logging
+ m_fAdvYSet = false;
+
+ m_srAttachTo = 0;
+ m_nAttachLevel = 0;
+
+ m_mAttachAtX = kNotYetSet;
+ m_mAttachAtY = 0;
+ m_nAttachAtGpoint = kNotYetSet;
+ m_mAttachAtXOffset = 0;
+ m_mAttachAtYOffset = 0;
+ m_mAttachWithX = kNotYetSet;
+ m_mAttachWithY = 0;
+ m_nAttachWithGpoint = kNotYetSet;
+ m_mAttachWithXOffset = 0;
+ m_mAttachWithYOffset = 0;
+
+ m_islotPosPass = kNotYetSet;
+
+ m_cnUserDefn = byte(cnUserDefn);
+ m_cnFeat = byte(cnFeat);
+
+ m_fHasComponents = false;
+ }
+
+ void Initialize(gid16 chw, GrEngine *, GrFeatureValues fval,
+ int ipass, int ichwSegOffset, int nUnicode = -1);
+ void Initialize(gid16 chw, GrEngine *, GrSlotState * pslotFeat,
+ int ipass, int ichwSegOffset);
+ void Initialize(gid16 chw, GrEngine *, GrSlotState * pslotFeat,
+ int ipass);
+
+ void InitializeFrom(GrSlotState * pslot, int ipass);
+ void CopyFeaturesFrom(GrSlotState * pslotSrc);
+ void FixAttachmentTree(GrSlotState * pslotOld);
+
+ void CopyFrom(GrSlotState * pslot, bool fCopyEverything = true);
+
+ // General:
+ int RawSegOffset() { return m_ichwSegOffset; }
+
+ void SetGlyphID(gid16 chw)
+ {
+ m_chwGlyphID = chw;
+ m_chwActual = kInvalidGlyph;
+ m_xysGlyphWidth = -1; // indicate glyph metrics are invalid
+ m_ipassFsmCol = -1;
+ m_colFsm = -1;
+ }
+
+ int PosPassIndex()
+ {
+ return m_islotPosPass;
+ }
+ void SetPosPassIndex(int islot, bool fInputToPosPass1)
+ {
+ // If we're resetting it, it should be to the same value as before:
+ Assert(fInputToPosPass1 || m_islotPosPass == kNotYetSet || m_islotPosPass == islot);
+ m_islotPosPass = islot;
+ }
+ void IncPosPassIndex()
+ {
+ m_islotPosPass++;
+ }
+ void ZapPosPassIndex()
+ {
+ m_islotPosPass = kNotYetSet;
+ }
+
+ int StyleIndex() { return m_bStyleIndex; }
+
+ int AttachTo() { return m_srAttachTo; }
+ int AttachLevel() { return m_nAttachLevel; }
+
+ int RawAttachAtX() { return m_mAttachAtX; }
+ int AttachAtY() { return m_mAttachAtY; }
+ int AttachAtGpoint() { return m_nAttachAtGpoint; }
+ int AttachAtXOffset() { return m_mAttachAtXOffset; }
+ int AttachAtYOffset() { return m_mAttachAtYOffset; }
+
+ int RawAttachWithX() { return m_mAttachWithX; }
+ int AttachWithY() { return m_mAttachWithY; }
+ int AttachWithGpoint() { return m_nAttachWithGpoint; }
+ int AttachWithXOffset() { return m_mAttachWithXOffset; }
+ int AttachWithYOffset() { return m_mAttachWithYOffset; }
+
+ void Associate(GrSlotState *);
+ void Associate(GrSlotState *, GrSlotState *);
+ void Associate(std::vector<GrSlotState*> &);
+ void ClearAssocs();
+
+ int AssocsSize() { return m_vpslotAssoc.size(); }
+ GrSlotState * RawBeforeAssocSlot()
+ {
+ if (m_vpslotAssoc.size() == 0)
+ return NULL;
+ return m_vpslotAssoc[0];
+ }
+ GrSlotState * RawAfterAssocSlot()
+ {
+ if (m_vpslotAssoc.size() == 0)
+ return NULL;
+ return m_vpslotAssoc.back();
+ }
+ ////GrSlotState * AssocSlot(int i) { return m_vpslotAssoc[i]; }
+
+ GrSlotState * AssocSlot(int i)
+ {
+ if (i < 0)
+ return NULL;
+ if (i >= signed(m_vpslotAssoc.size()))
+ return NULL;
+
+ GrSlotState * pslotAssoc = m_vpslotAssoc[i];
+ // handle possible reprocessing
+ while (pslotAssoc && pslotAssoc->PassModified() == m_ipassModified)
+ pslotAssoc = pslotAssoc->m_pslotPrevState;
+ return pslotAssoc;
+ }
+
+ void AllAssocs(std::vector<int> & vichw);
+ int BeforeAssoc();
+ int AfterAssoc();
+
+ void CleanUpAssocs();
+
+ void SetComponentRefsFor(GrSlotOutput *, int iComp = -1);
+ void AllComponentRefs(std::vector<int> & vichw);
+
+ int PassModified() { return m_ipassModified; }
+ int SegOffset();
+ int UnderlyingPos();
+ GrSlotState * PrevState() { return m_pslotPrevState; }
+
+ void MarkDeleted() // for now, do nothing
+ {
+ }
+
+ int IsSpace(GrTableManager * ptman);
+
+ // TODO: remove argument from these methods; it is no longer needed.
+ bool IsLineBreak(gid16 chwLB)
+ {
+ return (IsInitialLineBreak(chwLB) || IsFinalLineBreak(chwLB));
+ //return (m_chwGlyphID == chwLB); // TODO: remove
+ }
+ bool IsInitialLineBreak(gid16 chwLB)
+ {
+ return (m_spsl == kspslLbInitial);
+ //return (IsLineBreak(chwLB) && m_fInitialLB == true); // TODO: remove
+ }
+ bool IsFinalLineBreak(gid16 chwLB)
+ {
+ return (m_spsl == kspslLbFinal);
+ //return (IsLineBreak(chwLB) && m_fInitialLB == false); // TODO: remove
+ }
+
+ bool IsBidiMarker()
+ {
+ switch (m_spsl)
+ {
+ case kspslLRM:
+ case kspslRLM:
+ case kspslLRO:
+ case kspslRLO:
+ case kspslLRE:
+ case kspslRLE:
+ case kspslPDF:
+ return true;
+ default:
+ return false;
+ }
+ return false;
+ }
+
+ bool HasComponents() { return m_fHasComponents; }
+
+ // Directionality as determined by the bidi algorithm
+ DirCode DirProcessed() // return the value
+ {
+ Assert(m_dirc != kNotYetSet8);
+ if (m_dircProc == kdircUnknown)
+ m_dircProc = DirCode(m_dirc);
+ return m_dircProc;
+ }
+ void SetDirProcessed(DirCode dirc) // set the directionality
+ {
+ m_dircProc = dirc;
+ }
+ bool DirHasBeenProcessed() // has this slot been fully processed?
+ {
+ return m_fDirProcessed;
+ }
+ void MarkDirProcessed() // this slot has been fully processed
+ {
+ m_fDirProcessed = true;
+ }
+
+ int RawAdvanceX() { return m_mAdvanceX; }
+ int RawAdvanceY() { return m_mAdvanceY; }
+ int ShiftX() { return m_mShiftX; }
+ int ShiftY() { return m_mShiftY; }
+
+ // Slot attributes that must be calculated:
+
+ int AdvanceX(GrTableManager * ptman)
+ {
+ if (m_mAdvanceX == kNotYetSet)
+ // Initialize it from the glyph metric (adjusted for hinting).
+ m_mAdvanceX = short(GlyphMetricEmUnits(ptman, kgmetAdvWidth));
+ return m_mAdvanceX;
+ }
+
+ int AdvanceY(GrTableManager * ptman)
+ {
+ if (m_mAdvanceY == kNotYetSet)
+ // Initialize it from the glyph metric (adjusted for hinting).
+ m_mAdvanceY = short(GlyphMetricEmUnits(ptman, kgmetAdvHeight));
+ return m_mAdvanceY;
+ }
+
+ int AttachAtX(GrTableManager * ptman, GrSlotStream * psstrm)
+ {
+ if (m_mAttachAtX == kNotYetSet)
+ {
+ Assert(false); // Should have already been set in HandleModifiedPosition,
+ // but just in case...
+ if (m_srAttachTo == 0)
+ return 0;
+ else
+ m_mAttachAtX = short(AttachRoot(psstrm)->AdvanceX(ptman)); // attach on the right
+ }
+ return m_mAttachAtX;
+ }
+
+ int AttachWithX(GrTableManager * ptman, GrSlotStream * psstrm)
+ {
+ if (m_mAttachAtX == kNotYetSet)
+ {
+ Assert(false); // Should have already been set in HandleModifiedPosition,
+ // but just in case.
+ if (!m_srAttachTo == 0)
+ return 0;
+ else
+ m_mAttachAtX = 0; // attach on the right
+ }
+ return m_mAttachAtX;
+ }
+
+ int JStretch()
+ {
+ return m_mJStretch0;
+ }
+ int JShrink()
+ {
+ return m_mJShrink0;
+ }
+ int JStep()
+ {
+ return m_mJStep0;
+ }
+ int JWeight()
+ {
+ return m_nJWeight0;
+ }
+ int JWidth()
+ {
+ return m_mJWidth0;
+ }
+
+ // Slot attribute setters:
+
+ void SetAdvanceX(int mVal)
+ {
+ Assert(mVal < 0xFFFF); m_mAdvanceX = short(mVal & 0xFFFF); m_fShiftMod = true;
+ m_fAdvXSet = true; // for transduction logging
+ }
+ void SetAdvanceY(int mVal)
+ {
+ Assert(mVal < 0xFFFF); m_mAdvanceY = short(mVal & 0xFFFF); m_fShiftMod = true;
+ m_fAdvYSet = true; // for transduction logging
+ }
+ void SetShiftX(int mVal)
+ {
+ Assert(mVal < 0xFFFF); m_mShiftX = short(mVal & 0xFFFF);
+ m_fShiftMod = true;
+ }
+ void SetShiftY(int mVal)
+ {
+ Assert(mVal < 0xFFFF); m_mShiftY = short(mVal & 0xFFFF);
+ m_fShiftMod = true;
+ }
+
+ void SetAttachTo(int srVal)
+ {
+ Assert(srVal < 0xFFFF);
+ m_srAttachTo = short(srVal & 0xFFFF);
+ m_fAttachMod = true;
+ }
+ void SetAttachLevel(int nVal) {
+ Assert(nVal < 0xFFFF); m_nAttachLevel = short(nVal & 0xFFFF); m_fAttachMod = true; }
+
+ void SetAttachAtX(int mVal)
+ {
+ Assert(mVal < 0xFFFF);
+ m_mAttachAtX = short(mVal) & 0xFFFF;
+ m_fAttachMod = true;
+ }
+ void SetAttachAtY(int mVal) {
+ Assert(mVal < 0xFFFF); m_mAttachAtY = short(mVal & 0xFFFF); m_fAttachMod = true; }
+ void SetAttachAtGpoint(int nVal) {
+ m_nAttachAtGpoint = short(nVal); m_fAttachMod = true; }
+ void SetAttachAtXOffset(int mVal) {
+ Assert(mVal < 0xFFFF); m_mAttachAtXOffset = short(mVal & 0xFFFF); m_fAttachMod = true; }
+ void SetAttachAtYOffset(int mVal) {
+ Assert(mVal < 0xFFFF); m_mAttachAtYOffset = short(mVal & 0xFFFF); m_fAttachMod = true; }
+
+ void SetAttachWithX(int mVal) {
+ Assert(mVal < 0xFFFF); m_mAttachWithX = short(mVal & 0xFFFF); m_fAttachMod = true; }
+ void SetAttachWithY(int mVal) {
+ Assert(mVal < 0xFFFF); m_mAttachWithY = short(mVal & 0xFFFF); m_fAttachMod = true; }
+ void SetAttachWithGpoint(int nVal) {
+ m_nAttachWithGpoint = short(nVal); m_fAttachMod = true; }
+ void SetAttachWithXOffset(int mVal) {
+ Assert(mVal < 0xFFFF); m_mAttachWithXOffset = short(mVal & 0xFFFF); m_fAttachMod = true; }
+ void SetAttachWithYOffset(int mVal) {
+ Assert(mVal < 0xFFFF); m_mAttachWithYOffset = short(mVal & 0xFFFF); m_fAttachMod = true; }
+
+ void SetCompRefSlot(GrTableManager * ptman, int i, GrSlotState * pslotComp);
+
+ void SetBreakWeight(int lb) { m_lb = sdata8(lb); }
+ void SetInsertBefore(bool f) { m_fInsertBefore = f; }
+
+ void SetDirectionality(DirCode dirc) { m_dirc = sdata8(dirc); }
+ void SetDirLevel(int n) { m_nDirLevel = sdata8(n); }
+
+ void SetMeasureSol(int mVal) { m_mMeasureSol = short(mVal); }
+ void SetMeasureEol(int mVal) { m_mMeasureEol = short(mVal); }
+
+ void SetJStretch(int mVal) { m_mJStretch0 = short(mVal); }
+ void SetJShrink(int mVal) { m_mJShrink0 = short(mVal); }
+ void SetJStep(int mVal) { m_mJStep0 = short(mVal); }
+ void SetJWeight(int nVal) { m_nJWeight0 = byte(nVal); }
+ void SetJWidth(int mVal) { m_mJWidth0 = mVal; }
+ void AddJWidthToAdvance(GrTableManager * ptman)
+ {
+ // Don't change m_fShiftMod.
+ m_mAdvanceX = short(m_mJWidth0 + AdvanceX(ptman)); // make sure it is calculated
+ m_mJWidth0 = 0;
+ m_fAdvXSet = true; // for transduction logging
+ }
+
+ int PostBidiDirLevel(GrTableManager * ptman);
+
+ bool BaseEarlierInStream();
+
+ void ZapDirLevel()
+ {
+ m_nDirLevel = -1;
+ m_dircProc = kdircUnknown;
+ m_fDirProcessed = false;
+ }
+
+ int GlyphAttrValueEmUnits(GrTableManager * ptman, int nAttrID);
+ int GlyphMetricEmUnits(GrTableManager * ptman, int nGlyphMetricID);
+
+ float GlyphAttrValueLogUnits(GrTableManager * ptman, int nAttrID);
+ float GlyphMetricLogUnits(GrTableManager * ptman, int nGlyphMetricID);
+
+// void HandleModifiedCluster(GrTableManager * ptman,
+// GrSlotStream * psstrm, int islotThis);
+ void HandleModifiedPosition(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis);
+
+ void CalcCompositeMetrics(GrTableManager * ptman, GrSlotStream * psstrm,
+ int nLevel, bool fThorough = false);
+
+ void Position(GrTableManager * ptman,
+ GrSlotStream * psstrmOut, int * pmXPos, int * pmYPos);
+
+ void ZapPosition()
+ {
+ m_xsPositionX = kNegInfFloat;
+ m_ysPositionY = kNegInfFloat;
+ }
+
+ void SetXPos(float xs)
+ {
+ m_xsPositionX = xs;
+ }
+ void SetYPos(float ys)
+ {
+ m_ysPositionY = ys; // relative to baseline (positive is up)
+ }
+
+ float ClusterRootOffset() { return -m_xsClusterXOffset; } // the offset of the root
+ // relative to the whole cluster
+
+ float ClusterAdvWidthFrom(float xs) { return xs + m_xsClusterAdv; }
+ float ClusterBbLeftFrom(float xs) { return xs + m_xsClusterBbLeft; }
+ float ClusterBbRightFrom(float xs) { return xs + m_xsClusterBbRight; }
+
+ float ClusterLsb(GrSlotStream * psstrm, float xs)
+ {
+ return ClusterBbLeft(psstrm) + xs;
+ }
+ float ClusterRsb(GrSlotStream * psstrm, float xs)
+ {
+ return ClusterAdvWidthFrom(xs) - ClusterBbRightFrom(xs);
+ }
+
+ float ClusterAdvWidth(GrSlotStream * psstrm)
+ {
+ return ClusterAdvWidthFrom(Base(psstrm)->ClusterRootOffset());
+ }
+// int ClusterAdvHeight(GrSlotStream * psstrm)
+// {
+// Assert(m_mAdvanceY != kNotYetSet);
+// return EmUnitsToTwips(m_mAdvanceY);
+// }
+ float ClusterBbLeft(GrSlotStream * psstrm)
+ {
+ return ClusterBbLeftFrom(Base(psstrm)->ClusterRootOffset());
+ }
+ float ClusterBbRight(GrSlotStream * psstrm)
+ {
+ return ClusterBbRightFrom(Base(psstrm)->ClusterRootOffset());
+ }
+ float ClusterBbTop(GrSlotStream * psstrm)
+ {
+ return m_ysClusterBbTop;
+ }
+ float ClusterBbBottom(GrSlotStream * psstrm)
+ {
+ return m_ysClusterBbBottom;
+ }
+ float ClusterBbWidth(GrSlotStream * psstrm)
+ {
+ return m_xsClusterBbRight - m_xsClusterBbLeft + 1;
+ }
+ float ClusterBbHeight(GrSlotStream * psstrm)
+ {
+ return m_ysClusterBbTop - m_ysClusterBbBottom + 1;
+ }
+ float ClusterLsb(GrSlotStream * psstrm)
+ {
+ return ClusterBbLeft(psstrm);
+ }
+ float ClusterRsb(GrSlotStream * psstrm)
+ {
+ return ClusterAdvWidth(psstrm) - ClusterBbRight(psstrm);
+ }
+
+ float GlyphXOffset(GrSlotStream * psstrm, float fakeItalicRatio = 0);
+ float GlyphYOffset(GrSlotStream * psstrm = NULL);
+
+ bool IsBase()
+ {
+ Assert(m_dislotRootFixed == m_srAttachTo);
+ return (m_dislotRootFixed == 0);
+ }
+
+ bool HasClusterMembers()
+ {
+ return (m_vdislotAttLeaves.size() > 0);
+ }
+
+ GrSlotState * AttachRoot(GrSlotStream * psstrm)
+ {
+ if (m_srAttachTo == 0)
+ return NULL;
+ else
+ return SlotAtOffset(psstrm, m_srAttachTo);
+ }
+
+ int AttachRootPosPassIndex()
+ {
+ return PosPassIndex() + m_srAttachTo;
+ }
+
+ GrSlotState * Base(GrSlotStream * psstrm)
+ {
+ GrSlotState * pslotRoot = AttachRoot(psstrm);
+ if (!pslotRoot)
+ return this;
+ else
+ return pslotRoot->Base(psstrm);
+ }
+
+ int LastLeafOffset(GrSlotStream * psstrm);
+
+ void AddLeaf(int dislot)
+ {
+ m_vdislotAttLeaves.push_back(dislot * -1);
+ }
+ void RemoveLeaf(int dislot)
+ {
+ for (size_t iislot = 0; iislot < m_vdislotAttLeaves.size(); iislot++)
+ {
+ if (m_vdislotAttLeaves[iislot] == dislot * -1)
+ {
+ m_vdislotAttLeaves.erase(m_vdislotAttLeaves.begin() + iislot);
+ return;
+ }
+ }
+ Assert(false);
+ }
+
+ bool HasAsRoot(GrSlotStream * psstrm, GrSlotState * pslot)
+ {
+ GrSlotState * pslotRoot = AttachRoot(psstrm);
+ if (pslotRoot == pslot)
+ return true;
+ else if (pslotRoot == NULL)
+ return false;
+ else
+ return pslotRoot->HasAsRoot(psstrm, pslot);
+ }
+
+ bool HasAsPreviousState(GrSlotState * pslot)
+ {
+ if (this == pslot)
+ return true;
+ else
+ return m_pslotPrevState->HasAsPreviousState(pslot);
+ }
+
+ void EnsureCacheForOutput(GrTableManager * ptman);
+
+ bool IsLrm();
+ bool IsRlm();
+
+ // Cache of FSM column information for the most recent pass:
+ int FsmColumn() { return m_colFsm; }
+ int PassNumberForColumn() { return m_ipassFsmCol; }
+ void CacheFsmColumn(int ipass, int col)
+ {
+ m_colFsm = col;
+ m_ipassFsmCol = ipass;
+ }
+
+ // Variable-length buffer--includes four sub-buffers:
+ // * user-defined variables
+ // * component.???.ref assignments
+ // * mapping from components used to global attribute IDs for components
+ // * feature values
+
+ // user-defined slot attributes
+ int UserDefn(int slati)
+ {
+ Assert(slati < m_cnUserDefn);
+ return m_prgnVarLenBuf[slati].nValue;
+ }
+ void SetUserDefn(int slati, int nVal)
+ {
+ Assert(slati < m_cnUserDefn);
+ m_prgnVarLenBuf[slati].nValue = nVal;
+ }
+ u_intslot * PUserDefnBuf()
+ {
+ return m_prgnVarLenBuf;
+ }
+
+ // pointer to the associated slot which is the value of the comp.ref attribute
+ GrSlotState * CompRef(int slati)
+ {
+ Assert(slati < m_cnCompPerLig);
+ return m_prgnVarLenBuf[m_cnUserDefn + slati].pslot;
+ }
+ void SetCompRef(int slati, GrSlotState * pvSlot)
+ {
+ Assert(slati < m_cnCompPerLig);
+ m_prgnVarLenBuf[m_cnUserDefn + slati].pslot = pvSlot;
+ }
+ u_intslot * PCompRefBuf()
+ {
+ return m_prgnVarLenBuf + m_cnUserDefn;
+ }
+
+ // global component identifier
+ int Slati(int i)
+ {
+ Assert(i < m_cnCompPerLig);
+ return m_prgnVarLenBuf[m_cnUserDefn + m_cnCompPerLig + i].nValue;
+ }
+ void SetSlati(int i, int n)
+ {
+ Assert(i < m_cnCompPerLig);
+ m_prgnVarLenBuf[m_cnUserDefn + m_cnCompPerLig + i].nValue = n;
+ }
+ u_intslot * PSlatiBuf()
+ {
+ return m_prgnVarLenBuf + m_cnUserDefn + m_cnCompPerLig;
+ }
+
+ // feature settings
+ int FeatureValue(int i)
+ {
+ Assert(i < m_cnFeat);
+ return m_prgnVarLenBuf[m_cnUserDefn + (m_cnCompPerLig * 2) + i].nValue;
+ }
+
+ u_intslot * PFeatureBuf()
+ {
+ return m_prgnVarLenBuf + m_cnUserDefn + (m_cnCompPerLig * 2);
+ }
+
+ int CExtraSpace()
+ {
+ return m_cnUserDefn + (m_cnCompPerLig * 2) + m_cnFeat;
+ }
+
+ GrSlotState * CompRefSlot(int i);
+
+ void GetFeatureValues(GrFeatureValues * pfval)
+ {
+ pfval->m_nStyleIndex = m_bStyleIndex;
+ std::fill(pfval->m_rgnFValues, pfval->m_rgnFValues + kMaxFeatures, 0);
+ for (size_t i = 0; i < m_cnFeat; i++)
+ pfval->m_rgnFValues[i] = PFeatureBuf()[i].nValue;
+ }
+
+ // For transduction logging:
+#ifdef TRACING
+ void SlotAttrsModified(bool * rgfMods, bool fPreJust, int * pccomp, int * pcassoc);
+ void LogSlotAttributeValue(GrTableManager *, std::ostream &, int ipass, int slat, int icomp,
+ bool fPreJust, bool fPostJust);
+ void LogAssociation(GrTableManager * ptman,
+ std::ostream & strmOut, int ipass, int iassoc, bool fBoth, bool fAfter);
+ void LogXmlAttributes(std::ostream & strmOut, GrTableManager * ptman, GrSlotStream * psstrmOut,
+ int ipass, int islot,
+ bool fPreJust, bool fPostJust, bool fBidi, bool fBidiNext, int nIndent);
+ int GetSlotAttrValue(std::ostream & strmOut, GrTableManager * ptman,
+ int ipass, int slat, int iIndex, bool fPreJust, bool fPostJust);
+ int m_islotTmpIn; // for use by transduction log; index of slot in input stream
+ int m_islotTmpOut; // ditto; index of slot in output stream
+#endif // TRACING
+
+protected:
+
+ // Instance variables:
+ int m_ipassModified; // pass in which this slot was modified
+
+ GrSlotState * m_pslotPrevState;
+
+ int m_ichwSegOffset; // for original (pass 0) slot states: position in
+ // underlying text relative to the official
+ // beginning of the segment;
+ // should == kInvalid for other slot states
+ int m_islotPosPass; // index of slot in positioning streams, relative to first official
+ // slot in the segment (possibly the LB slot)
+
+ int m_colFsm; // which FSM column this glyph corresponds to...
+ int m_ipassFsmCol; // ...for the most recent pass
+
+ std::vector<GrSlotState*> m_vpslotAssoc; // association mappings
+
+ bool m_fNeutralAssocs; // true if we've set the associations to some neutral
+ // default, rather than them being set explicitly
+ // within a rule
+
+ int m_nUnicode; // for debugging
+
+ DirCode m_dircProc; // directionality as processed in bidi algorithm
+ bool m_fDirProcessed;
+
+ // affects length of variable-length buffer
+ byte m_cnUserDefn;
+ byte m_cnFeat;
+
+ byte m_bStyleIndex;
+
+ // Slot attributes:
+ short m_mAdvanceX;
+ short m_mAdvanceY;
+ short m_mShiftX;
+ short m_mShiftY;
+
+ short m_srAttachTo;
+ short m_nAttachLevel;
+
+ short m_mAttachAtX;
+ short m_mAttachAtY;
+ short m_mAttachAtXOffset;
+ short m_mAttachAtYOffset;
+ short m_mAttachWithX;
+ short m_mAttachWithY;
+ short m_mAttachWithXOffset;
+ short m_mAttachWithYOffset;
+
+ short m_nAttachAtGpoint;
+ short m_nAttachWithGpoint;
+
+ // Raw glyph metrics (directly from font)
+ float m_xysFontAscent;
+ float m_xysFontDescent;
+ float m_xysGlyphWidth;
+ float m_xysGlyphHeight;
+ float m_xysGlyphX;
+ float m_xysGlyphY;
+ float m_xysAdvX;
+ float m_xysAdvY;
+
+ // Attachment and metrics
+
+ // This is a flag that is set whenever we change the value of any of the attach
+ // slot attributes. Then when we want to find out something about the attachments,
+ // if it is set, we have some work to do in updating the pointers and metrics.
+ bool m_fAttachMod;
+
+ // This is a flag that is set whenever we change the value of any of the shift or
+ // advance slot attributes. It forces us to zap the metrics.
+ bool m_fShiftMod;
+
+ // This glyph (and all its leaves, if any) have a zero advance width;
+ // never allow it to affect the advance width of a cluster it is part of.
+ bool m_fIgnoreAdvance;
+
+ int m_dislotRootFixed; // the offset of the slot (relative to this one) that considers
+ // this slot to be one of its leaves
+ std::vector<int> m_vdislotAttLeaves;
+
+ // The following are used by the CalcCompositeMetrics() method and depend on
+ // the cluster level that was passed as an argument.
+
+ int m_nCompositeLevel; // cluster level last used to calculate composite metrics;
+ // kNegInfinity if uncalculated
+
+ // offsets for this node only, relative to cluster base
+ float m_xsOffsetX;
+ float m_ysOffsetY; // relative to baseline (positive is up)
+
+ // offsets for this node and its leaves, relative to cluster base (y-coords are
+ // relative to baseline)
+ float m_xsClusterXOffset;
+ float m_xsClusterAdv;
+ float m_xsClusterBbLeft;
+ float m_xsClusterBbRight;
+ float m_ysClusterBbTop;
+ float m_ysClusterBbBottom;
+
+ // cumulative total of shifts for this node and roots; advance needs to ignore these
+ float m_xsRootShiftX;
+ float m_ysRootShiftY;
+
+ bool m_fHasComponents; // default = false
+
+ // Private methods:
+
+ void CopyAbstractFrom(GrSlotState * pslot);
+
+ void AdjustRootMetrics(GrTableManager * ptman, GrSlotStream *);
+ void InitMetrics(GrTableManager * ptman, GrSlotState * pslotRoot);
+ void InitLeafMetrics(GrTableManager * ptman, GrSlotState * pslotRoot);
+ void InitRootMetrics(GrTableManager * ptman);
+ void CalcRootMetrics(GrTableManager * ptman, GrSlotStream *, int nLevel);
+ void AttachToRoot(GrTableManager * ptman, GrSlotStream *, GrSlotState * pslotNewRoot);
+ void AttachLogUnits(GrTableManager * ptman,
+ GrSlotState * pslotRoot,
+ float * pxsAttAtX, float * pysAttAtY,
+ float * pxsAttWithX, float * pysAttWithY);
+
+ GrSlotState * SlotAtOffset(GrSlotStream * psstrm, int dislot); // ENHANCE SharonC: inline?
+
+ void EnsureLocalAttachmentTree(GrTableManager * ptman,
+ GrSlotStream * psstrmIn, GrSlotStream * psstrmOut, int islotThis);
+
+ void ZapCompositeMetrics()
+ {
+ m_nCompositeLevel = kNegInfinity;
+ m_xsPositionX = kNegInfFloat;
+ m_ysPositionY = kNegInfFloat;
+ m_xsOffsetX = 0;
+ m_ysOffsetY = 0;
+ m_xsRootShiftX = 0;
+ m_ysRootShiftY = 0;
+ ZapRootMetrics();
+ }
+
+ void ZapRootMetrics()
+ {
+ m_xsClusterXOffset = 0;
+ m_xsClusterAdv = 0;
+ m_xsClusterBbLeft = 0;
+ m_xsClusterBbRight = 0;
+ m_ysClusterBbTop = 0;
+ m_ysClusterBbBottom = 0;
+ m_fIgnoreAdvance = false;
+ }
+
+ void ZapMetricsAndPositionDownToBase(GrSlotStream * psstrm)
+ {
+ ZapCompositeMetrics();
+ if (m_dislotRootFixed)
+ SlotAtOffset(psstrm, m_dislotRootFixed)->ZapMetricsAndPositionDownToBase(psstrm);
+ }
+
+ void ZapMetricsOfLeaves(GrSlotStream * psstrm, bool fThis = false)
+ {
+ if (fThis)
+ ZapCompositeMetrics();
+ for (size_t islot = 0; islot < m_vdislotAttLeaves.size(); islot++)
+ {
+ SlotAtOffset(psstrm, m_vdislotAttLeaves[islot])->ZapMetricsOfLeaves(psstrm, true);
+ }
+ }
+
+public: // for transduction logging
+ bool m_fAdvXSet;
+ bool m_fAdvYSet;
+
+}; // end of class GrSlotState
+
+
+/*----------------------------------------------------------------------------------------------
+ A GrSlotOutput represents one slot as the final output of the final pass. These
+ are recorded in the segment.
+
+ Hungarian: slout
+----------------------------------------------------------------------------------------------*/
+class GrSlotOutput : public GrSlotAbstract
+{
+ friend class GlyphInfo;
+ friend class Segment;
+ friend class SegmentMemoryUsage;
+
+public:
+ GrSlotOutput()
+ {
+ m_cComponents = 0;
+ m_isloutClusterBase = -1; // not part of any cluster
+ m_disloutCluster = 0;
+ m_igbb = -1;
+ }
+
+ void ExactCopyFrom(GrSlotOutput * pslout, u_intslot * pnVarLenBuf, int cnExtraPerSlot);
+
+ void InitializeOutputFrom(GrSlotState * pslot);
+
+ int BeforeAssoc()
+ {
+ return m_ichwBeforeAssoc; // relative to the official beginning of the segment
+ }
+ int AfterAssoc()
+ {
+ return m_ichwAfterAssoc; // relative to the official beginning of the segment
+ }
+
+ void SetBeforeAssoc(int ichw)
+ {
+ m_ichwBeforeAssoc = ichw;
+ }
+ void SetAfterAssoc(int ichw)
+ {
+ m_ichwAfterAssoc = ichw;
+ }
+ void AddComponentReference(int ichw, int slati)
+ {
+ if (m_cComponents >= m_cnCompPerLig)
+ {
+ Assert(false); // ignore the requested component ref
+ }
+ else
+ {
+ m_prgnVarLenBuf[m_cComponents].nValue
+ = ichw;
+
+ // OBSOLETE comment:
+ // Maps the used components to the defined components. Normally this will be
+ // one-to-one and the buffer will hold [0,1,2...]. But possibly we may
+ // have defined components a, b, and c, but only mapped a and c to actual
+ // characters. This buffer will then hold [0,2].
+
+ m_prgnVarLenBuf[m_cnCompPerLig + m_cComponents].nValue
+ = slati;
+
+// Assert(iComp >= m_cComponents); // because we process them in order they are defined
+ // in, but we could have skipped some that are
+ // defined
+ m_cComponents++;
+ }
+ }
+ int NumberOfComponents() // the number used by the rules
+ {
+ return m_cComponents;
+ }
+ // Index of ligature components, relative to the beginning of the segment.
+ // iComp is index of components USED in this glyph.
+ int UnderlyingComponent(int iComp)
+ {
+ Assert(iComp < m_cnCompPerLig);
+ return m_prgnVarLenBuf[iComp].nValue;
+ }
+ int ComponentId(int iComp)
+ {
+ return m_prgnVarLenBuf[m_cnCompPerLig + iComp].nValue;
+ }
+
+ //u_intslot * PCompRefBufSlout()
+ //{
+ // return m_prgnVarLenBuf;
+ //}
+
+ int CExtraSpaceSlout()
+ {
+ return (m_cnCompPerLig * 2);
+ }
+
+ void SetClusterBase(int islout)
+ {
+ m_isloutClusterBase = islout;
+ }
+
+ int ClusterBase()
+ {
+ return m_isloutClusterBase;
+ }
+
+ bool IsPartOfCluster()
+ {
+ return (m_isloutClusterBase > -1);
+ }
+
+ //int NumClusterMembers()
+ //{
+ // return m_visloutClusterMembers.size();
+ //}
+ //int ClusterMember(int iislout)
+ //{
+ // return m_visloutClusterMembers[iislout];
+ //}
+
+ void AddClusterMember(int isloutThis, int isloutAttached)
+ {
+ m_disloutCluster = sdata8(max(int(m_disloutCluster), abs(isloutThis - isloutAttached)));
+ }
+
+ void ClusterMembers(Segment * pseg, int islout, std::vector<int> & visloutRet);
+
+ int ClusterRange()
+ {
+ return m_disloutCluster;
+ }
+
+ float ClusterXOffset() { return m_xsClusterXOffset; }
+ float ClusterAdvance() { return m_xsClusterAdvance; }
+ void SetClusterXOffset(float xs) { m_xsClusterXOffset = xs; }
+ void SetClusterAdvance(float xs) { m_xsClusterAdvance = xs; }
+
+ float GlyphMetricLogUnits(Font * pfont, int nGlyphMetric);
+ //float GlyphMetricLogUnits(int nMetricID);
+
+ int GlyphBbIndex() { return m_igbb; }
+ void SetGlyphBbIndex (int i) { m_igbb = i; }
+
+ Rect BoundingBox(Font & font)
+ {
+ Rect rectBB;
+ rectBB.left = m_xsPositionX + GlyphMetricLogUnits(&font, kgmetBbLeft);
+ if (IsSpace())
+ rectBB.right = m_xsPositionX + GlyphMetricLogUnits(&font, kgmetAdvWidth);
+ else
+ rectBB.right = m_xsPositionX + GlyphMetricLogUnits(&font, kgmetBbRight);
+ rectBB.top = m_ysPositionY + GlyphMetricLogUnits(&font, kgmetBbTop);
+ rectBB.bottom = m_ysPositionY + GlyphMetricLogUnits(&font, kgmetBbBottom);
+ return rectBB;
+ }
+
+ bool IsLineBreak()
+ {
+ return (IsInitialLineBreak() || IsFinalLineBreak());
+ }
+ bool IsInitialLineBreak()
+ {
+ return (m_spsl == kspslLbInitial);
+ }
+ bool IsFinalLineBreak()
+ {
+ return (m_spsl == kspslLbFinal);
+ }
+
+ //float AdvanceXMetric()
+ //{
+ // return m_xysAdvX;
+ //}
+
+ bool IsSpace();
+
+ void AdjustPosXBy(float dxs)
+ {
+ m_xsPositionX += dxs;
+ //m_rectBB.left += dxs;
+ //m_rectBB.right += dxs;
+ }
+
+ void ShiftForDirDepthChange(float dxsSegWidth);
+
+ // Used by GlyphInfo
+ int IndexAttachedTo();
+ //inline float AdvanceX(Segment * pseg);
+ //inline float AdvanceY(Segment * pseg);
+ float MaxStretch(Segment * pseg, int level);
+ float MaxShrink(Segment * pseg, int level);
+ float StretchStep(Segment * pseg, int level);
+ int JustWeight(int level);
+ float JustWidth(Segment * pseg, int level);
+ float MeasureSolLogUnits(Segment * pseg);
+ float MeasureEolLogUnits(Segment * pseg);
+ Rect ComponentRect(Segment * pseg, int icomp);
+
+protected:
+ // Instance variables:
+
+ sdata8 m_cComponents;
+
+ data8 m_disloutCluster; // how far to search on either side of this glyph to find
+ // other members of the cluster;
+ // 0 means there are no cluster members or this glyph is
+ // attached to some other base
+
+ int m_isloutClusterBase; // the index of the slot that serves as the base for the
+ // cluster this slot is a part of; -1 if not part of cluster
+
+ int m_ichwBeforeAssoc; // index of associated character in the string
+ int m_ichwAfterAssoc; // (relative to the official beginning of the segment)
+ // char might possibly not be officially in this segment,
+ // in which case value is infinity
+
+ // Measurements for highlighting an entire cluster, relative to origin of this slot,
+ // which is the cluster base.
+ float m_xsClusterXOffset;
+ float m_xsClusterAdvance; // for single non-cluster glyphs, advance width of positioned glyph
+
+ // Index into m_prggbb in Segment; -1 indicates a line break slot that is not rendered:
+ int m_igbb;
+
+ float m_xsAdvanceX;
+// float m_ysAdvanceY; -- not used
+// Rect m_rectBB;
+
+}; // end of class GrSlotOutput
+
+} // namespace gr
+
+
+#endif // !SLOTSTATE_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/GrSlotStream.cpp b/Build/source/libs/graphite/src/segment/GrSlotStream.cpp
new file mode 100644
index 00000000000..db6a5c8af7e
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrSlotStream.cpp
@@ -0,0 +1,2368 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrSlotStream.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ GrSlotStream class implementation.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#include "GrConstants.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Answer true if there is nothing valid available to read from the stream.
+----------------------------------------------------------------------------------------------*/
+bool GrSlotStream::AtEnd()
+{
+ Assert(AssertValid());
+
+ if (m_islotReprocPos > -1 && m_islotReprocPos < signed(m_vpslotReproc.size()))
+ return false;
+
+ if (m_islotSegLim > -1 && m_islotReadPos >= m_islotSegLim)
+ // We've determined the segment limit, and we're at or past it.
+ return true;
+
+ return (m_islotReadPos == m_islotWritePos);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Answer true if there is nothing at all available to read from the stream.
+ For substitution passes, we need to consider slots that may be beyond what we know
+ will be the official end of the segment.
+----------------------------------------------------------------------------------------------*/
+bool GrSlotStream::AtEndOfContext()
+{
+ if (m_fUsedByPosPass)
+ return AtEnd();
+
+ if (m_islotReprocPos > -1 && m_islotReprocPos < signed(m_vpslotReproc.size()))
+ return false;
+
+ return (m_islotReadPos == m_islotWritePos);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Append a slot to the end of the stream.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::NextPut(GrSlotState * pslot)
+{
+ Assert(AssertValid());
+
+ if (m_islotWritePos < signed(m_vpslot.size()))
+ {
+ m_vpslot[m_islotWritePos] = pslot;
+ }
+ else
+ {
+ m_vpslot.push_back(pslot);
+ m_vislotPrevChunkMap.push_back(-1);
+ m_vislotNextChunkMap.push_back(-1);
+ }
+
+ if (m_fUsedByPosPass && GotIndexOffset())
+ pslot->SetPosPassIndex(m_islotWritePos - m_cslotPreSeg, m_fInputToPosPass1);
+
+ m_islotWritePos++;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the next slot from the stream.
+----------------------------------------------------------------------------------------------*/
+GrSlotState * GrSlotStream::NextGet()
+{
+ Assert(AssertValid());
+ Assert(!AtEndOfContext());
+
+ GrSlotState * pslotRet;
+
+ if (m_islotReprocPos > -1)
+ {
+ if (m_islotReprocPos >= signed(m_vpslotReproc.size()))
+ {
+ // Finished reprocessing.
+ Assert((unsigned)m_islotReprocPos == m_vpslotReproc.size());
+ m_islotReprocPos = -1;
+ // But leave the m_vpslotReproc array in place so that earlier slots can
+ // be accessed by the rules.
+ pslotRet = m_vpslot[m_islotReadPos];
+ m_islotReadPos++;
+ }
+ else
+ {
+ // Read from the reprocess buffer.
+ pslotRet = m_vpslotReproc[m_islotReprocPos];
+ m_islotReprocPos++;
+ }
+ }
+ else
+ {
+ // Read normally.
+ pslotRet = m_vpslot[m_islotReadPos];
+ m_islotReadPos++;
+ }
+
+ Assert(!m_fUsedByPosPass || pslotRet->PosPassIndex() != GrSlotAbstract::kNotYetSet);
+
+ return pslotRet;
+}
+
+/*---------------------------------------------------------------------------------------------
+ Peek at the next slot from the stream (dislot = 0 means the very next slot).
+ Only used for peeking forward. RuleInputSlot is used for accessing any possible
+ slot in the rule's context.
+----------------------------------------------------------------------------------------------*/
+GrSlotState * GrSlotStream::Peek(int dislot)
+{
+ Assert(AssertValid());
+ Assert(!AtEndOfContext());
+ Assert(dislot >= 0);
+
+ GrSlotState * pslotRet;
+
+ if (m_islotReprocPos > -1)
+ {
+ int cslotReproc = m_vpslotReproc.size() - m_islotReprocPos; // num left in reproc buffer
+ if (dislot >= cslotReproc)
+ {
+ // Not quite enough slots in the reprocess buffer.
+ pslotRet = m_vpslot[m_islotReadPos + dislot - cslotReproc];
+ }
+ else if (m_islotReprocPos + dislot < 0)
+ {
+ // Reading prior to the reprocess buffer
+ pslotRet = m_vpslot[m_islotReadPos + dislot - cslotReproc];
+ }
+ else
+ {
+ // Read from the reprocess buffer.
+ pslotRet = m_vpslotReproc[m_islotReprocPos + dislot];
+ }
+ }
+ else
+ {
+ // Read normally.
+ Assert(m_islotWritePos - m_islotReadPos > dislot);
+ pslotRet = m_vpslot[m_islotReadPos + dislot];
+ }
+
+ return pslotRet;
+}
+
+/*---------------------------------------------------------------------------------------------
+ Treat the stream, which is really the output stream, as an input stream,
+ retrieving a recently output slot. This happens when we are reading before the
+ current stream position when the rule is being matched, or before the original
+ stream position when the rule is being run.
+
+ @param dislot - how far back to peek before the write position
+ when the rule started; a negative number
+ (NOTE: the current write position is irrelevant)
+ @param fNullOkay - true if it's okay to return NULL in the situation where we're asking
+ for something before the beginning of the stream
+----------------------------------------------------------------------------------------------*/
+GrSlotState * GrSlotStream::PeekBack(int dislot, bool fNullOkay)
+{
+ Assert(dislot < 0);
+ if (dislot < m_islotRuleStartWrite * -1)
+ {
+ Assert(fNullOkay);
+ return NULL;
+ }
+ GrSlotState * pslotRet;
+ if (m_islotReprocPos > -1)
+ {
+ if (dislot < m_islotReprocLim - m_islotRuleStartWrite &&
+ dislot >= m_islotReprocLim - m_islotRuleStartWrite - signed(m_vpslotReproc.size()))
+ {
+ // Read from the reprocess buffer.
+ // Review: this is weird; can it ever happen?
+ pslotRet = m_vpslotReproc[m_vpslotReproc.size()
+ - (m_islotReprocLim - m_islotRuleStartWrite) + dislot];
+ }
+ else
+ pslotRet = m_vpslot[m_islotRuleStartWrite + dislot];
+ }
+ else
+ pslotRet = m_vpslot[m_islotRuleStartWrite + dislot];
+
+ return pslotRet;
+}
+
+/*---------------------------------------------------------------------------------------------
+ Skip the given number of slots in the stream.
+ ENHANCE: implement more efficiently
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::Skip(int dislot)
+{
+ for (int islot = 0; islot < dislot; ++islot)
+ NextGet();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Perform assertions to ensure that the stream is in a valid state.
+----------------------------------------------------------------------------------------------*/
+bool GrSlotStream::AssertValid()
+{
+ Assert(m_islotWritePos <= signed(m_vpslot.size()));
+ Assert(m_islotReadPos <= m_islotWritePos);
+ // Streams used by the positioning passes (input or output) should not be working
+ // with slots beyond the segment lim
+ Assert(m_islotSegLim == -1 || !m_fUsedByPosPass || m_islotReadPos <= m_islotSegLim);
+ Assert(m_vpslot.size() == m_vislotPrevChunkMap.size());
+ Assert(m_vpslot.size() == m_vislotNextChunkMap.size());
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of slots that have been completely output by the previous pass but not
+ yet processed by the following pass. ("Completely" output means that they do not need
+ to be reprocessed by the same pass, only then are they available as valid input.)
+ Include any slots that are present by virtue of needing to be reprocessed by the
+ corresponding output stream.
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::SlotsPending()
+{
+ Assert(AssertValid());
+ if (m_islotSegLim > -1)
+ return (m_islotSegLim - m_islotReadPos + SlotsToReprocess());
+ else
+ return (m_islotWritePos - m_islotReadPos + SlotsToReprocess());
+}
+
+int GrSlotStream::SlotsPendingInContext()
+{
+ Assert(AssertValid());
+ if (m_fUsedByPosPass)
+ return SlotsPending();
+ else
+ return (m_islotWritePos - m_islotReadPos + SlotsToReprocess());
+}
+
+int GrSlotStream::TotalSlotsPending()
+{
+ int cslot = SlotsPendingInContext();
+ if (m_fUsedByPosPass && m_islotSegLim > -1)
+ {
+ int ctmp = m_islotWritePos - m_islotReadPos + SlotsToReprocess();
+ if (ctmp > cslot)
+ {
+ int x; x = 3;
+ }
+ cslot = max(cslot, ctmp);
+ }
+ return cslot;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if this pass is input or output to a positioning pass and we're past the end
+ of the segment. So this stream is virtually finished.
+----------------------------------------------------------------------------------------------*/
+bool GrSlotStream::PastEndOfPositioning(bool fOutput)
+{
+ if (m_fUsedByPosPass && m_islotSegLim > -1)
+ {
+ if (fOutput) // this stream is functioning as an output stream
+ return (m_islotWritePos >= m_islotSegLim);
+ else // this stream is functioning as an input stream
+ return (m_islotReadPos >= m_islotSegLim);
+ }
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Mark the stream as fully written, so that the output pass doesn't keep trying to ask
+ for more input.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::MarkFullyWritten()
+{
+ m_fFullyWritten = true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the position of the first glyph at or following the given position
+ that is in the top direction, or -1 if we do not have a complete range.
+
+ @param ptman
+ @param islotStart
+ @nTopDirLevel - top direction: 0 = left-to-right, 1 = right-to-left
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::OldDirLevelRange(EngineState * pengst, int islotStart, int nTopDirLevel)
+{
+ Assert(m_islotReadPos <= islotStart);
+ Assert(islotStart < m_islotWritePos);
+
+ int islot = islotStart;
+ int nSlotDirLevel = GetSlotDirLevel(pengst, islot, nTopDirLevel, nTopDirLevel,
+ kdircUnknown, kdircNeutral);
+ if (nSlotDirLevel == -1)
+ return -1;
+ while (nSlotDirLevel > nTopDirLevel)
+ {
+ islot++;
+ if (islot >= m_islotWritePos)
+ {
+ if (m_fFullyWritten)
+ return islot;
+ else
+ return -1;
+ }
+ else if (m_islotSegLim > -1 && islot >= m_islotSegLim)
+ {
+ return islot;
+ }
+
+ nSlotDirLevel = GetSlotDirLevel(pengst, islot, nTopDirLevel, nTopDirLevel,
+ kdircUnknown, kdircNeutral);
+ if (nSlotDirLevel == -1)
+ return -1;
+ }
+ return islot;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the position of the first glyph at or following the given position
+ that is in the top direction, or -1 if we do not have a complete range.
+
+ @param ptman
+ @param islotStart
+ @nTopDirLevel - top direction: 0 = left-to-right, 1 = right-to-left
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::DirLevelRange(EngineState * pengst, int islotStart, int nTopDirLevel,
+ std::vector<int> & vislotStarts, std::vector<int> & vislotStops)
+{
+ Assert(m_islotReadPos <= islotStart);
+ Assert(islotStart < m_islotWritePos);
+
+ std::vector<int> vislotStartStack; // indices of starts of ranges to reverse
+
+ // Stack corresponding to embedding and override markers:
+ std::vector<DirCode> vdircMarkerStack;
+ std::vector<DirCode> vdircOverrideStack;
+ std::vector<int> vnLevelStack;
+
+ vislotStarts.clear();
+ vislotStops.clear();
+
+ //vislotStartStack.Push(islot);
+
+ int islotSegLim = (FullyWritten() || m_islotSegLim > -1) ?
+ FinalSegLim() :
+ WritePos() + 100; // arbitrarily large number
+
+ if (islotStart > islotSegLim)
+ {
+ // Don't do anything fancy with stuff beyond the end of the segment.
+ return 0;
+ }
+
+ DirCode dircMarker = kdircNeutral; // none so far
+ int nCurrLevel = nTopDirLevel;
+ int nMarkerLevel = nTopDirLevel;
+ //bool fHitMark = false;
+ DirCode dircOverride = kdircNeutral;
+ int islot = islotStart;
+ Assert(islot <= m_islotWritePos);
+
+ while (true)
+ {
+ GrSlotState * pslot = m_vpslot[islot];
+ DirCode dirc = pslot->DirProcessed();
+ bool fIncludeLast = false;
+ int nSlotDirLevel;
+ if (dirc == kdircLRO || dirc == kdircLRE) // steps X1, X3 in the Unicode bidi algorithm
+ {
+ vdircMarkerStack.push_back(dircMarker);
+ vdircOverrideStack.push_back(dircOverride);
+ vnLevelStack.push_back(nCurrLevel);
+ dircMarker = dirc;
+ dircOverride = (dirc == kdircLRO) ? kdircL : kdircNeutral;
+ nSlotDirLevel = (nCurrLevel % 2) ?
+ nCurrLevel + 1 : nCurrLevel + 2; // next highest LTR level
+ nMarkerLevel = nSlotDirLevel;
+
+ pslot->SetDirProcessed(dircMarker);
+ pslot->SetDirLevel(nMarkerLevel);
+ pslot->MarkDirProcessed();
+ }
+ else if (dirc == kdircRLO || dirc == kdircRLE) // steps X2, X4
+ {
+ vdircMarkerStack.push_back(dircMarker);
+ vdircOverrideStack.push_back(dircOverride);
+ vnLevelStack.push_back(nCurrLevel);
+ dircMarker = dirc;
+ dircOverride = (dirc == kdircRLO) ? kdircR : kdircNeutral;
+ nSlotDirLevel = (nCurrLevel % 2) ?
+ nCurrLevel + 2 : nCurrLevel + 1; // next highest RTL level
+ nMarkerLevel = nSlotDirLevel;
+
+ pslot->SetDirProcessed(dircMarker);
+ pslot->SetDirLevel(nMarkerLevel);
+ pslot->MarkDirProcessed();
+ }
+ else if (dirc == kdircPDF)
+ {
+ if (dircMarker == kdircNeutral)
+ pslot->SetDirProcessed((nCurrLevel % 2) ? kdircR : kdircL);
+ else
+ pslot->SetDirProcessed(RightToLeftDir(dircMarker) ? kdircPdfR : kdircPdfL);
+ pslot->SetDirLevel(nMarkerLevel);
+ pslot->MarkDirProcessed();
+
+ if (vnLevelStack.size())
+ {
+ dircMarker = vdircMarkerStack.back();
+ vdircMarkerStack.pop_back();
+ dircOverride = vdircOverrideStack.back();
+ vdircOverrideStack.pop_back();
+ nMarkerLevel = vnLevelStack.back();
+ vnLevelStack.pop_back();
+ nSlotDirLevel = nMarkerLevel;
+ fIncludeLast = true;
+ }
+ else // ignore
+ nSlotDirLevel = nCurrLevel;
+ }
+ else
+ {
+ nSlotDirLevel = GetSlotDirLevel(pengst, islot, nTopDirLevel, nMarkerLevel,
+ dircMarker, dircOverride);
+ if (nSlotDirLevel == -1)
+ return -1; // not enough slots
+ }
+
+ Assert(pengst->WhiteSpaceOnly() || nCurrLevel >= nTopDirLevel);
+ while (nSlotDirLevel > nCurrLevel)
+ {
+ vislotStartStack.push_back(islot);
+ nCurrLevel++;
+ }
+ // otherwise...
+ while (nTopDirLevel <= nCurrLevel && nSlotDirLevel < nCurrLevel)
+ {
+ if (vislotStartStack.size())
+ {
+ int islotStartTmp = vislotStartStack.back();
+ vislotStartStack.pop_back();
+ vislotStarts.push_back(islotStartTmp);
+ vislotStops.push_back(islot - 1); // previous character was the end of the range
+ }
+ else
+ Assert(pengst->WhiteSpaceOnly()); // the space is higher than the segment itself
+ nCurrLevel--;
+ }
+ // In the case of white-space-only segments, the space may be bumped up to a level
+ // higher than the segment itself.
+ Assert(pengst->WhiteSpaceOnly() || vislotStartStack.size() + nTopDirLevel == (unsigned)nCurrLevel);
+ Assert(pengst->WhiteSpaceOnly() || vnLevelStack.size() == vdircMarkerStack.size());
+ Assert(pengst->WhiteSpaceOnly() || vdircOverrideStack.size() == vdircMarkerStack.size());
+
+ if (nCurrLevel <= nTopDirLevel)
+ {
+ if (fIncludeLast)
+ {
+ // Include in the range to reverse the PDF or the char after the LRM/RLM.
+ // (Note: don't use a size_t below: we are decrementing below zero.)
+ for (int i = signed(vislotStops.size()) - 1; i >= 0 && vislotStops[i] == islot-1; i--)
+ {
+ vislotStops[i] = islot;
+ }
+ islot++;
+ }
+ break; // reached end of reversible range
+ }
+
+ islot++;
+ if (islot >= m_islotWritePos)
+ {
+ if (m_fFullyWritten)
+ break; // end of input
+ else
+ return -1; // not enough slots
+ }
+ else if (islot >= islotSegLim)
+ {
+ break; // end of input
+ }
+ }
+
+ // Reached the end of a reversable range.
+ while (vislotStartStack.size() > 0)
+ {
+ int islotStartTmp = vislotStartStack.back();
+ vislotStartStack.pop_back();
+ vislotStarts.push_back(islotStartTmp);
+ //vislotStops.push_back(min(islot, ReadPos() - 1));
+ //vislotStops.push_back(min(islot, max(ReadPos() - 1, islotStartTmp)));
+ vislotStops.push_back(min(islot - 1, islotSegLim - 1));
+ nCurrLevel--;
+ }
+ Assert(pengst->WhiteSpaceOnly() || nCurrLevel == nTopDirLevel);
+ Assert(vislotStarts.size() == vislotStops.size());
+
+ // The start- and stop-lists were generated in the order that we hit the stops, in other
+ // words, from inner to outer. Which is the order in which we need to do the reversals, too.
+
+ return islot;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Return the direction level of the glyph at the given position, according to the
+ Unicode bidi algorithm. Return -1 if there aren't enough slots in the stream to
+ figure it out.
+
+ ???? How should this handle the reprocessing sub-stream????
+
+ @param ptman
+ @param islot - slot for which information is requested
+ @param nOuterLevel - 0 = left-to-right, 1 = right-to-left
+ @param nCurrLevel
+ @param dircMarker - most recent override or embedding marker, if any
+ (for interpreting PDF codes)
+ @param dircOverride - override imposed by LRO or RLO
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::GetSlotDirLevel(EngineState * pengst, int islot,
+ int nOuterLevel, int nCurrLevel, DirCode dircMarker, DirCode dircOverride)
+{
+// Assert(m_psstrmReprocess == NULL);
+
+ GrSlotState * pslot = m_vpslot[islot];
+
+ int nDirLevel = pslot->DirLevel();
+ if (nDirLevel > -1)
+ // already figured out
+ return nDirLevel;
+
+ if (pengst->WhiteSpaceOnly())
+ {
+ // White-space-only segments should not have any reordering.
+ nDirLevel = pengst->ParaRightToLeft();
+ pslot->SetDirLevel(nDirLevel);
+ pslot->MarkDirProcessed();
+ return nDirLevel;
+ }
+
+ DirCode dirc = pslot->DirProcessed();
+
+ if (!pslot->DirHasBeenProcessed() && (WeakDir(dirc) || NeutralDir(dirc)) )
+ {
+ // Resolve weak and neutral types; process an entire run of weak types at once,
+ // in several passes.
+
+ int islotWeakRunLim = islot + 1;
+ while (true)
+ {
+ if (islotWeakRunLim >= m_islotWritePos)
+ {
+ if (!m_fFullyWritten)
+ return -1; // get more slots
+ else
+ break;
+ }
+ else if (m_islotSegLim > -1 && islotWeakRunLim >= SegLimIfKnown())
+ {
+ break;
+ }
+ if (StrongDir(m_vpslot[islotWeakRunLim]->DirProcessed()))
+ // ignore the line-break; we need the next strong dir after that
+ //// && !m_vpslot[islotWeakRunLim]->IsFinalLineBreak(ptman->LBGlyphID()))
+ {
+ break;
+ }
+ if (m_vpslot[islotWeakRunLim]->DirProcessed() == kdircPDF &&
+ dircMarker != kdircUnknown)
+ {
+ // A valid PDF is a strong code. TODO: replace kdircPDF with kdircPdfL/R
+ break;
+ }
+
+ islotWeakRunLim++;
+ }
+
+ int islotLp;
+
+ // X6. Handle directional overrides: LRO, RLO.
+ if (dircOverride != kdircNeutral)
+ {
+ for (islotLp = islot; islotLp < islotWeakRunLim; islotLp++)
+ {
+ m_vpslot[islotLp]->SetDirProcessed(dircOverride);
+ m_vpslot[islotLp]->MarkDirProcessed();
+ }
+ goto LSetDir;
+ }
+
+ DirCode dircLp;
+ //DirCode dircTmp;
+
+ // W1. Non-spacing marks get the type of the previous slot.
+ for (islotLp = islot; islotLp < islotWeakRunLim; islotLp++)
+ {
+ Assert(!m_vpslot[islotLp]->DirHasBeenProcessed());
+
+ if (m_vpslot[islotLp]->DirProcessed() == kdircNSM)
+ {
+#ifdef _DEBUG
+ if (islotLp <= 0)
+ {
+ Warn("Pathological case in bidi algorithm");
+ }
+#endif // _DEBUG
+ dircLp = AdjacentNonBndNeutralCode(pengst, islotLp - 1, -1, dircMarker);
+
+ m_vpslot[islotLp]->SetDirProcessed(dircLp);
+ }
+ }
+
+ // W2. European numbers are changed to Arabic numbers if the previous strong type
+ // was an Arabic letter.
+ DirCode dircPrevStrong = AdjacentStrongCode(pengst, islot - 1, -1, dircMarker);
+ if (dircPrevStrong == kdircRArab)
+ {
+ for (islotLp = islot; islotLp < islotWeakRunLim; islotLp++)
+ {
+ dircLp = m_vpslot[islotLp]->DirProcessed();
+ if (dircLp == kdircEuroNum)
+ m_vpslot[islotLp]->SetDirProcessed(kdircArabNum);
+ }
+ }
+
+ // W4. A single European separator between two Latin numbers changes to a Latin number.
+ // A single common separator between two numbers of the same type changes to that
+ // type.
+ for (islotLp = islot; islotLp < islotWeakRunLim; islotLp++)
+ {
+ dircLp = m_vpslot[islotLp]->DirProcessed();
+ if ((dircLp == kdircEuroSep || dircLp == kdircComSep) &&
+ islotLp + 1 < m_islotWritePos) // don't test last slot in stream
+ {
+ DirCode dircPrev = AdjacentNonBndNeutralCode(pengst, islotLp - 1, -1, dircMarker);
+ DirCode dircNext = AdjacentNonBndNeutralCode(pengst, islotLp + 1, 1, dircMarker);
+ if (dircPrev == dircNext)
+ {
+ if (dircLp == kdircEuroSep && dircPrev == kdircEuroNum)
+ {
+ m_vpslot[islotLp]->SetDirProcessed(kdircEuroNum);
+ }
+ else if (dircLp == kdircComSep &&
+ (dircPrev == kdircEuroNum || dircPrev == kdircArabNum))
+ {
+ m_vpslot[islotLp]->SetDirProcessed(dircPrev);
+ }
+ }
+ }
+ }
+
+ // W5, W6. A sequence of European number terminators adjacent to Latin numbers changes
+ // to Latin numbers.
+ // This appears to be an ambiguity in the official algorithm: do we search backward
+ // first, or forward? For our purposes, it is easier to search backward first.
+ for (islotLp = islot; islotLp < islotWeakRunLim; islotLp++)
+ {
+ dircLp = m_vpslot[islotLp]->DirProcessed();
+ if (dircLp == kdircEuroTerm || dircLp == kdircBndNeutral)
+ {
+ if (TerminatorSequence(pengst, islotLp - 1, -1, dircMarker) == kdircEuroNum)
+ dircLp = kdircEuroNum;
+ else
+ {
+ if (TerminatorSequence(pengst, islotLp + 1, 1, dircMarker) == kdircEuroNum)
+ dircLp = kdircEuroNum;
+ // else could possibly be unknown if we are at the end of the stream
+ }
+ }
+
+ // W6. Separators and terminators change to neutral. (Don't change
+ // boundary neutrals at this point, because that would confuse step Pre-L1.)
+ if (dircLp == kdircEuroSep || dircLp == kdircEuroTerm || dircLp == kdircComSep)
+ {
+ dircLp = kdircNeutral;
+ }
+ m_vpslot[islotLp]->SetDirProcessed(dircLp);
+ }
+
+ // W7. European numbers are changed to plain left-to-right if the previous strong type
+ // was left-to-right.
+ dircPrevStrong = AdjacentStrongCode(pengst, islot - 1, -1, dircMarker);
+ if (dircPrevStrong == kdircL)
+ {
+ for (islotLp = islot; islotLp < islotWeakRunLim; islotLp++)
+ {
+ dircLp = (m_vpslot[islotLp]->DirProcessed());
+ if (dircLp == kdircEuroNum)
+ m_vpslot[islotLp]->SetDirProcessed(kdircL);
+ }
+ }
+
+ // Pre-L1. Make a list of all the trailing whitespace characters that need to take
+ // on the direction of the final line break (ie, the top direction). We can't actually
+ // change them yet, because that would confuse the loop below. But we have to
+ // record them now because they might get changed in the loop below.
+ std::vector<int> vislotTrailingWS;
+ int islotFinalLB = -1;
+ for (islotLp = islotWeakRunLim; islotLp-- > islot; )
+ {
+ if (m_vpslot[islotLp]->IsFinalLineBreak(pengst->TableManager()->LBGlyphID()))
+ {
+ islotFinalLB = islotLp;
+ for (int islotLp2 = islotLp; islotLp2-- > islot; )
+ {
+ dircLp = m_vpslot[islotLp2]->DirProcessed();
+ if (dircLp == kdircWhiteSpace || dircLp == kdircBndNeutral)
+ vislotTrailingWS.push_back(islotLp2);
+ else
+ break; // hit something other than whitespace or neutral
+ }
+ break;
+ }
+ }
+
+ // N1. A sequence of neutrals takes the direction of the strong surrounding text if
+ // the text on both sides has the same direction. Latin and Arabic numbers are treated
+ // as if they are right-to-left.
+ // (If they are not the same, leave the type as neutral.)
+ for (islotLp = islot; islotLp < islotWeakRunLim; islotLp++)
+ {
+ dircLp = m_vpslot[islotLp]->DirProcessed();
+
+ // Change Boundary Neutrals to plain neutrals (must happen after Pre-L1).
+ if (dircLp == kdircBndNeutral)
+ {
+ m_vpslot[islotLp]->SetDirProcessed(kdircNeutral);
+ dircLp = kdircNeutral;
+ }
+
+ if (NeutralDir(dircLp))
+ {
+ // First, look for either a strong code or a number. If we get at least
+ // one strong code and a number with the same direction, use that strong
+ // code.
+ DirCode dircPrev = AdjacentStrongCode(pengst, islotLp - 1, -1, dircMarker, true);
+ DirCode dircNext = AdjacentStrongCode(pengst, islotLp + 1, 1, dircMarker, true);
+
+ if (dircNext == kdircUnknown)
+ return -1;
+
+ if (dircPrev == kdircUnknown)
+ dircPrev = dircNext;
+
+ DirCode dircResult = kdircUnknown;
+ if (dircNext == kdircNeutral)
+ {}
+ else if (RightToLeftDir(dircPrev) == RightToLeftDir(dircNext) &&
+ (StrongDir(dircNext) || StrongDir(dircPrev)))
+ {
+ // Got a strong matching direction.
+ dircResult = (StrongDir(dircPrev)) ? dircPrev : dircNext;
+ }
+ else if (dircNext == kdircPdfL || dircNext == kdircPdfR)
+ {
+ // A following PDF flag wins, because it represents the edge of a run.
+ dircResult = dircNext;
+ }
+ else if (StrongDir(dircNext) && StrongDir(dircPrev))
+ { // We must have text in different directions.
+ }
+ else
+ {
+ // Try again, insisting on strong codes, no numbers.
+ if (!StrongDir(dircPrev))
+ dircPrev = AdjacentStrongCode(pengst, islotLp - 1, -1, dircMarker, false);
+ if (!StrongDir(dircNext))
+ dircNext = AdjacentStrongCode(pengst, islotLp + 1, 1, dircMarker, false);
+ if (dircPrev == kdircUnknown)
+ dircPrev = dircNext;
+
+ if (RightToLeftDir(dircPrev) == RightToLeftDir(dircNext) &&
+ (StrongDir(dircNext) || StrongDir(dircPrev)))
+ {
+ // Got a strong matching direction.
+ dircResult = (StrongDir(dircPrev)) ? dircPrev : dircNext;
+ }
+ }
+
+ if (dircResult != kdircUnknown)
+ {
+ dircResult = (RightToLeftDir(dircResult)) ? kdircR : kdircL;
+ m_vpslot[islotLp]->SetDirProcessed(dircResult);
+ }
+ // else leave as neutral
+ }
+ }
+
+ // L1. Now change trailing neutrals recorded above to the directionality of
+ // the immediately following line-break, if any.
+ if (islotFinalLB != -1)
+ {
+ DirCode dircLB = m_vpslot[islotFinalLB]->DirProcessed();
+ dircLB = (dircLB == kdircLlb) ? kdircL : kdircR;
+ for (int iislot = 0; iislot < signed(vislotTrailingWS.size()); iislot++)
+ {
+ int islotTmp = vislotTrailingWS[iislot];
+ m_vpslot[islotTmp]->SetDirProcessed(dircLB);
+ }
+ }
+
+ // Mark all the slots processed.
+ for (islotLp = islot; islotLp < islotWeakRunLim; islotLp++)
+ m_vpslot[islotLp]->MarkDirProcessed();
+ }
+ else
+ m_vpslot[islot]->MarkDirProcessed();
+
+LSetDir:
+
+ // Final resolution.
+
+ dirc = pslot->DirProcessed();
+
+ if (dirc != kdircLlb && dirc != kdircRlb && dircOverride != kdircNeutral)
+ {
+ // Enforce whatever is imposed by the override.
+ m_vpslot[islot]->SetDirProcessed(dircOverride);
+ nDirLevel = nCurrLevel;
+ }
+ else if ((nCurrLevel % 2) == 0) // current level is even (left-to-right)
+ {
+ switch (dirc)
+ {
+ case kdircNeutral:
+ case kdircWhiteSpace:
+ nDirLevel = nCurrLevel;
+ break;
+
+ case kdircL:
+ nDirLevel = nCurrLevel;
+ break;
+
+ case kdircLlb:
+ case kdircRlb: // all line-breaks have the direction of the paragraph
+ nDirLevel = nOuterLevel;
+ break;
+
+ case kdircR:
+ case kdircRArab:
+ nDirLevel = nCurrLevel + 1;
+ break;
+
+ case kdircEuroNum:
+ case kdircArabNum:
+ nDirLevel = nCurrLevel + 2;
+ break;
+
+ default:
+ Assert(false);
+ nDirLevel = nCurrLevel;
+ }
+ }
+ else // current level is odd (right-to-left)
+ {
+ switch (dirc)
+ {
+ case kdircNeutral:
+ case kdircWhiteSpace:
+ nDirLevel = nCurrLevel;
+ break;
+
+ case kdircR:
+ //case kdircRlb:
+ case kdircRArab:
+ nDirLevel = nCurrLevel;
+ break;
+
+ case kdircL:
+ //case kdircLlb:
+ case kdircEuroNum:
+ case kdircArabNum:
+ nDirLevel = nCurrLevel + 1;
+ break;
+
+ case kdircLlb:
+ case kdircRlb: // all line-breaks have the direction of the paragraph
+ nDirLevel = nOuterLevel;
+ break;
+
+ default:
+ Assert(false);
+ nDirLevel = nCurrLevel;
+ }
+ }
+ pslot->SetDirLevel(nDirLevel);
+
+ return nDirLevel;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the next or previous strong code, kdircNeutral if we don't find one,
+ or kdircUnknown if we need more slots to process.
+
+ @param islot - index of slot of interest
+ @param nInc - +1 to search forward, -1 to search backward
+ @param fNumbersAreStrong - true if we want to treat numbers as having strong
+ directionality
+ @param dircPDF - how to interpret PDF codes (from corresponding RLO, etc)
+----------------------------------------------------------------------------------------------*/
+DirCode GrSlotStream::AdjacentStrongCode(EngineState * pengst, int islot, int nInc,
+ DirCode dircPDF, bool fNumbersAreStrong)
+{
+ if (islot < 0)
+ return pengst->InitialStrongDir();
+
+ else if (islot >= m_islotWritePos)
+ {
+ if (m_fFullyWritten || (m_islotSegLim > -1 && islot >= SegLimIfKnown()))
+ return kdircNeutral;
+ else
+ return kdircUnknown;
+ }
+
+ DirCode dirc = m_vpslot[islot]->DirProcessed();
+
+ if (dirc == kdircPDF && StrongDir(dircPDF))
+ return (RightToLeftDir(dircPDF)) ? kdircPdfR : kdircPdfL;
+ if (StrongDir(dirc))
+ return dirc;
+ if (fNumbersAreStrong && (dirc == kdircEuroNum || dirc == kdircArabNum))
+ return dirc;
+
+ return AdjacentStrongCode(pengst, islot + nInc, nInc, dircPDF, fNumbersAreStrong);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return kdircEuroNum if there is a terminator sequence starting or ending with a
+ European number. Return kdircUnknown if we need more slots to process.
+ Return kdircNeutral otherwise.
+
+ @param islot - index of slot of interest
+ @param nInc - +1 to search forward, -1 to search backward
+ @param dircPDF - how to interpret PDF codes (from corresponding RLO, etc)
+----------------------------------------------------------------------------------------------*/
+DirCode GrSlotStream::TerminatorSequence(EngineState * pengst, int islot, int nInc,
+ DirCode dircPDF)
+{
+ if (islot < 0)
+ return pengst->InitialTermDir();
+
+ else if (islot >= m_islotWritePos)
+ {
+ if (m_fFullyWritten)
+ return kdircNeutral;
+ else
+ return kdircUnknown;
+ }
+
+ DirCode dirc = m_vpslot[islot]->DirProcessed();
+
+ if (dirc == kdircPDF)
+ return (RightToLeftDir(dircPDF)) ? kdircPdfR : kdircPdfL;
+ else if (dirc == kdircEuroNum)
+ // number found at end of terminator sequence
+ return kdircEuroNum;
+ else if (dirc == kdircEuroTerm)
+ // yes, this slot is a terminator; are there more?
+ return TerminatorSequence(pengst, islot + nInc, nInc, dircPDF);
+ else if (dirc == kdircLlb || dirc == kdircRlb)
+ // line-break slot--ignore and keep going
+ return TerminatorSequence(pengst, islot + nInc, nInc, dircPDF);
+ else if (dirc == kdircBndNeutral)
+ // boundary neutral--ignore and keep going
+ return TerminatorSequence(pengst, islot + nInc, nInc, dircPDF);
+ else
+ // no number found
+ return kdircNeutral;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the previous code that is not a Boundary Neutral. Return Other Neutral if there
+ is no such.
+
+ @param islot - index of slot of interest
+ @param nInc - +1 to search forward, -1 to search backward
+ @param dircPDF - how to interpret PDF codes (from corresponding RLO, etc)
+----------------------------------------------------------------------------------------------*/
+DirCode GrSlotStream::AdjacentNonBndNeutralCode(EngineState * pengst, int islot, int nInc,
+ DirCode dircPDF)
+{
+ Assert(islot < m_islotWritePos);
+ if (islot < 0)
+ return kdircNeutral; // or should we use: ptman->InitialStrongDir() ??
+
+ else if (islot >= m_islotWritePos)
+ {
+ if (m_fFullyWritten)
+ return kdircNeutral;
+ else
+ return kdircUnknown;
+ }
+
+ DirCode dirc = m_vpslot[islot]->DirProcessed();
+
+ if (dirc == kdircBndNeutral)
+ return AdjacentNonBndNeutralCode(pengst, islot + nInc, nInc, dircPDF);
+ else if (dirc == kdircPDF)
+ return (RightToLeftDir(dircPDF)) ? kdircPdfR : kdircPdfL;
+ else
+ return dirc;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Directionality type functions.
+----------------------------------------------------------------------------------------------*/
+bool StrongDir(DirCode dirc)
+{
+ return (dirc == kdircL || dirc == kdircR || dirc == kdircRArab ||
+ dirc == kdircLRO || dirc == kdircRLO || dirc == kdircLRE || dirc == kdircRLE ||
+ dirc == kdircPdfL || dirc == kdircPdfR);
+}
+
+bool WeakDir(DirCode dirc)
+{
+ return (dirc == kdircEuroNum || dirc == kdircEuroSep ||
+ dirc == kdircEuroTerm || dirc == kdircArabNum ||
+ dirc == kdircComSep || dirc == kdircBndNeutral || dirc == kdircNSM);
+}
+
+bool NeutralDir(DirCode dirc)
+{
+ return (dirc == kdircWhiteSpace || dirc == kdircNeutral);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Special values used by the bidi algorithm.
+----------------------------------------------------------------------------------------------*/
+bool BidiCode(int nUnicode)
+{
+ switch (nUnicode)
+ {
+ case knLRM:
+ case knRLM:
+ case knLRO:
+ case knRLO:
+ case knLRE:
+ case knRLE:
+ case knPDF:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the directionality should be treated as right-to-left.
+ Used for the step of resolving neutrals (N1).
+----------------------------------------------------------------------------------------------*/
+bool RightToLeftDir(DirCode dirc)
+{
+ switch (dirc)
+ {
+ case kdircL:
+ case kdircLRO:
+ case kdircLRE:
+ case kdircPdfL:
+ return false;
+
+ case kdircR:
+ case kdircRArab:
+ case kdircArabNum:
+ case kdircEuroNum:
+ case kdircRLO:
+ case kdircRLE:
+ case kdircPdfR:
+ return true;
+
+ case kdircNeutral:
+ return false;
+
+ default:
+ Assert(false);
+ return false;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy a slot from prevStream, incrementing the positions.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::CopyOneSlotFrom(GrSlotStream * psstrmPrev)
+{
+#ifdef _DEBUG
+ gid16 chw; chw = psstrmPrev->Peek()->GlyphID();
+#endif
+
+ // If we are exactly at the segment boundary, pass the information on to this stream.
+ if (psstrmPrev->AtSegMin())
+ SetSegMinToWritePos();
+ if (psstrmPrev->AtSegLim())
+ SetSegLimToWritePos();
+
+ NextPut(psstrmPrev->NextGet());
+
+ AssertValid();
+ psstrmPrev->AssertValid();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy one slot from the input stream to the recipient, which is the output stream.
+ Used when reversing ranges of glyphs; caller is responsible for adjusting the read-
+ and write-positions of the streams.
+
+ REVIEW: How should this handle the reprocessing sub-stream? Currently this is not a problem
+ because this function is only used by the bidi pass, which never has intra-pass
+ reprocessing.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::SimpleCopyFrom(GrSlotStream * psstrmI, int islotInput, int islotOutput)
+{
+ if (signed(m_vpslot.size()) < islotOutput + 1)
+ {
+ m_vpslot.resize(islotOutput + 1);
+ m_vislotPrevChunkMap.resize(islotOutput + 1);
+ m_vislotNextChunkMap.resize(islotOutput + 1);
+ }
+
+ m_vpslot[islotOutput] = psstrmI->m_vpslot[islotInput];
+ m_vislotPrevChunkMap[islotOutput] = -1;
+ m_vislotNextChunkMap[islotOutput] = -1;
+
+ Assert(m_fUsedByPosPass);
+ if (m_fUsedByPosPass && GotIndexOffset())
+ m_vpslot[islotOutput]->SetPosPassIndex(islotOutput - m_cslotPreSeg, m_fInputToPosPass1);
+
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if there is physical space to add more glyphs, false if the positioning
+ has caused them to use all the alotted space. Recipient is assumed to be output
+ stream from the final pass.
+
+ @param ptman - table manager, for handling the positioning
+ @param pgg - graphics device
+ @param xsSpaceAllotted - how much space is available
+ @param fWidthIsCharCount - kludge for test procedures
+ @param fIgnoreTrailingWS - true if we are ignoring trailing white-space (currently
+ always true)
+ @param twsh - how the segment is handling trailing white-space
+ @param pxsWidth - return width of stuff so far
+----------------------------------------------------------------------------------------------*/
+bool GrSlotStream::MoreSpace(GrTableManager * ptman,
+ float xsSpaceAllotted, bool fWidthIsCharCount,
+ bool fIgnoreTrailingWS, TrWsHandling twsh,
+ float * pxsWidth)
+{
+ Assert(ptman->NumberOfPasses() - 1 == m_ipass);
+
+ if (fWidthIsCharCount)
+ {
+ // Used in test procedures
+ *pxsWidth = (float)m_islotWritePos;
+ return (m_islotWritePos < xsSpaceAllotted);
+ }
+ else
+ {
+ *pxsWidth = -1;
+ if (!GotIndexOffset())
+ return true;
+ if (WritePos() <= IndexOffset())
+ return true;
+ int dislot = MaxClusterSlot(WritePos());
+ if (dislot == kNegInfinity || dislot > 0)
+ // We're in the middle of processing a cluster--we have to keep processing,
+ // so for now assume there is more space.
+ return true;
+
+ float xsWidth, xsVisWidth;
+ ptman->CalcPositionsUpTo(m_ipass, NULL, &xsWidth, &xsVisWidth);
+
+ *pxsWidth = (fIgnoreTrailingWS || twsh == ktwshOnlyWs) ? xsVisWidth : xsWidth;
+ return (*pxsWidth < xsSpaceAllotted);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Work backwards from the prevLineBreak position (or if none, the readPos) to find the
+ previous line-break of the given weight or less. Return the position of the inserted
+ line-break slot, or -1 if no appropriate break point was found. Recipient should be
+ the output of the final line break pass, or if none, the output of the
+ glyph-generation pass.
+
+ @param ptman - table manager, for supplying new slots
+ @param islotPrevBreak - position of previous inserted line break
+ @param fInsertedLB - did we actually insert a line-break glyph before?
+ @param islotStartTry - where to start looking, or -1 for the end of the stream
+ @param lb - (max) break weight to allow
+ @param twsh - how we are handling trailing white-space
+ @param islotMin - first slot that is officially part of the segment (after initial LB)
+ @param plbNextToTry - the best we found
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::InsertLineBreak(GrTableManager * ptman,
+ int islotPrevBreak, bool fInsertedLB, int islotStartTry,
+ LineBrk lb, TrWsHandling twsh, int islotMin,
+ LineBrk * plbNextToTry)
+{
+ EngineState * pengst = ptman->State();
+
+ Assert(!fInsertedLB || islotPrevBreak > -1);
+
+ int ichwSegOffset;
+ int islot;
+ LineBrk lbFound;
+ if (!FindSegmentEnd(ptman, islotStartTry, lb, twsh, islotMin,
+ &islot, &ichwSegOffset, &lbFound, plbNextToTry))
+ {
+ return -1; // didn't find a legal break
+ }
+
+ GrSlotState * pslotCopyFeat = pengst->AnAdjacentSlot(m_ipass, islot + 1);
+ Assert(pslotCopyFeat);
+
+ if (islotPrevBreak > -1 && fInsertedLB)
+ {
+ //GrSlotState * pslotOld = m_vpslot[islotPrevBreak];
+
+ m_vpslot.erase(m_vpslot.begin() + islotPrevBreak);
+ m_vislotPrevChunkMap.erase(m_vislotPrevChunkMap.begin() + islotPrevBreak);
+ m_vislotNextChunkMap.erase(m_vislotNextChunkMap.begin() + islotPrevBreak);
+ AdjustPrevStreamNextChunkMap(ptman, islotPrevBreak + 1, -1);
+ }
+ else
+ {
+ m_islotReadPos++;
+ m_islotWritePos++;
+ }
+
+ GrSlotState * pslotNew;
+ pengst->NewSlot(ptman->LBGlyphID(), pslotCopyFeat, 0, ichwSegOffset, &pslotNew);
+
+ pslotNew->SetSpecialSlotFlag(kspslLbFinal);
+ pslotNew->SetBreakWeight(lbFound);
+ pslotNew->SetDirectionality(ptman->RightToLeft() ? kdircRlb : kdircLlb);
+
+ int islotLB = islot + 1;
+ m_vpslot.insert(m_vpslot.begin() + islotLB, pslotNew);
+ // Inserting -1 makes it part of a chunk with the previous char/glyph
+ m_vislotPrevChunkMap.insert(m_vislotPrevChunkMap.begin() + islotLB, -1);
+ m_vislotNextChunkMap.insert(m_vislotNextChunkMap.begin() + islotLB, -1);
+ AdjustPrevStreamNextChunkMap(ptman, islotLB, 1);
+ // We don't need to adjust the following stream because we are going to unwind it anyway.
+
+ if (m_fUsedByPosPass && GotIndexOffset())
+ {
+ pslotNew->SetPosPassIndex(islot - m_cslotPreSeg, m_fInputToPosPass1);
+ // Increment the stream index for the following slots.
+ for (int islotTmp = islotLB;
+ islotTmp < ((islotPrevBreak == -1) ? m_islotWritePos : islotPrevBreak + 1);
+ islotTmp++)
+ {
+ SlotAt(islotTmp)->IncPosPassIndex();
+ }
+ }
+
+ m_islotSegLim = islotLB + 1; // after the line-break glyph
+
+ return islotLB;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Make a segment break that does not correspond to a line break; ie, don't insert
+ a line-break glyph.
+
+ Work backwards from the prevLineBreak position (or if none, the readPos) to find the
+ previous line-break of the given weight or less. Return the position of the final slot
+ in the segment, or -1 if no appropriate break point was found. Recipient should be
+ the output of the final line break pass, if any, or the glyph-generation pass.
+
+ @param ptman - table manager, for supplying new slots
+ @param islotPrevBreak - position of previous inserted line break
+ @param fInsertedLB - did we actually insert a line-break glyph previously; currently
+ ignored
+ @param islotStartTry - where to start looking, or -1 for the end of the stream
+ @param lb - (max) break weight to allow
+ @param twsh - how we are handling trailing white-space
+ @param islotMin - first slot that is officially part of the segment (after initial LB)
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::MakeSegmentBreak(GrTableManager * ptman,
+ int islotPrevBreak, bool fInsertedLB, int islotStartTry,
+ LineBrk lb, TrWsHandling twsh, int islotMin,
+ LineBrk * plbNextToTry)
+{
+ int ichwSegOffset;
+ int islot;
+ LineBrk lbFound;
+ if (!FindSegmentEnd(ptman, islotStartTry, lb, twsh, islotMin,
+ &islot, &ichwSegOffset, &lbFound, plbNextToTry))
+ {
+ return -1; // didn't find a legal break
+ }
+
+ // Review: do we need to delete any previously-inserted line-break glyph from the stream?
+ // Doesn't seem like this has been a problem so far.
+
+ m_islotSegLim = islot + 1; // after the final glyph of this segment
+
+ return islot;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Work backwards from the prev line break position (or if none, the readPos) to find an
+ earlier line-break of the given weight or less.
+ Recipient should be the output of the final line break pass, if any, or the output
+ of the glyph-generation pass.
+
+ @param ptman - table manager, for supplying new slots
+ @param islotStartTry - where to start looking, or -1 for the end of the stream
+ @param lb - (max) break weight to allow
+ @param twsh - how we are handling trailing white-space
+ @param islotMin - first slot that is officially part of the segment (after initial LB)
+ @param pislot - slot AFTER which the break will go (not the lim of the segment)
+ @param pichwSegOffset - offset relative to the segment
+ @param plbFound - weight of break to be created
+ @param plbNextToTry - best found, in case we didn't find one at the requested level
+
+ @return Whether or not an appropriate break was found.
+----------------------------------------------------------------------------------------------*/
+bool GrSlotStream::FindSegmentEnd(GrTableManager * ptman,
+ int islotStartTry, LineBrk lb, TrWsHandling twsh, int islotMin,
+ int * pislot, int * pichwSegOffset, LineBrk * plbFound,
+ LineBrk * plbNextToTry)
+{
+ Assert(AssertValid());
+ Assert(m_ipass == ptman->NumberOfLbPasses());
+
+ if (islotStartTry < 0)
+ return false;
+
+ *pislot = islotStartTry;
+ GrSlotState * pslot = m_vpslot[*pislot];
+ *plbNextToTry = klbClipBreak; // worst break
+
+ ptman->State()->SetRemovedTrWhiteSpace(false);
+
+ while (twsh != ktwshOnlyWs) // in white-space only case, ignore lb values
+ {
+ if (*pislot < islotMin)
+ {
+ return false;
+ }
+ *plbFound = LineBrk(pslot->m_lb);
+ // Sanity check
+ if (abs(*plbFound) > klbClipBreak)
+ {
+// Assert(false);
+ Warn("Unusually large breakweight");
+ *plbFound = (LineBrk)((*plbFound < 0) ? -klbClipBreak : klbClipBreak);
+ }
+ *plbNextToTry = (LineBrk)(min(static_cast<int>(*plbNextToTry), abs(*plbFound)));
+ *pichwSegOffset = pslot->SegOffset();
+
+ if (int(*plbFound) >= 0 && *plbFound <= lb)
+ break;
+
+ --(*pislot);
+ if (*pislot < 0)
+ {
+ return false;
+ }
+ pslot = m_vpslot[*pislot];
+
+ if (int(*plbFound) <= 0 && ((int)*plbFound * -1) <= lb)
+ {
+ *plbFound = LineBrk(int(*plbFound) * -1);
+ break;
+ }
+ }
+
+ // Found a good break.
+
+ if (twsh == ktwshOnlyWs)
+ {
+ // white-space-only segment
+ while (pslot->Directionality() != kdircWhiteSpace)
+ {
+ --(*pislot);
+ if (*pislot < 0)
+ return false;
+ pslot = m_vpslot[*pislot];
+ *pichwSegOffset = pslot->SegOffset();
+ }
+ }
+ else if (twsh == ktwshNoWs)
+ {
+ // no trailing white-space: remove it
+ while (pslot->Directionality() == kdircWhiteSpace)
+ {
+ --(*pislot);
+ if (*pislot < 0)
+ return false;
+ pslot = m_vpslot[*pislot];
+ *pichwSegOffset = pslot->SegOffset();
+ ptman->State()->SetRemovedTrWhiteSpace(true);
+ }
+ }
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the stream (which should be the output of the last linebreak pass) has
+ a better break at some earlier point than the one we found.
+
+ @param islotBreak - position of inserted or final break point in stream, or index
+ of last valid slot
+----------------------------------------------------------------------------------------------*/
+bool GrSlotStream::HasEarlierBetterBreak(int islotBreak, LineBrk lbFound, gid16 chwLB)
+{
+ Assert(AssertValid());
+
+ int islot = islotBreak;
+ if (SlotAt(islot)->IsFinalLineBreak(chwLB))
+ islot--;
+
+ if (lbFound == klbNoBreak)
+ lbFound = (LineBrk)SlotAt(islot)->BreakWeight();
+
+ while (islot >= 0)
+ {
+ if (SlotAt(islot)->IsInitialLineBreak(chwLB))
+ return false;
+ if (SlotAt(islot)->BreakWeight() < lbFound)
+ return true;
+ islot--;
+ }
+
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Make sure the stream contains a local instance of the given slot, not a copy used by
+ a previous pass.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::EnsureLocalCopy(GrTableManager * ptman, GrSlotState * pslot,
+ GrSlotStream * psstrmIn)
+{
+ //Assert(m_vpslot[islot + m_cslotPreSeg] == pslot);
+ Assert(pslot->PassModified() <= m_ipass);
+
+ if (pslot->PassModified() < m_ipass)
+ {
+ int islot = pslot->PosPassIndex();
+ Assert(SlotAtPosPassIndex(islot) == pslot);
+ GrSlotState * pslotNew;
+ ptman->State()->NewSlotCopy(pslot, m_ipass, &pslotNew);
+ m_vpslot[islot + m_cslotPreSeg] = pslotNew;
+
+ psstrmIn->ReplaceSlotInReprocessBuffer(pslot, pslotNew);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ A slot has been replace within the coorsponding output stream. Make sure the reprocess
+ buffer of this stream constains the same slot.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::ReplaceSlotInReprocessBuffer(GrSlotState * pslotOld, GrSlotState * pslotNew)
+{
+ if (m_islotReprocPos > -1)
+ {
+ for (size_t islot = 0; islot < m_vpslotReproc.size(); islot++)
+ {
+ if (m_vpslotReproc[islot] == pslotOld)
+ m_vpslotReproc[islot] = pslotNew;
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Inserting a line break can potentially alter the directionality of preceeding glyphs.
+ Zap the information that has been calculated.
+
+ @param islotLB - index of the inserted final line-break glyph
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::ZapCalculatedDirLevels(int islotLB)
+{
+ int islot;
+ for (islot = m_islotWritePos; islot-- > islotLB; )
+ m_vpslot[islot]->ZapDirLevel();
+
+ for (islot = islotLB; islot-- > 0; )
+ {
+ if (StrongDir(m_vpslot[islot]->Directionality()))
+ // We've found a strong direction code; don't need to zap beyond this point.
+ return;
+
+ m_vpslot[islot]->ZapDirLevel();
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the slot index of the last slot in the cluster for the just-processed chunk,
+ relative to the last slot in the chunk.
+
+ Return kNegInfinity if there are not enough slots in the stream to tell. This can
+ happen while we are in the middle of processing a cluster.
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::MaxClusterSlot(int islotChunkMin, int islotChunkLim)
+{
+ Assert(islotChunkLim > islotChunkMin);
+
+ if (!m_fUsedByPosPass)
+ return 0; // no clusters yet
+
+ int islotRet = SlotAt(islotChunkLim - 1)->PosPassIndex();
+
+ for (int islot = islotChunkMin; islot < islotChunkLim; islot++)
+ {
+ GrSlotState * pslot = SlotAt(islot);
+
+ if (m_cslotPreSeg == -1)
+ return kNegInfinity;
+ if (!HasSlotAtPosPassIndex(pslot->AttachRootPosPassIndex()))
+ return kNegInfinity;
+
+ GrSlotState * pslotBase = pslot->Base(this);
+
+ int dislotOffset = pslotBase->LastLeafOffset(this);
+ if (dislotOffset == kNegInfinity)
+ return kNegInfinity;
+ islotRet = max(islotRet, pslotBase->PosPassIndex() + dislotOffset);
+ }
+
+ // Make it relative to the last slot in the chunk.
+ islotRet -= SlotAt(islotChunkLim - 1)->PosPassIndex();
+
+ return islotRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the break weight of the given slot, which should be a line-break.
+ OBSOLETE??
+----------------------------------------------------------------------------------------------*/
+LineBrk GrSlotStream::BreakWeightAt(gid16 chwLB, int islot)
+{
+ GrSlotState * pslot = GetSlotAt(islot);
+ Assert(pslot->IsLineBreak(chwLB));
+ return LineBrk(pslot->m_lb);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Append an initial or final line break of the given weight to the stream.
+
+ @param ptman - table manager, for generating new slot
+ @param lb - break weight for the line-break glyph
+ @param dirc - directionality code for the line-break glyph
+ @param islotLB - where to insert, or -1 if at the end
+ @param fInitial - is this an initial line-break, or a final break?
+ @param ichwSegOffset - offset relative to the beginning of the segment
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::AppendLineBreak(GrTableManager * ptman, GrCharStream * pchstrm,
+ LineBrk lb, DirCode dirc, int islotLB, bool fInitial, int ichwSegOffset)
+{
+ EngineState * pengst = ptman->State();
+
+ Assert(AssertValid());
+/// Assert(m_islotReprocPos == -1);
+
+ Assert(islotLB == -1 || fInitial);
+ if (islotLB == -1)
+ islotLB = m_islotWritePos;
+
+// int islot = m_islotWritePos;
+
+ GrSlotState * pslotCopyFeat = pengst->AnAdjacentSlot(m_ipass, islotLB);
+ GrSlotState * pslotNew;
+ if (pslotCopyFeat)
+ pengst->NewSlot(ptman->LBGlyphID(), pslotCopyFeat, 0, ichwSegOffset, &pslotNew);
+ else
+ {
+ GrFeatureValues fval;
+ pchstrm->CurrentFeatures(ptman, &fval);
+ pengst->NewSlot(ptman->LBGlyphID(), fval, 0, ichwSegOffset, -1, &pslotNew);
+ }
+
+ pslotNew->m_lb = sdata8(lb);
+ pslotNew->SetSpecialSlotFlag(fInitial ? kspslLbInitial : kspslLbFinal);
+ //pslotNew->m_fInitialLB = fInitial; // TODO: remove
+ pslotNew->SetDirectionality(dirc);
+
+ m_vpslot.insert(m_vpslot.begin() + islotLB, pslotNew);
+ // Make it part of a chunk with previous char/glyph
+ m_vislotPrevChunkMap.insert(m_vislotPrevChunkMap.begin() + islotLB, -1);
+ m_vislotNextChunkMap.insert(m_vislotNextChunkMap.begin() + islotLB, -1);
+ if (m_ipass > 0)
+ AdjustPrevStreamNextChunkMap(ptman, islotLB, 1);
+
+ m_islotWritePos++;
+
+ if (m_fUsedByPosPass && GotIndexOffset())
+ {
+ pslotNew->SetPosPassIndex(islotLB - m_cslotPreSeg, m_fInputToPosPass1);
+ // Increment the stream index for the following slots.
+ for (int islotTmp = islotLB + 1; islotTmp < m_islotWritePos; islotTmp++)
+ {
+ SlotAt(islotTmp)->IncPosPassIndex();
+ }
+ }
+
+ if (fInitial)
+ m_islotSegMin = islotLB; // just before the LB
+ else
+ m_islotSegLim = islotLB + 1; // just after the LB
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the index of the line break glyph within the specified range, or -1 if none.
+ Recipient is functioning as the output stream.
+
+ @param chwLB - glyph ID being used for line-break glyphs
+ @param islotMin/Lim - range to search
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::FindFinalLineBreak(gid16 chwLB, int islotMin, int islotLim)
+{
+ for (int islot = islotMin; islot < islotLim; ++islot)
+ {
+ if (m_vpslot[islot]->IsFinalLineBreak(chwLB))
+ return islot;
+ }
+ return -1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ A slot has been inserted (nInc == 1) or deleted (nInc == -1). Adjust the next-chunk map
+ of the previous stream to match.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::AdjustPrevStreamNextChunkMap(GrTableManager * ptman, int islotMod, int nInc)
+{
+ if (m_ipass == 0)
+ return; // no previous stream to adjust
+
+ int islotTmp = max(islotMod - 5, 0);
+ while (islotTmp > 0 && m_vislotPrevChunkMap[islotTmp] == -1)
+ islotTmp--;
+
+ ptman->InputStream(m_ipass)->AdjustNextChunkMap(
+ ((islotTmp <= 0) ? 0 : m_vislotPrevChunkMap[islotTmp]),
+ islotMod, nInc);
+}
+
+/*----------------------------------------------------------------------------------------------
+ An insertion or deletion has occurred at the given location in the following stream
+ (specifically of an line-break glyph). Adjust the next-chunk-map accordingly so
+ the indices still match.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::AdjustNextChunkMap(int islotMin, int islotInsOrDel, int nInc)
+{
+ for (int islot = islotMin; islot < m_islotWritePos; islot++)
+ {
+ if (m_vislotNextChunkMap[islot] != -1 && m_vislotNextChunkMap[islot] >= islotInsOrDel)
+ m_vislotNextChunkMap[islot] += nInc;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Unwind the read position of the stream, so that the following pass will begin
+ reading from the new position. The recipient is functioning as the input stream.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::UnwindInput(int islotNewPos, bool fPreBidiPass)
+{
+ Assert(m_islotReprocPos == -1);
+ Assert(islotNewPos <= m_islotReadPos);
+
+ int islot;
+ for (islot = islotNewPos; islot < m_islotReadPos; ++islot)
+ m_vislotNextChunkMap[islot] = -1;
+
+ m_islotReadPos = islotNewPos;
+ m_islotReadPosMax = m_islotReadPos;
+
+ Assert(m_islotReadPos <= m_islotWritePos);
+ if (fPreBidiPass)
+ {
+ for (islot = m_islotReadPos; islot < m_islotWritePos; ++islot)
+ SlotAt(islot)->ZapDirLevel();
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Unwind the write position of the stream, so that the pass will begin writing
+ at the new position. The recipient is functioning as the output stream
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::UnwindOutput(int islotNewPos, bool fOutputOfPosPass)
+{
+ Assert(islotNewPos <= m_islotWritePos);
+
+ int islot;
+ for (islot = islotNewPos; islot < m_islotWritePos; ++islot)
+ {
+ m_vislotPrevChunkMap[islot] = -1;
+
+ if (!fOutputOfPosPass && m_fUsedByPosPass)
+ // This stream is the input to the first positioning pass, ie, the output
+ // of the last sub pass or the bidi pass. Zap the stream indices,
+ // since unwinding this pass could cause them to be invalid due to a later
+ // reordering.
+ SlotAt(islot)->ZapPosPassIndex();
+ }
+
+ m_islotWritePos = islotNewPos;
+
+ m_fFullyWritten = false;
+
+ if (m_islotSegMin > m_islotWritePos)
+ m_islotSegMin = -1;
+ if (m_islotSegLim > m_islotWritePos)
+ m_islotSegLim = -1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ We've just created a new chunk, with the recipient as the output stream. The beginning
+ of the chunk is passed as 'islotOutput' and the end of the chunk is assumed to be the
+ write-position of the recipient. Store the mappings into the corresponding
+ input position.
+
+ @param islotInputMin - beginning of chunk in input stream
+ @param islotOutputMin - beginning of chunk in output stream (recipient)
+ @param islotInputLim - end of chunk in input stream (currently not used)
+ @param fSkipChunkStart - if true, either we have reprocessed part of a
+ previously created chunk,
+ or there was no input consumed;
+ in either case, don't record the beginning of the chunk,
+ just make this chunk be part of the previous
+ @param fBackingUp - this chunk results in the stream position moving backwards,
+ so clear anything we're backing over
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::MapInputChunk(int islotInputMin, int islotOutputMin, int islotInputLim,
+ bool fSkipChunkStart, bool fBackingUp)
+{
+ Assert(AssertValid());
+ Assert(islotOutputMin >= -1);
+
+ if (!fSkipChunkStart)
+ {
+ Assert(islotOutputMin >= 0);
+ if (islotOutputMin >= 0) // just in case an invalid value was passed
+ m_vislotPrevChunkMap[islotOutputMin] = islotInputMin;
+ }
+
+ int islot;
+ for (islot = max(0, islotOutputMin + 1); islot < m_islotWritePos; ++islot)
+ m_vislotPrevChunkMap[islot] = -1; // not a chunk boundary
+
+// if (fBackingUp && m_islotWritePos < m_vislotPrevChunkMap.Size())
+// m_vislotPrevChunkMap[m_islotWritePos] = -1;
+
+ if (fBackingUp)
+ for (islot = m_islotWritePos; islot < signed(m_vislotPrevChunkMap.size()); islot++)
+ m_vislotPrevChunkMap[islot] = -1;
+
+// m_vislotPrevChunkMap[m_islotWritePos] = islotInputLim;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the length of the final chunk, where the recipient is the input stream.
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::LastNextChunkLength()
+{
+ int cslotRet = 1;
+ for (int islot = m_islotReadPos; islot-- > 0; )
+ {
+ if (m_vislotNextChunkMap[islot] != -1)
+ return cslotRet;
+ cslotRet++;
+ }
+ return cslotRet + 1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ We've just created a new chunk, with the recipient as the input stream. The beginning of
+ the chunk is passed as 'islotInputMin' and the end of the chunk is assumed to be the
+ read-position of the recipient. Store the mappings into the corresponding
+ output position.
+
+ @param islotOutputMin - beginning of chunk in output stream
+ @param islotInputMin - beginning of chunk in input stream (recipient)
+ @param islotOutputLim - end of chunk in output stream (currently not used)
+ @param fSkipChunkStart - if true, either we have reprocessed part of a
+ previously created chunk,
+ or there was no output generated;
+ in either case, don't record the beginning of the chunk,
+ just make this chunk be part of the previous
+ @param fBackingUp - this chunk results in the stream position moving backwards,
+ so clear anything we're backing over
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::MapOutputChunk(int islotOutputMin, int islotInputMin, int islotOutputLim,
+ bool fSkipChunkStart, int cslotReprocess, bool fBackingUp)
+{
+ Assert(AssertValid());
+
+ // Note: islotInputMin can be less than -1 if there is a large reprocess buffer near the
+ // beginning of the input stream. In which case, fSkipChunk start should be true and
+ // cslotReprocess large enough to keep any of the stuff below from having any problems.
+ //Assert(islotInputMin >= -1);
+
+ if (!fSkipChunkStart)
+ {
+ Assert(islotInputMin >= 0);
+ if (islotInputMin >= 0) // just in case an invalid value was passed
+ m_vislotNextChunkMap[islotInputMin] = islotOutputMin;
+ }
+
+ int islot;
+ for (islot = max(0, islotInputMin + 1 + cslotReprocess); islot < m_islotReadPos; ++islot)
+ m_vislotNextChunkMap[islot] = -1; // not a chunk boundary
+
+// if (fBackingUp && m_islotReadPos < m_vislotNextChunkMap.Size())
+// m_vislotNextChunkMap[m_islotReadPos] = -1;
+
+ if (fBackingUp)
+ for (islot = m_islotReadPos; islot < signed(m_vislotNextChunkMap.size()); islot++)
+ m_vislotNextChunkMap[islot] = -1;
+
+// m_vislotNextChunkMap[m_islotReadPos] = islotOutputLim;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Ensure that the chunk maps for a pair of streams match properly. The recipient is
+ the input stream.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::AssertChunkMapsValid(GrSlotStream * psstrmOut)
+{
+#ifdef _DEBUG
+ GrSlotStream * psstrmIn = this;
+
+ Assert(m_ipass == 0 || (m_ipass + 1 == psstrmOut->m_ipass));
+
+ int islotMapNext;
+ int islotMapPrev;
+ int islot;
+ for (islot = 0; islot < m_islotReadPos; ++islot)
+ {
+ islotMapNext = psstrmIn->ChunkInNext(islot);
+ Assert(islotMapNext != -2);
+ if (islotMapNext != -1)
+ {
+ islotMapPrev = psstrmOut->ChunkInPrev(islotMapNext);
+ if (islotMapPrev == -2)
+ {
+ Assert(islot == psstrmOut->WritePos());
+ }
+ else
+ {
+ Assert(islot == islotMapPrev);
+ }
+ }
+ }
+
+ for (islot = 0; islot < psstrmOut->m_islotWritePos; ++islot)
+ {
+ islotMapPrev = psstrmOut->ChunkInPrev(islot);
+ Assert(islotMapPrev != -2);
+ if (islotMapPrev != -1)
+ {
+ islotMapNext = psstrmIn->ChunkInNext(islotMapPrev);
+ if (islotMapNext == -2)
+ {
+ Assert(islot == psstrmIn->ReadPos());
+ }
+ else
+ {
+ Assert(islot == islotMapNext);
+ }
+ }
+ }
+#endif // _DEBUG
+}
+
+/*----------------------------------------------------------------------------------------------
+ Ensure that corresponding items in the streams of a positioning pass have matching
+ stream indices. The recipient is the output stream.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::AssertStreamIndicesValid(GrSlotStream * psstrmIn)
+{
+#ifdef _DEBUG
+ if (!GotIndexOffset())
+ return;
+
+ Assert(m_fUsedByPosPass);
+
+ for (int islot = 0; islot < WritePos(); islot++)
+ {
+ GrSlotState * pslotOut = SlotAt(islot);
+ GrSlotState * pslotIn =
+ psstrmIn->SlotAt(islot + psstrmIn->IndexOffset() - IndexOffset());
+ Assert(pslotOut->PosPassIndex() == pslotIn->PosPassIndex());
+ Assert(pslotOut->HasAsPreviousState(pslotIn));
+ }
+#endif // _DEBUG
+}
+
+/*----------------------------------------------------------------------------------------------
+ Ensure that the roots of all attachments made in this chunk are present
+ in the output stream. (Currently the compiler ensures this by making it an error
+ to write rules that don't do this.)
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::AssertAttachmentsInOutput(int islotMin, int islotLim)
+{
+#ifdef _DEBUG
+ for (int islot = islotMin; islot < islotLim; islot++)
+ {
+ GrSlotState * pslotOut = SlotAt(islot);
+ int dislot = pslotOut->AttachTo();
+ Assert(islotMin <= islot + dislot);
+ Assert(islot + dislot < islotLim);
+ }
+#endif // _DEBUG
+}
+
+/*----------------------------------------------------------------------------------------------
+ Answer the slot index corresponding to the start of the chunk (as mapped to the following
+ stream).
+ ENHANCE: make more robust.
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::ChunkInNextMin(int islot)
+{
+ int islotRet = islot;
+ while (m_vislotNextChunkMap[islotRet] == -1 && islotRet > 0)
+ --islotRet;
+ return islotRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Answer the slot index corresponding to the end of the chunk (as mapped to the following
+ stream).
+ ENHANCE: make more robust.
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::ChunkInNextLim(int islot)
+{
+ int islotRet = islot + 1;
+ if (islotRet == m_islotReadPos)
+ return islot;
+ while (m_vislotNextChunkMap[islotRet] == -1 && islotRet < m_islotReadPos)
+ {
+ ++islotRet;
+ Assert(islotRet < signed(m_vislotNextChunkMap.size()));
+ }
+ return islotRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Skip over the given number slots. This is used to resync the streams when we
+ are restarting a new segment. Specifically the output stream informs the
+ input stream of the number of slots to skip to get the boundary for a chunk that
+ the output finds interesting.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::ResyncSkip(int cslot)
+{
+ Assert(AssertValid());
+ m_islotReadPos += cslot;
+ m_cslotSkippedForResync = cslot;
+ // Should never skip past the beginning of the line.
+ Assert(m_islotSegMin == -1 || m_islotReadPos <= m_islotSegMin);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Record the number of slots in the stream that are previous to the official start of the
+ segment.
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::CalcIndexOffset(GrTableManager * ptman)
+{
+ if (GotIndexOffset())
+ return; // already figured it
+
+ if (m_islotSegMin > -1)
+ {
+ m_cslotPreSeg = m_islotSegMin;
+ if (m_fUsedByPosPass)
+ {
+ for (int islotPre = 0; islotPre < WritePos(); islotPre++)
+ {
+ SlotAt(islotPre)->SetPosPassIndex(islotPre - m_cslotPreSeg,
+ m_fInputToPosPass1);
+ }
+ }
+ }
+ // else can't figure it out yet
+
+ // Old code:
+#if 0
+ gid16 chwLB = ptman->LBGlyphID();
+
+ for (int islot = 0; islot < WritePos(); islot++)
+ {
+ if (SlotAt(islot)->IsLineBreak(chwLB))
+ {
+ if (SlotAt(islot)->IsInitialLineBreak(chwLB))
+ {
+ m_cslotPreSeg = islot;
+ }
+ else
+ {
+ // Otherwise, we hit the final line break, which is kind of strange, because
+ // in this case there is no initial line break, and we should have set
+ // m_cslotPreSeg to 0 immediately when it was initialized.
+ Assert(false);
+ m_cslotPreSeg = 0;
+ }
+
+ if (m_fUsedByPosPass)
+ {
+ for (int islotPre = 0; islotPre < WritePos(); islotPre++)
+ {
+ SlotAt(islotPre)->SetPosPassIndex(islotPre - m_cslotPreSeg,
+ m_fInputToPosPass1);
+ }
+ }
+ return;
+ }
+
+ }
+ // No line breaks yet, so no way to tell.
+#endif
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the positions in the streams for the next rule. The recipient is the output stream.
+ If we are moving backwards, copy part of the output stream back to (a temporary buffer
+ in) the input stream, so that we can reprocess it.
+
+ @param cslotArg - how far to skip forward or back; most commonly zero
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::SetPosForNextRule(int cslotArg, GrSlotStream * psstrmIn,
+ bool fOutputOfPosPass)
+{
+ Assert(AssertValid());
+
+ int cslot = cslotArg;
+ // Can't reprocess what has already been read by the next pass. MaxBackup should allow
+ // the flexibility needed, but if not, we fix it here.
+ if (m_islotWritePos + cslot < m_islotReadPos)
+ cslot = m_islotReadPos - m_islotWritePos;
+
+ Assert(psstrmIn->m_ipass == m_ipass-1);
+
+ if (cslot >= 0)
+ {
+ // Skipping forward.
+ Assert(cslot <= psstrmIn->SlotsPendingInContext());
+ for (int islot = 0; islot < cslot; islot++)
+ CopyOneSlotFrom(psstrmIn);
+ }
+ else
+ {
+ // Reprocessing.
+
+ // Save corresponding positions before doing the back-up.
+ int islotReadPosInSave = psstrmIn->ReadPosForNextGet();
+ int islotWritePosOutSave = this->WritePos();
+
+ std::vector<GrSlotState*> vpslotTmp;
+ int islot;
+ if (psstrmIn->SlotsToReprocess() > 0)
+ {
+ // Stick any slots still to reprocess in a temporary buffer.
+ for (islot = psstrmIn->m_islotReprocPos;
+ islot < signed(psstrmIn->m_vpslotReproc.size());
+ islot++)
+ {
+ vpslotTmp.push_back(psstrmIn->m_vpslotReproc[islot]);
+ }
+ }
+
+ psstrmIn->ClearReprocBuffer();
+ psstrmIn->m_islotReprocLim = psstrmIn->m_islotReadPos;
+
+ for (islot = cslot; islot < 0; islot++)
+ psstrmIn->m_vpslotReproc.push_back(m_vpslot[m_islotWritePos+islot]);
+ for (islot = 0; islot < signed(vpslotTmp.size()); islot++)
+ psstrmIn->m_vpslotReproc.push_back(vpslotTmp[islot]);
+ psstrmIn->m_islotReprocPos = 0;
+
+ if (!fOutputOfPosPass && m_fUsedByPosPass)
+ {
+ // Last substitution pass; zap the stream indices, since they may
+ // now be invalid.
+ for (islot = 0; islot < signed(psstrmIn->m_vpslotReproc.size()); islot++)
+ psstrmIn->m_vpslotReproc[islot]->ZapPosPassIndex();
+ }
+
+ // If either the min or lim is in the middle of the reprocess buffer,
+ // adjust as necessary to match where it is in the output stream.
+ int islotSegMinIn = psstrmIn->SegMin();
+ if (islotSegMinIn > -1 &&
+ psstrmIn->ReadPosForNextGet() <= islotSegMinIn &&
+ islotSegMinIn < islotReadPosInSave)
+ {
+ Assert(this->SegMin() > -1);
+ int dislotIn = islotReadPosInSave - islotSegMinIn;
+ int dislotOut = islotWritePosOutSave - SegMin();
+ psstrmIn->SetSegMin(islotSegMinIn + dislotIn - dislotOut, true);
+ if (psstrmIn->m_cslotPreSeg > psstrmIn->SegMin())
+ psstrmIn->m_cslotPreSeg = -1;
+ }
+ int islotSegLimIn = psstrmIn->SegLimIfKnown();
+ if (islotSegLimIn > -1 &&
+ psstrmIn->ReadPosForNextGet() <= islotSegLimIn &&
+ islotSegLimIn < islotReadPosInSave)
+ {
+ int islotSegLimOut = this->SegLimIfKnown();
+ Assert(islotSegLimOut > -1);
+ int dislotIn = islotReadPosInSave - islotSegLimIn;
+ int dislotOut = islotWritePosOutSave - islotSegLimOut;
+ psstrmIn->SetSegLim(islotSegLimIn + dislotIn - dislotOut);
+ }
+
+ m_islotWritePos += cslot;
+
+ if (m_islotSegMin >= m_islotWritePos)
+ m_islotSegMin = -1;
+ if (m_islotSegLim >= m_islotWritePos)
+ m_islotSegLim = -1;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ If a rule was run over a LB glyph, set the appropriate flag in the table manager.
+ CURRENTLY NOT USED
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::SetLBContextFlag(GrTableManager * ptman, int islotStart)
+{
+ gid16 chwLB = ptman->LBGlyphID();
+ for (int islot = islotStart; islot < WritePos(); islot++)
+ {
+ GrSlotState * pslot = SlotAt(islot);
+ if (pslot->IsInitialLineBreak(chwLB))
+ ptman->State()->SetStartLineContext(true);
+ if (pslot->IsFinalLineBreak(chwLB))
+ ptman->State()->SetEndLineContext(true);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the number of slots that have been output by the current pass but must be
+ reprocessed by this same pass. The recipient is serving as the input stream.
+----------------------------------------------------------------------------------------------*/
+int GrSlotStream::SlotsToReprocess()
+{
+ Assert(AssertValid());
+
+ if (m_islotReprocPos == -1)
+ return 0;
+ return (m_vpslotReproc.size() - m_islotReprocPos);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the input at the given slot, that is, the original input, ignoring the issue of
+ reprocessing.
+----------------------------------------------------------------------------------------------*/
+GrSlotState * GrSlotStream::GetSlotAt(int islot)
+{
+ return m_vpslot[islot];
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the "current" input item from the rule's perspective, ie, the last slot read.
+ So dislotOffset = 0 means not the slot at the read position but one slot earlier.
+
+ If dislotOffset is less the the original read position that was in effect at the
+ beginning of the rule, we need to read from the output stream, which has the
+ up-to-date values. See the class comment for more details.
+
+ @param dislotOffset - offset from current stream position
+ @param fNullOkay - true if it's okay to return NULL in the situation where we're asking
+ for something before the beginning of the stream
+----------------------------------------------------------------------------------------------*/
+
+GrSlotState * GrSlotStream::RuleInputSlot(int dislotOffset, GrSlotStream * psstrmOutput,
+ bool fNullOkay)
+{
+ Assert(m_islotRuleStartRead <= m_islotReadPos);
+
+ if (dislotOffset > 0)
+ return Peek(dislotOffset - 1);
+
+ int cslotOffsetBack = dislotOffset * -1;
+
+ if (m_islotReprocLim > -1)
+ {
+ // There is a reprocess buffer.
+
+ // Position when starting the rule should never be earlier than the
+ // beginning of the reprocess buffer.
+ Assert(m_islotRuleStartRead >= m_islotReprocLim - signed(m_vpslotReproc.size()));
+
+ // number of items following the reprocess buffer:
+ int cslotPostReproc = m_islotReadPos - m_islotReprocLim;
+
+ if (cslotOffsetBack >= cslotPostReproc)
+ {
+ // number of items in the reprocess buffer that were valid when the rule
+ // was started:
+ int cslotValidReproc = m_islotReprocLim - m_islotRuleStartRead;
+
+ if (cslotOffsetBack >= cslotPostReproc + cslotValidReproc)
+ {
+ // Read from the output stream.
+ int dislotTmp = dislotOffset - 1 + cslotPostReproc + cslotValidReproc;
+ Assert(dislotTmp < 0);
+ return psstrmOutput->PeekBack(dislotTmp);
+ }
+ else
+ {
+ if (m_islotReprocPos > -1)
+ {
+ // Current read pos is inside reprocess buffer.
+ Assert(cslotPostReproc == 0);
+ int islotStartReadReprocBuf = m_vpslotReproc.size() - cslotValidReproc;
+ Assert(islotStartReadReprocBuf >= 0);
+ int islotInReprocBuf = m_islotReprocPos - cslotOffsetBack - 1;
+ if (islotInReprocBuf < islotStartReadReprocBuf)
+ {
+ // Return a slot from before the reprocess buffer, from the
+ // output stream (which is serving as our input stream for precontext
+ // items).
+ return psstrmOutput->PeekBack(islotInReprocBuf - islotStartReadReprocBuf);
+ }
+ else if (islotInReprocBuf < 0)
+ {
+ Assert(false);
+ //int islotReprocMin = m_islotReprocLim - m_vpslotReproc.Size();
+ //return m_vpslot[islotReprocMin + islotInReprocBuf];
+ }
+ else
+ // Read from the reprocess buffer.
+ return m_vpslotReproc[islotInReprocBuf];
+ }
+ else
+ // Looking backwards into the reprocess buffer.
+ return m_vpslotReproc[
+ m_vpslotReproc.size() - cslotOffsetBack + cslotPostReproc - 1];
+ }
+ }
+ }
+
+ // There is no reprocess buffer, or it is not a factor.
+
+ if (m_islotReadPos + dislotOffset - 1 < m_islotRuleStartRead)
+ {
+ // Read from the output stream.
+ return psstrmOutput->PeekBack(m_islotReadPos + dislotOffset - 1 - m_islotRuleStartRead,
+ fNullOkay);
+ }
+ else
+ {
+ // Read normally from the input stream.
+ return m_vpslot[m_islotReadPos - cslotOffsetBack - 1];
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the "current" output item from the rule's perspective, ie, the last slot written.
+ So dislotOffset = 0 means not the slot at the write position but one slot earlier.
+----------------------------------------------------------------------------------------------*/
+
+GrSlotState * GrSlotStream::RuleOutputSlot(int dislotOffset)
+{
+ return m_vpslot[m_islotWritePos - 1 + dislotOffset];
+}
+
+/*----------------------------------------------------------------------------------------------
+ For any slot in the final output that has no associations, set the "before" pointer to
+ the following slot and the "after" pointer to the preceding slot. The idea of this is
+ that it will make it impossible to select a the glyph separately.
+
+ Note that if the slot is the first on the line, it will not be associated with
+ a slot in the previous segment.
+
+ @param chwLB - the glyph IB for the line-break glyphs
+----------------------------------------------------------------------------------------------*/
+void GrSlotStream::SetNeutralAssociations(gid16 chwLB)
+{
+ for (int islot = 0; islot < m_islotWritePos; ++islot)
+ {
+ GrSlotState * pslot = SlotAt(islot);
+ if (pslot->PassModified() > 0 &&
+ (pslot->BeforeAssoc() == kPosInfinity || pslot->AfterAssoc() == kNegInfinity))
+ {
+ pslot->CleanUpAssocs();
+ if (pslot->BeforeAssoc() != kPosInfinity && pslot->AfterAssoc() != kNegInfinity)
+ continue;
+
+ Assert(pslot->BeforeAssoc() == kPosInfinity && pslot->AfterAssoc() == kNegInfinity);
+
+ GrSlotState * pslotBefore = FindAssociatedSlot(islot, 1, chwLB);
+ GrSlotState * pslotAfter = FindAssociatedSlot(islot, -1, chwLB);
+
+ if (pslotBefore && pslotAfter)
+ pslot->Associate(pslotBefore, pslotAfter);
+ else if (pslotBefore)
+ pslot->Associate(pslotBefore);
+ else if (pslotAfter)
+ pslot->Associate(pslotAfter);
+ else
+ // Weird, but can happen with an empty segment.
+ Warn("No assocations");
+
+// Assert(pslot->m_vpslotAssoc.Size() > 0);
+ pslot->m_fNeutralAssocs = true;
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Find the next or previous slot in the final output that has explicit associations, or
+ return NULL if none.
+
+ @param islot - starting slot
+ @param nInc - +1 if we want to find the next slot, -1 if we want the previous slot
+ @param chwLB - the glyph IB for the line-break glyphs
+----------------------------------------------------------------------------------------------*/
+GrSlotState * GrSlotStream::FindAssociatedSlot(int islot, int nInc, gid16 chwLB)
+{
+ int islotNext = islot + nInc;
+
+ while (islotNext >= 0 && islotNext < m_islotWritePos)
+ {
+ GrSlotState * pslotRet = SlotAt(islotNext);
+ if (pslotRet->IsLineBreak(chwLB))
+ { }
+ else if (pslotRet->PassModified() == 0 ||
+ (pslotRet->m_vpslotAssoc.size() > 0 && pslotRet->m_fNeutralAssocs == false))
+ {
+ return pslotRet;
+ }
+ islotNext += nInc;
+ }
+ return NULL;
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/GrSlotStream.h b/Build/source/libs/graphite/src/segment/GrSlotStream.h
new file mode 100644
index 00000000000..006191252dc
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrSlotStream.h
@@ -0,0 +1,577 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrSlotStream.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Classes GrSlotStream and GrSlotState.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef SLOTSTREAM_INCLUDED
+#define SLOTSTREAM_INCLUDED
+
+//:End Ignore
+
+namespace gr
+{
+
+class EngineState;
+class Font;
+
+/*----------------------------------------------------------------------------------------------
+ Each GrSlotStream represents the output of one pass, which also serves as the input
+ of the following pass. Hence it has two positions, a write position for when it is
+ serving as an output stream, and a read position for when it is serving as an input
+ stream. The TableManager holds a list of the streams.
+
+ The reading of slot streams is complicated by two factors. First, it may be necessary
+ to access the "pre-context" items of a rule, which are the slots before the current
+ stream position at the point when the rule is matched. These items will not be modified
+ by the rule, but may have been modified by a previous rule in the same pass, Therefore
+ we need to read these slots from the output stream, rather than the input stream,
+ because the output stream has the current slot attribute values that we want to work with.
+ In order make this happen, we keep track of the read and write positions of
+ the streams at the time the current rule was matched (m_islotRuleStartRead and
+ m_islotRuleStartWrite) and whenever we try to read a slot before m_islotRuleStartRead,
+ we read the corresponding slot from the output stream instead.
+
+ Second, a rule may explicitly set the advance position so that some items are
+ actually reprocessed (and potentially modified) by the same pass. When this happens,
+ we actually copy the slots to reprocess from the output stream back
+ into a temporary buffer (m_vpslotReproc) in the input stream, and set up the stream so
+ that the next read operations will read from the buffer.
+
+ It gets tricky because these two mechanisms can overlap with each other, so care
+ must be taken to read from the right place: the input stream in the normal way,
+ the reprocess buffer, or the output stream. See the RuleInputSlot method.
+
+ Another messy bit of code has to do with maintaining chunks. These are used for
+ backtracking and unwinding after inserting a line-break. Adjacent streams have maps
+ showing how many slots were processed by a single rule; the maps must be consisent
+ between adjacent rules. The following is an example of a pair of valid chunk maps:
+
+ Input stream Output stream
+ Pos next-map prev-map
+ 0 0 0
+ 1 -1 -1
+ 2 2 2
+ 3 4 -1
+ 4 -1 3
+ 5 -1 -1
+ 6 7 -1
+ 7 -1 6
+ 8 -1 -1
+
+ A -1 means that slot is not at the beginning of a chunk. Otherwise, there must be a
+ corresponding value in the parallel map of the adjacent stream--eg, the input stream's
+ next-map(3) == 4 and the output stream's prev-map(4) == 3. Assertions are run
+ regularly to ensure that the chunk maps stay valid.
+
+ So above, the first chunk corresponds to slots 0-1 in the input and 0-1 in the output;
+ two slots were processed by the rule. The second chunk corresponds to slot 2
+ in the input and slots 2-3 in the output (a slot was inserted).
+ The third corresponds to slots 3-5 in the input and 4-6 in the output (three slots
+ processed). The fourth chunk covers slots 6-8 in the input and 7-8 in the output
+ (one slot was deleted).
+
+ ENHANCE SharonC: explain the effect of skipped slots on the chunk maps.
+
+ Hungarian: sstrm
+----------------------------------------------------------------------------------------------*/
+class GrSlotStream {
+
+ friend class GrSlotState;
+ friend class FontMemoryUsage;
+
+public:
+ // Constructor:
+ GrSlotStream(int ipass)
+ {
+ m_ipass = ipass;
+ m_vpslot.clear();
+ m_vislotPrevChunkMap.clear();
+ m_vislotNextChunkMap.clear();
+ m_vpslotReproc.clear();
+ }
+
+ // Destructor:
+ ~GrSlotStream()
+ {
+ ReleaseSlots(0, m_vpslot.size());
+ }
+
+ void ReleaseSlots(int islotMin, int islotLim)
+ {
+ // A slot stream is responsible for deleting the slot states that it created,
+ // that is, the ones whose modified tag equals this stream's pass index.
+ // NO LONGER TRUE - there is a master list of them managed by the GrTableManager.
+// for (int islot = islotMin; islot < islotLim; ++islot)
+// {
+// if (m_vpslot[islot]->m_ipassModified == m_ipass)
+// delete m_vpslot[islot];
+// }
+ }
+
+ // Getters:
+ int WritePos() { return m_islotWritePos; }
+ int ReadPos() { return m_islotReadPos; }
+ bool FullyWritten() { return m_fFullyWritten; }
+
+ int SlotsPresent() { return m_vpslot.size(); }
+
+ // Setters:
+ void SetWritePos(int islot)
+ {
+ m_islotWritePos = islot;
+ }
+ void SetReadPos(int islot)
+ {
+ m_islotReadPos = islot;
+ }
+
+ void Initialize(int ipassPos1, bool fAnythingPrevious)
+ {
+ m_islotWritePos = 0;
+ m_islotReadPos = 0;
+ m_islotReprocPos = -1;
+ m_islotReprocLim = -1;
+ m_islotRuleStartRead = 0;
+ m_islotRuleStartWrite = 0;
+ m_islotReadPosMax = 0;
+ m_cslotSkippedForResync = 0;
+ m_cslotPreSeg = (fAnythingPrevious) ? -1 : 0;
+ m_fFullyWritten = false;
+ m_islotSegMin = -1;
+ m_islotSegLim = -1;
+ m_fUsedByPosPass = (m_ipass + 1 >= ipassPos1);
+ m_fInputToPosPass1 = (m_ipass + 1 == ipassPos1);
+ m_vpslot.clear(); // not responsible for destroying the slots
+ m_vislotPrevChunkMap.clear();
+ m_vislotNextChunkMap.clear();
+ }
+
+public:
+ bool AtEnd();
+ bool AtEndOfContext();
+ void NextPut(GrSlotState* pslot);
+ GrSlotState * NextGet();
+ GrSlotState * Peek(int dislot = 0);
+ GrSlotState * PeekBack(int dislot, bool fNullOkay = false);
+ void Skip(int = 1);
+ GrSlotState * SlotAt(int islot)
+ {
+ return m_vpslot[islot];
+ }
+
+ int OutputOfPass()
+ {
+ return m_ipass;
+ }
+
+ // This function is intended to be used within positioning passes where there is a
+ // one-to-one correspondence beween the slots in consecutive streams.
+ GrSlotState * OutputSlotAt(int islot)
+ {
+ return Peek(islot - ReadPosForNextGet());
+ }
+
+ int ReadPosForNextGet()
+ {
+ return ReadPos() - SlotsToReprocess();
+ }
+
+ // Only valid for streams that are the input or output to a positioning pass.
+ GrSlotState * SlotAtPosPassIndex(int islot)
+ {
+ Assert(GotIndexOffset());
+ Assert(m_fUsedByPosPass);
+ return m_vpslot[islot + m_cslotPreSeg];
+ }
+
+ // Only valid for streams that are the input or output to a positioning pass.
+ bool HasSlotAtPosPassIndex(int islot)
+ {
+ Assert(GotIndexOffset());
+ Assert(m_fUsedByPosPass);
+ return (signed(m_vpslot.size()) > (islot + m_cslotPreSeg));
+ }
+
+ bool AssertValid();
+ void AssertChunkMapsValid(GrSlotStream * psstrmOut);
+ void AssertStreamIndicesValid(GrSlotStream * psstrmIn);
+ void AssertAttachmentsInOutput(int islotMin, int islotLim);
+ bool NoReproc()
+ {
+ return (m_islotReprocPos == -1 || (m_islotReprocPos >= signed(m_vpslotReproc.size())));
+ }
+
+ int SlotsPending();
+ int SlotsPendingInContext();
+ int TotalSlotsPending();
+ bool PastEndOfPositioning(bool fOutput);
+
+ void ClearReprocBuffer()
+ {
+ m_islotReprocPos = -1;
+ m_islotReprocLim = -1;
+ m_vpslotReproc.clear();
+ }
+
+ int ReprocLim()
+ {
+ return m_islotReprocLim;
+ }
+
+ int ReprocMin()
+ {
+ Assert(m_islotReprocPos > -1);
+ return m_islotReprocLim - m_vpslot.size();
+ }
+
+ int RuleStartReadPos()
+ {
+ return m_islotRuleStartRead;
+ }
+
+ void SetRuleStartReadPos()
+ {
+ if (m_islotReprocPos > -1)
+ m_islotRuleStartRead = m_islotReprocLim - SlotsToReprocess();
+ else
+ m_islotRuleStartRead = m_islotReadPos;
+ }
+
+ int RuleStartWritePos()
+ {
+ return m_islotRuleStartWrite;
+ }
+
+ void SetRuleStartWritePos()
+ {
+ m_islotRuleStartWrite = m_islotWritePos;
+ }
+
+ void MarkFullyWritten();
+
+ void SetSegMin(int islot, bool fAdjusting = false)
+ {
+ Assert(fAdjusting || m_islotSegMin == -1 || m_islotSegMin == islot);
+ m_islotSegMin = islot;
+ }
+ void SetSegMinToWritePos(bool fMod = true)
+ {
+ if (m_islotSegMin == -1)
+ m_islotSegMin = m_islotWritePos;
+ else
+ Assert(m_islotSegMin <= m_islotWritePos); // eg, already set to before the initial LB
+ }
+ int SegMin()
+ {
+ return m_islotSegMin;
+ }
+ void SetSegLim(int islot)
+ {
+ m_islotSegLim = islot;
+ }
+ void SetSegLimToWritePos(bool fMod = true)
+ {
+ if (m_islotSegLim > -1 && !fMod)
+ {
+ Assert(m_islotSegLim <= m_islotWritePos);
+ return;
+ }
+ m_islotSegLim = m_islotWritePos;
+ }
+ int SegLimIfKnown()
+ {
+ return m_islotSegLim;
+ }
+ int FinalSegLim()
+ {
+ if (m_islotSegLim > -1)
+ return m_islotSegLim;
+ else
+ return m_islotWritePos;
+ }
+
+ // Return true if we are exactly at the segment min.
+ bool AtSegMin()
+ {
+ if (m_islotSegMin == -1)
+ return false;
+ return (m_islotSegMin == ReadPosForNextGet());
+ }
+
+ // Return true if we are exactly at the segment lim.
+ bool AtSegLim()
+ {
+ if (m_islotSegLim == -1)
+ return false;
+ return (m_islotSegLim == ReadPosForNextGet());
+ }
+
+ int ReadPosMax()
+ {
+ return m_islotReadPosMax;
+ }
+ void SetReadPosMax(int islot)
+ {
+ m_islotReadPosMax = std::max(m_islotReadPosMax, islot);
+ }
+
+ int OldDirLevelRange(EngineState * pengst, int islotStart, int nTopDirection);
+ int DirLevelRange(EngineState * pengst, int islotStart, int nTopDirection,
+ std::vector<int> & vislotStarts, std::vector<int> & vislotStops);
+ int GetSlotDirLevel(EngineState * pengst, int islot,
+ int nOuterLevel, int nCurrLevel, DirCode dircMarker, DirCode dircOverride);
+ DirCode AdjacentStrongCode(EngineState * pengst, int islot, int nInc,
+ DirCode dircPDF, bool fNumbersAreStrong = false);
+ DirCode TerminatorSequence(EngineState * pengst, int islot, int nInc, DirCode dircPDF);
+ DirCode AdjacentNonBndNeutralCode(EngineState * pengst, int islot, int nInc,
+ DirCode dircPDF);
+
+ void CopyOneSlotFrom(GrSlotStream * psstrmPrev);
+ void SimpleCopyFrom(GrSlotStream * psstrmI, int islotInput, int islotOutput);
+
+ bool MoreSpace(GrTableManager * ptman,
+ float xsSpaceAllotted, bool fWidthIsCharCount,
+ bool fIgnoreTrailingWS, TrWsHandling twsh,
+ float * pxsWidth);
+
+ int InsertLineBreak(GrTableManager * ptman,
+ int islotPrevBreak, bool fInsertedLB, int islotStartTry,
+ LineBrk lb, TrWsHandling twsh, int islotMin, LineBrk * plbNextToTry);
+ int MakeSegmentBreak(GrTableManager * ptman,
+ int islotPrevBreak, bool fInsertedLB, int islotStartTry,
+ LineBrk lb, TrWsHandling twsh, int islotMin, LineBrk * plbNextToTry);
+ bool FindSegmentEnd(GrTableManager * ptman,
+ int islotStartTry, LineBrk lb, TrWsHandling twsh, int islotMin,
+ int * pislot, int * pichwSegOffset,
+ LineBrk * plbFound, LineBrk * plbNextToTry);
+ bool HasEarlierBetterBreak(int islotBreak, LineBrk lbFound, gid16 chwLB);
+ LineBrk BreakWeightAt(gid16 chwLB, int islot);
+ void AppendLineBreak(GrTableManager *, GrCharStream * pchstrm,
+ LineBrk, DirCode dirc, int islot, bool fInitial, int ichwSegOffset);
+ int FindFinalLineBreak(gid16 chwLB, int islotMin, int islotLim);
+ void AdjustPrevStreamNextChunkMap(GrTableManager * ptman, int islotMod, int nInc);
+ void AdjustNextChunkMap(int islotMin, int islotMod, int nInc);
+
+ void EnsureLocalCopy(GrTableManager * ptman, GrSlotState * pslot, GrSlotStream * psstrmIn);
+ void ReplaceSlotInReprocessBuffer(GrSlotState * pslotOld, GrSlotState * pslotNew);
+
+ void ZapCalculatedDirLevels(int islotLB);
+
+ int MaxClusterSlot(int islotChunkLim)
+ {
+ return MaxClusterSlot(islotChunkLim - 1, islotChunkLim);
+ }
+ int MaxClusterSlot(int islotChunkMin, int islotChunkLim);
+
+ void UnwindInput( int islot, bool fPreBidiPass);
+ void UnwindOutput(int islot, bool fOutputOfPosPass);
+
+ void MapInputChunk( int islotIn, int islotOut, int islotInLim,
+ bool fReprocessing, bool fBackingUp);
+ void MapOutputChunk(int islotOut, int islotIn, int islotOutLim,
+ bool fReprocessing, int cslotReprocess, bool fBackingUp);
+
+ int LastNextChunkLength();
+
+ int ChunkInPrev(int i)
+ {
+ Assert(i >= 0);
+ Assert(i < signed(m_vislotPrevChunkMap.size()));
+ Assert(i < m_islotWritePos);
+ return m_vislotPrevChunkMap[i];
+ }
+ int ChunkInNext(int i)
+ {
+ Assert(i >= 0);
+ Assert(i < signed(m_vislotNextChunkMap.size()));
+ Assert(i < m_islotReadPos);
+ return m_vislotNextChunkMap[i];
+ }
+
+ int ChunkInNextMin(int islot);
+ int ChunkInNextLim(int islot);
+
+ void ResyncSkip(int nslot);
+ int SlotsSkippedToResync()
+ {
+ return m_cslotSkippedForResync;
+ }
+ void ClearSlotsSkippedToResync()
+ {
+ m_cslotSkippedForResync = 0;
+ }
+
+ int IndexOffset()
+ {
+ Assert(GotIndexOffset()); // should have been calculated
+ return m_cslotPreSeg;
+ }
+ void SetIndexOffset(int c)
+ {
+ m_cslotPreSeg = c;
+ }
+ bool GotIndexOffset()
+ {
+ return (m_cslotPreSeg >= 0);
+ }
+ void CalcIndexOffset(GrTableManager * ptman);
+
+ void SetPosForNextRule(int nslot, GrSlotStream * psstrmInput, bool fOutputOfPosPass);
+ void SetLBContextFlag(GrTableManager * ptman, int islotStart);
+ int SlotsToReprocess();
+
+ void SetNeutralAssociations(gid16 chwLB);
+protected:
+ GrSlotState * FindAssociatedSlot(int islot, int nInc, gid16 chwLB);
+
+ GrSlotState * GetSlotAt(int islot);
+
+public:
+ // Used by the action code:
+ void BackupReadPos(int cslot = 1)
+ {
+ for (int islot = 0; islot < cslot; islot++)
+ {
+ if (m_islotReprocLim > -1 && m_islotReprocLim == m_islotReadPos)
+ {
+ if (m_islotReprocPos == -1)
+ m_islotReprocPos = m_vpslotReproc.size() - 1;
+ else
+ --m_islotReprocPos;
+ Assert(m_islotReprocPos >= 0);
+ }
+ else
+ --m_islotReadPos;
+ }
+ }
+
+ GrSlotState * RuleInputSlot(int dislot = 0, GrSlotStream * psstrmOut = NULL,
+ bool fNullOkay = false);
+ GrSlotState * RuleOutputSlot(int dislot = 0);
+
+ void PutSlotAt(GrSlotState * pslot, int islot)
+ {
+ // Currently only used for the final pass, when applying justify.width to
+ // the advance width.
+ Assert(signed(m_vpslot.size()) > islot);
+ Assert(WritePos() > islot);
+ Assert(ReadPos() <= islot);
+ Assert(SlotsToReprocess() == 0);
+ m_vpslot[islot] = pslot;
+ }
+
+protected:
+ // Instance variables:
+ int m_ipass; // which pass this stream is serving as OUTPUT of
+
+ std::vector<GrSlotState*> m_vpslot; // the slots being processed
+
+ // Chunking information:
+ std::vector<int> m_vislotPrevChunkMap; // chunk mapping into previous stream;
+ // -1 if not at a chunk boundary
+ // (this information is needed for
+ // reinitialization after inserting a line break)
+
+ std::vector<int> m_vislotNextChunkMap; // chunk mapping into next stream, or -1
+ // (this information is needed for backtracking)
+
+ // Since most streams serve as both input and output, there are two positions.
+ // Note that readPos <= writePos always.
+ int m_islotWritePos; // where previous pass should put next output
+ int m_islotReadPos; // where following pass should start processing from
+
+ // When we are reprocessing some of the output from the next stream:
+ std::vector<GrSlotState*> m_vpslotReproc; // temporary buffer
+ int m_islotReprocLim; // the read position corresponding to the end of the reprocess
+ // buffer; -1 if buffer is invalid
+ int m_islotReprocPos; // index into m_vpslotReproc from where we should read next;
+ // -1 if we are not reprocessing
+
+ int m_islotRuleStartRead; // read position when the rule was started; any requests before
+ // this point should access the output stream, because it has
+ // the most up-to-date values.
+ int m_islotRuleStartWrite; // write position when the rule started
+
+ bool m_fFullyWritten; // set to true when we can't get any more from the
+ // previous pass; initially false.
+
+ int m_islotSegMin; // the official min of the segment; -1 if not yet set
+ int m_islotSegLim; // the official lim of the segment; -1 if not yet set
+ // (only set for the output of the final line-break pass
+ // and those beyond)
+
+ int m_cslotSkippedForResync; // number of slots skipped to resync;
+ // specifically, the number of slots' worth of the
+ // next-chunk-map that are invalid, not mapped
+ // to any slots in the following stream
+
+ int m_cslotPreSeg; // number of slots previous to the official beginning of the segment;
+ // -1 if we haven't figured it out yet. Used for keeping streams
+ // in the positioning pass in sync; not particularly useful for
+ // substitution passes, and will possibly be left uncalculated.
+
+ bool m_fUsedByPosPass; // true if this is input to or output from a positioning pass
+ bool m_fInputToPosPass1; // true if this is the input to the first positioning pass
+
+ // Max value of m_islotReadPos; used for recognizing infinite loops and forcibly
+ // advancing (see GrPass::CheckInputProgress).
+ int m_islotReadPosMax;
+
+public:
+ // For transduction logging:
+#ifdef TRACING
+// void LogSlotGlyphs(std::ofstream & strmOut, gid16 chwLB);
+#endif // TRACING
+
+ // For test procedures:
+ int NumberOfSlots() { return m_vpslot.size(); }
+ GrSlotState * LastSlotWritten()
+ {
+ if (m_islotWritePos == 0)
+ return NULL;
+ else
+ return m_vpslot[m_islotWritePos-1];
+ }
+ GrSlotState * LastSlotRead()
+ {
+ if (m_islotReadPos == 0)
+ return NULL;
+ else
+ return m_vpslot[m_islotReadPos-1];
+ }
+
+ gid16 GlyphIDAt(int islot)
+ {
+ return m_vpslot[islot]->m_chwGlyphID;
+ }
+
+ int PreChunk() // answer the number of prepended items that are not in any chunk;
+ // should be obsolete now
+ {
+ int islot;
+ for (islot = 0; islot < m_islotReadPos; ++islot)
+ {
+ if (m_vislotNextChunkMap[islot] != -1)
+ return islot;
+ }
+ Assert(false);
+ return islot;
+ }
+
+}; // end of class GrSlotStream
+
+} // namespace gr
+
+
+#endif // !SLOTSTREAM_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/GrTableManager.cpp b/Build/source/libs/graphite/src/segment/GrTableManager.cpp
new file mode 100644
index 00000000000..fde364e7e2e
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrTableManager.cpp
@@ -0,0 +1,2691 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrTableManager.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ GrTableManager, which handles the interactions between passes, including the demand-pull
+ algorithm.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+//#ifndef _WIN32
+#include <stdlib.h>
+#include <math.h>
+//#endif
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Constructors and initializers
+----------------------------------------------------------------------------------------------*/
+EngineState::EngineState()
+ : m_ipassJustCalled(-1),
+ m_fStartLineContext(false),
+ m_fEndLineContext(false),
+ ////m_pgg(NULL),
+ m_cslotPreSeg(0),
+ m_islotblkCurr(-1),
+ m_islotNext(kSlotBlockSize),
+ m_fInitialLB(false),
+ m_fFinalLB(false),
+ m_fInsertedLB(false),
+ m_fExceededSpace(false),
+ m_fHitHardBreak(false),
+ m_fRemovedWhtsp(false),
+ m_dxsShrinkPossible(GrSlotState::kNotYetSet),
+ m_islotPosNext(-1),
+ m_xsPosXNext(0),
+ m_ysPosYNext(0),
+ m_dxsTotWidthSoFar(0),
+ m_dxsVisWidthSoFar(0),
+ m_prgzpst(NULL),
+ m_prgpsstrm(NULL)
+{
+ m_vslotblk.clear();
+ m_vprgnSlotVarLenBufs.clear();
+}
+
+void EngineState::Initialize(GrEngine * pgreng, GrTableManager * ptman)
+{
+ m_ptman = ptman;
+ m_cpass = ptman->NumberOfPasses(); // duplicate for convenience
+
+ m_cUserDefn = pgreng->NumUserDefn();
+ m_cFeat = pgreng->NumFeat();
+ m_cCompPerLig = pgreng->NumCompPerLig();
+
+ if (m_prgzpst)
+ delete[] m_prgzpst;
+ m_prgzpst = new PassState[m_cpass];
+ ptman->StorePassStates(m_prgzpst);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Destructors
+----------------------------------------------------------------------------------------------*/
+GrTableManager::~GrTableManager()
+{
+ for (int ipass = 0; ipass < m_cpass; ++ipass)
+ delete Pass(ipass);
+
+ delete[] m_prgppass;
+}
+
+EngineState::~EngineState()
+{
+ DestroySlotBlocks();
+
+ delete[] m_prgzpst;
+
+ if (m_prgpsstrm)
+ {
+ for (int isstrm = 0; isstrm < m_cpass; ++isstrm)
+ delete OutputStream(isstrm);
+
+ delete[] m_prgpsstrm;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Delete all the slots.
+----------------------------------------------------------------------------------------------*/
+void EngineState::DestroySlotBlocks()
+{
+ Assert(m_vslotblk.size() == m_vprgnSlotVarLenBufs.size());
+ for (size_t islotblk = 0; islotblk < m_vslotblk.size(); ++islotblk)
+ {
+ delete[] m_vslotblk[islotblk];
+ delete[] m_vprgnSlotVarLenBufs[islotblk];
+ }
+ m_vslotblk.clear();
+ m_vprgnSlotVarLenBufs.clear();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Create the passes, and them fill them in by reading from the file stream.
+----------------------------------------------------------------------------------------------*/
+bool GrTableManager::CreateAndReadPasses(GrIStream & grstrm,
+ int fxdSilfVersion, int fxdRuleVersion,
+ int cpassFont, long lSubTableStart, int * rgnPassOffsets,
+ int ipassSub1Font, int ipassPos1Font, int ipassJust1Font, byte ipassPostBidiFont)
+{
+ Assert(ipassSub1Font <= ipassJust1Font);
+ Assert(ipassJust1Font <= ipassPos1Font);
+ Assert(ipassPos1Font <= cpassFont);
+ if (ipassSub1Font > ipassJust1Font || ipassJust1Font > ipassPos1Font
+ || ipassPos1Font > cpassFont)
+ {
+ return false; // bad table
+ }
+
+ // Adjusted indices based on the fact that we have a glyph generation pass that is
+ // pass 0, and possibly a bidi pass:
+ m_cpass = cpassFont + 1;
+ int ipassLB1, ipassSub1, ipassBidi, ipassPos1, ipassJust1;
+ ipassLB1 = 1;
+ ipassSub1 = ipassSub1Font + 1;
+ if (ipassPostBidiFont == 0xFF)
+ {
+ // No bidi pass.
+ m_fBidi = false;
+ // Add 1 below to account for the glyph-generation pass.
+ ipassPos1 = ipassPos1Font + 1;
+ ipassJust1 = ipassJust1Font + 1;
+ ipassBidi = ipassJust1;
+ }
+ else
+ {
+ m_fBidi = true;
+ m_cpass++;
+ Assert(ipassPostBidiFont == ipassJust1Font);
+ ipassJust1 = ipassJust1Font + 2;
+ ipassPos1 = ipassPos1Font + 2;
+ ipassBidi = ipassJust1 - 1;
+ }
+
+ // Always make at least one positioning pass, even if there are no rules.
+ if (ipassPos1 == m_cpass)
+ {
+ m_cpass++;
+ }
+
+ m_prgppass = new GrPass*[m_cpass + 1];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+
+ int ipass = 1;
+ int ipassFont = 0;
+ m_cpassLB = 0;
+ m_ipassJust1 = 1;
+ m_ipassPos1 = 1;
+ for ( ; ipass < m_cpass; ipass++, ipassFont++)
+ {
+ if (ipass < ipassSub1)
+ {
+ m_prgppass[ipass] = new GrLineBreakPass(ipass);
+ m_prgppass[ipass]->ReadFromFont(grstrm, fxdSilfVersion, fxdRuleVersion,
+ lSubTableStart + rgnPassOffsets[ipassFont]);
+ m_cpassLB++;
+ m_ipassJust1++;
+ m_ipassPos1++;
+ }
+ else if (ipassSub1 <= ipass && ipass < ipassBidi)
+ {
+ m_prgppass[ipass] = new GrSubPass(ipass);
+ m_prgppass[ipass]->ReadFromFont(grstrm, fxdSilfVersion, fxdRuleVersion,
+ lSubTableStart + rgnPassOffsets[ipassFont]);
+ m_ipassJust1++;
+ m_ipassPos1++;
+ }
+ else if (ipassBidi == ipass && ipass < ipassJust1)
+ {
+ m_prgppass[ipass] = new GrBidiPass(ipass);
+ m_prgppass[ipass]->SetTopDirLevel(TopDirectionLevel());
+ ipassFont--; // no corresponding pass in font
+ m_ipassJust1++;
+ m_ipassPos1++;
+ }
+ else if (ipassJust1 <= ipass && ipass < ipassPos1)
+ {
+ // A justification pass is, in essence, a substitution pass.
+ m_prgppass[ipass] = new GrSubPass(ipass);
+ m_prgppass[ipass]->ReadFromFont(grstrm, fxdSilfVersion, fxdRuleVersion,
+ lSubTableStart + rgnPassOffsets[ipassFont]);
+ m_ipassPos1++;
+ }
+ else if (ipassPos1 <= ipass)
+ {
+ m_prgppass[ipass] = new GrPosPass(ipass);
+ if (ipassFont < cpassFont)
+ {
+ m_prgppass[ipass]->ReadFromFont(grstrm, fxdSilfVersion, fxdRuleVersion,
+ lSubTableStart + rgnPassOffsets[ipassFont]);
+ }
+ else
+ {
+ // No positioning pass in font: create a bogus one.
+ m_prgppass[ipass]->InitializeWithNoRules();
+ }
+ }
+ else
+ {
+ Assert(false);
+ return false; // bad table
+ }
+ }
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Create passes corresponding to an invalid font.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::CreateEmpty()
+{
+ m_cpass = 2;
+
+ m_prgppass = new GrPass*[2];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+
+ m_prgppass[1] = new GrPosPass(1);
+ m_prgppass[1]->InitializeWithNoRules();
+
+ m_ipassPos1 = 1;
+ m_cpassLB = 0;
+ m_fBidi = false;
+
+ m_engst.CreateEmpty();
+}
+
+void EngineState::CreateEmpty()
+{
+ m_fStartLineContext = false;
+ m_fEndLineContext = false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Create the slot streams corresponding to the passes.
+----------------------------------------------------------------------------------------------*/
+void EngineState::CreateSlotStreams()
+{
+ if (m_prgpsstrm)
+ return;
+
+ m_prgpsstrm = new GrSlotStream * [m_cpass];
+ for (int ipass = 0; ipass < m_cpass; ++ipass)
+ {
+ m_prgpsstrm[ipass] = new GrSlotStream(ipass);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Store information about the pass-states in the pass objects.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::StorePassStates(PassState * rgzpst)
+{
+ for (int ipass = 0; ipass < m_cpass; ipass++)
+ Pass(ipass)->SetPassState(rgzpst + ipass);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Demand-driven loop: with goal of filling up final slot stream, loop backward and forward
+ filling up slot streams until final stream has reached physical capacity.
+
+ @param pgjus - justification agent; NULL if justification is of no interest
+ @param jmodi - (internal) justification mode
+ @param fStartLine, fEndLine
+ @param ichSegLim - known end of segment; -1 when using backtracking
+ @param dxWidthRequested - available width; when justifying, exact width desired
+ @param dxUnjustifiedWidth - when justifying, what the width would be normally
+ @param fNeedFinalBreak - true if the end of the segment needs to be a valid break point
+ @param fMoreText - true if char stream doesn't go up to text-stream lim
+ @param ichFontLim - end of the range that could be rendered by this font
+ @param fInfiniteWidth - used for "measured" segments
+ @param fWidthIsCharCount - kludge for test procedures: the width is a character count,
+ not a pixel count
+ @param lbPref - try for longest segment ending with this breakweight
+ - when justifying, lb to assume
+ @param lbMax - max (last resort) breakweight if no preferred break possible
+ @param ichwCallerBtLim - caller's backtrack lim; -1 if caller is not backtracking
+ @param twsh - how to handle trailing white-space
+ @param fParaRtl - overall paragraph direction
+ @param nDirDepth - direction depth of this segment
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::Run(Segment * psegNew, Font * pfont,
+ GrCharStream * pchstrm, IGrJustifier * pgjus, int jmodi,
+ LayoutEnvironment & layout,
+ int ichSegLim,
+ float dxWidthRequested, float dxUnjustifiedWidth,
+ bool fNeedFinalBreak, bool fMoreText, int ichFontLim,
+ bool fInfiniteWidth, bool fWidthIsCharCount,
+ int ichwCallerBtLim,
+ int nDirDepth, SegEnd estJ)
+{
+ bool fStartLine = layout.startOfLine();
+ bool fEndLine = layout.endOfLine();
+ LineBrk lbPref = layout.bestBreak();
+ LineBrk lbMax = layout.worstBreak();
+ TrWsHandling twsh = layout.trailingWs();
+ bool fParaRtl = layout.rightToLeft();
+ Segment * psegPrev = layout.prevSegment();
+ Segment * psegInit = layout.segmentForInit();
+ std::ostream * pstrmLog = layout.loggingStream();
+
+ m_engst.Initialize(Engine(), this); // do this after the tables have been fully read
+ m_engst.m_jmodi = jmodi;
+ m_engst.m_ipassJustCalled = -1;
+ m_engst.m_twsh = twsh;
+ m_engst.m_fParaRtl = fParaRtl;
+ m_engst.m_dxsShrinkPossible = GrSlotState::kNotYetSet;
+ m_fLogging = (pstrmLog != NULL);
+
+ int cbPrev;
+ byte * pbPrevSegDat = NULL;
+ if (psegPrev)
+ cbPrev = psegPrev->NextSegInitBuffer(&pbPrevSegDat);
+ else if (psegInit)
+ cbPrev = psegInit->ThisSegInitBuffer(&pbPrevSegDat);
+ else
+ cbPrev = 0;
+
+ if (pchstrm->IsEmpty())
+ {
+ m_engst.m_lbPrevEnd = klbNoBreak;
+ InitSegmentAsEmpty(psegNew, pfont, pchstrm, fStartLine, fEndLine);
+ psegNew->SetWidths(0, 0);
+ psegNew->SetUpOutputArrays(pfont, this, NULL, 0, 0, 0, twsh,
+ fParaRtl, nDirDepth, true);
+ psegNew->SetLayout(layout);
+ return;
+ }
+
+ int islotUnderBreak = -1; // position of inserted or final break point in underlying
+ // data; none so far (if an actual LB has been inserted,
+ // this is the index of that slot; otherwise it is the
+ // index of the last valid slot)
+ int islotSurfaceBreak = -1; // position of line break in surface stream; none so far
+ LineBrk lbBestToTry = lbPref;
+ LineBrk lbFound = klbNoBreak;
+
+ float dxMaxWidth = dxWidthRequested;
+
+ if (m_engst.m_jmodi == kjmodiJustify)
+ {
+ Assert(fInfiniteWidth);
+ lbBestToTry = klbClipBreak;
+ lbFound = lbPref;
+ }
+
+ float dxWidth;
+
+ std::vector<int> vnslotNeeded;
+ vnslotNeeded.resize(m_cpass);
+
+ m_engst.InitializeStreams(this, pchstrm, cbPrev, pbPrevSegDat, fNeedFinalBreak, &islotUnderBreak);
+
+ int ipassCurr;
+ int nNeedInput; // kNextPass: go on to the next pass
+ // kBacktrack: need to insert a line break
+ // > 0: need more input from previous pass
+
+ int cchwPostXlbContext = m_pgreng->PostXlbContext();
+ if (ichSegLim > -1)
+ {
+ // When we know exactly where the end of the segment will be, get as much as
+ // we need from the character stream, and then fill up the remaining streams.
+ // (3 below is an arbitrary number; we just want to get slightly more than
+ // we really need.)
+ vnslotNeeded[0] = ichSegLim - pchstrm->Min() + cchwPostXlbContext + 3;
+ for (int ipass = 1; ipass < m_cpass; ipass++)
+ vnslotNeeded[ipass] = 10000;
+ // Start at pass 0.
+ ipassCurr = 0;
+ }
+ else
+ {
+ // When we're doing line-breaking to find the end of the segment, use the
+ // demand-driven approach that tries to fill up the available space.
+ vnslotNeeded[m_cpass - 1] = 1;
+
+ // Start at the last pass. (It might be more efficient to start at the first pass and
+ // generate a small arbitrary number of glyphs.)
+ ipassCurr = m_cpass - 1;
+ }
+
+ while (ipassCurr < m_cpass)
+ {
+ if (ipassCurr == 0)
+ {
+ int nNeedNow = vnslotNeeded[0];
+ // Zeroth pass: generate glyph IDs from the underlying input.
+ nNeedInput = Pass(0)->ExtendGlyphIDOutput(this,
+ pchstrm, OutputStream(0), ichSegLim, cchwPostXlbContext, lbPref,
+ nNeedNow, fNeedFinalBreak, m_engst.m_twsh, &islotUnderBreak);
+ Assert(nNeedInput == kNextPass || nNeedInput == kBacktrack);
+ vnslotNeeded[0] -= nNeedNow;
+ }
+ else if (ipassCurr < m_cpass - 1)
+ {
+ // Middle pass.
+ int cslotNeedNow = vnslotNeeded[ipassCurr];
+ cslotNeedNow = max(1, cslotNeedNow);
+ int cslotGot;
+ Pass(ipassCurr)->ExtendOutput(this,
+ InputStream(ipassCurr), OutputStream(ipassCurr), cslotNeedNow, twsh,
+ &nNeedInput, &cslotGot, &islotUnderBreak);
+ vnslotNeeded[ipassCurr] -= cslotGot;
+ //if (nNeedInput != kNextPass && nNeedInput != kBacktrack)
+ // nNeedInput = max(nNeedInput, cslotNeedNow - cslotGot);
+ }
+ else // (ipassCurr == m_cpass - 1)
+ {
+ // Final pass: position and test allotted space.
+ float dxWidthWShrink = dxMaxWidth;
+ if (m_engst.m_dxsShrinkPossible != GrSlotState::kNotYetSet)
+ dxWidthWShrink += (int)m_engst.m_dxsShrinkPossible;
+ nNeedInput = Pass(ipassCurr)->ExtendFinalOutput(this,
+ InputStream(ipassCurr), OutputStream(ipassCurr),
+ dxWidthWShrink, fWidthIsCharCount, fInfiniteWidth,
+ (islotUnderBreak > -1), (fNeedFinalBreak && lbFound == klbNoBreak),
+ lbMax, twsh,
+ &islotSurfaceBreak, &dxWidth);
+ }
+
+ if (m_engst.m_jmodi == kjmodiJustify)
+ {
+ if (ipassCurr < m_ipassJust1 && !OutputStream(ipassCurr)->FullyWritten())
+ {
+ // When justifying, fill up all the streams up to the point where we need
+ // to interact with the justification routine.
+ // I think this code is obsolete.
+ int nStillNeed = 1000;
+ if ((ipassCurr == 1 && nNeedInput != kNextPass) || ipassCurr == 0)
+ nStillNeed = ichSegLim - (pchstrm->Pos() - pchstrm->Min())
+ + cchwPostXlbContext + 3;
+ if (nStillNeed > 0)
+ {
+ if (nNeedInput == kNextPass)
+ ipassCurr++; // repeat this pass
+ nNeedInput = nStillNeed;
+ }
+ }
+ else if (nNeedInput == kNextPass && ipassCurr + 1 == m_ipassJust1)
+ {
+ CallJustifier(pgjus, ipassCurr, dxUnjustifiedWidth, dxWidthRequested, fEndLine);
+ }
+ }
+ DetermineShrink(pgjus, ipassCurr);
+
+ if (nNeedInput == kBacktrack)
+ {
+ // Final output has overflowed its space--find (or adjust) the break point.
+
+ bool fFoundBreak = Backtrack(&islotUnderBreak,
+ &lbBestToTry, lbMax, twsh, fMoreText, ichwCallerBtLim, &lbFound);
+ if (!fFoundBreak)
+ {
+ // Nothing will fit. Initialize the new segment just enough so that
+ // we can delete it.
+ InitSegmentToDelete(psegNew, pfont, pchstrm);
+ return;
+ }
+ }
+ else if (nNeedInput == kNextPass)
+ {
+ // This pass is sufficiently full--return to following pass.
+ ipassCurr++;
+ }
+ else
+ {
+ // Get more input from previous pass.
+ ipassCurr--;
+ vnslotNeeded[ipassCurr] = nNeedInput;
+ }
+ }
+
+ // At this point we have fully transduced all the text for this segment.
+
+ // Figure out why we broke the segment and what the caller is supposed to do about it.
+ SegEnd est;
+ if (m_engst.m_jmodi == kjmodiJustify)
+ {
+ // Don't change what was passed in.
+ est = estJ;
+ }
+ else if (m_engst.m_fRemovedWhtsp) // (islotUnderBreak > -1 && twsh == ktwshNoWs)
+ {
+ Assert(!m_engst.m_fInsertedLB);
+ est = kestMoreWhtsp;
+ }
+
+ else if (m_engst.m_fHitHardBreak)
+ {
+ est = kestHardBreak;
+ }
+
+ else if (!m_engst.m_fExceededSpace && !fMoreText)
+ // Rendered to the end of the original requested range.
+ est = kestNoMore;
+
+// else if (!m_fExceededSpace && !fNextIsSameWs && fMoreText)
+// // Writing system break; may be more room on the line. But see tweak below.
+// *pest = kestWsBreak;
+
+ else if (m_engst.m_fExceededSpace)
+ {
+ // Exceeded available space, found a legal break.
+ if (twsh == ktwshNoWs && m_engst.m_fRemovedWhtsp)
+ est = kestMoreWhtsp;
+ else
+ est = kestMoreLines;
+ }
+
+ else if (twsh == ktwshOnlyWs)
+ {
+ est = kestOkayBreak; // but see tweak below
+ }
+
+ else
+ {
+ // Broke because of something like a font change. Determine whether this is a legal
+ // break or not.
+ // TODO SharonC: handle the situation where it is legal to break BEFORE the first
+ // character of the following segment.
+ Assert(fMoreText);
+ //Assert(fNextIsSameWs);
+ if (ichwCallerBtLim > -1)
+ {
+ Assert(m_engst.m_fInsertedLB);
+ }
+ else if (ichSegLim > -1)
+ {
+ // We stopped where caller said to.
+ Assert(fInfiniteWidth);
+ }
+ else
+ {
+ Assert(!m_engst.m_fInsertedLB);
+ Assert(islotUnderBreak == -1 || m_engst.m_fFinalLB);
+ }
+ int islotTmp = OutputStream(m_cpass - 1)->WritePos();
+ GrSlotState * pslotTmp;
+ if (m_engst.m_fFinalLB || m_engst.m_fInsertedLB)
+ pslotTmp = OutputStream(m_cpass-1)->SlotAt(islotTmp - 2);
+ else
+ pslotTmp = OutputStream(m_cpass-1)->SlotAt(islotTmp - 1);
+
+ if (abs(pslotTmp->BreakWeight()) <= lbPref)
+ est = kestOkayBreak;
+
+ else if (abs(pslotTmp->BreakWeight()) > lbMax)
+ est = kestBadBreak;
+
+ else if (OutputStream(m_cpassLB)->HasEarlierBetterBreak(islotUnderBreak, lbFound,
+ this->LBGlyphID()))
+ {
+ est = kestBadBreak;
+ }
+ else
+ est = kestOkayBreak;
+
+ // We no longer have the ability to know whether or not the next segment will use
+ // the same writing system.
+ //if (est == kestBadBreak && m_engst.m_fExceededSpace && !fNextIsSameWs && fMoreText)
+ // est = kestWsBreak;
+ }
+
+ // Make a segment out of it and return it.
+ int dichSegLen;
+ InitNewSegment(psegNew, pfont, pchstrm, pgjus,
+ islotUnderBreak, islotSurfaceBreak, fStartLine, fEndLine, ichFontLim, lbFound, est,
+ &dichSegLen);
+ if (psegNew->segmentTermination() == kestNothingFit)
+ {
+ return;
+ }
+ else if (psegNew->segmentTermination() == kestHardBreak &&
+ psegNew->startCharacter() == psegNew->stopCharacter())
+ {
+ // Empty segment caused by a hard-break.
+ m_engst.m_lbPrevEnd = klbNoBreak;
+ psegNew->SetWidths(0, 0);
+ psegNew->SetUpOutputArrays(pfont, this, NULL, 0, 0, 0, twsh,
+ fParaRtl, nDirDepth, true);
+ psegNew->SetLayout(layout);
+ return;
+ }
+
+ psegNew->RecordInitializationForThisSeg(cbPrev, pbPrevSegDat);
+
+ if ((est == kestNoMore || est == kestWsBreak) && twsh == ktwshOnlyWs &&
+ dichSegLen < pchstrm->Lim() - pchstrm->Min())
+ {
+ // If we are asking for white-space only, and we didn't use up everything in the font
+ // range, we could possibly have gotten an initial white-space only segment
+ // (as opposed to a writing system break).
+ est = kestOkayBreak;
+ psegNew->FixTermination(est);
+ }
+
+ SetFinalPositions(psegNew, fWidthIsCharCount);
+
+ // Do this before fixing up the associations below, so we can see the raw ones produced by the
+ // rules themselves.
+ //if (m_pgreng->LoggingTransduction())
+ // WriteTransductionLog(pchstrm, *ppsegRet,
+ // cbPrev, pbPrevSegDat, pbNextSegDat, pcbNextSegDat);
+ WriteTransductionLog(pstrmLog, pchstrm, psegNew, cbPrev, pbPrevSegDat);
+
+ RecordAssocsAndOutput(pfont, psegNew, twsh, fParaRtl, nDirDepth);
+
+ // Do this after fixing up the associations.
+ //if (m_pgreng->LoggingTransduction())
+ // WriteAssociationLog(pchstrm, *ppsegRet);
+ WriteAssociationLog(pstrmLog, pchstrm, psegNew);
+
+ psegNew->SetLayout(layout);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Create a new segment to return.
+
+ @param pchstrm - input stream
+ @param pgjus - justification agent, in case this segment needs to be
+ stretched or shrunk
+ @param islotLBStreamBreak - position of inserted line break slot (which should be equal
+ to the position in the glyph generation stream);
+ -1 if no line-break was inserted (we rendered to the
+ end of the range)
+ @param islotSurfaceBreak - position of line break slot in final (surface) stream
+ @param fStartLine - does this segment start a line?
+ @param fEndLine - does this segment end a line?
+ @param ichFontLim - end of range that could be rendered by this font
+ @param lbEndFound - line break found; possibly adjusted here
+ @param est - why did the segment terminate
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::InitNewSegment(Segment * psegNew,
+ Font * pfont, GrCharStream * pchstrm, IGrJustifier * pgjus,
+ int islotLBStreamBreak, int islotSurfaceBreak, bool fStartLine, bool fEndLine, int ichFontLim,
+ LineBrk lbEndFound, SegEnd est, int * pdichSegLen)
+{
+ LineBrk lbStart = m_engst.m_lbPrevEnd;
+ LineBrk lbEnd = lbEndFound;
+ if (est == kestBadBreak)
+ lbEnd = klbLetterBreak;
+
+ int ichwMin = pchstrm->Min();
+ int ichwLim;
+
+// int cslotPreSegStream0 = m_cslotPreSeg;
+// if (m_fInitialLB && m_cpassLB > 0)
+// {
+// // Initial LB is included in m_cslotPreSeg, but is not in stream 0.
+// // --Not really needed, because both islotLBStreamBreak and m_cslotPreSeg take
+// // the initial LB into account if it is there.
+// cslotPreSegStream0--;
+// }
+
+ // No longer have to subtract this, because the chunk map takes it into
+ // consideration.
+ //int cslotPreInitialLB = m_cslotPreSeg - (m_fInitialLB ? 1 : 0);
+
+ //int ichwOldTmp;
+
+ if (m_engst.m_fInsertedLB)
+ {
+ Assert(islotLBStreamBreak > -1);
+ int ichwSegLim = m_engst.LbSlotToSegLim(islotLBStreamBreak, pchstrm, m_cpassLB);
+ ichwLim = ichwSegLim + pchstrm->Min(); // - cslotPreInitialLB;
+
+ // Old result, for debugging:
+ //ichwOldTmp = islotLBStreamBreak + pchstrm->Min() - m_cslotPreSeg;
+ }
+ else if (m_engst.m_fFinalLB || islotLBStreamBreak == -1)
+ ichwLim = pchstrm->Lim();
+ else
+ {
+ int ichwSegLim = m_engst.LbSlotToSegLim(islotLBStreamBreak, pchstrm, m_cpassLB);
+ ichwLim = ichwSegLim + pchstrm->Min(); // - cslotPreInitialLB;
+
+ // Old result, for debugging:
+ // islotLBStreamBreak is the last slot in the segment, not the LB glyph; hence +1.
+ //ichwOldTmp = islotLBStreamBreak + pchstrm->Min() - m_cslotPreSeg + 1;
+ }
+
+ *pdichSegLen = ichwLim - ichwMin;
+
+ if (ichwMin >= ichwLim)
+ {
+ if (est == kestHardBreak)
+ {
+ // Empty segment cause by a hard-break.
+ InitSegmentAsEmpty(psegNew, pfont, pchstrm, fStartLine, fEndLine);
+ psegNew->FixTermination(est);
+ }
+ else
+ {
+ // Invalid empty segment.
+ Assert(ichwMin == ichwLim);
+ InitSegmentToDelete(psegNew, pfont, pchstrm);
+ }
+ return;
+ }
+
+ Assert(psegNew);
+
+ psegNew->Initialize(pchstrm->TextSrc(),
+ ichwMin, ichwLim,
+ lbStart, lbEnd, est, fStartLine, fEndLine, m_pgreng->RightToLeft());
+
+ psegNew->SetEngine(m_pgreng);
+ psegNew->SetFont(pfont);
+ psegNew->SetJustifier(pgjus);
+ psegNew->SetFaceName(m_pgreng->FaceName(), m_pgreng->BaseFaceName());
+
+ bool fNextSegNeedsContext =
+ !(est == kestNoMore || est == kestWsBreak
+ || ichwLim >= pchstrm->Lim() || ichwLim >= ichFontLim);
+
+ InitializeForNextSeg(psegNew, islotLBStreamBreak, islotSurfaceBreak, lbEnd,
+ fNextSegNeedsContext, pchstrm);
+
+ psegNew->SetPreContext(0 - m_pgreng->PreXlbContext());
+}
+
+/*----------------------------------------------------------------------------------------------
+ The newly created segment is invalid, for instance, because we were backtracking and
+ couldn't find a valid break point. Initialize it just enough so that it can be
+ deleted by the client.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::InitSegmentToDelete(Segment * psegNew, Font * pfont,
+ GrCharStream * pchstrm)
+{
+ psegNew->Initialize(pchstrm->TextSrc(), 0, 0,
+ klbClipBreak, klbClipBreak, kestNothingFit, false, false,
+ m_pgreng->RightToLeft());
+
+ psegNew->SetEngine(m_pgreng);
+ psegNew->SetFont(pfont);
+ psegNew->SetJustifier(NULL); // can't justify an empty segment
+ psegNew->SetFaceName(m_pgreng->FaceName(), m_pgreng->BaseFaceName());
+ psegNew->SetPreContext(0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Map from the given slot (which is generally the final LB slot) to the end of the segment,
+ taking into account the fact that a single slot may represent two 16-bit surrogates.
+
+ There are several approaches that seem reasonable but do NOT work. (I tried them!)
+ You can't calculate it directly from the length of the streams, because that doesn't take
+ into account the possible presence of surrogate pairs in the character stream. You can't
+ use the chunk map at the point of the LB, because if a rule spanned a LB the chunk won't
+ have ended there and so there won't be any valid information.
+
+ What seems to work is to figure out the slot(s) in the zeroth stream using the associations
+ and then use the segment offset for this slot. This should be reliable because there is
+ always a one-to-one correspondence between glyphs in the line-break passes (ie, no
+ insertions or deletions), so the associations should be dependable and straightforward.
+----------------------------------------------------------------------------------------------*/
+int EngineState::LbSlotToSegLim(int islotLB, GrCharStream * pchstrm, int cpassLB)
+{
+ Assert(islotLB < OutputStream(cpassLB)->WritePos());
+
+ // Figure out the corresponding characters in the zeroth stream. These should be straight-
+ // forward to figure out because no substitutions are permitted in the LB passes.
+ // I do the slots before and after the LB, if possible, as a sanity check.
+ GrSlotStream * psstrmLB = OutputStream(cpassLB);
+ GrSlotState * pslotPreLB = (m_fFinalLB || m_fInsertedLB) ?
+ psstrmLB->SlotAt(islotLB - 1) :
+ psstrmLB->SlotAt(islotLB);
+ GrSlotState * pslotPostLB = (psstrmLB->WritePos() > islotLB + 1) ?
+ psstrmLB->SlotAt(islotLB + 1) :
+ NULL;
+
+ int ichwPreLB = pslotPreLB->AfterAssoc();
+
+ int ichwSegLim;
+ if (pslotPostLB)
+ {
+ ichwSegLim = pslotPostLB->BeforeAssoc();
+ Assert(ichwPreLB + 1 == ichwSegLim
+ || ichwPreLB + 2 == ichwSegLim); // in case of a surrogate
+ }
+ else
+ {
+ ichwSegLim = ichwPreLB + 1;
+ while (!pchstrm->AtUnicodeCharBoundary(ichwSegLim))
+ ichwSegLim++;
+ Assert(pchstrm->AtUnicodeCharBoundary(ichwSegLim));
+ }
+
+ // Old buggy routine that doesn't handle the case where a rule (and hence the chunk map) did
+ // not end at the LB character:
+ // Map backwards through the LB pass streams, if any.
+ //int islotAdjusted = islotLB + 1; // after the LB
+ //for (int ipass = m_cpassLB; ipass > 0; ipass--)
+ //{
+ // islotAdjusted = ChunkInPrev(ipass, islotAdjusted, pchstrm);
+ //}
+ //
+ //int ichwSegLim = ChunkInPrev(0, islotAdjusted, pchstrm);
+
+ // Mapping from 32-bit to 16-bit should only increase the index. Except that there
+ // may be a LB in the slot stream that is not in the character stream, so it could be
+ // one less.
+ Assert(ichwSegLim + m_cslotPreSeg >= islotLB - 1);
+
+ return ichwSegLim;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the chunk mapping into the previous stream, taking into account the fact that it
+ is not recorded for the write-position.
+----------------------------------------------------------------------------------------------*/
+int GrTableManager::ChunkInPrev(int ipass, int islot, GrCharStream * pchstrm)
+{
+ GrSlotStream * psstrmOut = OutputStream(ipass);
+ GrSlotStream * psstrmIn = (ipass == 0) ? NULL : InputStream(ipass);
+
+ int islotTmp = islot;
+ int islotAdjusted;
+ do {
+ if (islot >= psstrmOut->WritePos())
+ {
+ Assert(islot == psstrmOut->WritePos());
+ islotAdjusted = (ipass == 0) ? pchstrm->SegOffset() : psstrmIn->ReadPos();
+ Assert(islotAdjusted > -1);
+ }
+ else
+ islotAdjusted = psstrmOut->ChunkInPrev(islotTmp);
+ islotTmp--;
+ } while (islotAdjusted == -1);
+
+ return islotAdjusted;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Create a new segment corresponding to an empty string.
+
+ @param pchstrm - input stream
+ @param fStartLine - does this segment start a line?
+ @param fEndLine - does this segment end a line?
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::InitSegmentAsEmpty(Segment * psegNew, Font * pfont,
+ GrCharStream * pchstrm, bool fStartLine, bool fEndLine)
+{
+ LineBrk lbStart = m_engst.m_lbPrevEnd;
+ LineBrk lbEnd = klbNoBreak;
+
+ int ichwMin = 0;
+ int ichwLim = 0;
+
+ Assert(psegNew);
+
+ psegNew->Initialize(pchstrm->TextSrc(), ichwMin, ichwLim,
+ lbStart, lbEnd, kestNoMore, fStartLine, fEndLine, m_pgreng->RightToLeft());
+
+ psegNew->SetEngine(m_pgreng);
+ psegNew->SetFont(pfont);
+ psegNew->SetJustifier(NULL); // can't justify an empty segment
+ psegNew->SetFaceName(m_pgreng->FaceName(), m_pgreng->BaseFaceName());
+
+ byte pbNextSegDat[256];
+ int cbNextSegDat;
+ int * pcbNextSegDat = &cbNextSegDat;
+
+ // Initialization for (theoretical) next segment.
+ byte * pb = pbNextSegDat;
+ *pb++ = byte(lbEnd);
+ *pb++ = kdircNeutral;
+ *pb++ = kdircNeutral;
+ *pb++ = 0;
+ for (int ipass = 0; ipass < m_cpass; ipass++)
+ *pb++ = 0;
+ *pcbNextSegDat = 0;
+ psegNew->RecordInitializationForNextSeg(*pcbNextSegDat, pbNextSegDat);
+
+ psegNew->SetPreContext(0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Find a line-break and unwind the passes. Return true if we were able to
+ backtrack successfully (which may have meant using a less-than-optimal line-break).
+ Return false if no line-break could be found (because maxBreakWeight did not allow
+ letter breaks or clipping--generally because there was already something on this
+ line).
+
+ @param pislotPrevBreak - position of previously-created break, -1 if none;
+ this is the index of the line-break glyph if any,
+ or the index of the last slot in the segment;
+ adjusted to contain the position of the newly
+ found break
+ @param plbMin - minimum (best) line break weight to try
+ @param lbMax - maximum (worst possible) line break weight
+ @param twsh - how to handle trailing white-space
+ @param fMoreText - true if char stream doesn't go up to original lim
+ @param ichwCallerBtLim - caller's backtrack lim; -1 if caller is not backtracking
+ @param plbFound - kind of line-break created
+----------------------------------------------------------------------------------------------*/
+bool GrTableManager::Backtrack(int * pislotPrevBreak,
+ LineBrk * plbMin, LineBrk lbMax, TrWsHandling twsh, bool fMoreText,
+ int ichwCallerBtLim,
+ LineBrk * plbFound)
+{
+ int islotStartTry;
+ //if (*pislotPrevBreak == ichwCallerBtLim - 1)
+ //{
+ // islotStartTry = *pislotPrevBreak;
+ //}
+ //else
+ if (*pislotPrevBreak == -1)
+ {
+ // If no line break has been found so far, figure out where to start trying based
+ // on where the final stream choked.
+ GrSlotStream * psstrmFinal = OutputStream(m_cpass-1);
+ if ((islotStartTry
+ = m_engst.TraceStreamZeroPos(psstrmFinal->WritePos()-1, TopDirectionLevel()))
+ == -1)
+ {
+ // Just start looking at the end of what's been generated.
+ islotStartTry = OutputStream(m_cpassLB)->ReadPos() - 1;
+ }
+ }
+ else
+ {
+ // Start just before previous line break.
+ if (m_engst.m_fInsertedLB || m_engst.m_fFinalLB)
+ islotStartTry = *pislotPrevBreak - 2; // skip inserted LB and previous slot
+ else
+ islotStartTry = *pislotPrevBreak - 1; // skip previous slot
+ }
+ if (ichwCallerBtLim > -1 && islotStartTry > ichwCallerBtLim - 1)
+ {
+ islotStartTry = ichwCallerBtLim - 1;
+ }
+
+ // Determine if we want to insert an actual line-break "glyph". Don't do that if
+ // we are omitting trailing white space or we are at a writing-system or font break.
+ bool fInsertLB;
+ if (twsh == ktwshNoWs)
+ // omitting trailing white-space
+ fInsertLB = false;
+ else if (twsh == ktwshOnlyWs)
+ // trailing white-space segment
+ fInsertLB = true;
+ else if (ichwCallerBtLim > -1)
+ // backtracking
+ fInsertLB = true;
+ else if (*pislotPrevBreak > -1)
+ // no longer at the edge of the writing system or font
+ fInsertLB = true;
+ else if (!fMoreText)
+ // at final edge of total range to render
+ fInsertLB = true;
+ else
+ fInsertLB = false;
+
+ // Try to insert a line-break in the output of the (final) line-break pass (if any, or
+ // the output of the glyph-generation pass). First try the preferred (strictest)
+ // break weight and gradually relax.
+ LineBrk lb = *plbMin;
+ Assert(*plbMin <= lbMax);
+ GrSlotStream * psstrmLB = OutputStream(m_cpassLB);
+ islotStartTry = min(islotStartTry, psstrmLB->WritePos() - 1);
+ int islotNewBreak = -1;
+ while (lb <= lbMax)
+ {
+ LineBrk lbNextToTry;
+ if (fInsertLB)
+ {
+ islotNewBreak = psstrmLB->InsertLineBreak(this,
+ *pislotPrevBreak, m_engst.m_fInsertedLB, islotStartTry,
+ lb, twsh, m_engst.m_cslotPreSeg, &lbNextToTry);
+ }
+ else
+ {
+ islotNewBreak = psstrmLB->MakeSegmentBreak(this,
+ *pislotPrevBreak, m_engst.m_fInsertedLB, islotStartTry,
+ lb, twsh, m_engst.m_cslotPreSeg, &lbNextToTry);
+ }
+ if (islotNewBreak > -1)
+ break;
+ if (lb >= lbMax)
+ break;
+ lb = IncLineBreak(lb); // relax the break weight
+ }
+
+ if (islotNewBreak == -1)
+ {
+ return false;
+ }
+
+ // We've successfully inserted a line break.
+
+ if (fInsertLB)
+ m_engst.m_fInsertedLB = true;
+
+ m_engst.m_fFinalLB = false;
+
+ UnwindAndReinit(islotNewBreak);
+
+ *pislotPrevBreak = islotNewBreak;
+ *plbMin = lb; // return the best break we were able to find, so we don't keep trying
+ // for a better one when we know now that we can't find it
+ *plbFound = lb;
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ This method is called after backtracking or removing trailing white-space.
+ Unwind the following slot streams as necessary depending on where the change was made.
+
+ @param islotNewBreak - in output of (final) line-break pass
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::UnwindAndReinit(int islotNewBreak)
+{
+ OutputStream(m_cpassLB)->ZapCalculatedDirLevels(islotNewBreak);
+
+ // Mark the passes before the line-break pass as fully written, so that if there
+ // isn't a line-break glyph to intercept, we don't keep trying to get more input
+ // from them.
+ int ipass;
+ for (ipass = 1; ipass < m_cpassLB + 1; ++ipass)
+ {
+ InputStream(ipass)->MarkFullyWritten();
+ }
+
+ // Unwind the passes to the changed positions.
+ // Note that we don't need to unwind pass 0, since all it does is generate glyph IDs.
+ // Also we don't need to unwind the line-break passes, because conceptually they happen
+ // before the break is inserted.
+
+ int islotChgPos = islotNewBreak;
+ bool fFirst = true;
+ for (ipass = m_cpassLB + 1 ; ipass < m_cpass ; ++ipass)
+ {
+ islotChgPos =
+ Pass(ipass)->Unwind(this, islotChgPos, InputStream(ipass), OutputStream(ipass),
+ fFirst);
+ fFirst = false;
+ }
+ // For anything that may have been skipped in the final output:
+ OutputStream(m_cpass - 1)->SetReadPos(0);
+ OutputStream(m_cpass - 1)->SetReadPosMax(0);
+ Pass(m_cpass - 1)->UndoResyncSkip();
+ OutputStream(m_cpass - 1)->ClearSlotsSkippedToResync();
+
+ m_engst.InitPosCache();
+
+ m_engst.m_dxsShrinkPossible = GrSlotState::kNotYetSet; // recalculate it
+}
+
+/*----------------------------------------------------------------------------------------------
+ Store information in the newly created segment that will allow us to reinitalize
+ the streams in order to process the next segment, appropriately handling any
+ cross-line-boundary contextuals.
+
+ The information required is the number of glyphs in the first stream that must
+ be reprocessed, and a skip-offset between each stream indicating the beginning
+ of chunk boundaries.
+
+ In most cases, where there are no cross-line-boundary contextuals, all these numbers
+ will be zero.
+
+ The buffer generated is of the following format (all are 1 byte, unsigned):
+ end breakweight
+ previous strong directionality code
+ previous terminator dir code
+ restart backup
+ skip offsets for each pass
+ This format must match what is generated by InitializeStreams.
+
+ @param pseg - newly created segment
+ @param islotUnderBreak - position of line break inserted in underlying stream (output
+ of glyph-generation pass--stream 0); -1 if we rendered to
+ the end of the range
+ @param islotSurfaceBreak - position of line break in surface stream;
+ -1 if we rendered to the end of the range
+ @param lbEnd - kind of line-break at the end of this segment
+ @param fNextSegNeedsContext - true if we need to remember the context for the next seg
+ @param pchstrm - character stream input for this segment
+ @param cbNextMax - amount of space available in the buffer
+ @param pbNextSegDat - buffer for initializing next segment
+ @param pcbNextSegDat - amount of space used in buffer
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::InitializeForNextSeg(Segment * pseg,
+ int islotUnderBreak, int islotSurfaceBreak, LineBrk lbEnd,
+ bool fNextSegNeedsContext, GrCharStream * pchstrm)
+{
+ byte pbNextSegDat[256];
+ int cbNextSegDat;
+ int * pcbNextSegDat = &cbNextSegDat;
+
+ std::vector<int> vcslotSkipOffsets;
+ vcslotSkipOffsets.resize(m_cpass);
+
+ byte * pb = pbNextSegDat;
+
+ if (!fNextSegNeedsContext)
+ {
+ // No contextualization between this segment and the next, whatever kind of renderer
+ // it might use.
+ *pcbNextSegDat = 0;
+ return;
+ }
+
+ gid16 chwLB = LBGlyphID();
+
+ int islotUnderLim = islotUnderBreak;
+ if (!m_engst.m_fInsertedLB && !m_engst.m_fFinalLB)
+ // Then islotUnderBreak is the position of the last slot in the segment; increment
+ // to get the lim in stream zero.
+ islotUnderLim++;
+
+ int islotSurfaceLim = islotSurfaceBreak;
+ if (islotSurfaceLim == -1)
+ islotSurfaceLim = OutputStream(m_cpass - 1)->FinalSegLim();
+
+ *pb++ = byte(lbEnd);
+
+ // Find previous strong and terminator directionality codes.
+
+ GrSlotStream * psstrm = OutputStream(m_cpass - 1);
+ DirCode dircStrong = kdircNeutral;
+ DirCode dircTerm = kdircNeutral;
+ int islot;
+ for (islot = islotSurfaceLim; islot-- > 0; )
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ DirCode dirc = pslot->Directionality();
+ if (dircTerm == kdircNeutral && dirc == kdircEuroTerm)
+ dircTerm = dirc;
+ if (StrongDir(dirc))
+ {
+ dircStrong = dirc;
+ break;
+ }
+ }
+ *pb++ = byte(dircStrong);
+ *pb++ = byte(dircTerm);
+
+ // Record how much of each pass to redo in the next segment.
+ // The basic algorithm is described in the "WR Data Transform Engine" document.
+ // But here we are doing a variation on what is described there. We are calculating
+ // the backup locations for BOTH the rule start locations and the necessary pre-contexts.
+ // It is the precontext values that are recorded for use by the following segment. But we
+ // also calculate the positions for the rule-start locations to make sure there is enough
+ // pre-context at each pass.
+
+ int islotRS = islotSurfaceLim; // rule-start positions
+ int islotPC = islotRS; // to handle pre-context positions
+
+ // If line-breaks are irrelevant to this font, we don't need to bother.
+ bool fGiveUp = !m_pgreng->LineBreakFlag();
+
+ int ipass;
+ for (ipass = m_cpass - 1; ipass >= 0 && !fGiveUp; --ipass)
+ {
+ GrSlotStream * psstrmIn = (ipass == 0) ? NULL : InputStream(ipass);
+ GrSlotStream * psstrmOut = OutputStream(ipass);
+ int islotBackupMin = (ipass == 0) ? 0 : psstrmOut->SegMin();
+ if (ipass >= m_cpassLB && m_engst.m_fInitialLB)
+ islotBackupMin++; // how far we can back up--not before the start of this segment
+
+ int islotPrevRS = 0; // corresponding slot in the previous stream for rule-start position
+ int islotPrevPC = 0; // same for pre-context position
+
+ // Initially we have to include at least this many prior slots:
+ int cslotSkipOffset = 0;
+
+ if (islotRS == psstrmOut->WritePos())
+ {
+ islotPrevRS = (ipass == 0) ? pchstrm->Pos() : psstrmIn->ReadPos();
+ }
+ else
+ {
+ // Ignore the final line-break, because it is explicitly inserted during
+ // the (final) line-break pass.
+// if (ipass == m_cpassLB && psstrm->SlotAt(islotRS)->IsFinalLineBreak(chwLB))
+// {
+// Assert(islotRS > 0);
+// islotRS--;
+// }
+ // Ignore the chunk in the pass that generated the line break that corresponds
+ // to the inserted line break being chunked with the previous glyph--we don't
+ // want to treat that as a cross-line-boundary contextual!
+ if (ipass == m_cpassLB && psstrmOut->SlotAt(islotRS)->IsFinalLineBreak(chwLB))
+ {
+// Assert(psstrm->ChunkInPrev(islotRS) == -1);
+ if (islotRS + 1 == psstrmOut->WritePos())
+ islotPrevRS = (ipass == 0) ? pchstrm->SegOffset() : psstrmIn->ReadPos();
+ else
+ islotPrevRS = psstrmOut->ChunkInPrev(islotRS + 1);
+ }
+ else
+ {
+ // Back up to the beginning of a chunk.
+ while (islotRS >= islotBackupMin &&
+ (islotPrevRS = psstrmOut->ChunkInPrev(islotRS)) == -1)
+ {
+ --islotRS;
+ //++cslotSkipOffset;
+ }
+ }
+ }
+ if (islotPrevRS == -1 || islotRS < islotBackupMin) // hit the start of the segment
+ {
+ // In order to get enough context to be sure to run the same rules again,
+ // we'd have to back up into the previous segment. Too complicated, so give up.
+ fGiveUp = true;
+ break;
+ }
+
+ int cslotPreContext = Pass(ipass)->MaxRulePreContext();
+LBackupPC:
+ if (islotPC == psstrmOut->WritePos())
+ {
+ islotPrevPC = (ipass == 0) ? pchstrm->Pos() : psstrmIn->ReadPos();
+ }
+ else
+ {
+ if (ipass == m_cpassLB && psstrmOut->SlotAt(islotPC)->IsFinalLineBreak(chwLB))
+ {
+ if (islotPC+1 == psstrmOut->WritePos())
+ islotPrevPC = (ipass == 0) ? pchstrm->SegOffset() : psstrmIn->ReadPos();
+ else
+ islotPrevPC = psstrmOut->ChunkInPrev(islotPC+1);
+ }
+ else
+ {
+ // Back up to the beginning of a chunk; also make sure there are enough slots
+ // to handle the required pre-context for this pass.
+ while (islotPC >= islotBackupMin &&
+ ((islotPrevPC = psstrmOut->ChunkInPrev(islotPC)) == -1 ||
+ islotPrevRS - islotPrevPC < cslotPreContext))
+ {
+ --islotPC;
+ ++cslotSkipOffset;
+ }
+ }
+ }
+ if (islotPC >= islotBackupMin && islotPrevRS - islotPrevPC < cslotPreContext)
+ {
+ --islotPC;
+ ++cslotSkipOffset;
+ goto LBackupPC;
+ }
+ if (islotPrevPC == -1 || islotPC < islotBackupMin) // hit the start of the segment
+ {
+ fGiveUp = true;
+ break;
+ }
+
+ vcslotSkipOffsets[ipass] = cslotSkipOffset;
+
+ islotRS = islotPrevRS;
+ islotPC = islotPrevPC;
+
+ if (ipass == 0)
+ {
+ // Convert from underlying chars to stream-zero slots.
+ islotRS += m_engst.m_cslotPreSeg;
+ islotPC += m_engst.m_cslotPreSeg;
+ }
+ }
+
+ // The following should be the case unless they tried to position contextually across
+ // the line break boundary, which is a very strange thing to do! - no longer true,
+ // because the pre-context is now included in this count, and it normal to have
+ // a pre-context in the final positioning pass.
+ //Assert(vcslotSkipOffsets[m_cpass-1] == 0);
+
+ // Also no adjustments are made by the glyph-generation pass, so this should always
+ // be true:
+ Assert(vcslotSkipOffsets[0] == 0);
+
+ // The number of slots in the underlying input previous to the line-break
+ // that must be reprocessed:
+ int cslotPreLB = islotUnderLim - islotPC;
+
+ if (fGiveUp)
+ {
+ // We can't reasonably provide enough context, so don't try to do it at all.
+ cslotPreLB = 0;
+ for (ipass = 0; ipass < m_cpass; ipass++)
+ vcslotSkipOffsets[ipass] = 0;
+ }
+
+ Assert(cslotPreLB >= 0);
+ Assert(cslotPreLB < 0xFF);
+
+ *pb++ = byte(cslotPreLB);
+ for (ipass = 0; ipass < m_cpass; ipass++)
+ *pb++ = byte(vcslotSkipOffsets[ipass]);
+
+ *pcbNextSegDat = 4 + m_cpass;
+
+ pseg->RecordInitializationForNextSeg(*pcbNextSegDat, pbNextSegDat);
+}
+/*----------------------------------------------------------------------------------------------
+ Make sure the final positions are set for every glyph.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::SetFinalPositions(Segment * pseg, bool fWidthIsCharCount)
+{
+ float xsTotalWidth, xsVisWidth;
+
+#ifdef OLD_TEST_STUFF
+ if (fWidthIsCharCount)
+ xsTotalWidth = xsVisWidth = 0;
+ else
+#endif // OLD_TEST_STUFF
+
+ // Make sure the final positions are set for every glyph.
+ CalcPositionsUpTo(m_cpass-1, reinterpret_cast<GrSlotState *>(NULL),
+ &xsTotalWidth, &xsVisWidth);
+ pseg->SetWidths(xsVisWidth, xsTotalWidth);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Calculate the associations, and record the output slots in the segment.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::RecordAssocsAndOutput(Font * pfont, Segment * pseg,
+ TrWsHandling twsh, bool fParaRtl, int nDirDepth)
+{
+ int cchwUnderlying = pseg->stopCharacter() - pseg->startCharacter();
+ GrSlotStream * psstrmFinal = OutputStream(m_cpass-1);
+ int csloutSurface = psstrmFinal->WritePos() - psstrmFinal->IndexOffset(); // # of output slots
+
+ psstrmFinal->SetNeutralAssociations(LBGlyphID());
+
+ pseg->SetUpOutputArrays(pfont, this, psstrmFinal, cchwUnderlying, csloutSurface, LBGlyphID(),
+ twsh, fParaRtl, nDirDepth);
+
+ // Set underlying-to-surface assocations in the segment.
+ CalculateAssociations(pseg, csloutSurface);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Calculate the underlying-to-surface associations and ligature mappings.
+ Assumes the arrays have been properly initialized.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::CalculateAssociations(Segment * pseg, int csloutSurface)
+{
+ GrSlotStream * psstrmFinal = OutputStream(m_cpass-1);
+
+ std::vector<int> vichwAssocs;
+ std::vector<int> vichwComponents;
+
+ for (int islot = psstrmFinal->IndexOffset(); islot < psstrmFinal->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrmFinal->SlotAt(islot);
+ int islout = islot - psstrmFinal->IndexOffset();
+ if (!pslot->IsLineBreak(LBGlyphID()))
+ {
+ vichwAssocs.clear();
+ pslot->AllAssocs(vichwAssocs);
+
+ size_t iichw;
+ for (iichw = 0; iichw < vichwAssocs.size(); ++iichw)
+ {
+ pseg->RecordSurfaceAssoc(vichwAssocs[iichw], islout, 0);
+ }
+
+ vichwComponents.clear();
+ if (pslot->HasComponents())
+ pslot->AllComponentRefs(vichwComponents);
+
+ for (iichw = 0; iichw < vichwComponents.size(); iichw++)
+ {
+ pseg->RecordLigature(vichwComponents[iichw], islout, iichw);
+ }
+ }
+ }
+
+ AdjustAssocsForOverlaps(pseg);
+ pseg->CleanUpAssocsVectors();
+
+// pseg->AdjustForOverlapsWithPrevSeg(); // for any characters officially in the
+ // previous segment but rendered in this one,
+ // or vice versa
+
+ // TODO SharonC: for all characters that are right-to-left in the underlying stream,
+ // reverse the before and after flags in the segment.
+}
+
+/*----------------------------------------------------------------------------------------------
+ For any slots associated with characters in the new segment but not rendered in the
+ segment, adjust the underlying-to-surface mappings accordingly. Ie, set the before
+ mapping to kNegInfinity for slots at the beginning of the streams, and set the
+ after mapping to kPosInfinity for slots at the end of the streams.
+
+ TODO SharonC: Rework this method more carefully to handle each slot exactly once. The current
+ approach could possibly, for instance, process a slot that is inserted in one pass
+ and deleted in the next.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::AdjustAssocsForOverlaps(Segment * pseg)
+{
+ if (!m_engst.m_fInitialLB && !m_engst.m_fFinalLB && !m_engst.m_fInsertedLB)
+ // no cross-line contextualization possible
+ return;
+
+ gid16 chwLB = LBGlyphID();
+ std::vector<int> vichwAssocs;
+
+ // Process any slots output by any substitution pass (or later) on either side of the
+ // line-breaks. These are the relevant slots that are rendered in the previous and
+ // following segments.
+ for (int ipass = m_cpass; ipass-- > m_cpassLB + 1; )
+ {
+ GrSlotStream * psstrm = OutputStream(ipass);
+ int islotMin = (ipass == m_cpass - 1) ? psstrm->IndexOffset() : 0;
+
+ if (m_engst.m_fInitialLB)
+ {
+ for (int islot = islotMin; ; islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ if (pslot->IsInitialLineBreak(chwLB))
+ break;
+ Assert(!pslot->IsFinalLineBreak(chwLB));
+ if (pslot->PassModified() != ipass)
+ continue;
+
+ vichwAssocs.clear();
+ pslot->AllAssocs(vichwAssocs);
+ for (size_t iichw = 0; iichw < vichwAssocs.size(); ++iichw)
+ pseg->MarkSlotInPrevSeg(vichwAssocs[iichw], islot);
+ }
+ }
+
+ if ((m_engst.m_fFinalLB || m_engst.m_fInsertedLB) && ipass > m_cpassLB)
+ {
+ for (int islot = psstrm->WritePos(); islot-- > islotMin ; )
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ if (pslot->IsFinalLineBreak(chwLB))
+ break;
+ Assert(!pslot->IsInitialLineBreak(chwLB));
+ if (pslot->PassModified() != ipass)
+ continue;
+
+ vichwAssocs.clear();
+ pslot->AllAssocs(vichwAssocs);
+ for (size_t iichw = 0; iichw < vichwAssocs.size(); ++iichw)
+ pseg->MarkSlotInNextSeg(vichwAssocs[iichw], islot);
+ }
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Initialize all the streams. In particular, process the information about the
+ skip-offsets to handle segments other than the first.
+
+ @param cbPrev - number of bytes in the pbPrevSegDat buffer
+ @param pbPrevSegDat - buffer in the following format (all are 1 byte, unsigned):
+ prev seg's end breakweight
+ prev seg's previous strong directionality code
+ prev seg's previous terminator dir code
+ restart backup
+ skip offsets for each pass
+ This format must match what is generated by InitializeForNextSeg.
+----------------------------------------------------------------------------------------------*/
+void EngineState::InitializeStreams(GrTableManager * ptman,
+ GrCharStream * pchstrm,
+ int cbPrev, byte * pbPrevSegDat, bool fNeedFinalBreak, int * pislotFinalBreak)
+{
+ int cpassLB = ptman->NumberOfLbPasses();
+ int ipassPos1 = ptman->FirstPosPass();
+
+ CreateSlotStreams();
+
+ int cslotBackup = 0;
+
+ InitForNewSegment(ptman);
+
+ if (cbPrev == 0)
+ {
+ m_lbPrevEnd = klbNoBreak;
+ m_dircInitialStrongDir = kdircNeutral;
+ m_dircInitialTermDir = kdircNeutral;
+ for (int ipass = 0; ipass < m_cpass; ++ipass)
+ {
+ OutputStream(ipass)->Initialize(ipassPos1, false);
+ m_prgzpst[ipass].SetResyncSkip(0);
+
+ if (ptman->LoggingTransduction())
+ m_prgzpst[ipass].InitializeLogInfo();
+ }
+ }
+ else
+ {
+ Assert(cbPrev >= 4);
+ byte * pb = pbPrevSegDat;
+
+ m_lbPrevEnd = LineBrk(*pb++);
+
+ // Directionality codes from the previous segment.
+ m_dircInitialStrongDir = DirCode((int)*pb++);
+ m_dircInitialTermDir = DirCode((int)*pb++);
+
+ cslotBackup = (int)*pb++;
+ Assert((cbPrev == 4 || cslotBackup == 0) || cbPrev == m_cpass + 4);
+
+ for (int ipass = 0; ipass < m_cpass; ++ipass)
+ {
+ OutputStream(ipass)->Initialize(ipassPos1, true);
+ if (cbPrev == 4)
+ m_prgzpst[ipass].SetResyncSkip(0); // different writing system
+ else
+ m_prgzpst[ipass].SetResyncSkip(*pb++);
+
+ if (ptman->LoggingTransduction())
+ m_prgzpst[ipass].InitializeLogInfo();
+ }
+
+ pchstrm->Backup(cslotBackup);
+ }
+
+ if (cbPrev > 0 || pchstrm->StartLine())
+ {
+ // Go ahead and run the initial line-break passes (if any), and then insert
+ // a line-break at the appropriate place where the new segment will begin.
+ int cslotToGet = cslotBackup;
+LGetMore:
+ ptman->Pass(0)->ExtendGlyphIDOutput(ptman, pchstrm, OutputStream(0),
+ -1, 0, klbWordBreak,
+ cslotToGet, fNeedFinalBreak, m_twsh, pislotFinalBreak);
+ OutputStream(0)->SetSegMin(cslotBackup);
+ for (int ipass = 1; ipass <= cpassLB; ipass++)
+ {
+ if (cslotToGet > 0)
+ {
+ int nRet = kNextPass;
+ int cslotGot;
+ ptman->Pass(ipass)->ExtendOutput(ptman,
+ InputStream(ipass), OutputStream(ipass),
+ cslotToGet, m_twsh, &nRet, &cslotGot, pislotFinalBreak);
+ if (nRet != kNextPass)
+ {
+ cslotToGet = 1;
+ goto LGetMore;
+ }
+ }
+ OutputStream(ipass)->SetSegMin(cslotBackup);
+ }
+ Assert(OutputStream(cpassLB)->WritePos() >= cslotBackup);
+ m_cslotPreSeg = cslotBackup;
+ if (pchstrm->StartLine())
+ {
+ OutputStream(cpassLB)->AppendLineBreak(ptman, pchstrm, m_lbPrevEnd,
+ (ptman->RightToLeft() ? kdircRlb : kdircLlb), cslotBackup, true, -1);
+ SetInitialLB();
+ m_cslotPreSeg++;
+ if (cpassLB > 0 && *pislotFinalBreak > -1)
+ // See corresponding kludge in GrPass::ExtendGlyphIDOutput.
+ *pislotFinalBreak += 1;
+ }
+ else
+ {
+ OutputStream(cpassLB)->SetSegMin(cslotBackup);
+ }
+ OutputStream(cpassLB)->CalcIndexOffset(ptman);
+ }
+
+ else
+ {
+ Assert(cslotBackup == 0);
+ OutputStream(0)->SetSegMin(0);
+ m_cslotPreSeg = 0;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Reinitialize as we start to generate a new segment.
+----------------------------------------------------------------------------------------------*/
+void EngineState::InitForNewSegment(GrTableManager * ptman)
+{
+ // Set up a fresh batch of slots.
+ DestroySlotBlocks();
+ m_islotblkCurr = -1;
+ m_islotNext = kSlotBlockSize;
+
+ m_fInitialLB = false;
+ m_fFinalLB = false;
+ m_fInsertedLB = false;
+ m_fExceededSpace = false;
+ m_fHitHardBreak = false;
+ m_fRemovedWhtsp = false;
+ InitPosCache();
+ //////m_pgg = pgg;
+
+ for (int ipass = 0; ipass < m_cpass; ipass++)
+ m_prgzpst[ipass].InitForNewSegment(ipass, ptman->Pass(ipass)->MaxRuleContext());
+}
+
+/*----------------------------------------------------------------------------------------------
+ Calculate the position in stream zero of the given slot in the final stream,
+ based on the associations. (This will be the same as the position at the end of the
+ line-break passes, which is really what we want.)
+
+ @param islotFinal - index of the final slot in the final stream
+----------------------------------------------------------------------------------------------*/
+int EngineState::TraceStreamZeroPos(int islotFinal, int nTopDir)
+{
+ GrSlotStream * psstrmFinal = OutputStream(m_cpass - 1);
+ if (psstrmFinal->WritePos() == 0)
+ return -1;
+
+ GrSlotState * pslot = psstrmFinal->SlotAt(islotFinal);
+
+ // If we're in the middle of reordered bidi stuff, just use the end of the stream.
+ if (pslot->DirLevel() > nTopDir)
+ return -1;
+
+ int islot = pslot->BeforeAssoc();
+ if (islot == kPosInfinity || islot < 0)
+ return -1;
+ return islot + m_cslotPreSeg;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the next higher (more relaxed, less desirable) line break weight.
+----------------------------------------------------------------------------------------------*/
+LineBrk GrTableManager::IncLineBreak(LineBrk lb)
+{
+ Assert(lb != klbClipBreak);
+ return (LineBrk)((int)lb + 1);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return a pointer to a slot that is near the current position in the given stream.
+ Return NULL if no slots have been output at all.
+ This is used for initializing features of line-break slots.
+ @param ipassArg - pass at which to start looking
+ @param islot - slot to look for; -1 if considering the current position
+----------------------------------------------------------------------------------------------*/
+GrSlotState * EngineState::AnAdjacentSlot(int ipassArg, int islot)
+{
+ int ipass = ipassArg;
+ while (ipass >= 0)
+ {
+ GrSlotStream * psstrm = OutputStream(ipass);
+ if (psstrm->NumberOfSlots() > 0)
+ {
+ if (islot == -1)
+ {
+ if (psstrm->AtEnd())
+ return psstrm->SlotAt(psstrm->WritePos() - 1);
+ else
+ return psstrm->Peek();
+ }
+ else
+ {
+ if (psstrm->WritePos() <= islot)
+ return psstrm->SlotAt(psstrm->WritePos() - 1);
+ else
+ return psstrm->SlotAt(islot);
+ }
+ }
+ ipass--;
+ }
+ return NULL;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Simple access methods.
+----------------------------------------------------------------------------------------------*/
+GrEngine * GrTableManager::Engine()
+{
+ return m_pgreng;
+}
+
+EngineState * GrTableManager::State()
+{
+ return &m_engst;
+}
+
+GrEngine * EngineState::Engine()
+{
+ return m_ptman->Engine();
+}
+
+GrTableManager * EngineState::TableManager()
+{
+ return m_ptman;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Memory management for slots
+----------------------------------------------------------------------------------------------*/
+
+// standard for pass 0 slots
+void EngineState::NewSlot(
+ gid16 gID, GrFeatureValues fval, int ipass, int ichwSegOffset, int nUnicode,
+ GrSlotState ** ppslotRet)
+{
+ NextSlot(ppslotRet);
+ (*ppslotRet)->Initialize(gID, Engine(), fval, ipass, ichwSegOffset, nUnicode);
+}
+
+// line-break slots
+void EngineState::NewSlot(
+ gid16 gID, GrSlotState * pslotFeat, int ipass, int ichwSegOffset,
+ GrSlotState ** ppslotRet)
+{
+ NextSlot(ppslotRet);
+ (*ppslotRet)->Initialize(gID, Engine(), pslotFeat, ipass, ichwSegOffset);
+}
+
+// for inserting new slots after pass 0 (under-pos and unicode are irrelevant)
+void EngineState::NewSlot(
+ gid16 gID, GrSlotState * pslotFeat, int ipass,
+ GrSlotState ** ppslotRet)
+{
+ NextSlot(ppslotRet);
+ (*ppslotRet)->Initialize(gID, Engine(), pslotFeat, ipass);
+}
+
+// for making a new version of the slot initialized from the old
+void EngineState::NewSlotCopy(GrSlotState * pslotCopyFrom, int ipass,
+ GrSlotState ** ppslotRet)
+{
+ NextSlot(ppslotRet);
+ (*ppslotRet)->InitializeFrom(pslotCopyFrom, ipass);
+}
+
+void EngineState::NextSlot(GrSlotState ** ppslotRet)
+{
+ int cnExtraPerSlot = m_cUserDefn + (m_cCompPerLig * 2) + m_cFeat;
+ if (m_islotNext >= kSlotBlockSize)
+ {
+ // Allocate a new block of slots
+ GrSlotState * slotblkNew = new GrSlotState[kSlotBlockSize];
+ u_intslot * prgnSlotBuf = new u_intslot[kSlotBlockSize * cnExtraPerSlot];
+
+ m_vslotblk.push_back(slotblkNew);
+ m_vprgnSlotVarLenBufs.push_back(prgnSlotBuf);
+ m_islotblkCurr++;
+ m_islotNext = 0;
+ Assert((unsigned)m_islotblkCurr == m_vslotblk.size()-1);
+ }
+
+ *ppslotRet = m_vslotblk[m_islotblkCurr] + m_islotNext;
+ (*ppslotRet)->BasicInitialize(m_cUserDefn, m_cCompPerLig, m_cFeat,
+ (m_vprgnSlotVarLenBufs[m_islotblkCurr] + (m_islotNext * cnExtraPerSlot)));
+ m_islotNext++;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert the number of font design units into source device logical units.
+----------------------------------------------------------------------------------------------*/
+float GrTableManager::EmToLogUnits(int m)
+{
+ return m_engst.EmToLogUnits(m);
+}
+
+float EngineState::EmToLogUnits(int m)
+{
+ if (m == 0)
+ return 0;
+
+ float xysFontEmSquare;
+ m_pfont->getFontMetrics(NULL, NULL, &xysFontEmSquare);
+
+ // mEmUnits should be equal to the design units in the font's em square
+ int mEmUnits = Engine()->GetFontEmUnits();
+ if (mEmUnits <= 0)
+ {
+ Warn("Failed to obtain font em-units");
+ return (float)m;
+ }
+
+ return GrEngine::GrIFIMulDiv(m, xysFontEmSquare, mEmUnits);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert the source device coordinates to font design units.
+----------------------------------------------------------------------------------------------*/
+int GrTableManager::LogToEmUnits(float xys)
+{
+ return m_engst.LogToEmUnits(xys);
+}
+
+int EngineState::LogToEmUnits(float xys)
+{
+ if (xys == 0)
+ return 0;
+
+ float xysFontEmSquare;
+ m_pfont->getFontMetrics(NULL, NULL, &xysFontEmSquare);
+
+ // mEmUnits should be equal to the design units in the font's em square
+ int mEmUnits = Engine()->GetFontEmUnits();
+ if (mEmUnits < 0)
+ {
+ Warn("Failed to obtain font em-units");
+ return (int)xys;
+ }
+
+ return GrEngine::GrFIFMulDiv(xys, mEmUnits, xysFontEmSquare);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Find the coordinates for a given glyph point.
+ Return true on success, false otherwise.
+----------------------------------------------------------------------------------------------*/
+bool GrTableManager::GPointToXY(gid16 chwGlyphID, int nGPoint, float * pxs, float * pys)
+{
+ return m_engst.GPointToXY(chwGlyphID, nGPoint, pxs, pys);
+}
+
+bool EngineState::GPointToXY(gid16 chwGlyphID, int nGPoint, float * pxs, float * pys)
+{
+ *pxs = INT_MIN;
+ *pys = INT_MIN;
+ Point pointRet;
+ m_pfont->getGlyphPoint(chwGlyphID, nGPoint, pointRet);
+ *pxs = pointRet.x;
+ *pys = pointRet.y;
+
+ return true;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Call the justification routines.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::CallJustifier(IGrJustifier * pgjus, int ipassCurr,
+ float dxUnjustified, float dxJustified, bool fEndLine)
+{
+ // Indicates the stream the justification routines will read and modify:
+ m_engst.m_ipassJustCalled = ipassCurr;
+
+ int iGlyphMin = OutputStream(ipassCurr)->SegMin();
+ int iGlyphLim = OutputStream(ipassCurr)->SegLimIfKnown();
+ if (iGlyphLim == -1)
+ iGlyphLim = OutputStream(ipassCurr)->WritePos();
+
+ GrSlotStream * psstrm = OutputStream(ipassCurr);
+ if (m_pgreng->BasicJustification() && fEndLine)
+ UnstretchTrailingWs(psstrm, iGlyphLim);
+
+ pgjus->adjustGlyphWidths(m_pgreng, iGlyphMin, iGlyphLim, dxUnjustified, dxJustified);
+
+ // After returning, reading and modifying slot attributes is not permitted:
+ m_engst.m_ipassJustCalled = -1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ For the basic justification approach, remove stretch from the trailing whitespace.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::UnstretchTrailingWs(GrSlotStream * psstrm, int iGlyphLim)
+{
+ int islot = iGlyphLim - 1;
+ while (islot >= 0)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ if (pslot->IsLineBreak(LBGlyphID()))
+ { } // keep looking for the trailing space
+ else if (pslot->IsSpace(this))
+ pslot->SetJStretch(0); // TODO: do this at level 0
+ else
+ // something other than space--quit
+ return;
+ islot--;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Determine how much shrink is permissible.
+
+ This method is really used only for testing the shrink mechanism, since at this time
+ we don't allow low-end justification to do any shrinking.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::DetermineShrink(IGrJustifier * pgjus, int ipassCurr)
+{
+ if (m_engst.m_dxsShrinkPossible != GrSlotState::kNotYetSet)
+ return;
+
+ if (m_engst.m_jmodi != kjmodiCanShrink || pgjus == NULL)
+ {
+ m_engst.m_dxsShrinkPossible = 0;
+ return;
+ }
+
+ if (ipassCurr != m_ipassJust1 - 1)
+ return;
+
+ GrSlotStream * psstrm = OutputStream(ipassCurr);
+ if (!psstrm->FullyWritten())
+ return;
+
+ // Normally just answer 0. To test shrinking, turn on the code below.
+ m_engst.m_dxsShrinkPossible = 0;
+
+#if TEST_SHRINK
+ int mTotal = 0;
+ int mShrink = 0;
+ int islotLim = psstrm->SegLimIfKnown();
+ if (islotLim == -1)
+ islotLim = psstrm->WritePos();
+ for ( ; islotLim >= 0; islotLim--)
+ {
+ // Trailing white space is not shrinkable.
+ GrSlotState * pslot = psstrm->SlotAt(islotLim - 1);
+ if (pslot->IsLineBreak(LBGlyphID()))
+ continue;
+ if (!pslot->IsSpace(this))
+ break;
+ }
+ int islot;
+ for (islot = psstrm->SegMin(); islot < islotLim; islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ if (pslot->IsLineBreak(LBGlyphID()))
+ continue;
+ mTotal += pslot->AdvanceX(this);
+ mShrink += pslot->JShrink();
+ }
+
+ // Say that we are allowed to shrink up to 10% of the width of the segment.
+ mShrink = min(mShrink, mTotal/10);
+ m_engst.m_dxsShrinkPossible = EmToLogUnits(mShrink);
+#endif // TEST_SHRINK
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the attribute of the given slot, back to the justification routine. Return
+ logical units.
+----------------------------------------------------------------------------------------------*/
+GrResult EngineState::GetGlyphAttrForJustification(int iGlyph, int jgat, int nLevel,
+ float * pValueRet)
+{
+ GrResult res;
+ int valueRetInt = 0;
+ switch(jgat)
+ {
+ case kjgatWeight:
+ case kjgatStretchInSteps:
+ case kjgatBreak:
+ res = GetGlyphAttrForJustification(iGlyph, jgat, nLevel, &valueRetInt);
+ *pValueRet = (float)valueRetInt;
+ return res;
+ default:
+ break;
+ }
+
+ if (m_ipassJustCalled == -1)
+ return kresUnexpected;
+
+ if (nLevel != 1)
+ return kresInvalidArg;
+
+ GrSlotStream * psstrm = OutputStream(m_ipassJustCalled);
+
+ if (iGlyph < -1 || iGlyph >= psstrm->WritePos())
+ return kresInvalidArg;
+
+ GrSlotState * pslot = psstrm->SlotAt(iGlyph);
+
+ // bool fConvertUnits = true;
+
+ switch(jgat)
+ {
+ case kjgatStretch:
+ *pValueRet = EmToLogUnits(pslot->JStretch());
+ break;
+ case kjgatShrink:
+ *pValueRet = EmToLogUnits(pslot->JShrink());
+ break;
+ case kjgatStep:
+ *pValueRet = EmToLogUnits(pslot->JStep());
+ break;
+ default:
+ return kresNotImpl;
+ }
+ return kresOk;
+}
+
+GrResult EngineState::GetGlyphAttrForJustification(int iGlyph, int jgat, int nLevel,
+ int * pValueRet)
+{
+ GrResult res;
+ float valueRetFloat;
+ switch(jgat)
+ {
+ case kjgatStretch:
+ case kjgatShrink:
+ case kjgatStep:
+ res = GetGlyphAttrForJustification(iGlyph, jgat, nLevel, &valueRetFloat);
+ *pValueRet = GrEngine::RoundFloat(valueRetFloat);
+ return res;
+ default:
+ break;
+ }
+
+ if (m_ipassJustCalled == -1)
+ return kresUnexpected;
+
+ if (nLevel != 1)
+ return kresInvalidArg;
+
+ GrSlotStream * psstrm = OutputStream(m_ipassJustCalled);
+
+ if (iGlyph < -1 || iGlyph >= psstrm->WritePos())
+ return kresInvalidArg;
+
+ GrSlotState * pslot = psstrm->SlotAt(iGlyph);
+
+ int mStretch, mStep;
+ //float xsStretch, xsStep;
+
+ switch(jgat)
+ {
+ case kjgatWeight:
+ *pValueRet = pslot->JWeight();
+ break;
+ case kjgatStretchInSteps:
+ // ???? should this be calculated in terms of logical units??
+ // Probably doesn't matter, since the logical units are floating point, so the
+ // level of precision is about the same.
+ mStretch = pslot->JStretch();
+ mStep = pslot->JStep();
+ if (mStep == 0)
+ return kresUnexpected;
+ *pValueRet = int(mStretch / mStep); // round down
+ break;
+ //case kjgatStretchInSteps:
+ // xsStretch = EmToLogUnits(pslot->JStretch());
+ // xsStep = EmToLogUnits(pslot->JStep());
+ // if (xsStep == 0)
+ // return kresUnexpected;
+ // *pValueRet = int(xsStretch / xsStep); // round down
+ // break;
+ case kjgatBreak:
+ *pValueRet = pslot->BreakWeight();
+ break;
+ default:
+ return kresNotImpl;
+ }
+ return kresOk;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the attribute of the given slot, for the justification routine.
+----------------------------------------------------------------------------------------------*/
+GrResult EngineState::SetGlyphAttrForJustification(int iGlyph, int jgat, int nLevel,
+ float value)
+{
+ GrResult res;
+ int valueInt;
+ switch(jgat)
+ {
+ case kjgatWeight:
+ case kjgatStretchInSteps:
+ case kjgatBreak:
+ valueInt = (int)value;
+ res = SetGlyphAttrForJustification(iGlyph, jgat, nLevel, valueInt);
+ return res;
+ default:
+ break;
+ }
+
+ if (m_ipassJustCalled == -1)
+ return kresUnexpected;
+
+ if (nLevel != 1)
+ return kresInvalidArg;
+
+ GrSlotStream * psstrm = OutputStream(m_ipassJustCalled);
+
+ if (iGlyph < -1 || iGlyph >= psstrm->WritePos())
+ return kresInvalidArg;
+
+ GrSlotState * pslot = psstrm->SlotAt(iGlyph);
+
+ int mValue = LogToEmUnits(value);
+ mValue = min(mValue, 0xFFFF); // truncate to an unsigned short
+
+ // Review: do we really want to allow them to set stretch/shrink/step/weight? The normal
+ // thing for them to do is set width.
+ switch(jgat)
+ {
+ case kjgatStretch:
+ pslot->SetJStretch(mValue);
+ break;
+ case kjgatShrink:
+ pslot->SetJShrink(mValue);
+ break;
+ case kjgatStep:
+ pslot->SetJStep(mValue);
+ break;
+ case kjgatWidth:
+ pslot->SetJWidth(mValue);
+ break;
+ default:
+ return kresNotImpl;
+ }
+ return kresOk;
+}
+
+GrResult EngineState::SetGlyphAttrForJustification(int iGlyph, int jgat, int nLevel,
+ int value)
+{
+ GrResult res;
+ float valueFloat;
+ switch(jgat)
+ {
+ case kjgatStretch:
+ case kjgatShrink:
+ case kjgatStep:
+ case kjgatWidth:
+ valueFloat = (float)value;
+ res = SetGlyphAttrForJustification(iGlyph, jgat, nLevel, valueFloat);
+ return res;
+ default:
+ break;
+ }
+
+ if (m_ipassJustCalled == -1)
+ return kresUnexpected;
+
+ if (nLevel != 1)
+ return kresInvalidArg;
+
+ GrSlotStream * psstrm = OutputStream(m_ipassJustCalled);
+
+ if (iGlyph < -1 || iGlyph >= psstrm->WritePos())
+ return kresInvalidArg;
+
+ GrSlotState * pslot = psstrm->SlotAt(iGlyph);
+
+ int mValue, cSteps;
+ switch(jgat)
+ {
+ case kjgatWeight:
+ pslot->SetJWeight(value);
+ break;
+ case kjgatWidthInSteps:
+ cSteps = value;
+ mValue = pslot->JStep();
+ if (mValue == 0)
+ return kresUnexpected;
+ pslot->SetJWidth(mValue * cSteps);
+ break;
+ default:
+ return kresNotImpl;
+ }
+ return kresOk;
+}
+
+//:>--------------------------------------------------------------------------------------------
+//:> Functions to forward to the engine.
+//:>------------------------------------------------------------------------------------------*/
+gid16 GrTableManager::GetGlyphIDFromUnicode(int nUnicode)
+{
+ return m_pgreng->GetGlyphIDFromUnicode(nUnicode);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+gid16 GrTableManager::ActualGlyphForOutput(utf16 chw)
+{
+ return m_pgreng->ActualGlyphForOutput(chw);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+GrGlyphTable * GrTableManager::GlyphTable()
+{
+ return m_pgreng->GlyphTable();
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+gid16 GrTableManager::LBGlyphID()
+{
+ return m_pgreng->LBGlyphID();
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+gid16 GrTableManager::GetClassGlyphIDAt(int nClass, int nIndex)
+{
+ return m_pgreng->GetClassGlyphIDAt(nClass, nIndex);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+int GrTableManager::GetIndexInGlyphClass(int nClass, gid16 chwGlyphID)
+{
+ return m_pgreng->GetIndexInGlyphClass(nClass, chwGlyphID);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+size_t GrTableManager::NumberOfGlyphsInClass(int nClass)
+{
+ return m_pgreng->NumberOfGlyphsInClass(nClass);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+void GrTableManager::SetSlotAttrsFromGlyphAttrs(GrSlotState * pslot)
+{
+ m_pgreng->SetSlotAttrsFromGlyphAttrs(pslot);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+int GrTableManager::NumFeat()
+{
+ return m_pgreng->NumFeat();
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+int GrTableManager::DefaultForFeatureAt(int ifeat)
+{
+ return m_pgreng->DefaultForFeatureAt(ifeat);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+void GrTableManager::DefaultsForLanguage(isocode lgcode,
+ std::vector<featid> & vnFeats, std::vector<int> & vnValues)
+{
+ return m_pgreng->DefaultsForLanguage(lgcode, vnFeats, vnValues);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+GrFeature * GrTableManager::FeatureWithID(featid nID, int * pifeat)
+{
+ return m_pgreng->FeatureWithID(nID, pifeat);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+GrFeature * GrTableManager::Feature(int ifeat)
+{
+ return m_pgreng->Feature(ifeat);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+bool GrTableManager::RightToLeft()
+{
+ if (m_engst.WhiteSpaceOnly())
+ return m_engst.m_fParaRtl;
+ else
+ return m_pgreng->RightToLeft();
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+int GrTableManager::TopDirectionLevel()
+{
+ return m_pgreng->TopDirectionLevel();
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+float GrTableManager::VerticalOffset()
+{
+ return m_pgreng->VerticalOffset();
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+int GrTableManager::NumUserDefn()
+{
+ return m_pgreng->NumUserDefn();
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+int GrTableManager::NumCompPerLig()
+{
+ return m_pgreng->NumCompPerLig();
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+int GrTableManager::ComponentIndexForGlyph(gid16 chwGlyphID, int nCompID)
+{
+ return m_pgreng->ComponentIndexForGlyph(chwGlyphID, nCompID);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+int GrTableManager::GlyphAttrValue(gid16 chwGlyphID, int nAttrID)
+{
+ return m_pgreng->GlyphAttrValue(chwGlyphID, nAttrID);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+bool GrTableManager::LoggingTransduction()
+{
+ return m_fLogging;
+ //return m_pgreng->LoggingTransduction();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Calculate the positions of the glyphs up to the given slot, within the output of the given
+ pass. If the slot is NULL, go all the way to the end of what has been generated.
+
+ @param ipass - index of pass needing positioning; normally this will be the
+ final pass, but it could be another if positions are
+ requested by the rules themselves
+ @param pslotLast - last slot that needs to be positioned, or NULL
+ @param pxsWidth - return the total width used so far
+ @param psxVisibleWidth - return the visible width so far
+
+ MOVE to EngineState
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::CalcPositionsUpTo(int ipass, GrSlotState * pslotLast,
+ float * pxsWidth, float * pxsVisibleWidth)
+{
+ Assert(ipass >= m_ipassPos1 - 1);
+
+ int isstrm = ipass;
+ GrSlotStream * psstrm = OutputStream(isstrm);
+ Assert(psstrm->GotIndexOffset());
+ if (psstrm->WritePos() <= psstrm->IndexOffset())
+ {
+ Assert(psstrm->WritePos() == 0);
+ *pxsWidth = 0;
+ *pxsVisibleWidth = 0;
+ return;
+ }
+ if (!pslotLast)
+ {
+ pslotLast = psstrm->SlotAt(psstrm->WritePos() - 1);
+ }
+ Assert(pslotLast);
+
+ // First set positions of all base slots.
+
+ int islot = psstrm->IndexOffset();
+ GrSlotState * pslot;
+ float xs = 0;
+ float ys = VerticalOffset();
+ *pxsWidth = 0;
+ *pxsVisibleWidth = 0;
+
+ bool fLast = false;
+ bool fLastBase = false;
+
+ bool fFakeItalic = m_pgreng->FakeItalic();
+ float fakeItalicRatio = 0;
+ if (fFakeItalic)
+ fakeItalicRatio = State()->GetFont()->fakeItalicRatio();
+ bool fBasicJust = m_pgreng->BasicJustification();
+
+ // Figure out how to know when to stop.
+ // We need to calculate up to the base of the last leaf slot, if it happens
+ // to be later in the stream than the last actual slot passed in.
+ if (!psstrm->HasSlotAtPosPassIndex(pslotLast->AttachRootPosPassIndex()))
+ return;
+ GrSlotState * pslotLastBase = pslotLast->Base(psstrm);
+
+ if (ipass == m_cpass - 1 && m_engst.m_islotPosNext > -1)
+ {
+ // For final pass, initialize from cache of previous calculations.
+ islot = m_engst.m_islotPosNext;
+ xs = m_engst.m_xsPosXNext;
+ ys = m_engst.m_ysPosYNext;
+ *pxsWidth = m_engst.m_dxsTotWidthSoFar;
+ *pxsVisibleWidth = m_engst.m_dxsVisWidthSoFar;
+
+ if (psstrm->SlotsPresent() <= islot)
+ return;
+
+ if (pslotLastBase->PosPassIndex() == GrSlotAbstract::kNotYetSet)
+ {
+ Assert(false); // I think this case is handled above
+ return; // can't position this slot yet; its base has not been processed
+ }
+
+ if (pslotLastBase->PosPassIndex() + psstrm->IndexOffset() < islot)
+ {
+ fLastBase = true;
+ if (pslotLast == pslotLastBase)
+ fLast = true;
+ }
+ }
+
+ std::vector<GrSlotState *> vpslotAttached;
+
+ bool fRtl = RightToLeft();
+
+ while (!fLast || !fLastBase)
+ {
+ Assert(islot < psstrm->SlotsPresent());
+
+ pslot = (isstrm == ipass) ? psstrm->SlotAt(islot) : psstrm->OutputSlotAt(islot);
+
+ if (!pslot->IsBase())
+ {
+ // This slot is attached to another; it will be positioned strictly
+ // relative to that one. This happens in the loop below.
+ vpslotAttached.push_back(pslot);
+ }
+ else
+ {
+ // Base character.
+
+ bool fLB = pslot->IsLineBreak(LBGlyphID());
+ if (InternalJustificationMode() == kjmodiJustify && fBasicJust
+ && ipass == m_cpass - 1 && !fLB)
+ {
+ m_engst.AddJWidthToAdvance(psstrm, &pslot, islot, &pslotLast, &pslotLastBase);
+ }
+
+ // Make sure the metrics are the complete ones.
+ pslot->CalcCompositeMetrics(this, psstrm, kPosInfinity, true);
+
+ float xsInc = pslot->GlyphXOffset(psstrm, fakeItalicRatio);
+ float ysInc = pslot->GlyphYOffset(psstrm);
+ float xsAdvX = pslot->ClusterAdvWidth(psstrm);
+ float ysAdvY = (fLB) ?
+ 0 :
+ EmToLogUnits(pslot->AdvanceY(this));
+
+ if (fRtl)
+ {
+ xs -= xsAdvX;
+ ys -= ysAdvY;
+ pslot->SetXPos(xs + xsInc);
+ pslot->SetYPos(ys + ysInc);
+ }
+ else
+ {
+ pslot->SetXPos(xs + xsInc);
+ pslot->SetYPos(ys + ysInc);
+ xs += xsAdvX;
+ ys += ysAdvY;
+ }
+
+ *pxsWidth = max(*pxsWidth, fabsf(xs));
+ if (!IsWhiteSpace(pslot))
+ *pxsVisibleWidth = *pxsWidth;
+
+ if (isstrm == m_cpass - 1)
+ {
+ // For the final output pass, cache the results of the calculation so far.
+ // Only do this for slots that have actually been processed by the final
+ // pass, because others may have intermediate values that may be changed
+ // later.
+ m_engst.m_islotPosNext = pslot->PosPassIndex() + psstrm->IndexOffset() + 1;
+ m_engst.m_xsPosXNext = xs;
+ m_engst.m_ysPosYNext = ys;
+ m_engst.m_dxsTotWidthSoFar = *pxsWidth;
+ m_engst.m_dxsVisWidthSoFar = *pxsVisibleWidth;
+ }
+ }
+
+ // Need to have calculated both the last leaf and the last base (if they happen to
+ // be different); if so, we're done.
+ if (pslot == pslotLast)
+ fLast = true;
+ if (pslot == pslotLastBase)
+ fLastBase = true;
+
+ islot++;
+ }
+
+ Assert(fLast);
+ Assert(fLastBase);
+
+ // Now set positions of non-base slots, relative to their bases.
+
+ for (size_t ipslot = 0; ipslot < vpslotAttached.size(); ipslot++)
+ {
+ GrSlotState * pslot = vpslotAttached[ipslot];
+ GrSlotState * pslotBase = pslot->Base(psstrm);
+ if (pslotBase->XPosition() == kNegInfinity || pslotBase->YPosition() == kNegInfinity)
+ {
+ Assert(false);
+ continue;
+ }
+ float xsCluster = pslotBase->XPosition() - pslotBase->GlyphXOffset(psstrm, fakeItalicRatio);
+ float ysCluster = pslotBase->YPosition() - pslotBase->GlyphYOffset(psstrm);
+ float xsInc = pslot->GlyphXOffset(psstrm, fakeItalicRatio);
+ float ysInc = pslot->GlyphYOffset(psstrm);
+ pslot->SetXPos(xsCluster + xsInc);
+ pslot->SetYPos(ysCluster + ysInc);
+
+ // My theory is that we don't need to adjust *pxsWidth here, because the width of
+ // any non-base slots should be factored into the advance width of their cluster
+ // base, which was handled above.
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the given slot is white space.
+----------------------------------------------------------------------------------------------*/
+bool GrTableManager::IsWhiteSpace(GrSlotState * pslot)
+{
+ if (pslot->IsLineBreak(LBGlyphID()))
+ return true;
+ return pslot->IsSpace(this);
+}
+
+/*----------------------------------------------------------------------------------------------
+ When doing basic justification, apply the value of justify.width to the advance width.
+ This happens during the final positioning routine.
+----------------------------------------------------------------------------------------------*/
+void EngineState::AddJWidthToAdvance(GrSlotStream * psstrm, GrSlotState ** ppslot, int islot,
+ GrSlotState ** ppslotLast, GrSlotState ** ppslotLastBase)
+{
+ Assert(psstrm->OutputOfPass() == m_cpass - 1); // only used for final stream
+ if ((*ppslot)->JWidth() > 0)
+ {
+ if ((*ppslot)->PassModified() != m_cpass - 1)
+ {
+ // Replace the slot with a new slot, so it gets marked properly with the
+ // pass in which it was modified. (Otherwise the debug log gets screwed up.)
+ GrSlotState * pslotNew;
+ NewSlotCopy((*ppslot), m_cpass - 1, &pslotNew);
+ psstrm->PutSlotAt(pslotNew, islot);
+ if (*ppslot == *ppslotLast)
+ *ppslotLast = pslotNew;
+ if (*ppslot == *ppslotLastBase)
+ *ppslotLastBase = pslotNew;
+ *ppslot = pslotNew;
+ }
+ (*ppslot)->AddJWidthToAdvance(TableManager());
+ }
+}
+
+
+//:>********************************************************************************************
+//:> Debuggers and utilities
+//:>********************************************************************************************
+
+//:Ignore
+#if 0
+void GrTableManager::TempDebug()
+{
+ for (int ipass = 0; ipass < m_cpass; ++ipass)
+ {
+ int wpos = OutputStream(ipass)->WritePos();
+ int rpos = OutputStream(ipass)->ReadPos();
+ GrSlotState * wslot = OutputStream(ipass)->LastSlotWritten();
+ GrSlotState * rslot = OutputStream(ipass)->LastSlotRead();
+
+ }
+}
+#endif
+/*----------------------------------------------------------------------------------------------
+ Given a character index in the original string, locate the corresponding line-break slot
+ in the final surface stream. The character index must be one before which there is a
+ line-break (seg lim), or the beginning or the end of the string.
+ TODO SharonC: fix the bugs
+----------------------------------------------------------------------------------------------*/
+int GrTableManager::SurfaceLineBreakSlot(int ichw, GrCharStream * pchstrm, bool fInitial)
+{
+ if (ichw == 0)
+ {
+ Assert(fInitial);
+ return -1; // no initial line break
+ }
+ if (ichw == pchstrm->Lim())
+ {
+ Assert(!fInitial);
+ return -1; // no terminating line break
+ }
+
+ int islotIn = pchstrm->SegOffset(ichw);
+ Assert(islotIn >= 0);
+ islotIn += (fInitial? m_engst.m_cslotPreSeg - 1: m_engst.m_cslotPreSeg);
+
+ gid16 chwLBGlyphID = LBGlyphID();
+
+ // Now islotIn is the position in stream 0;
+
+ for (int ipass = 1; ipass < m_cpass; ++ipass)
+ {
+ int islotChunkMin;
+ int islotChunkLim;
+ GrSlotStream * psstrmOut = OutputStream(ipass);
+
+ GrSlotStream * psstrmIn = InputStream(ipass);
+ if (fInitial)
+ islotIn = max(islotIn, psstrmIn->PreChunk());
+ int islotT = psstrmIn->ChunkInNextMin(islotIn);
+ islotChunkMin = psstrmIn->ChunkInNext(islotT);
+ islotChunkMin = (islotChunkMin == -1)? 0: islotChunkMin;
+
+ islotT = psstrmIn->ChunkInNextLim(islotIn);
+ Assert(islotT <= psstrmIn->ReadPos());
+ if (islotT == psstrmIn->ReadPos())
+ islotChunkLim = psstrmOut->WritePos();
+ else
+ islotChunkLim = psstrmIn->ChunkInNext(islotT);
+
+ int islotOut;
+ for (islotOut = islotChunkMin; islotOut < islotChunkLim; ++islotOut)
+ {
+ gid16 chw = psstrmOut->GlyphIDAt(islotOut);
+ if (chw == chwLBGlyphID)
+ break;
+ }
+ Assert(psstrmOut->GlyphIDAt(islotOut) == chwLBGlyphID);
+
+ islotIn = islotOut;
+ }
+ return islotIn;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Generate a debugger string showing the chunk boundaries for the given stream.
+----------------------------------------------------------------------------------------------*/
+std::wstring GrTableManager::ChunkDebugString(int ipass)
+{
+ GrSlotStream * psstrm = OutputStream(ipass);
+ std::wstring stuRet;
+ //utf16 chwN = '\\';
+ //utf16 chwR = '^';
+
+ gid16 chwLBGlyphID = LBGlyphID();
+
+ for (int islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ if (psstrm->ChunkInPrev(islot) != -1)
+ {
+ if (psstrm->ChunkInNext(islot) != -1)
+ stuRet.append(L">");
+ else
+ stuRet.append(L"\\");
+ }
+ else if (psstrm->ChunkInNext(islot) != -1)
+ stuRet.append(L"/");
+ else
+ stuRet.append(L" ");
+
+// if (islot == psstrm->ReadPos())
+// stuRet.Append(&chwR, 1);
+
+ wchar_t chw = psstrm->SlotAt(islot)->GlyphID();
+ if (chw == chwLBGlyphID)
+ stuRet.append(L"#");
+ else
+ stuRet.append(&chw, 1);
+ }
+ return stuRet;
+}
+
+} // namespace gr
+
+//:End Ignore
diff --git a/Build/source/libs/graphite/src/segment/GrTableManager.h b/Build/source/libs/graphite/src/segment/GrTableManager.h
new file mode 100644
index 00000000000..e0306c832c7
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/GrTableManager.h
@@ -0,0 +1,583 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999 - 2008 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrTableManager.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ The GrTableManager class.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GR_TABLEMAN_INCLUDED
+#define GR_TABLEMAN_INCLUDED
+
+#include <cassert>
+//:End Ignore
+
+namespace gr
+{
+
+class Font;
+
+/*----------------------------------------------------------------------------------------------
+ There is a single instance of Engine State that keeps track of the state of the processing
+ for a single segment generation.
+
+ Hungarian: engst
+----------------------------------------------------------------------------------------------*/
+class EngineState
+{
+ friend class GrTableManager;
+ friend class FontMemoryUsage;
+
+public:
+ EngineState();
+ void Initialize(GrEngine *, GrTableManager *);
+
+ ~EngineState();
+ void DestroySlotBlocks();
+
+ void InitForNewSegment(GrTableManager * ptman);
+
+ void CreateEmpty();
+
+ GrEngine * Engine();
+ GrTableManager * TableManager();
+
+ void CreateSlotStreams();
+
+ GrSlotStream * InputStream(int ipass)
+ {
+ Assert(ipass > 0); // the char stream serves as input to the zeroth pass
+ return m_prgpsstrm[ipass - 1];
+ }
+
+ // Return the stream that serves as output to the given pass.
+ GrSlotStream * OutputStream(int ipass)
+ {
+ Assert(ipass < m_cpass);
+ return m_prgpsstrm[ipass];
+ }
+
+ GrSlotState * AnAdjacentSlot(int ipassArg, int islotArg);
+
+ GrResult GetGlyphAttrForJustification(int iGlyph, int jgat, int nLevel, float * pxysValueRet);
+ GrResult GetGlyphAttrForJustification(int iGlyph, int jgat, int nLevel, int * pxysValueRet);
+ GrResult SetGlyphAttrForJustification(int iGlyph, int jgat, int nLevel, float xysValue);
+ GrResult SetGlyphAttrForJustification(int iGlyph, int jgat, int nLevel, int xysValue);
+
+ enum { kSlotBlockSize = 50 }; // number of slots to allocate in a block
+
+ void InitPosCache()
+ {
+ m_islotPosNext = -1;
+ m_xsPosXNext = 0;
+ m_ysPosYNext = 0;
+ m_dxsTotWidthSoFar = 0;
+ m_dxsVisWidthSoFar = 0;
+ }
+
+ void SetFont(Font * pfont)
+ {
+ m_pfont = pfont;
+ }
+ Font * GetFont()
+ {
+ return m_pfont;
+ }
+
+ bool StartLineContext()
+ {
+ return m_fStartLineContext;
+ }
+ bool EndLineContext()
+ {
+ return m_fEndLineContext;
+ }
+ void SetStartLineContext(bool f)
+ {
+ m_fStartLineContext = f;
+ }
+ void SetEndLineContext(bool f)
+ {
+ m_fEndLineContext = f;
+ }
+
+ void SetInitialLB(bool f = true)
+ {
+ m_fInitialLB = f;
+ }
+
+ void SetFinalLB(bool f = true)
+ {
+ m_fFinalLB = f;
+ }
+
+ void SetInsertedLB(bool f = true)
+ {
+ m_fInsertedLB = f;
+ }
+
+ bool HasInitialLB()
+ {
+ return m_fInitialLB;
+ }
+ bool HasInsertedLB()
+ {
+ return m_fInsertedLB;
+ }
+ bool HasFinalLB()
+ {
+ return m_fFinalLB;
+ }
+
+ void SetExceededSpace(bool f = true)
+ {
+ m_fExceededSpace = f;
+ }
+
+ bool ExceededSpace()
+ {
+ return m_fExceededSpace;
+ }
+
+ void SetHitHardBreak(bool f = true)
+ {
+ m_fHitHardBreak = f;
+ }
+
+ bool HitHardBreak()
+ {
+ return m_fHitHardBreak;
+ }
+
+ void SetRemovedTrWhiteSpace(bool f = true)
+ {
+ m_fRemovedWhtsp = f;
+ }
+
+ bool RemovedTrWhiteSpace()
+ {
+ return m_fRemovedWhtsp;
+ }
+
+ bool WhiteSpaceOnly()
+ {
+ return (m_twsh == ktwshOnlyWs);
+ }
+
+ bool ParaRightToLeft()
+ {
+ return m_fParaRtl;
+ }
+
+ //int PrevPassMaxBackup(int ipass)
+ //{
+ // if (ipass == 0)
+ // return 0;
+ // return Pass(ipass - 1)->MaxBackup();
+ //}
+
+ DirCode InitialStrongDir()
+ {
+ return m_dircInitialStrongDir;
+ }
+ DirCode InitialTermDir()
+ {
+ return m_dircInitialTermDir;
+ }
+
+ void InitializeStreams(GrTableManager * ptman, GrCharStream * pchstrm,
+ int cbPrev, byte * pbPrevSegDat, bool fNeedFinalBreak, int * pislotFinalBreak);
+ int LbSlotToSegLim(int islot, GrCharStream * pchstrm, int cpassLB);
+ int TraceStreamZeroPos(int islotFinal, int nTopDir);
+
+ float EmToLogUnits(int m);
+ int LogToEmUnits(float xys);
+ bool GPointToXY(gid16 chwGlyphID, int nGPoint, float * xs, float * ys);
+
+ void AddJWidthToAdvance(GrSlotStream * psstrm, GrSlotState ** ppslot, int islot,
+ GrSlotState ** ppslotLast, GrSlotState ** ppslotLastBase);
+
+ // Memory management for slots:
+ void NewSlot(gid16 gID, GrFeatureValues fval, int ipass, int ichwSegOffset, int nUnicode,
+ GrSlotState **);
+ void NewSlot(gid16 gID, GrSlotState * pslotFeat, int ipass, int ichwSegOffset,
+ GrSlotState **);
+ void NewSlot(gid16 gID, GrSlotState * pslotFeat, int ipass, GrSlotState **);
+ void NewSlotCopy(GrSlotState * pslotCopyFrom, int ipass,
+ GrSlotState ** pslotRet);
+protected:
+ void NextSlot(GrSlotState ** ppslot);
+
+protected:
+ GrTableManager * m_ptman;
+
+ int m_cFeat;
+ int m_cCompPerLig;
+ int m_cUserDefn;
+
+ int m_jmodi; // justification mode
+ int m_ipassJustCalled; // pass after which justification routine was called;
+ // -1 if we are not in the midst of interacting with the
+ // GrJustifier
+
+ // Pointer to font
+ Font * m_pfont;
+
+ bool m_fStartLineContext; // true if there was a rule that ran over the initial LB
+ bool m_fEndLineContext; // true if there was a rule that ran over the final LB
+
+ // the number of slots inserted in the first stream before the official beginning
+ // of the segment, including any initial line break
+ int m_cslotPreSeg;
+
+ // List of allocated GrSlotStates; hungarian slotblk = prgslot
+ std::vector<GrSlotState *> m_vslotblk;
+ std::vector<u_intslot *> m_vprgnSlotVarLenBufs; // corresponding var-length blocks
+ int m_islotblkCurr;
+ int m_islotNext;
+
+ // Directionality codes from previous segment; these are used by the bidi algorithm
+ // at the initial line-break character.
+ DirCode m_dircInitialStrongDir;
+ DirCode m_dircInitialTermDir;
+
+ LineBrk m_lbPrevEnd;
+
+ // All of the following 3 are true only when there is an actual LB glyph in the stream
+ bool m_fInitialLB; // is there is an initial LB (an actual LB glyph--in all streams)
+ bool m_fFinalLB; // is there is a final LB (in all streams--true when we've hit
+ // the end of the input and end-of-line is true)
+ bool m_fInsertedLB; // is there is a final LB inserted in the output of LB pass
+ // (true when we've backtracked)
+
+ bool m_fExceededSpace; // true if we backtracked due to exceeding space; false if we
+ // haven't backtracked, or we did so for some other reason
+ // (eg, omitting trailing whitespace)
+
+ bool m_fHitHardBreak; // true if we encountered a hard-break in the input stream
+ // (before the natural end of the segment)
+
+ bool m_fRemovedWhtsp; // true if we've hit trailing whitespace characters that we've
+ // removed
+
+ TrWsHandling m_twsh; // white-space handling
+ bool m_fParaRtl; // paragraph direction
+
+ float m_dxsShrinkPossible;
+
+ // The final positioning pass is where we are going to do most of the positioning.
+ // Cache the intermediate results so we don't have to calculate from the beginning of
+ // the segment every time.
+ int m_islotPosNext; // where to continue calculating positions in final output stream
+ // (one past the last base that was calculated)
+ float m_xsPosXNext;
+ float m_ysPosYNext;
+ float m_dxsTotWidthSoFar;
+ float m_dxsVisWidthSoFar;
+
+ int m_cpass; // number of passes
+
+ // array of pass-state objects
+ PassState * m_prgzpst;
+
+ // array of slot streams which are output of passes (input of zeroth
+ // pass is the character stream, not a slot stream):
+ GrSlotStream ** m_prgpsstrm;
+ // For instance, a simple set of passes might look like this:
+ // CharStream
+ // GlyphGenPass pass 0
+ // SlotStream stream 0
+ // SubPass pass 1
+ // SlotStream stream 1
+ // PosPass pass 2
+ // SlotStream stream 2
+ //
+ // m_cpass = 3
+
+}; // end of class EngineState
+
+/*----------------------------------------------------------------------------------------------
+ There is a single instance of GrTableManager that handle the interactions between
+ passes, including the demand-pull mechanism.
+
+ Hungarian: tman
+----------------------------------------------------------------------------------------------*/
+
+class GrTableManager {
+ friend class FontMemoryUsage;
+
+public:
+ // Constructor & destructor:
+ GrTableManager(GrEngine * pgreng)
+ : m_cpass(0),
+ m_fBidi(false),
+ m_prgppass(NULL),
+ m_pgreng(pgreng)
+ {
+ Assert(pgreng);
+ }
+
+ ~GrTableManager();
+
+ bool CreateAndReadPasses(GrIStream & grstrm, int fxdSilfVersion, int fxdRuleVersion,
+ int cpassFont, long lSubTableStart, int * rgnPassOffsets,
+ int ipassSub1Font, int ipassPos1Font, int ipassJust1Font, byte ipassPostBidiFont);
+
+ void CreateEmpty();
+
+ GrEngine * Engine();
+ EngineState * State();
+
+ void Run(Segment * psegNew, Font * pfont, GrCharStream * pchstrm,
+ IGrJustifier * pgjus, int jmodi,
+ LayoutEnvironment & layout,
+ int ichStop, float dxWidth, float dxUnjustified,
+ bool fNeedFinalBreak, bool fMoreText, int ichFontLim,
+ bool fInfiniteWidth, bool fWidthIsCharCount,
+ int ichwCallerBtLim,
+ int nDirDepth, SegEnd estJ);
+
+ GrPass* Pass(int ipass)
+ {
+ Assert(ipass >= 0);
+ return m_prgppass[ipass];
+ }
+
+ int NumberOfPasses()
+ {
+ return m_cpass;
+ }
+
+ int NumberOfLbPasses()
+ {
+ return m_cpassLB;
+ }
+
+ bool HasBidiPass()
+ {
+ return m_fBidi;
+ }
+
+ int FirstPosPass()
+ {
+ return m_ipassPos1;
+ }
+
+ void StorePassStates(PassState * rgzpst);
+
+ // Return the stream that serves as input to the given pass.
+ GrSlotStream * InputStream(int ipass)
+ {
+ return m_engst.InputStream(ipass);
+ }
+ GrSlotStream * OutputStream(int ipass)
+ {
+ return m_engst.OutputStream(ipass);
+ }
+
+ void UnwindAndReinit(int islotNewBreak);
+
+public:
+ int InternalJustificationMode()
+ {
+ return m_engst.m_jmodi;
+ }
+
+ bool ShouldLogJustification()
+ {
+ return (m_engst.m_jmodi != kjmodiNormal);
+ }
+
+ int PrevPassMaxBackup(int ipass)
+ {
+ if (ipass == 0)
+ return 0;
+ return Pass(ipass - 1)->MaxBackup();
+ }
+
+ // Forward to the engine itself
+ gid16 GetGlyphIDFromUnicode(int nUnicode);
+ gid16 ActualGlyphForOutput(utf16 chwGlyphID);
+ GrGlyphTable * GlyphTable();
+
+ gid16 LBGlyphID();
+
+ gid16 GetClassGlyphIDAt(int nClass, int nIndex);
+ int GetIndexInGlyphClass(int nClass, gid16 chwGlyphID);
+ size_t NumberOfGlyphsInClass(int nClass);
+
+ void SetSlotAttrsFromGlyphAttrs(GrSlotState * pslot);
+
+ int NumFeat();
+ int DefaultForFeatureAt(int ifeat);
+ GrFeature * FeatureWithID(featid nID, int * pifeat);
+ GrFeature * Feature(int ifeat);
+ void DefaultsForLanguage(isocode lgcode,
+ std::vector<featid> & vnFeats, std::vector<int> & vnValues);
+
+ bool RightToLeft();
+ int TopDirectionLevel();
+
+ float VerticalOffset();
+
+ int NumUserDefn();
+ int NumCompPerLig();
+
+ int ComponentIndexForGlyph(gid16 chwGlyphID, int nCompID);
+ int GlyphAttrValue(gid16 chwGlyphID, int nAttrID);
+
+ // ---
+
+ bool LoggingTransduction();
+
+ float EmToLogUnits(int m);
+ int LogToEmUnits(float xys);
+ bool GPointToXY(gid16 chwGlyphID, int nGPoint, float * xs, float * ys);
+
+ void CalcPositionsUpTo(int ipass, GrSlotState * pslotLast,
+ float * pxsWidth, float * pxsVisibleWidth);
+
+ void InitPosCache()
+ {
+ m_engst.InitPosCache();
+ }
+
+ bool IsWhiteSpace(GrSlotState * pslot);
+
+ // For transduction logging:
+ bool WriteTransductionLog(std::ostream * pstrmLog,
+ GrCharStream * pchstrm, Segment * psegRet, int cbPrevSetDat, byte * pbPrevSegDat);
+ bool WriteAssociationLog(std::ostream * pstrmLog,
+ GrCharStream * pchstrm, Segment * psegRet);
+ bool WriteXmlLog(std::ostream * pstrmLog,
+ GrCharStream * pchstrm, Segment * psegRet, int cbPrevSegDat, byte * pbPrevSegDat);
+ bool WriteXmlAssocLog(std::ostream * pstrmLog,
+ GrCharStream * pchstrm, Segment * psegRet);
+
+#ifdef TRACING
+ void WriteXductnLog(std::ostream & strmOut, GrCharStream * pchstrm, Segment * psegRet,
+ int cbPrevSegDat, byte * pbPrevSegDat);
+ //bool LogFileName(std::string & staFile);
+ void LogUnderlying(std::ostream & strmOut, GrCharStream * pchstrm, int cchwBackup);
+ void LogPass1Input(std::ostream & strmOut);
+ void LogPassOutput(std::ostream & strmOut, int ipass, int cslotSkipped);
+ void LogAttributes(std::ostream & strmOut, int ipass, bool fJustWidths = false);
+ void LogFinalPositions(std::ostream & strmOut);
+ void LogUnderlyingHeader(std::ostream & strmOut, int ichwMin,
+ int ichwLim, int cchwBackup, int * prgichw16bit);
+ void LogSlotHeader(std::ostream & strmOut, int cslot,
+ int cspPerSlot, int cspLeading, int islotMin = 0);
+ void LogSlotGlyphs(std::ostream & strmOut, GrSlotStream * psstrm);
+ void SlotAttrsModified(int ipass, bool * rgfMods, bool fPreJust, int * pccomp, int *pcassoc);
+ void LogInTable(std::ostream & strmOut, int n);
+ void LogInTable(std::ostream & strmOut, float n);
+ void LogHexInTable(std::ostream & strmOut, gid16 chw, bool fPlus = false);
+ void LogDirCodeInTable(std::ostream & strmOut, int dirc);
+ void LogBreakWeightInTable(std::ostream & strmOut, int lb);
+
+ void WriteXmlLogAux(std::ostream & strmOut,
+ GrCharStream * pchstrm, Segment * psegRet, int cbPrevSegDat, byte * pbPrevSegDat);
+ void LogXmlUnderlying(std::ostream & strmOut, GrCharStream * pchstrm, int cchwBackup, size_t nIndent);
+ void LogXmlUnderlyingAux(std::ostream & strmOut, GrCharStream * pchstrm,
+ int cch32Backup, int cch32Lim, size_t nIndent,
+ bool fLogText, bool fLogFeatures, bool fLogColor, bool fLogStrOff, bool fLogLig, bool fLogGlyphs);
+ void LogXmlPass(std::ostream & strmOut, int ipass, int cslotSkipped, int nIndent);
+
+ void LogXmlTagOpen(std::ostream & strmOut, std::string strTag, size_t nIndent, bool fContent);
+ void LogXmlTagPostAttrs(std::ostream & strmOut, bool fContent);
+ void LogXmlTagClose(std::ostream & strmOut, std::string strTag, size_t nIndent, bool fContent);
+ void LogXmlTagAttr(std::ostream & strmOut, std::string strAttr, int nValue, size_t nIndent = 0);
+ void LogXmlTagAttr(std::ostream & strmOut, std::string strAttr, const char * szValue, size_t nIndent = 0);
+ void LogXmlTagAttrHex(std::ostream & strmOut, std::string strAttr, int nValue, size_t nIndent = 0);
+ std::string HexString(int n1, int n2, int n3, int n4, int n5, int n6);
+ std::string HexString(std::vector<int>);
+ void LogXmlTagColor(std::ostream & strmOut, std::string strAttr, int clrValue, bool fBack,
+ size_t nIndent = 0);
+ void LogXmlDirCode(std::ostream & strmOut, std::string strAttr, int dircValue, size_t nIndent = 0);
+ void LogXmlBreakWeight(std::ostream & strmOut, std::string strAttr, int dircValue,
+ size_t nIndent = 0);
+ void LogXmlComment(std::ostream & strmOut, std::string strComment, size_t nIndent = 0);
+
+#endif // TRACING
+
+protected:
+ void InitNewSegment(Segment * psegNew, Font * pfont, GrCharStream * pchstrm, IGrJustifier * pgjus,
+ int islotStream0Break, int islotSurfaceBreak, bool fStartLine, bool fEndLine, int ichFontLim,
+ LineBrk lbEnd, SegEnd est, int * dichSegLen);
+
+ void InitSegmentAsEmpty(Segment * psegNew, Font * pfont, GrCharStream * pchstrm,
+ bool fStartLine, bool fEndLine);
+
+ void InitSegmentToDelete(Segment * psegNew, Font * pfont, GrCharStream * pchstrm);
+
+ int ChunkInPrev(int ipass, int islot, GrCharStream * pchstrm);
+
+ bool Backtrack(int * islotPrevLB,
+ LineBrk * plbPref, LineBrk lbMax, TrWsHandling, bool fMoreText,
+ int ichwCallerBtLim, LineBrk * plbFound);
+
+ LineBrk IncLineBreak(LineBrk lb);
+
+ void InitializeForNextSeg(Segment* pseg,
+ int islotStream0Break, int islotSurfaceBreak, LineBrk lbEnd,
+ bool fNextSegNeedsContext, GrCharStream * pchstrm);
+
+ void SetFinalPositions(Segment * pseg, bool fWidthIsCharCount);
+ void RecordAssocsAndOutput(Font * pfont, Segment * pseg,
+ TrWsHandling twsh, bool fParaRtl, int nDirDepth);
+
+ void CalculateAssociations(Segment * pseg, int csloutSurface);
+ void AdjustAssocsForOverlaps(Segment * pseg);
+
+ void UnstretchTrailingWs(GrSlotStream * psstrm, int iGlyphLim);
+ void CallJustifier(IGrJustifier * pgjus, int ipassCurr, float dxUnjustified, float dxJustified,
+ bool fEndLine);
+
+ void DetermineShrink(IGrJustifier * pgjus, int ipass);
+
+protected:
+ // Instance variables:
+
+ int m_cpass; // number of passes; zero-th pass is Unicode character -> glyph ID mapping;
+ // Note thatwe always have one positioning pass to measure things even
+ // if there are no tables to run.
+
+ int m_cpassLB; // number of line-break passes
+ int m_ipassPos1; // first positioning pass
+ int m_ipassJust1; // first justification pass (== m_ipassPos1 if none)
+
+ bool m_fBidi; // is there a bidi pass?
+
+ // array of passes:
+ GrPass ** m_prgppass;
+
+ // Pointer back to Graphite engine, to give access to global constants and tables.
+ GrEngine * m_pgreng;
+
+ // State of processing.
+ EngineState m_engst;
+
+ bool m_fLogging;
+
+public:
+ // For test procedures:
+ void SetUpTest(std::wstring);
+
+protected:
+ void TempDebug();
+ int SurfaceLineBreakSlot(int ichw, GrCharStream * pchstrm, bool fInitial);
+ std::wstring ChunkDebugString(int ipass);
+}; // end of class GrTableManager
+
+} // namespace gr
+
+
+#endif // !GR_TABLEMAN_INCLUDED
diff --git a/Build/source/libs/graphite/src/segment/Main.h b/Build/source/libs/graphite/src/segment/Main.h
new file mode 100644
index 00000000000..da95af09ce8
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/Main.h
@@ -0,0 +1,181 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: Main.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Main.header file for the Graphite engine.
+----------------------------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GRAPHITE_H
+#define GRAPHITE_H 1
+
+//:End Ignore
+
+#define NO_EXCEPTIONS 1
+
+// It's okay to use functions that were declared deprecated by VS 2005:
+#ifdef _MSC_VER
+#define _CRT_SECURE_NO_DEPRECATE
+#pragma warning(disable: 4996) // warning: function was declared deprecated
+#pragma warning(disable: 4702) // unreachable code
+#endif
+
+#include "GrCommon.h"
+
+//:>********************************************************************************************
+//:> Interfaces.
+//:>********************************************************************************************
+#include "GrData.h"
+
+//:>********************************************************************************************
+//:> Implementations.
+//:>********************************************************************************************
+
+#ifndef _WIN32
+#include "GrMstypes.h"
+#ifndef HAVE_FABSF
+float fabsf(float x);
+#endif
+#endif
+#include "GrDebug.h"
+
+// For reading the font (FieldWorks's approach) and transduction logging:
+#include <fstream>
+#include <iostream>
+
+#include <vector>
+////#include <algorithm>
+#include <string>
+
+// gAssert should be used for any kind of assertions that can be caused by a corrupted font,
+// particularly those that won't be caught when loading the tables.
+#define gAssert(x) Assert(x)
+// When testing the error mechanism (because the process of bringing up the assertion dialog
+// interferes with FW repainting the invalid window:
+////#define gAssert(x) if (!(x)) Warn("corrupted font?")
+
+// Internal headers.
+#include "FileInput.h"
+
+// Public headers.
+#include "GrResult.h"
+//////#include "IGrGraphics.h"
+#include "ITextSource.h"
+#include "IGrJustifier.h"
+#include "IGrEngine.h"
+#include "GrConstants.h"
+#include "GrFeature.h"
+
+// External helper classes.
+#include "GrExt.h"
+
+
+// Forward declarations.
+namespace gr
+{
+ class GrTableManager;
+ class Segment;
+ class GrEngine;
+}
+
+// Define after GrExt.h to avoid conflict with FW Rect class.
+namespace gr
+{
+/*
+struct Point
+{
+ float x;
+ float y;
+
+ Point()
+ {
+ x = y = 0;
+ }
+
+ Point(POINT & p)
+ {
+ x = (float)p.x;
+ y = (float)p.y;
+ }
+};
+
+
+struct Rect
+{
+ float top;
+ float bottom;
+ float left;
+ float right;
+
+ Rect()
+ {
+ top = bottom = left = right = 0;
+ };
+
+ Rect(RECT & r)
+ {
+ top = (float)r.top;
+ bottom = (float)r.bottom;
+ left = (float)r.left;
+ right = (float)r.right;
+ };
+};
+*/
+}; // namespace gr
+
+#include "GrFeatureValues.h"
+#include "GrSlotState.h"
+
+#include "SegmentAux.h"
+
+// Internal headers
+#include "GrCharStream.h"
+#include "GrGlyphTable.h"
+#include "GrClassTable.h"
+#include "GrPseudoMap.h"
+#include "GrSlotStream.h"
+#include "GrFSM.h"
+#include "GrPass.h"
+#include "GrTableManager.h"
+#include "FontCache.h"
+
+
+// Public headers
+#include "Font.h"
+#include "GraphiteProcess.h"
+#include "GrEngine.h"
+#include "FontFace.h"
+#include "Segment.h"
+#include "SegmentPainter.h"
+
+//#ifdef _WIN32
+//#include <hash_map>
+//#include "WinFont.h"
+//#include "WinSegmentPainter.h"
+//#endif
+
+// Internal headers
+#include "TtfUtil.h"
+//#include "GrUtil.h"
+
+#include "GrWrappers.h"
+
+//#include "IGrDebug.h"
+//#include "GrSegmentDebug.h"
+//#include "GrEngineDebug.h"
+
+/////<<<<<<< .mine
+// clashes with non gr stuff
+// using namespace gr;
+///////>>>>>>> .r98
+
+#endif // GRAPHITE_H
+
diff --git a/Build/source/libs/graphite/src/segment/Makefile.am b/Build/source/libs/graphite/src/segment/Makefile.am
new file mode 100644
index 00000000000..59113aa924b
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/Makefile.am
@@ -0,0 +1,26 @@
+segmentdir = $(top_srcdir)/src/segment
+
+libgraphite_la_SOURCES += $(segmentdir)/FileInput.cpp
+libgraphite_la_SOURCES += $(segmentdir)/FontCache.cpp
+libgraphite_la_SOURCES += $(segmentdir)/FontFace.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrCharStream.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrClassTable.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrEngine.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrFeature.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrFSM.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrGlyphTable.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrPassActionCode.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrPass.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrSlotState.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrSlotStream.cpp
+libgraphite_la_SOURCES += $(segmentdir)/GrTableManager.cpp
+libgraphite_la_SOURCES += $(segmentdir)/MemoryUsage.cpp
+libgraphite_la_SOURCES += $(segmentdir)/Platform.cpp
+libgraphite_la_SOURCES += $(segmentdir)/SegmentAux.cpp
+libgraphite_la_SOURCES += $(segmentdir)/Segment.cpp
+libgraphite_la_SOURCES += $(segmentdir)/TestFSM.cpp
+libgraphite_la_SOURCES += $(segmentdir)/TestPasses.cpp
+libgraphite_la_SOURCES += $(segmentdir)/TransductionLog.cpp
+
+EXTRA_DIST += $(segmentdir)/*.h
+
diff --git a/Build/source/libs/graphite/src/segment/MemoryUsage.cpp b/Build/source/libs/graphite/src/segment/MemoryUsage.cpp
new file mode 100644
index 00000000000..1fb3fc25282
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/MemoryUsage.cpp
@@ -0,0 +1,781 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: MemoryUsage.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Calculates memory usage for the engine and segments.
+----------------------------------------------------------------------------------------------*/
+
+#pragma warning(disable: 4244) // conversion from wchar_t to char
+#pragma warning(disable: 4702) // unreachable code
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+
+#include "GrCommon.h"
+#include "GrData.h"
+#ifndef _WIN32
+#include "GrMstypes.h"
+#endif
+#include "GrDebug.h"
+//#include <fstream>
+#include <iostream>
+#include <cstring>
+//#include <string>
+// Forward declarations.
+
+#include "Main.h"
+
+//namespace gr
+//{
+// class GrTableManager;
+// class Segment;
+// class GrEngine;
+//}
+//
+//#include "GrTableManager.h"
+//#include "GrFeatureValues.h"
+//#include "GrSlotState.h"
+//#include "SegmentAux.h"
+//#include "Segment.h"
+#include "MemoryUsage.h"
+
+//#ifndef _MSC_VER
+//#include "config.h"
+//#endif
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+const int stringOverhead = (3 * sizeof(int)) + (sizeof(void *)) + (8 * sizeof(short));
+const int vectorOverhead = 3 * sizeof(void *);
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Font/engine
+//:>********************************************************************************************
+
+void FontMemoryUsage::initialize()
+{
+ font = 0;
+ fontCache = 0;
+ fontFace = 0;
+
+ eng_count = 0;
+ eng_overhead = 0;
+ eng_scalars = 0;
+ eng_strings = 0;
+ eng_pointers = 0;
+ eng_cmap = 0;
+ eng_nameTable = 0;
+
+ pseudoMap = 0;
+
+ clstbl_counters = 0;
+ clstbl_offsets = 0;
+ clstbl_glyphList = 0;
+
+ glftbl_general = 0;
+ glftbl_compDefns = 0;
+ glftbl_attrTable = 0;
+ glftbl_attrOffsets = 0;
+
+ lngtbl_general = 0;
+ lngtbl_entries = 0;
+ lngtbl_featureSets = 0;
+
+ tman_general = 0;
+
+ pass_count = 0;
+ pass_general = 0;
+ pass_fsm = 0;
+ pass_ruleExtras = 0;
+ pass_constraintOffsets = 0;
+ pass_constraintCode = 0;
+ pass_actionOffsets = 0;
+ pass_actionCode = 0;
+
+ engst_general = 0;
+ engst_passState = 0;
+
+ sstrm_count = 0;
+ sstrm_general = 0;
+ sstrm_chunkMapsUsed = 0;
+ sstrm_chunkMapsAlloc = 0;
+ sstrm_reprocBuf = 0;
+
+ slot_count = 0;
+ slot_general = 0;
+ slot_abstract = 0;
+ slot_varLenBuf = 0;
+ slot_assocsUsed = 0;
+ slot_assocsAlloc = 0;
+ slot_attachUsed = 0;
+ slot_attachAlloc = 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the total byte count.
+----------------------------------------------------------------------------------------------*/
+int FontMemoryUsage::total()
+{
+ int grandTotal = 0;
+ grandTotal += font + fontCache + fontFace;
+ grandTotal += eng_overhead + eng_scalars + eng_strings + eng_pointers + eng_cmap + eng_nameTable;
+ grandTotal += pseudoMap;
+ grandTotal += clstbl_counters + clstbl_offsets + clstbl_glyphList;
+ grandTotal += glftbl_general + glftbl_compDefns + glftbl_attrTable + glftbl_attrOffsets;
+ grandTotal += lngtbl_general + lngtbl_entries + lngtbl_featureSets;
+ grandTotal += tman_general;
+ grandTotal += pass_general + pass_fsm + pass_ruleExtras
+ + pass_constraintOffsets + pass_constraintCode + pass_actionOffsets + pass_actionCode;
+ grandTotal += engst_general + engst_passState;
+ grandTotal += sstrm_general + sstrm_chunkMapsAlloc + sstrm_reprocBuf;
+ grandTotal += slot_general + slot_abstract + slot_varLenBuf + slot_assocsAlloc + slot_attachAlloc;
+
+ return grandTotal;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Add the results of two runs together.
+----------------------------------------------------------------------------------------------*/
+void FontMemoryUsage::add(FontMemoryUsage & fmu)
+{
+ font += fmu.font;
+ fontCache += fmu.fontCache;
+ fontFace += fmu.fontFace;
+
+ eng_count += fmu.eng_count;
+ eng_overhead += fmu.eng_overhead;
+ eng_scalars += fmu.eng_scalars;
+ eng_strings += fmu.eng_strings;
+ eng_pointers += fmu.eng_pointers;
+ eng_cmap += fmu.eng_cmap;
+ eng_nameTable += fmu.eng_nameTable;
+
+ pseudoMap += fmu.pseudoMap;
+
+ clstbl_counters += fmu.clstbl_counters;
+ clstbl_offsets += fmu.clstbl_offsets;
+ clstbl_glyphList += fmu.clstbl_glyphList;
+
+ glftbl_general += fmu.glftbl_general;
+ glftbl_compDefns += fmu.glftbl_compDefns;
+ glftbl_attrTable += fmu.glftbl_attrTable;
+ glftbl_attrOffsets += fmu.glftbl_attrOffsets;
+
+ lngtbl_general += fmu.lngtbl_general;
+ lngtbl_entries += fmu.lngtbl_entries;
+ lngtbl_featureSets += fmu.lngtbl_featureSets;
+
+ tman_general += fmu.tman_general;
+
+ pass_count += fmu.pass_count;
+ pass_general += fmu.pass_general;
+ pass_fsm += fmu.pass_fsm;
+ pass_ruleExtras += fmu.pass_ruleExtras;
+ pass_constraintOffsets += fmu.pass_constraintOffsets;
+ pass_constraintCode += fmu.pass_constraintCode;
+ pass_actionOffsets += fmu.pass_actionOffsets;
+ pass_actionCode += fmu.pass_actionCode;
+
+ engst_general += fmu.engst_general;
+ engst_passState += fmu.engst_passState;
+
+ sstrm_count += fmu.sstrm_count;
+ sstrm_general += fmu.sstrm_general;
+ sstrm_chunkMapsUsed += fmu.sstrm_chunkMapsUsed;
+ sstrm_chunkMapsAlloc += fmu.sstrm_chunkMapsAlloc;
+ sstrm_reprocBuf += fmu.sstrm_reprocBuf;
+
+ slot_count += fmu.slot_count;
+ slot_general += fmu.slot_general;
+ slot_abstract += fmu.slot_abstract;
+ slot_varLenBuf += fmu.slot_varLenBuf;
+ slot_assocsUsed += fmu.slot_assocsUsed;
+ slot_assocsAlloc += fmu.slot_assocsAlloc;
+ slot_attachUsed += fmu.slot_attachUsed;
+ slot_attachAlloc += fmu.slot_attachAlloc;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Add up the memory used by all the engines in the cache.
+----------------------------------------------------------------------------------------------*/
+FontMemoryUsage Font::calculateMemoryUsage()
+{
+ FontMemoryUsage fmu;
+ FontFace::calculateAllMemoryUsage(fmu);
+ return fmu;
+}
+
+void FontFace::calculateAllMemoryUsage(FontMemoryUsage & fmu)
+{
+ s_pFontCache->calculateMemoryUsage(fmu);
+}
+
+void FontCache::calculateMemoryUsage(FontMemoryUsage & fmuTotal)
+{
+ fmuTotal.fontCache += sizeof(int) * 4; // m_cfci, m_cfciMax, m_cfface, m_flush
+ fmuTotal.fontCache += sizeof(void*); // m_prgfci;
+
+ // Iterate through all the font faces in the cache.
+ for (int ifci = 0; ifci < m_cfci; ifci++)
+ {
+ CacheItem * pfci = m_prgfci + ifci;
+ char rgchFontName[32];
+ memset(rgchFontName, 0, 32 * sizeof(char));
+ std::copy(pfci->szFaceName, pfci->szFaceName + 32, rgchFontName);
+ std::string strFontName(rgchFontName);
+ fmuTotal.vstrFontNames.push_back(strFontName);
+ int cface = 0;
+ if (pfci->pffaceRegular)
+ {
+ FontMemoryUsage fmu;
+ pfci->pffaceRegular->calculateMemoryUsage(fmu);
+ fmuTotal.add(fmu);
+ fmuTotal.vFontTotalsReg.push_back(fmu.total());
+ cface++;
+ }
+ else
+ fmuTotal.vFontTotalsReg.push_back(0);
+
+ if (pfci->pffaceBold)
+ {
+ FontMemoryUsage fmu;
+ pfci->pffaceBold->calculateMemoryUsage(fmu);
+ fmuTotal.add(fmu);
+ fmuTotal.vFontTotalsBold.push_back(fmu.total());
+ cface++;
+ }
+ else
+ fmuTotal.vFontTotalsBold.push_back(0);
+
+ if (pfci->pffaceItalic)
+ {
+ FontMemoryUsage fmu;
+ pfci->pffaceItalic->calculateMemoryUsage(fmu);
+ fmuTotal.add(fmu);
+ fmuTotal.vFontTotalsItalic.push_back(fmu.total());
+ cface++;
+ }
+ else
+ fmuTotal.vFontTotalsItalic.push_back(0);
+
+ if (pfci->pffaceBI)
+ {
+ FontMemoryUsage fmu;
+ pfci->pffaceBI->calculateMemoryUsage(fmu);
+ fmuTotal.add(fmu);
+ fmuTotal.vFontTotalsBI.push_back(fmu.total());
+ cface++;
+ }
+ else
+ fmuTotal.vFontTotalsBI.push_back(0);
+
+ fmuTotal.vFaceCount.push_back(cface);
+ }
+}
+
+void FontFace::calculateMemoryUsage(FontMemoryUsage & fmu)
+{
+ fmu.fontFace += sizeof(int); // m_cfonts
+ fmu.fontFace += sizeof(void *) * 2; // s_pFontCache, m_pgreng
+
+ fmu.font += m_cfonts * sizeof(void*); // m_pfface
+
+ fmu.addEngine(m_pgreng);
+}
+
+void FontMemoryUsage::addEngine(GrEngine * pgreng)
+{
+ eng_count++;
+
+ eng_overhead += sizeof(long); // m_cref
+ eng_scalars += sizeof(bool) * 6; // m_fBold, m_fItalic, m_fSmart...
+ eng_scalars += sizeof(bool) * 2; // m_fFakeItalicCache, m_fFakeBICache;
+ eng_strings += stringOverhead * 4; // m_strCtrlFileReg/Bold/Italic/BI
+ eng_strings += sizeof(wchar_t) * pgreng->m_strCtrlFileReg.length();
+ eng_strings += sizeof(wchar_t) * pgreng->m_strCtrlFileBold.length();
+ eng_strings += sizeof(wchar_t) * pgreng->m_strCtrlFileItalic.length();
+ eng_strings += sizeof(wchar_t) * pgreng->m_strCtrlFileBI.length();
+ eng_scalars += sizeof(bool);
+ eng_strings += stringOverhead * 6; // m_stuCtrlFile etc.
+ eng_strings += sizeof(wchar_t) * pgreng->m_stuCtrlFile.length();
+ eng_strings += sizeof(wchar_t) * pgreng->m_stuInitError.length();
+ eng_strings += sizeof(wchar_t) * pgreng->m_stuFaceName.length();
+ eng_strings += sizeof(wchar_t) * pgreng->m_stuFeatures.length();
+ eng_strings += sizeof(wchar_t) * pgreng->m_stuBaseFaceName.length();
+ eng_scalars += sizeof(bool); // m_fUseSepBase
+ eng_scalars += sizeof(GrResult) * 2; // m_resFontRead, m_resFontValid
+ eng_scalars += sizeof(FontErrorCode);
+ eng_scalars += sizeof(int) * 3; // m_fxdBadVersion, m_nFontCheckSum, m_nScriptTag, m_grfsdc
+ eng_scalars += sizeof(bool); // m_fRightToLeft
+ eng_scalars += sizeof(int) * 2; // m_mXAscent, m_mXDescent
+ eng_scalars += sizeof(float); // m_dysOffset
+ eng_scalars += sizeof(bool); // m_fBasicJust
+ eng_scalars += sizeof(int); // m_cJLevels
+ eng_pointers += sizeof(void*) * 4; // m_ptman, m_pctbl, m_pgtbl, m_pfface
+ eng_scalars += sizeof(GrFeature) * kMaxFeatures;
+ eng_scalars += sizeof(int); // m_cfeat
+ eng_scalars += sizeof(size_t); // m_clcidFeatLabelLangs
+ eng_scalars += sizeof(short) * pgreng->m_clcidFeatLabelLangs;
+ // m_langtbl
+ eng_scalars += sizeof(bool); // m_fLineBreak
+ eng_scalars += sizeof(int) * 2; // m_cchwPreXlbContext, m_cchwPostXlbContext
+ eng_scalars += sizeof(data16) * 7; // m_chwPseudoAttr, etc.
+ eng_scalars += sizeof(gid16); // m_chwLBGlyphID
+ eng_scalars += sizeof(int) * 4; // m_cComponents, m_cnUserDefn, m_cnCompPerLig, m_mFontEmUnits
+
+ pseudoMap += sizeof(int) * 3;
+ pseudoMap += sizeof(GrPseudoMap) * pgreng->m_cpsd;
+
+ eng_cmap += sizeof(void*) * 2;
+ eng_cmap += sizeof(byte*);
+ eng_cmap += sizeof(bool);
+ if (pgreng->m_fCmapTblCopy)
+ eng_cmap += pgreng->m_cbCmapTbl;
+
+ eng_nameTable += sizeof(byte *);
+ eng_nameTable += sizeof(bool);
+ if (pgreng->m_fNameTblCopy)
+ eng_nameTable += pgreng->m_cbNameTbl;
+
+ eng_scalars += sizeof(bool) * 2; // m_fLogXductn, m_fInErrorState
+
+ clstbl_counters += sizeof(int) * 2; // m_ccls, m_cclsLinear
+ clstbl_offsets += sizeof(data16) * (pgreng->m_pctbl->m_ccls + 1);
+ clstbl_glyphList += sizeof(data16) * (pgreng->m_pctbl->m_prgichwOffsets[pgreng->m_pctbl->m_ccls]);
+
+ glftbl_general += sizeof(int) * 3; // m_cglf, m_cComponents, m_cgstbl
+ glftbl_general += vectorOverhead; // m_vpgstbl
+ GrGlyphSubTable * pgstbl = pgreng->m_pgtbl->m_vpgstbl[0];
+ glftbl_general += sizeof(int) * 4; // m_fxdSilfVersion, m_nAttrIDLim, m_cComponents, m_cnCompPerLig
+ glftbl_general += sizeof(bool) * 2; // m_fHasDebugStrings, m_fGlocShort
+ glftbl_general += sizeof(data16) * 3; // m_chw...Attr
+ glftbl_compDefns += sizeof(int) * (pgstbl->m_cnCompPerLig + 1) * pgreng->m_pgtbl->m_cglf;
+ glftbl_attrTable += sizeof(int) * 2; // m_fxdSilfVersion, m_cbEntryBufLen
+ glftbl_attrTable += sizeof(byte) * pgstbl->m_pgatbl->m_cbEntryBufLen;
+ glftbl_attrOffsets +=
+ (pgreng->m_pgtbl->m_cglf + 1) * ((pgstbl->m_fGlocShort) ? sizeof(data16) : sizeof(data32));
+
+ lngtbl_general += sizeof(size_t); // m_clang
+ lngtbl_general += sizeof(data16) * 3; // m_dilangInit, m_cLoop, m_ilangStart
+ lngtbl_general += sizeof(void*) * 2; // m_prglang, m_prgfset
+ lngtbl_general += sizeof(int); // m_cbOffset0
+ lngtbl_entries += sizeof(GrLangTable::LangEntry) * pgreng->m_langtbl.m_clang;
+ lngtbl_featureSets += sizeof(GrLangTable::FeatSet) * pgreng->m_langtbl.m_cfset;
+
+ GrTableManager * ptman = pgreng->m_ptman;
+ tman_general += sizeof(int) * 4; // m_cpass, m_cpassLB, m_ipassPos1, m_ipassJust1
+ tman_general += sizeof(bool); // m_fBidi
+ tman_general += sizeof(void*) * 2; // m_prgppass, m_pgreng
+ tman_general += sizeof(void*) * ptman->m_cpass; // m_prgppass
+ tman_general += sizeof(bool); // m_fLogging
+
+ pass_count += ptman->m_cpass;
+ for (int ipass = 0; ipass < ptman->m_cpass; ipass++)
+ {
+ GrPass * ppass = ptman->m_prgppass[ipass];
+ pass_general = sizeof(GrPass);
+
+ GrFSM * pfsm = ppass->m_pfsm;
+ if (pfsm)
+ {
+ pass_fsm += sizeof(int) * 5; // m_crow, m_crowFinal, m_rowFinalMin, m_crowNonAcpt, m_ccol
+ pass_fsm += sizeof(void*) * 3; // m_prgirulnMin, m_prgrulnMatched, m_prgrowTransitions
+ int crowSuccess = pfsm->m_crow - pfsm->m_crowNonAcpt;
+ pass_fsm += sizeof(data16) * (crowSuccess + 1); // m_prgirulnMin
+ pass_fsm += sizeof(data16) * (pfsm->m_crulnMatched); // m_prgrulnMatched
+ pass_fsm += sizeof(short) * ((pfsm->m_crow - pfsm->m_crowFinal) * pfsm->m_ccol);
+ pass_fsm += sizeof(data16); // m_dimcrInit, m_cLoop, m_imcrStart
+ pass_fsm += sizeof(int); // m_cmcr
+ pass_fsm += sizeof(void*); // m_prgmcr
+ pass_fsm += sizeof(GrFSMClassRange) * pfsm->m_cmcr;
+ pass_fsm += sizeof(int) * 2; // m_critMinRulePreContext, m_critMaxRulePreContext
+ pass_fsm += sizeof(void*); // m_prgrowStartStates
+ pass_fsm += sizeof(short) * (pfsm->m_critMaxRulePreContext - pfsm->m_critMinRulePreContext + 1);
+ }
+
+ pass_ruleExtras = sizeof(data16) * ppass->m_crul; // m_prgchwRuleSortKeys
+ pass_ruleExtras = sizeof(byte*) * ppass->m_crul; // m_prgcritRulePreModContext
+
+ pass_constraintOffsets += sizeof(data16) * (ppass->m_crul + 1);
+ pass_actionOffsets =+ sizeof(data16) * (ppass->m_crul + 1);
+
+ pass_constraintCode += sizeof(byte) * ppass->m_cbConstraints;
+ pass_actionCode += sizeof(byte) * ppass->m_cbActions;
+
+ pass_general += sizeof(bool) * ppass->m_crul; // m_prgfRuleOkay
+ pass_general += vectorOverhead; // m_vnStack
+ pass_general += sizeof(int) * ppass->m_vnStack.capacity();
+ }
+
+ engst_general += sizeof(EngineState);
+ engst_general += sizeof(void *) * ptman->m_engst.m_vslotblk.capacity();
+ engst_general += sizeof(void *) * ptman->m_engst.m_vprgnSlotVarLenBufs.capacity();
+ engst_general += sizeof(void *) * ptman->m_engst.m_cpass; // m_prgpsstrm
+
+ engst_passState += sizeof(PassState) * ptman->m_engst.m_cpass;
+
+ for (int isstrm = 0; isstrm < ptman->m_engst.m_cpass; isstrm++)
+ {
+ sstrm_count++;
+ GrSlotStream * psstrm = ptman->m_engst.m_prgpsstrm[isstrm];
+ sstrm_general += sizeof(GrSlotStream);
+ sstrm_chunkMapsUsed += psstrm->m_vislotPrevChunkMap.size();
+ sstrm_chunkMapsUsed += psstrm->m_vislotPrevChunkMap.size();
+ sstrm_chunkMapsAlloc += psstrm->m_vislotPrevChunkMap.capacity();
+ sstrm_chunkMapsAlloc += psstrm->m_vislotNextChunkMap.capacity();
+ sstrm_reprocBuf += psstrm->m_vpslotReproc.capacity();
+ sstrm_reprocBuf += sizeof(int) * 2;
+ sstrm_general -= sizeof(int) * 2;
+ }
+
+ slot_general += ptman->m_engst.m_vslotblk.size() * EngineState::kSlotBlockSize
+ * (sizeof(GrSlotState) - sizeof(GrSlotAbstract));
+ slot_abstract += ptman->m_engst.m_vslotblk.size() * EngineState::kSlotBlockSize
+ * sizeof(GrSlotAbstract);
+ int cnExtraPerSlot = ptman->m_engst.m_cUserDefn + (ptman->m_engst.m_cCompPerLig * 2)
+ + ptman->m_engst.m_cFeat;
+ slot_varLenBuf += EngineState::kSlotBlockSize * cnExtraPerSlot * sizeof(u_intslot);
+ for (size_t islotblk = 0; islotblk < ptman->m_engst.m_vslotblk.size(); islotblk++)
+ {
+ for (int islot = 0; islot < EngineState::kSlotBlockSize; islot++)
+ {
+ slot_count++;
+ GrSlotState * pslot = ptman->m_engst.m_vslotblk[islotblk] + islot;
+ slot_assocsUsed += pslot->m_vpslotAssoc.size();
+ slot_assocsAlloc += pslot->m_vpslotAssoc.capacity();
+ slot_attachUsed += pslot->m_vdislotAttLeaves.size();
+ slot_attachAlloc += pslot->m_vdislotAttLeaves.capacity();
+ }
+ }
+
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out the memory usage onto a stream.
+----------------------------------------------------------------------------------------------*/
+void FontMemoryUsage::prettyPrint(std::ostream & strm)
+{
+ int totalBytes = total();
+
+ strm << "Number of engines: " << eng_count << "\n";
+ strm << "Number of passes: " << pass_count << "\n\n";
+
+ strm << "Number of slot streams: " << sstrm_count << "\n";
+ strm << "Number of slots: " << slot_count << "\n\n";
+
+ int classTableTotal = clstbl_counters + clstbl_offsets + clstbl_glyphList;
+ int glyphTableTotal = glftbl_general + glftbl_compDefns + glftbl_attrTable + glftbl_attrOffsets;
+ int langTableTotal = lngtbl_general + lngtbl_entries + lngtbl_featureSets;
+ int passTotal = pass_general + pass_fsm + pass_ruleExtras + pass_constraintOffsets + pass_constraintCode
+ + pass_actionOffsets + pass_actionCode;
+ int engineTotal = eng_overhead + eng_scalars + eng_strings + eng_pointers + eng_cmap + eng_nameTable
+ + pseudoMap + classTableTotal + glyphTableTotal + langTableTotal + tman_general
+ + passTotal;
+
+ strm << "BYTE COUNT TOTALS\n";
+ strm << "Font: " << font << "\n";
+ strm << "Font cache: " << fontCache << "\n";
+ strm << "Font face: " << fontFace << "\n";
+ strm << "Engine " << engineTotal << "\n";
+ strm << " Overhead: " << eng_overhead << "\n";
+ strm << " Scalars: " << eng_scalars << "\n";
+ strm << " Strings: " << eng_strings << "\n";
+ strm << " Pointers: " << eng_pointers << "\n";
+ strm << " Cmap table: " << eng_cmap << "\n";
+ strm << " Name table: " << eng_nameTable << "\n";
+ strm << " Pseudo map: " << pseudoMap << "\n";
+ strm << " Class table: " << classTableTotal << "\n";
+ strm << " Counters: " << clstbl_counters << "\n";
+ strm << " Offsets: " << clstbl_offsets << "\n";
+ strm << " Glyph list: " << clstbl_glyphList << "\n";
+ strm << " Glyph table: " << glyphTableTotal << "\n";
+ strm << " General: " << glftbl_general << "\n";
+ strm << " Component defns: " << glftbl_compDefns << "\n";
+ strm << " Attr table: " << glftbl_attrTable << "\n";
+ strm << " Attr offsets: " << glftbl_attrOffsets << "\n";
+ strm << " Language table: " << langTableTotal << "\n";
+ strm << " General: " << lngtbl_general << "\n";
+ strm << " Entries: " << lngtbl_entries << "\n";
+ strm << " Feature sets: " << lngtbl_featureSets << "\n";
+ strm << " Table manager: " << tman_general << "\n";
+ strm << " Passes: " << passTotal << "\n";
+ strm << " General: " << pass_general << "\n";
+ strm << " FSM: " << pass_fsm << "\n";
+ strm << " Rule extras: " << pass_ruleExtras << "\n";
+ strm << " Constraint offsets: " << pass_constraintOffsets << "\n\n";
+ strm << " Constraint code: " << pass_constraintCode << "\n";
+ strm << " Action offsets: " << pass_actionOffsets << "\n";
+ strm << " Action code: " << pass_actionCode << "\n\n";
+
+ int slotTotal = slot_general + slot_abstract + slot_varLenBuf + slot_assocsAlloc + slot_attachAlloc;
+ int streamTotal = sstrm_general + sstrm_chunkMapsAlloc + sstrm_reprocBuf + slotTotal;
+ int engineStateTotal = engst_general + engst_passState + streamTotal;
+
+ strm << " Engine State: " << engineStateTotal << "\n";
+ strm << " General: " << engst_general << "\n";
+ strm << " Pass states: " << engst_passState << "\n";
+ strm << " Slot streams: " << streamTotal << "\n";
+ strm << " General: " << sstrm_general << "\n";
+ strm << " Chunk maps: " << sstrm_chunkMapsAlloc << " (" << sstrm_chunkMapsUsed << " used)\n";
+ strm << " Reprocess buffer: " << sstrm_reprocBuf << "\n";
+ strm << " Slots: " << slotTotal << "\n";
+ strm << " General: " << slot_general << "\n";
+ strm << " Abstract: " << slot_abstract << "\n";
+ strm << " Var-length buf: " << slot_varLenBuf << "\n";
+ strm << " Associations: " << slot_assocsAlloc << " (" << slot_assocsUsed << " used)\n";
+ strm << " Attachments: " << slot_attachAlloc << " (" << slot_attachUsed << " used)\n\n";
+
+ strm << "Total bytes used: " << totalBytes << "\n\n";
+
+ strm << "TOTALS PER FONT\n";
+ for (size_t ifont = 0; ifont < vstrFontNames.size(); ifont++)
+ {
+ strm << vstrFontNames[ifont].c_str() << "\n";
+ strm << " Regular: " << vFontTotalsReg[ifont] << "\n";
+ strm << " Bold: " << vFontTotalsBold[ifont] << "\n";
+ strm << " Italic: " << vFontTotalsItalic[ifont] << "\n";
+ strm << " Bold-italic: " << vFontTotalsBI[ifont] << "\n\n";
+ }
+}
+
+
+//:>********************************************************************************************
+//:> Segment
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Initialize the data structure.
+----------------------------------------------------------------------------------------------*/
+void SegmentMemoryUsage::initialize()
+{
+ seg_count = 0;
+ overhead = 0;
+ pointers = 0;
+ scalars = 0;
+ strings = 0;
+ metrics = 0;
+ associations = 0;
+ init = 0;
+ obsolete = 0;
+
+ slot_count = 0;
+ slot_abstract = 0;
+ slot_varLenBuf = 0;
+ slot_scalars = 0;
+ slot_clusterMembers = 0;
+
+ glyphInfo_count = 0;
+ glyphInfo = 0;
+
+ wastedVector = 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Add the memory for the segemtn to the SegmentMemoryUsage data structure.
+----------------------------------------------------------------------------------------------*/
+void Segment::calculateMemoryUsage(SegmentMemoryUsage & smu)
+{
+ smu.addSegment(*this);
+}
+
+
+void SegmentMemoryUsage::addSegment(Segment & seg)
+{
+ seg_count++;
+
+ overhead += sizeof(long); // m_cref
+ pointers += sizeof(void*); // m_pgts
+ scalars += sizeof(int); // m_dichwLim
+ scalars += sizeof(int); // m_ichwMin
+ pointers += sizeof(void*); // m_pfont
+ pointers += sizeof(void*); // m_preneng
+ scalars += sizeof(bool); // m_fErroneous
+ pointers += sizeof(void*); // m_pgjus
+ scalars += sizeof(LayoutEnvironment);
+ scalars += sizeof(bool); // m_fWsRtl
+ scalars += sizeof(bool); // m_fParaRtl
+ scalars += sizeof(TrWsHandling);
+ scalars += sizeof(int); // m_nDirDepth
+ init += sizeof(byte*); // m_prgbNextSegDat
+ init += sizeof(int); // m_cbNextSegDat
+ init += sizeof(byte) * seg.m_cbNextSegDat;
+ init += sizeof(byte*); // m_prgInitDat
+ init += sizeof(int); // m_cbInitDat
+ init += sizeof(byte) * seg.m_cbInitDat;
+ init += sizeof(int); // m_dichPreContext
+// obsolete += sizeof(void *); // m_psegPrev
+// obsolete += sizeof(void *); // m_psegNext
+// strings += stringOverhead * 2;
+// strings += sizeof(wchar_t) * seg.m_stuFaceName.length();
+// strings += sizeof(wchar_t) * seg.m_stuBaseFaceName.length();
+// scalars += sizeof(bool); // m_fUseSepBase;
+// scalars += sizeof(float); // m_pixHeight
+// scalars += sizeof(bool); // m_fBold
+// scalars += sizeof(bool); // m_fItalic
+ scalars += sizeof(LineBrk); // m_lbStart
+ scalars += sizeof(LineBrk); // m_lbEnd
+ scalars += sizeof(bool); // m_fStartLine
+ scalars += sizeof(bool); // m_fEndLine
+ scalars += sizeof(SegEnd); // m_est
+ metrics += sizeof(int); // m_mFontEmUnits
+ metrics += sizeof(float) * 17; // was 19, removed m_x/ysDPI
+ associations += sizeof(int); // m_ichwAssocsMin
+ associations += sizeof(int); // m_ichwAssocsLim
+ int dichw = seg.m_ichwAssocsLim - seg.m_ichwAssocsMin;
+ associations += sizeof(int*); // m_prgisloutBefore
+ associations += sizeof(int) * dichw;
+ associations += sizeof(int*); // m_prgisloutAfter
+ associations += sizeof(int) * dichw;
+ associations += sizeof(void*); // m_prgpvisloutAssocs
+ associations += sizeof(void*) * dichw;
+ for (int idichw = 0; idichw < dichw; idichw++)
+ {
+ std::vector<int> * pvisloutAssocs = seg.m_prgpvisloutAssocs[idichw];
+ if (pvisloutAssocs)
+ {
+ associations += vectorOverhead;
+ associations += sizeof(int) * pvisloutAssocs->capacity();
+ wastedVector += sizeof(int) * (pvisloutAssocs->capacity() - pvisloutAssocs->size());
+ }
+ }
+ associations += sizeof(int*); // m_prgisloutLigature
+ associations += sizeof(int) * dichw;
+ associations += sizeof(sdata8*); // m_prgiComponent
+ associations += sizeof(sdata8) * dichw;
+// obsolete += sizeof(void*); // m_psstrm
+ scalars += sizeof(int); // m_cslout
+ slot_count += seg.m_cslout;
+ for (int islout = 0; islout < seg.m_cslout; islout++)
+ {
+ GrSlotOutput * pslout = seg.m_prgslout + islout;
+ slot_abstract += sizeof(gid16) * 2; // m_chwGlyphID, m_chwActual
+ slot_abstract += sizeof(sdata8) * 4; // m_spsl, m_dirc, m_lb, m_nDirLevel
+// slot_abstract += sizeof(float) * 8; // font/glyph metrics
+ slot_abstract += sizeof(short) * 5; // slot attributes - was 21
+ slot_abstract += sizeof(int); // m_mJWidth0;
+ slot_abstract += sizeof(byte); // m_nJWeight0;
+ slot_abstract += sizeof(bool); // m_fInsertBefore
+ slot_abstract += sizeof(sdata8); // m_bIsSpace
+ slot_abstract += sizeof(byte); // m_cnCompPerLig
+ slot_abstract += sizeof(void*); // m_prgnVarLenBuf
+ slot_varLenBuf += pslout->CExtraSpaceSlout() * sizeof(u_intslot);
+ slot_abstract += sizeof(float); // m_xsPositionX, m_ysPositionY
+// slot_abstract += sizeof(bool); // m_fAdvXSet, m_fAdvYSet
+ slot_scalars += sizeof(int) * 2; // m_ichwBefore/AfterAssoc
+ slot_scalars += sizeof(sdata8); // m_cComponents
+ slot_scalars += sizeof(int); // m_isloutClusterBase
+ slot_scalars += sizeof(sdata8); // m_disloutCluster
+ slot_scalars += sizeof(float) * 3; // m_xsClusterXOffset, m_xsClusterAdvance, m_xsAdvanceX
+ slot_scalars += sizeof(int); // m_igbb
+// slot_scalars += sizeof(Rect); // m_rectBB
+ }
+ scalars += sizeof(int); // m_cnUserDefn
+ scalars += sizeof(int); // m_cnCompPerLig
+ scalars += sizeof(int); // m_cnFeat
+ glyphInfo_count += seg.m_cginf;
+ scalars += sizeof(int); // m_cginf;
+ scalars += sizeof(int); // m_isloutGinf0
+ for (int iginf = 0; iginf < seg.m_cginf; iginf++)
+ {
+ ///GlyphInfo * pginf = seg.m_prgginf + iginf;
+ glyphInfo += sizeof(void *); // m_pseg
+ glyphInfo += sizeof(void *); // m_pslout
+ glyphInfo += sizeof(int); // m_islout
+ }
+ init += sizeof(int); // m_cslotRestartBackup
+ init += vectorOverhead;
+ init += sizeof(sdata8) * seg.m_vnSkipOffsets.capacity();
+ wastedVector += sizeof(sdata8) * (seg.m_vnSkipOffsets.capacity() - seg.m_vnSkipOffsets.size());
+ init += sizeof(DirCode); // m_dircPrevStrong
+ init += sizeof(DirCode); // m_dircPrevTerm
+
+ //int grandTotal;
+ //grandTotal = overhead + pointers + scalars + strings + metrics + associations
+ // + init + obsolete + slot_count + slot_abstract + slot_varLenBuf + slot_scalars
+ // + slot_clusterMembers + glyphInfo_count + glyphInfo;
+
+ //int totalPerSeg = grandTotal / seg_count;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out the memory usage onto a stream.
+----------------------------------------------------------------------------------------------*/
+void SegmentMemoryUsage::prettyPrint(std::ostream & strm)
+{
+ int totalBytes = overhead + pointers + scalars + strings + metrics + associations
+ + init + obsolete + slot_count + slot_abstract + slot_varLenBuf + slot_scalars
+ + slot_clusterMembers + glyphInfo_count + glyphInfo;
+
+ int slotTotal = slot_abstract + slot_varLenBuf + slot_scalars + slot_clusterMembers;
+
+ strm << "Number of segments: " << seg_count << "\n\n";
+
+ strm << "TOTALS\n";
+ strm << "Overhead: " << overhead << "\n";
+ strm << "Pointers: " << pointers << "\n";
+ strm << "Scalars: " << scalars << "\n";
+ strm << "Strings: " << strings << "\n";
+ strm << "Metrics: " << metrics << "\n";
+ strm << "Associations: " << associations << "\n";
+ strm << "Obsolete: " << obsolete << "\n";
+ strm << "Slot data: " << slotTotal << "\n";
+ strm << " Abstract: " << slot_abstract << "\n";
+ strm << " Var-length buffer: " << slot_varLenBuf << "\n";
+ strm << " Scalars: " << slot_scalars << "\n";
+ strm << " Cluster members: " << slot_clusterMembers << "\n";
+ strm << "Glyph info: " << glyphInfo << "\n\n";
+
+ strm << "Wasted in vectors: " << wastedVector << "\n\n";
+
+ strm << "Total bytes used: " << totalBytes << "\n\n";
+
+ if (seg_count > 0)
+ {
+ strm << "AVERAGES\n";
+ strm << "Overhead: " << overhead/seg_count << "\n";
+ strm << "Pointers: " << pointers/seg_count << "\n";
+ strm << "Scalars: " << scalars/seg_count << "\n";
+ strm << "Strings: " << strings/seg_count << "\n";
+ strm << "Metrics: " << metrics/seg_count << "\n";
+ strm << "Associations: " << associations/seg_count << "\n";
+ strm << "Obsolete: " << obsolete/seg_count << "\n";
+ strm << "Slot data: " << slotTotal/seg_count << "\n";
+ strm << " Abstract: " << slot_abstract/seg_count << "\n";
+ strm << " Var-length buffer: " << slot_varLenBuf/seg_count << "\n";
+ strm << " Scalars: " << slot_scalars/seg_count << "\n";
+ strm << " Cluster members: " << slot_clusterMembers/seg_count << "\n";
+ strm << "Glyph info: " << glyphInfo/seg_count << "\n\n";
+
+ strm << "Avg. bytes per segment: " << totalBytes / seg_count << "\n\n";
+
+ strm << "Avg. # of slots per segment: " << slot_count / seg_count << "\n\n";
+ }
+}
+
+} //namespace gr
+
diff --git a/Build/source/libs/graphite/src/segment/Platform.cpp b/Build/source/libs/graphite/src/segment/Platform.cpp
new file mode 100644
index 00000000000..30ec3f4bf1f
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/Platform.cpp
@@ -0,0 +1,113 @@
+#include "GrPlatform.h"
+
+#ifdef _WIN32
+#include "windows.h"
+
+namespace gr
+{
+
+size_t Platform_UnicodeToANSI(const utf16 * prgchwSrc, size_t cchwSrc, char * prgchsDst, size_t cchsDst)
+{
+ return ::WideCharToMultiByte(CP_ACP, 0, (LPCWSTR)prgchwSrc, cchwSrc, prgchsDst, cchsDst, NULL, NULL);
+}
+
+size_t Platform_AnsiToUnicode(const char * prgchsSrc, size_t cchsSrc, utf16 * prgchwDst, size_t cchwDst)
+{
+ return ::MultiByteToWideChar(CP_ACP, 0, prgchsSrc, cchsSrc, (LPWSTR)prgchwDst, cchwDst);
+}
+
+size_t Platform_8bitToUnicode(int nCodePage, const char * prgchsSrc, int cchsSrc,
+ utf16 * prgchwDst, int cchwDst)
+{
+ return ::MultiByteToWideChar(nCodePage, 0, prgchsSrc, cchsSrc, (LPWSTR)prgchwDst, cchwDst);
+}
+
+size_t utf8len(const char *s)
+{
+ return mbstowcs(NULL,s,0);
+}
+
+utf16 *utf16cpy(utf16 *dest, const utf16 *src)
+{
+ return (utf16*)wcscpy((wchar_t*)dest, (const wchar_t*)src);
+}
+
+utf16 *utf16ncpy(utf16 *dest, const utf16 *src, size_t n)
+{
+ return (utf16*)wcsncpy((wchar_t*)dest, (const wchar_t*)src, n);
+}
+
+utf16 *utf16ncpy(utf16 *dest, const char *src, size_t n)
+{
+ #ifdef UTF16DEBUG
+ std::cerr << "utf16ncpy8: " << src << std::endl;
+ #endif
+ Platform_AnsiToUnicode(src, strlen(src), dest, n);
+ return dest;
+}
+
+
+size_t utf16len(const utf16 *s)
+{
+ return wcslen((const wchar_t*)s);
+}
+
+int utf16cmp(const utf16 *s1, const utf16 *s2)
+{
+return wcscmp((const wchar_t*)s1, (const wchar_t*)s2);
+}
+
+int utf16ncmp(const utf16 *s1, const utf16 *s2, size_t n)
+{
+ return wcsncmp((const wchar_t*)s1, (const wchar_t*)s2, n);
+}
+
+int utf16cmp(const utf16 *s1, const char *s2)
+{
+ while (*s1 && s2)
+ {
+ if (*s1 < *s2)
+ {
+ return -1;
+ }
+ if (*s1 > *s2)
+ {
+ return 1;
+ }
+ *s1++;
+ *s2++;
+ }
+ if (*s1) return -1;
+ else if (*s2) return 1;
+ return 0;
+}
+
+}
+#else // not _WIN32
+
+#include <iostream>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef HAVE_FABSF
+float fabsf(float x)
+{
+ return (x < 0.0f) ? -x : x;
+}
+#endif
+
+namespace gr
+{
+
+size_t utf16len(const utf16 *s)
+{
+ // assumes NULL terminated strings
+ const utf16 *start = s;
+ for (; *s; ++s);
+
+ return s - start;
+}
+
+} // namespace gr
+#endif // _WIN32
+
diff --git a/Build/source/libs/graphite/src/segment/Segment.cpp b/Build/source/libs/graphite/src/segment/Segment.cpp
new file mode 100644
index 00000000000..b936b037a64
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/Segment.cpp
@@ -0,0 +1,3547 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: Segment.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Implements a Graphite segment--a range of rendered text in one writing system, that can be
+ rendered with a single font, and that fits on a single line.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+// any other headers (not precompiled)
+#include <math.h>
+#ifndef _WIN32
+#include <stdlib.h>
+#endif
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+#if 0 // TODO remove
+namespace
+{
+
+static bool g_fDrawing;
+
+} // namespace
+#endif
+
+
+static int g_csegTotal = 0;
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Segment methods
+//:>********************************************************************************************
+
+
+int Segment::GetSegmentCount() /// TEMP
+{
+ return g_csegTotal;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Constructor: basic initialization.
+----------------------------------------------------------------------------------------------*/
+Segment::Segment() :
+ m_pgts(NULL),
+ m_pfont(NULL),
+ m_preneng(NULL),
+ m_fErroneous(false),
+ m_pgjus(NULL),
+ m_prgbNextSegDat(NULL),
+ m_cbNextSegDat(0),
+ m_prgInitDat(NULL),
+ m_cbInitDat(0),
+// m_fUseSepBase(0),
+ //m_psegAltEndLine(NULL),
+ m_prgisloutBefore(NULL),
+ m_prgisloutAfter(NULL),
+ m_prgpvisloutAssocs(NULL),
+ m_prgisloutLigature(NULL),
+ m_prgiComponent(NULL),
+// m_psstrm(NULL),
+ m_cslout(0),
+ m_prgslout(NULL),
+ m_prgnSlotVarLenBuf(NULL),
+// m_cnUserDefn(0),
+ m_cnCompPerLig(0),
+// m_cnFeat(0),
+ m_cginf(0),
+ m_prgginf(NULL)
+{
+ m_cref = 1;
+
+ g_csegTotal++;
+
+// m_stuFaceName.erase();
+// m_stuBaseFaceName.erase();
+ m_vnSkipOffsets.clear();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Reference counting.
+----------------------------------------------------------------------------------------------*/
+
+long Segment::IncRefCount(void)
+{
+ AssertPtr(this);
+ return InterlockedIncrement(&m_cref);
+}
+
+long Segment::DecRefCount(void)
+{
+ AssertPtr(this);
+ long cref = InterlockedDecrement(&m_cref);
+ if (cref == 0) {
+ m_cref = 1;
+ delete this;
+ }
+ return cref;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Constructor to fit as much of the text on the line as possible,
+ finding a reasonable break point if necessary.
+----------------------------------------------------------------------------------------------*/
+LineFillSegment::LineFillSegment(
+ Font * pfont,
+ ITextSource * pts,
+ LayoutEnvironment * playoutArg,
+ toffset ichStart,
+ toffset ichStop,
+ float xsMaxWidth,
+ bool fBacktracking)
+ : Segment()
+{
+ if (!pfont)
+ throw;
+ if (!pts)
+ throw;
+
+ LayoutEnvironment layoutDefault;
+ LayoutEnvironment * playout = (!playoutArg) ? &layoutDefault : playoutArg;
+
+ pfont->RenderLineFillSegment(this, pts, *playout, ichStart, ichStop, xsMaxWidth,
+ fBacktracking);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Constructor to create a segment representing the given range of characters.
+----------------------------------------------------------------------------------------------*/
+RangeSegment::RangeSegment(
+ Font * pfont,
+ ITextSource * pts,
+ LayoutEnvironment * playoutArg,
+ toffset ichStart,
+ toffset ichStop,
+ Segment * psegInitLike)
+ : Segment()
+{
+ if (!pfont)
+ throw;
+ if (!pts)
+ throw;
+
+ LayoutEnvironment layoutDefault;
+ LayoutEnvironment * playout = (!playoutArg) ? &layoutDefault : playoutArg;
+ playout->setSegmentForInit(psegInitLike);
+
+ pfont->RenderRangeSegment(this, pts, *playout, ichStart, ichStop);
+
+ playout->setSegmentForInit(NULL);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Constructor to create a justified segment. Private.
+----------------------------------------------------------------------------------------------*/
+JustSegmentAux::JustSegmentAux(
+ Font * pfont,
+ ITextSource * pts,
+ LayoutEnvironment * playoutArg,
+ toffset ichStart,
+ toffset ichStop,
+ float xsNaturalWidth,
+ float xsJustifiedWidth,
+ Segment * psegInitLike)
+ : Segment()
+{
+ if (!pfont)
+ throw;
+ if (!pts)
+ throw;
+
+ LayoutEnvironment layoutDefault;
+ LayoutEnvironment * playout = (!playoutArg) ? &layoutDefault : playoutArg;
+ playout->setSegmentForInit(psegInitLike);
+
+ pfont->RenderJustifiedSegment(this, pts, *playout, ichStart, ichStop,
+ xsNaturalWidth, xsJustifiedWidth);
+
+ playout->setSegmentForInit(NULL);
+}
+
+//Segment::Segment(ITextSource * pgts, int ichwMin, int ichwLim,
+// LineBrk lbStart, LineBrk lbEnd,
+// bool fStartLine, bool fEndLine, bool fWsRtl)
+//{
+// m_cref = 1;
+// Initialize(pgts, ichwMin, ichwLim, lbStart, lbEnd, fStartLine, fEndLine, fWsRtl);
+//}
+
+void Segment::Initialize(ITextSource * pgts, int ichwMin, int ichwLim,
+ LineBrk lbStart, LineBrk lbEnd, SegEnd est,
+ bool fStartLine, bool fEndLine, bool fWsRtl)
+{
+ AssertPtrN(pgts);
+ Assert(ichwMin >= 0);
+ Assert(ichwLim >= 0);
+ Assert(ichwMin <= ichwLim);
+
+ //pgts->TextSrcObject(&m_pgts); // create a permanent wrapper, if necessary
+ // m_pgts->AddRef(); no, smart pointer
+ m_pgts = pgts;
+
+ m_ichwMin = ichwMin;
+ m_dichwLim = ichwLim - ichwMin;
+ m_lbStart = lbStart;
+ m_lbEnd = lbEnd;
+ m_est = est;
+ m_dxsStretch = 0;
+ m_dxsWidth = -1;
+ m_dysAscent = -1; // to properly init, ComputeDimensions must be called
+ m_dysHeight = -1;
+ m_dysXAscent = -1;
+ m_dysXDescent = -1;
+ m_dysAscentOverhang = -1;
+ m_dysDescentOverhang = -1;
+ m_dxsLeftOverhang = -1;
+ m_dxsRightOverhang = -1;
+ m_dysOffset = 0;
+ m_fStartLine = fStartLine;
+ m_fEndLine = fEndLine;
+ m_fWsRtl = fWsRtl;
+
+ m_dxsVisibleWidth = -1;
+ m_dxsTotalWidth = -1;
+
+// m_psstrm = NULL;
+ m_prgslout = NULL;
+ m_prgnSlotVarLenBuf = NULL;
+ m_prgisloutBefore = NULL;
+ m_prgisloutAfter = NULL;
+ m_prgpvisloutAssocs = NULL;
+ m_prgisloutLigature = NULL;
+ m_prgiComponent = NULL;
+
+ m_prgbNextSegDat = NULL;
+ m_cbNextSegDat = 0;
+
+ //m_psegAltEndLine = NULL;
+
+// m_stuFaceName.erase();
+// m_stuBaseFaceName.erase();
+// m_fUseSepBase = false;
+
+// m_psegPrev = NULL; // obsolete
+// m_psegNext = NULL;
+
+ //InitializePlatform();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Destructor.
+----------------------------------------------------------------------------------------------*/
+Segment::~Segment()
+{
+ g_csegTotal--;
+
+ DestroyContents();
+}
+
+void Segment::DestroyContents()
+{
+ delete m_pfont;
+ m_pfont = NULL;
+
+ //if (m_pgts)
+ // // A specially-created wrapper object has to be deleted.
+ // m_pgts->DeleteTextSrcPtr();
+ m_pgts = NULL;
+
+ //if (m_pgjus)
+ // // A specially-created wrapper object has to be deleted.
+ // m_pgjus->DeleteJustifierPtr();
+ m_pgjus = NULL;
+
+ //if (m_psegAltEndLine)
+ //{
+ // if (m_psegAltEndLine->m_psegAltEndLine == this)
+ // m_psegAltEndLine->m_psegAltEndLine = NULL;
+ // delete m_psegAltEndLine;
+ //}
+
+ //for (int iginf = 0; iginf < m_cginf; iginf++) // DELETE
+ // delete m_prgginf[iginf].components;
+
+ Assert((m_prgslout && m_prgnSlotVarLenBuf) || (!m_prgslout && !m_prgnSlotVarLenBuf));
+ delete[] m_prgslout;
+ delete[] m_prgnSlotVarLenBuf;
+ delete[] m_prgisloutBefore;
+ delete[] m_prgisloutAfter;
+ for (int ichw = 0; ichw < m_ichwAssocsLim - m_ichwAssocsMin; ichw++)
+ {
+ if (m_prgpvisloutAssocs && m_prgpvisloutAssocs[ichw])
+ delete m_prgpvisloutAssocs[ichw];
+ }
+ delete[] m_prgpvisloutAssocs;
+ delete[] m_prgisloutLigature;
+ delete[] m_prgiComponent;
+ delete[] m_prgbNextSegDat;
+ delete[] m_prgInitDat;
+ delete[] m_prgginf;
+ m_cginf = 0;
+
+ //DestroyContentsPlatform();
+
+ // ReleaseObj(m_pgts); automatic because smart pointer
+}
+
+/*----------------------------------------------------------------------------------------------
+ Factory method to create a new version of an existing segment with different
+ line-boundary flags.
+----------------------------------------------------------------------------------------------*/
+Segment * Segment::LineContextSegment(Segment & seg, bool fStartLine, bool fEndLine)
+{
+ if (!seg.hasLineBoundaryContext())
+ {
+ // Make an identical segment and just change the flags.
+ Segment * psegNew = new Segment(seg);
+ psegNew->InitLineContextSegment(fStartLine, fEndLine);
+ return psegNew;
+ }
+ else
+ {
+ // Rerun the processing.
+ LayoutEnvironment layout = seg.Layout();
+ layout.setStartOfLine(fStartLine);
+ layout.setEndOfLine(fEndLine);
+ ITextSource & gts = seg.getText();
+ Font & font = seg.getFont();
+ return new RangeSegment(&font, &gts, &layout,
+ seg.startCharacter(), seg.stopCharacter(), &seg);
+ }
+}
+
+void Segment::InitLineContextSegment(bool fStartLine, bool fEndLine)
+{
+ // For RTL end-of-line segments, trailing white space hangs off the left of
+ // the origin of the segment. So when changing that flag
+ // shift appropriately.
+ bool fShift = ((m_nDirDepth % 2) && (m_fEndLine != fEndLine));
+
+ m_fStartLine = fStartLine;
+ m_fEndLine = fEndLine;
+
+ m_layout.setStartOfLine(fStartLine);
+ m_layout.setEndOfLine(fEndLine);
+
+ if (fShift)
+ {
+ (m_fEndLine) ?
+ ShiftGlyphs(m_dxsVisibleWidth - m_dxsTotalWidth) : // shift left
+ ShiftGlyphs(m_dxsTotalWidth - m_dxsVisibleWidth); // shift right
+ }
+
+ m_dxsWidth = -1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ A factory method to create a justified version of an existing segment.
+----------------------------------------------------------------------------------------------*/
+Segment * Segment::JustifiedSegment(Segment & seg, float xsNewWidth)
+{
+ LayoutEnvironment layout(seg.Layout());
+ ITextSource & gts = seg.getText();
+
+ // Why do we have to do this?
+ layout.setJustifier(seg.Justifier());
+ Font & font = seg.getFont();
+ return new JustSegmentAux(&font, &gts, &layout,
+ seg.startCharacter(), seg.stopCharacter(),
+ seg.advanceWidth(), xsNewWidth, &seg);
+}
+
+/*----------------------------------------------------------------------------------------------
+ A factory method to create a new version of an existing trailing white-space segment
+ with a different direction.
+----------------------------------------------------------------------------------------------*/
+Segment * Segment::WhiteSpaceSegment(Segment & seg, int nNewDepth)
+{
+ Segment * psegNew = new Segment(seg);
+ psegNew->InitWhiteSpaceSegment(nNewDepth);
+ return psegNew;
+}
+
+void Segment::InitWhiteSpaceSegment(int nNewDepth)
+{
+ if (nNewDepth == m_nDirDepth)
+ {
+ return;
+ }
+ else if ((nNewDepth % 2) == (m_nDirDepth % 2))
+ {
+ // Same direction, not much to change.
+ m_nDirDepth = nNewDepth;
+ return;
+ }
+ else if (m_twsh != ktwshOnlyWs)
+ return; // couldn't change it, oh, well
+
+ // Otherwise, do the hard stuff: reverse the positions of the glyphs.
+ for (int islout = 0; islout < m_cslout; islout++)
+ {
+ OutputSlot(islout)->ShiftForDirDepthChange(m_dxsTotalWidth);
+ }
+ m_nDirDepth = nNewDepth;
+
+ //SetDirectionDepthPlatform(nNewDepth);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Basic copy method.
+----------------------------------------------------------------------------------------------*/
+Segment::Segment(Segment & seg)
+{
+ int islout;
+
+ m_pgts = seg.m_pgts;
+ m_dichwLim = seg.m_dichwLim;
+ m_ichwMin = seg.m_ichwMin;
+ m_pfont = seg.m_pfont->copyThis();
+ m_preneng = seg.m_preneng;
+ m_fErroneous = seg.m_fErroneous;
+ m_pgjus = seg.m_pgjus;
+ m_fWsRtl = seg.m_fWsRtl;
+ m_fParaRtl = seg.m_fParaRtl;
+ m_twsh = seg.m_twsh;
+ m_nDirDepth = seg.m_nDirDepth;
+ m_cbNextSegDat = seg.m_cbNextSegDat;
+ m_prgbNextSegDat = new byte[m_cbNextSegDat];
+ std::copy(seg.m_prgbNextSegDat, seg.m_prgbNextSegDat + m_cbNextSegDat, m_prgbNextSegDat);
+// m_psegPrev = seg.m_psegPrev;
+// m_psegNext = seg.m_psegNext;
+// m_stuFaceName = seg.m_stuFaceName;
+// m_stuBaseFaceName = seg.m_stuBaseFaceName;
+// m_fUseSepBase = seg.m_fUseSepBase;
+// m_pixHeight = seg.m_pixHeight;
+// m_fBold = seg.m_fBold;
+// m_fItalic = seg.m_fItalic;
+ m_lbStart = seg.m_lbStart;
+ m_lbEnd = seg.m_lbEnd;
+ m_fStartLine = seg.m_fStartLine;
+ m_fEndLine = seg.m_fEndLine;
+ m_est = seg.m_est;
+ m_mFontEmUnits = seg.m_mFontEmUnits;
+ m_dysFontAscent = seg.m_dysFontAscent;
+ m_dysFontDescent = seg.m_dysFontDescent;
+ m_xysEmSquare = seg.m_xysEmSquare;
+// m_xsDPI = seg.m_xsDPI;
+// m_ysDPI = seg.m_ysDPI;
+ m_dxsStretch = seg.m_dxsStretch;
+ m_dxsWidth = seg.m_dxsWidth;
+ m_dysHeight = seg.m_dysHeight;
+ m_dysAscent = seg.m_dysAscent;
+ m_dysXAscent = seg.m_dysXAscent;
+ m_dysXDescent = seg.m_dysXDescent;
+ m_dysAscentOverhang = seg.m_dysAscentOverhang;
+ m_dysDescentOverhang = seg.m_dysDescentOverhang;
+ m_dxsLeftOverhang = seg.m_dxsLeftOverhang;
+ m_dxsRightOverhang = seg.m_dxsRightOverhang;
+ m_dxsVisibleWidth = seg.m_dxsVisibleWidth;
+ m_dxsTotalWidth = seg.m_dxsTotalWidth;
+ m_isloutVisLim = seg.m_isloutVisLim;
+ m_dysOffset = seg.m_dysOffset;
+
+ m_ichwAssocsMin = seg.m_ichwAssocsMin;
+ m_ichwAssocsLim = seg.m_ichwAssocsLim;
+
+ int dichw = m_ichwAssocsLim - m_ichwAssocsMin;
+ m_prgisloutBefore = new int[dichw];
+ std::copy(seg.m_prgisloutBefore, seg.m_prgisloutBefore + dichw, m_prgisloutBefore);
+ m_prgisloutAfter = new int[dichw];
+ std::copy(seg.m_prgisloutAfter, seg.m_prgisloutAfter + dichw, m_prgisloutAfter);
+ m_prgpvisloutAssocs = new std::vector<int> * [dichw];
+ for (int ivislout = 0; ivislout < dichw; ivislout++)
+ {
+ std::vector<int> * pvislout = seg.m_prgpvisloutAssocs[ivislout];
+ if (pvislout)
+ {
+ std::vector<int> * pvisloutNew = new std::vector<int>;
+ m_prgpvisloutAssocs[ivislout] = pvisloutNew;
+ *pvisloutNew = *pvislout; // copy the vector
+ }
+ }
+ m_prgisloutLigature = new int[dichw];
+ std::copy(seg.m_prgisloutLigature, seg.m_prgisloutLigature + dichw, m_prgisloutLigature);
+ m_prgiComponent = new sdata8[dichw];
+ std::copy(seg.m_prgiComponent, seg.m_prgiComponent + dichw, m_prgiComponent);
+
+ m_cslout = seg.m_cslout;
+ int cnExtraPerSlot = (m_cslout > 0) ? seg.m_prgslout[0].CExtraSpaceSlout() : 0;
+ m_prgnSlotVarLenBuf = new u_intslot[m_cslout * cnExtraPerSlot];
+ m_prgslout = new GrSlotOutput[m_cslout];
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutOrig = seg.m_prgslout + islout;
+ GrSlotOutput * psloutThis = m_prgslout + islout;
+ psloutThis->ExactCopyFrom(psloutOrig,
+ m_prgnSlotVarLenBuf + (islout * cnExtraPerSlot), // var-length buffer location
+ cnExtraPerSlot);
+ }
+
+// m_cnUserDefn = seg.m_cnUserDefn;
+ m_cnCompPerLig = seg.m_cnCompPerLig;
+// m_cnFeat = seg.m_cnFeat;
+ m_cslotRestartBackup = seg.m_cslotRestartBackup;
+ std::copy(seg.m_prgnSlotVarLenBuf, seg.m_prgnSlotVarLenBuf +
+ (m_cslout * cnExtraPerSlot), m_prgnSlotVarLenBuf);
+
+ m_cginf = seg.m_cginf;
+ m_isloutGinf0 = seg.m_isloutGinf0;
+ m_prgginf = new GlyphInfo[m_cginf];
+ std::copy(seg.m_prgginf, seg.m_prgginf + m_cginf, m_prgginf);
+ for (int iginf = 0; iginf < m_cginf; iginf++)
+ {
+ m_prgginf[iginf].m_pseg = this;
+ m_prgginf[iginf].m_pslout = m_prgslout + m_prgginf[iginf].m_islout;
+ }
+
+ // Platform-specific; remove eventually:
+ //m_cgstrm = seg.m_cgstrm;
+ //m_prggstrm = new GlyphStrm[m_cgstrm];
+ //for (int igstrm = 0; igstrm < m_cgstrm; igstrm++)
+ //{
+ // m_prggstrm[igstrm].gsk.ys = seg.m_prggstrm[igstrm].gsk.ys;
+ // m_prggstrm[igstrm].gsk.clrFore = seg.m_prggstrm[igstrm].gsk.clrFore;
+ // m_prggstrm[igstrm].gsk.clrBack = seg.m_prggstrm[igstrm].gsk.clrBack;
+ // m_prggstrm[igstrm].vchwGlyphId = seg.m_prggstrm[igstrm].vchwGlyphId;
+ // m_prggstrm[igstrm].vdxs = seg.m_prggstrm[igstrm].vdxs;
+ // m_prggstrm[igstrm].vigbb = seg.m_prggstrm[igstrm].vigbb;
+ // m_prggstrm[igstrm].xsStart = seg.m_prggstrm[igstrm].xsStart;
+ // m_prggstrm[igstrm].xsStartInt = seg.m_prggstrm[igstrm].xsStartInt;
+ //}
+ //m_cgbb = seg.m_cgbb;
+ //m_prggbb = new GlyphBb[m_cgbb];
+ //memcpy(m_prggbb, seg.m_prggbb, m_cgbb * sizeof(GlyphBb));
+ //-------------------------------------
+
+ m_vnSkipOffsets = seg.m_vnSkipOffsets;
+ m_dircPrevStrong = seg.m_dircPrevStrong;
+ m_dircPrevTerm = seg.m_dircPrevTerm;
+ m_cbInitDat = seg.m_cbInitDat;
+ m_prgInitDat = new byte[m_cbInitDat];
+ std::copy(seg.m_prgInitDat, seg.m_prgInitDat + m_cbInitDat, m_prgInitDat);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Swap the guts of the two segments.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+void Segment::SwapWith(Segment * pgrseg)
+{
+ int crefThis = m_cref;
+ int crefOther = pgrseg->m_cref;
+
+ std::swap(*this, *pgrseg);
+
+ m_cref = crefThis;
+ pgrseg->m_cref = crefOther;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Delete the pointer to the alternate-end-of-line segment.
+----------------------------------------------------------------------------------------------*/
+void Segment::ClearAltEndLineSeg()
+{
+ //if (m_psegAltEndLine)
+ //{
+ // if (m_psegAltEndLine->m_psegAltEndLine == this)
+ // m_psegAltEndLine->m_psegAltEndLine = NULL; // so we don't get into a loop
+ // delete m_psegAltEndLine;
+ // m_psegAltEndLine = NULL;
+ //}
+}
+
+
+//:>********************************************************************************************
+//:> Interface methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Return the font that was used to create this segment.
+ Note that in some implementations, the font may be invalid; eg, on Windows the font
+ may not contain a valid device context.
+----------------------------------------------------------------------------------------------*/
+Font & Segment::getFont()
+{
+ return *m_pfont;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the text-source that the segment is representing.
+----------------------------------------------------------------------------------------------*/
+ITextSource & Segment::getText()
+{
+ return *m_pgts;
+}
+
+/*----------------------------------------------------------------------------------------------
+ The distance the drawing point should advance after drawing this segment.
+ Always positive, even for RtoL segments.
+----------------------------------------------------------------------------------------------*/
+float Segment::advanceWidth()
+{
+ if (m_dxsWidth < 0)
+ {
+ ////SetUpGraphics(ichwBase, pgg, true);
+ ComputeDimensions();
+ }
+ return m_dxsWidth;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Compute the rectangle in destination coords which contains all the pixels drawn by
+ this segment. This should be a sufficient rectangle to invalidate if the segment is
+ about to be discarded.
+----------------------------------------------------------------------------------------------*/
+Rect Segment::boundingRect()
+{
+ if (m_dxsWidth < 0)
+ {
+ ////SetUpGraphics(ichwBase, pgg, true);
+ ComputeDimensions();
+ }
+
+ Rect rectRet;
+ rectRet.top = m_dysAscent + m_dysAscentOverhang;
+ rectRet.bottom = (m_dysAscent - m_dysHeight) - m_dysDescentOverhang;
+ rectRet.left = m_dxsLeftOverhang;
+ rectRet.right = m_dxsVisibleWidth + m_dxsRightOverhang;
+
+ return rectRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Answer whether the primary direction of the segment is right-to-left. This is based
+ on the direction of the writing system, except for white-space-only segments, in
+ which case it is based on the main paragraph direction.
+----------------------------------------------------------------------------------------------*/
+bool Segment::rightToLeft()
+{
+ if (m_twsh == ktwshOnlyWs)
+ {
+ // White-space-only segment: use main paragraph direction.
+ return (m_nDirDepth % 2);
+ }
+
+ GrEngine * pgreng = EngineImpl();
+ if (pgreng)
+ {
+ return pgreng->RightToLeft();
+ }
+ return (m_pgts->getRightToLeft(m_ichwMin));
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the depth of direction embedding used by this segment. It is presumably the same
+ for all runs of the segment, otherwise, some of them would use a different writing
+ system and therefore be part of a different segment. So just use the first.
+----------------------------------------------------------------------------------------------*/
+int Segment::directionDepth(bool * pfWeak)
+{
+ if (pfWeak)
+ *pfWeak = (m_twsh == ktwshOnlyWs);
+
+// *pnDepth = m_pgts->getDirectionDepth(m_ichwLim);
+// Assert(*pnDepth == m_nDirDepth);
+
+ return m_nDirDepth;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Change the direction of the segment. This is needed specifically for white-space-only
+ segments, which are initially created to be in the direction of the paragraph, but then
+ later are discovered to not be line-end after all, and need to be changed to use the
+ directionality of the writing system.
+
+ @return kresFail for segments that do not have weak directionality and therefore
+ cannot be changed.
+----------------------------------------------------------------------------------------------*/
+bool Segment::setDirectionDepth(int nNewDepth)
+{
+ Assert(false);
+
+ if (nNewDepth == m_nDirDepth)
+ {
+ return true;
+ }
+ else if ((nNewDepth % 2) == (m_nDirDepth % 2))
+ {
+ // Same direction, not much to change.
+ m_nDirDepth = nNewDepth;
+ return true;
+ }
+ else if (m_twsh != ktwshOnlyWs)
+ return false;
+
+ // Otherwise, do the hard stuff: reverse the positions of the glyphs.
+ for (int islout = 0; islout < m_cslout; islout++)
+ {
+ OutputSlot(islout)->ShiftForDirDepthChange(m_dxsTotalWidth);
+ }
+
+ //SetDirectionDepthPlatform(nNewDepth);
+
+ return true;
+
+}
+
+/*----------------------------------------------------------------------------------------------
+ The logical range of characters covered by the segment, relative to the beginning of
+ the segment. The stop character is the index of the first character beyond the end
+ of the segment.
+
+ These values should be exact at a writing system or string boundary,
+ but may be somewhat fuzzy at a line-break, since characters may be re-ordered
+ across such boundaries. The renderer is free to apply any definition it likes of
+ where a line-break occurs. This should always be the same value obtained from the
+ renderer as pdichLimSeg.
+----------------------------------------------------------------------------------------------*/
+int Segment::startCharacter()
+{
+ return m_ichwMin;
+}
+
+int Segment::stopCharacter()
+{
+ return m_ichwMin + m_dichwLim;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Returns an indication of why the segment ended.
+----------------------------------------------------------------------------------------------*/
+bool Segment::startOfLine()
+{
+ return m_fStartLine;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Returns an indication of why the segment ended.
+----------------------------------------------------------------------------------------------*/
+bool Segment::endOfLine()
+{
+ return m_fEndLine;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Returns true if this segment has something special happening at line boundaries.
+----------------------------------------------------------------------------------------------*/
+bool Segment::hasLineBoundaryContext()
+{
+ return (EngineImpl()->LineBreakFlag());
+}
+
+/*----------------------------------------------------------------------------------------------
+ Returns an indication of why the segment ended.
+----------------------------------------------------------------------------------------------*/
+SegEnd Segment::segmentTermination()
+{
+ return m_est;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Indicates the last character of interest to the segment, relative to the beginning
+ of the segment. The meaning of this is that no behavior of this segment will be
+ affected if characters beyond that change. This does not necessarily mean that
+ a different line break could not have been obtained by the renderer if characters
+ beyond that change, just that a segment with the boundaries of this one would
+ not behave differently.
+----------------------------------------------------------------------------------------------*/
+//GrResult Segment::get_LimInterest(int ichwBase, int * pdichw)
+//{
+// ChkGrOutPtr(pdichw);
+//
+// GrEngine * pgreng = EngineImpl();
+// Assert(pgreng);
+// *pdichw = m_dichwLim + pgreng->PostXlbContext();
+// ReturnResult(kresOk);
+//}
+
+/*----------------------------------------------------------------------------------------------
+ Changes the end-of-line status of the segment. This is used after making the last segment
+ of a string if we want to attempt to put some more text after it (e.g., in another
+ writing system), or if we have reordered due to bidirectionality.
+
+ ENHANCE: the current version handles switching back and forth when we are trying to
+ decide whether we can put more stuff on a line. So it assumes we are at the end of
+ the contextual run (ie, the next batch of stuff will be in a different ows).
+ This will not correctly handle the way this function could or possibly
+ should be used for bidirectional reordering.
+----------------------------------------------------------------------------------------------*/
+/*
+GrResult Segment::changeLineEnds(bool fNewStart, bool fNewEnd)
+{
+ if (m_fStartLine != fNewStart || m_fEndLine != fNewEnd)
+ {
+ if (EngineImpl()->LineBreakFlag())
+ {
+ if (!m_psegAltEndLine)
+ {
+ int dichwLimSeg, dichwContext;
+ float dxWidth;
+ SegEnd est;
+ int cbNextSegDat;
+ byte rgbNextSegDat[256];
+ OLECHAR rgchErrMsg[256];
+ Segment * pseg;
+
+ EngineImpl()->FindBreakPointAux(m_pfont, m_pgts, m_pgjus,
+ m_ichwMin, m_ichwMin + m_dichwLim, m_ichwMin + m_dichwLim,
+ false, fNewStart, fNewEnd, kPosInfFloat, false,
+ klbNoBreak, klbNoBreak, m_twsh, m_fParaRtl,
+ &pseg,
+ &dichwLimSeg, &dxWidth, &est,
+ m_cbInitDat, m_prgInitDat, 256, rgbNextSegDat, &cbNextSegDat,
+ &dichwContext,
+ NULL,
+ rgchErrMsg, 256);
+ // TODO: do something with the error message. This shouldn't really happen,
+ // since to get here we already created a segment with this font.
+ if (!pseg)
+ {
+ // Because we provide INT_MAX as the amount of space, there should
+ // always be enough room to generate the alternate segment.
+ Assert(false);
+ THROW(kresUnexpected);
+ }
+ Assert(cbNextSegDat == 0);
+ m_psegAltEndLine = pseg;
+ }
+ Assert(m_psegAltEndLine->m_fEndLine == fNewEnd);
+ Segment * pseg = m_psegAltEndLine; // save the value
+ SwapWith(m_psegAltEndLine);
+ m_psegAltEndLine = pseg; // reset it after swap
+ pseg->m_psegAltEndLine = this;
+ }
+ else
+ {
+ bool fShift = ((m_nDirDepth % 2) && (m_fEndLine != fNewEnd));
+ m_fStartLine = fNewStart;
+ m_fEndLine = fNewEnd;
+ if (fShift)
+ {
+ (m_fEndLine) ?
+ ShiftGlyphs(m_dxsVisibleWidth - m_dxsTotalWidth) : // shift left
+ ShiftGlyphs(m_dxsTotalWidth - m_dxsVisibleWidth); // shift right
+ }
+ m_dxsWidth = -1;
+ }
+ }
+
+ ReturnResult(kresOk);
+}
+*/
+
+/*----------------------------------------------------------------------------------------------
+ Get the type of break that occurs at the logical start of the segment.
+----------------------------------------------------------------------------------------------*/
+LineBrk Segment::startBreakWeight()
+{
+ return m_lbStart;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Get the type of break that occurs at the logical end of the segment.
+----------------------------------------------------------------------------------------------*/
+LineBrk Segment::endBreakWeight()
+{
+ return m_lbEnd;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Read the amount of stretch, that is, the difference between the actual and natural width.
+ If the segment has been shrunk, returns a negative number.
+ TODO: implement properly.
+----------------------------------------------------------------------------------------------*/
+float Segment::stretch()
+{
+ return (float)m_dxsStretch;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the maximum stretch possible.
+ TODO: implement properly.
+----------------------------------------------------------------------------------------------*/
+float Segment::maxStretch()
+{
+ return 1000;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the maximum shrink possible.
+ TODO: implement properly.
+----------------------------------------------------------------------------------------------*/
+float Segment::maxShrink()
+{
+ return 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return iterators representing the complete range of glyphs in the segment.
+----------------------------------------------------------------------------------------------*/
+std::pair<GlyphIterator, GlyphIterator> Segment::glyphs()
+{
+ return std::make_pair(GlyphIterator(*this, 0), GlyphIterator(*this, m_cginf));
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return iterators representing the set of glyphs for the given character.
+----------------------------------------------------------------------------------------------*/
+std::pair<GlyphSetIterator, GlyphSetIterator> Segment::charToGlyphs(toffset ich)
+{
+ std::vector<int> vislout = UnderlyingToLogicalAssocs(ich);
+
+ if (vislout.size() == 0)
+ return std::make_pair(GlyphSetIterator(), GlyphSetIterator());
+ else
+ {
+ // Note that BOTH instances of GlyphSetIterator must use the same underlying vector,
+ // so that comparisons make sense.
+ RcVector * qvislout = new RcVector(vislout);
+ return std::make_pair(
+ GlyphSetIterator(*this, 0, qvislout),
+ GlyphSetIterator(*this, vislout.size(), qvislout));
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the rendered glyphs and their x- and y-coordinates, in the order generated by
+ the final positioning pass, relative to the top-left of the segment. They are always
+ returned in (roughly) left-to-right order. Note: any of the arrays may be null.
+----------------------------------------------------------------------------------------------*/
+/*
+GrResult Segment::GetGlyphsAndPositions(
+ Rect rs, Rect rd, int cchMax, int * pcchRet,
+ utf16 * prgchGlyphs, float * prgxd, float * prgyd, float * prgdxdAdv)
+{
+ ChkGrOutPtr(pcchRet);
+ if (prgchGlyphs)
+ ChkGrArrayArg(prgchGlyphs, cchMax);
+ if (prgxd)
+ ChkGrArrayArg(prgxd, cchMax);
+ if (prgyd)
+ ChkGrArrayArg(prgyd, cchMax);
+ if (prgdxdAdv)
+ ChkGrArrayArg(prgdxdAdv, cchMax);
+
+ GrResult res;
+
+ //SetUpGraphics(ichwBase, pgg, true);
+
+ Assert(m_dxsWidth >= 0);
+ Assert(m_dysAscent >= 0);
+
+ *pcchRet = m_cginf;
+ if (cchMax < m_cginf)
+ {
+ res = (cchMax == 0) ? kresFalse : kresInvalidArg;
+ //RestoreFont(pgg);
+ ReturnResult(res);
+ }
+
+ if (m_dxsWidth < 0)
+ ComputeDimensions();
+
+ float dysFontAscent = m_dysFontAscent;
+ //////res = GetFontAscentSourceUnits(pgg, &dysFontAscent);
+ //////if (ResultFailed(res))
+ //////{
+ ////// RestoreFont(pgg);
+ ////// ReturnResult(res);
+ //////}
+
+ float xs = 0;
+ // Top of text that sits on the baseline, relative to top of segment:
+ float ys = m_dysAscent - dysFontAscent;
+
+ float * prgxdLocal;
+ if (prgxd == NULL)
+ prgxdLocal = new float[cchMax];
+ else
+ prgxdLocal = prgxd;
+
+ res = GetGlyphsAndPositionsPlatform(xs, ys, rs, rd,
+ prgchGlyphs, prgxdLocal, prgyd, prgdxdAdv);
+
+ if (!prgxd)
+ delete[] prgxdLocal;
+
+ //RestoreFont(pgg);
+
+ ReturnResult(res);
+}
+*/
+
+/*----------------------------------------------------------------------------------------------
+ For debugging. Return the characters in this segment.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+GrResult Segment::GetCharData(int cchMax, utf16 * prgch, int * pcchRet)
+{
+ ChkGrArgPtr(prgch);
+ ChkGrOutPtr(pcchRet);
+
+ int ichLimTmp = m_ichwMin + min(m_dichwLim, cchMax);
+ m_pgts->fetch(m_ichwMin, ichLimTmp - m_ichwMin, prgch);
+ *pcchRet = ichLimTmp - m_ichwMin;
+ ReturnResult(kresOk);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return either the first or last character that the the glyph corresponds to. The
+ index of the glyph matches what was returned by GetGlyphsAndPositions.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+GrResult Segment::GlyphToChar(int iginf, bool fFirst, int * pich)
+{
+ Assert(m_dxsWidth >= 0);
+ Assert(m_dysAscent >= 0);
+
+ *pich = PhysicalSurfaceToUnderlying(iginf, fFirst);
+ ReturnResult(kresOk);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return all the characters that the glyph corresponds to. Most commonly this will
+ be only one char, but ligatures, for instance, will have several. The index of the
+ glyph matches what was returned by GetGlyphsAndPositions.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+GrResult Segment::GlyphToAllChars(int iginf,
+ int cichMax, int * prgich, int * pcichRet)
+{
+ Assert(m_dxsWidth >= 0);
+ Assert(m_dysAscent >= 0);
+
+ std::vector<int> vich;
+ int ichFirst = PhysicalSurfaceToUnderlying(iginf, true);
+ int ichLast = PhysicalSurfaceToUnderlying(iginf, false);
+ Assert(ichFirst <= ichLast);
+
+ if (ichFirst < ichLast)
+ {
+ // Loop over the range of characters that might be associated with this glyph
+ // and add any that actually are.
+ // TODO: we should probably use a method that gets us all the physical associations,
+ // but this should get us 99.5% of the way there for now.
+ for (int ich = ichFirst; ich <= ichLast; ich++)
+ {
+ int iginfFirst = UnderlyingToPhysicalSurface(ich, true);
+ int iginfLast = UnderlyingToPhysicalSurface(ich, false);
+ if (iginfFirst == iginf || iginfLast == iginf)
+ vich.push_back(ich);
+ }
+ }
+ else
+ vich.push_back(ichFirst);
+
+ *pcichRet = vich.size();
+ if (cichMax < signed(vich.size()))
+ {
+ GrResult res = (cichMax == 0 ? kresFalse : kresInvalidArg);
+ ReturnResult(res);
+ }
+ int * pi = prgich;
+ for (size_t i = 0; i < vich.size(); i++)
+ *pi++ = vich[i];
+
+ ReturnResult(kresOk);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return either the first or last glyph that corresponds to the character. The
+ index of the glyph matches what was returned by GetGlyphsAndPositions.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+GrResult Segment::CharToGlyph(int ich, bool fFirst, int * pigbb)
+{
+ Assert(m_dxsWidth >= 0);
+ Assert(m_dysAscent >= 0);
+
+ *pigbb = UnderlyingToPhysicalSurface(ich, fFirst);
+ ReturnResult(kresOk);
+}
+
+
+//:>********************************************************************************************
+//:> Non-FieldWorks interface methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Return the breakweight for the given character. Returns the best value if the character is
+ mapped to glyphs with different values.
+----------------------------------------------------------------------------------------------*/
+LineBrk Segment::getBreakWeight(int ich, bool fBreakBefore)
+{
+ LineBrk lbFirst, lbLast;
+
+ int isloutFirst = UnderlyingToLogicalSurface(ich, true);
+ if (isloutFirst == kPosInfinity || isloutFirst == kNegInfinity)
+ return klbClipBreak;
+ GrSlotOutput * psloutFirst = m_prgslout + isloutFirst;
+ bool fNotFirst = false;
+ if ((psloutFirst->NumberOfComponents() > 0)
+ && psloutFirst->UnderlyingComponent(0) != ich)
+ {
+ // Not the first component of a ligature.
+ lbFirst = (LineBrk) ((int)klbClipBreak * -1);
+ fNotFirst = true;
+ }
+ else
+ {
+ lbFirst = (LineBrk) psloutFirst->BreakWeight();
+ }
+
+ int isloutLast = UnderlyingToLogicalSurface(ich, false);
+ if (isloutLast == kPosInfinity || isloutLast == kNegInfinity)
+ return klbClipBreak;
+ GrSlotOutput * psloutLast = m_prgslout + isloutLast;
+ bool fNotLast = false;
+ if ((psloutLast->NumberOfComponents() > 0)
+ && psloutLast->UnderlyingComponent(psloutLast->NumberOfComponents() - 1) != ich)
+ {
+ // Not the last component of a ligature.
+ lbLast = klbClipBreak;
+ fNotLast = true;
+ }
+ else
+ {
+ lbLast = (LineBrk) psloutLast->BreakWeight();
+ }
+
+ LineBrk lbRet;
+ if (fNotLast && fNotFirst)
+ // middle of a ligature
+ lbRet = klbClipBreak;
+ else if (fNotLast)
+ lbRet = (fBreakBefore) ? lbFirst : klbClipBreak;
+ else if (fNotFirst)
+ lbRet = (fBreakBefore) ? klbClipBreak : lbLast;
+ else
+ lbRet = (fBreakBefore) ? lbFirst : lbLast;
+
+ return lbRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the width of the range of characters. Line-boundary contextualization is handled
+ by the measure attributes on the glyphs. The width returned is equivalent to the sum of
+ the widths of any line-segments that would be needed to underline all the characters.
+
+ Since this method is intended to be used on "measured" segments that include the entire
+ paragraph, it is not very smart about handling cross-line-boundary contextualization.
+ It basically ignores any glyphs that are rendered by this segment but not officially
+ part of the segment.
+----------------------------------------------------------------------------------------------*/
+float Segment::getRangeWidth(int ichMin, int ichLim,
+ bool fStartLine, bool fEndLine, bool fSkipSpace)
+{
+ if (m_dxsWidth < 0)
+ {
+ ////SetUpGraphics(ichwBase, pgg, true);
+ ComputeDimensions();
+ }
+
+ Assert(m_dxsWidth >= 0);
+ Assert(m_dysAscent >= 0);
+
+ //float xsSegRight = m_dxsTotalWidth;
+
+ int ichMinRange = min(ichMin, ichLim);
+ int ichLimRange = max(ichMin, ichLim);
+
+ //int ichMinSeg = max(ichMinRange, m_ichwMin + m_ichwAssocsMin);
+ //int ichLimSeg = min(ichLimRange, m_ichwMin + m_ichwAssocsLim);
+ int ichMinSeg = max(ichMinRange, m_ichwMin);
+ int ichLimSeg = min(ichLimRange, m_ichwMin + m_dichwLim);
+
+ if (ichLimSeg < m_ichwMin) // not + m_ichwAssocsMin
+ return 0;
+ if (ichMinSeg >= m_ichwMin + m_dichwLim) // not m_ichwAssocsLim
+ return 0;
+
+ if (fSkipSpace)
+ {
+ int islout = UnderlyingToLogicalSurface(ichLimSeg - 1, true);
+ GrSlotOutput * pslout = (islout == kNegInfinity || islout == kPosInfinity) ?
+ NULL :
+ OutputSlot(islout);
+ while (pslout && pslout->IsSpace())
+ {
+ ichLimSeg--;
+ islout = UnderlyingToLogicalSurface(ichLimSeg - 1, true);
+// pslout = OutputSlot(islout);
+ pslout = (islout == kNegInfinity || islout == kPosInfinity) ?
+ NULL : OutputSlot(islout);
+ }
+ }
+
+ float xsWidth = 0;
+ SegmentNonPainter segp(this); // doesn't really need to paint
+ float rgxdLefts[100];
+ float rgxdRights[100];
+ size_t cxd = 0;
+ if (ichMinRange < ichLimRange)
+ cxd = segp.getUnderlinePlacement(ichMinSeg, ichLimSeg, fSkipSpace,
+ 100, rgxdLefts, rgxdRights, NULL);
+ for (size_t i = 0; i < cxd; i++)
+ xsWidth += rgxdRights[i] - rgxdLefts[i];
+
+ // Add in the line-boundary contextualization.
+ int isloutFirst = UnderlyingToLogicalSurface(ichMin, true);
+ int isloutLast = UnderlyingToLogicalSurface(ichLim - 1, false);
+ int mSol = 0;
+ int mEol = 0;
+ if (0 <= isloutFirst && isloutFirst < m_cslout)
+ mSol = m_prgslout[isloutFirst].MeasureSol();
+ if (0 <= isloutLast && isloutLast < m_cslout)
+ mEol = m_prgslout[isloutLast].MeasureEol();
+ float dxsSol = GrEngine::GrIFIMulDiv(mSol, m_xysEmSquare, m_mFontEmUnits);
+ float dxsEol = GrEngine::GrIFIMulDiv(mEol, m_xysEmSquare, m_mFontEmUnits);
+ xsWidth += dxsSol;
+ xsWidth += dxsEol;
+
+ //RestoreFont(pgg);
+
+ return xsWidth;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the next reasonable breakpoint after ichStart resulting in range that fits in
+ the specified width.
+----------------------------------------------------------------------------------------------*/
+int Segment::findNextBreakPoint(int ichStart,
+ LineBrk lbPref, LineBrk lbWorst, float dxMaxWidth,
+ float * pdxBreakWidth, bool fStartLine, bool fEndLine)
+{
+ ChkGrOutPtr(pdxBreakWidth);
+
+ int ichBreak;
+
+ // First make a rough estimation of how much will fit, using a binary chop approach.
+ int iginfStart = UnderlyingToPhysicalSurface(ichStart, !m_fWsRtl);
+ int iginfEnd = UnderlyingToPhysicalSurface(m_ichwMin + m_dichwLim - 1, m_fWsRtl);
+ int iginfLeft = min(iginfStart, iginfEnd);
+ int iginfRight= max(iginfStart, iginfEnd);
+
+ int iginfMin = iginfLeft;
+ int iginfLim = iginfRight;
+ int ichFit;
+ if (m_fWsRtl) // right-to-left
+ {
+ float xRight = GlyphLeftEdge(iginfRight + 1);
+ float xLeftMost = xRight - dxMaxWidth;
+ while (GlyphLeftEdge(iginfLim) < xLeftMost)
+ {
+ if (iginfLim - iginfMin <= 1)
+ break;
+ int iginfMid = (iginfLim + iginfMin) >> 1; // divide by 2
+ if (GlyphLeftEdge(iginfMid) < xLeftMost)
+ iginfLim = iginfMid;
+ else
+ iginfMin = iginfMid;
+ }
+ ichFit = PhysicalSurfaceToUnderlying(iginfLim, false);
+ }
+ else // left-to-right
+ {
+ float xLeft = GlyphLeftEdge(iginfLeft);
+ float xRightMost = dxMaxWidth - xLeft; // QUESTION: shouldn't this be +, not -?
+ iginfLim++;
+ while (GlyphLeftEdge(iginfLim) > xRightMost)
+ {
+ if (iginfLim - iginfMin <= 1)
+ break;
+ int iginfMid = (iginfLim + iginfMin) >> 1; // divide by 2
+ if (GlyphLeftEdge(iginfMid) > xRightMost)
+ iginfLim = iginfMid;
+ else
+ iginfMin = iginfMid;
+ }
+ Assert(iginfLim <= m_cginf);
+ if (iginfLim >= m_cginf) iginfLim = m_cginf - 1;
+ ichFit = PhysicalSurfaceToUnderlying(iginfLim, false);
+ }
+
+ // Breaking after ichFit should pretty much fit in the space. But make sure.
+ float dxWidthFit;
+ while (ichFit > ichStart)
+ {
+ dxWidthFit = getRangeWidth(ichStart, ichFit, fStartLine, fEndLine);
+ if (dxWidthFit <= dxMaxWidth)
+ break;
+ ichFit--;
+ }
+
+ if (ichFit <= ichStart)
+ {
+ // Nothing will fit.
+ return ichStart - 1;
+ }
+
+ // Now look for a good break. First look forward until the range doesn't fit anymore.
+ int ichTry = ichFit;
+ int nExtra = 2;
+ LineBrk lbBest = klbClipBreak;
+ int ichBestBreak = -1;
+ while (nExtra > 0 && ichTry < m_ichwMin + m_dichwLim)
+ {
+ float dxWTmp;
+ dxWTmp = getRangeWidth(ichStart, ichTry, fStartLine, fEndLine);
+ if (dxWTmp <= dxMaxWidth)
+ {
+ LineBrk lbTmp;
+ lbTmp = getBreakWeight(ichTry - 1, false);
+ if (lbTmp > 0 && lbTmp < lbWorst && max(lbTmp, lbPref) <= lbBest)
+ {
+ ichBestBreak = ichTry;
+ lbBest = max(lbTmp, lbPref); // any value better than lbPref is insignificant
+ }
+ else
+ {
+ lbTmp = getBreakWeight(ichTry - 1, true);
+ if (lbTmp < 0)
+ {
+ lbTmp = LineBrk(max(lbTmp * -1L, long(lbPref)));
+ if (lbTmp < lbWorst && lbTmp <= lbBest)
+ {
+ ichBestBreak = ichTry - 1;
+ lbBest = lbTmp;
+ }
+ }
+ }
+ }
+ else
+ {
+ // Didn't fit. But it is theoretically possible that actually adding another
+ // character will! Try a few more.
+ nExtra--;
+ }
+ ichTry++;
+ }
+
+ if (ichTry >= m_ichwMin + m_dichwLim)
+ {
+ // Break at the end of the segment.
+ ichBreak = m_ichwMin + m_dichwLim;
+ *pdxBreakWidth = getRangeWidth(ichStart, m_dichwLim, fStartLine, fEndLine);
+ return ichBreak;
+ }
+
+ if (ichBestBreak > -1 && lbBest <= lbPref)
+ {
+ // Found a reasonable break by looking forward; return it.
+ ichBreak = ichBestBreak;// + m_ichwMin;
+ *pdxBreakWidth = getRangeWidth(ichStart, ichBestBreak, fStartLine, fEndLine);
+ return ichBreak;
+ }
+
+ // Didn't find a really good break point looking forward from our rough guess.
+ // Now look backward.
+
+ ichTry = ichFit;
+ while (ichTry > ichStart)
+ {
+ LineBrk lbTmp;
+ lbTmp = getBreakWeight(ichTry - 1, false);
+ if (lbTmp > 0 && lbTmp < lbWorst && max(lbTmp, lbPref) < lbBest)
+ {
+ ichBestBreak = ichTry;
+ lbBest = max(lbTmp, lbPref); // any value better than lbPref is insignificant
+ }
+ else
+ {
+ lbTmp = getBreakWeight(ichTry - 1, true);
+ if (lbTmp < 0)
+ {
+ lbTmp = LineBrk(max(lbTmp * -1L, long(lbPref)));
+ if (lbTmp < lbWorst && lbTmp < lbBest)
+ {
+ ichBestBreak = ichTry - 1;
+ lbBest = lbTmp;
+ }
+ }
+ }
+ if (lbBest <= lbPref)
+ break;
+
+ ichTry--;
+ }
+
+ if (ichBestBreak > -1 && ichBestBreak > ichStart)
+ {
+ // Found a reasonable break by looking backward; return it.
+ ichBreak = ichBestBreak;// + m_ichwMin;
+ *pdxBreakWidth = getRangeWidth(ichStart, ichBestBreak, fStartLine, fEndLine);
+ return ichBreak;
+ }
+
+ // No reasonable break.
+ return ichStart - 1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Private; used by findNextBreakPoint().
+----------------------------------------------------------------------------------------------*/
+float Segment::GlyphLeftEdge(int iginf)
+{
+ if (iginf >= m_cginf)
+ return m_prgginf[m_cginf - 1].origin() + m_prgginf[m_cginf - 1].advanceWidth();
+// return m_prgginf[m_cginf].origin() + m_prgginf[m_cginf].advanceWidth();
+ else
+ return m_prgginf[iginf].origin();
+}
+
+
+//:>********************************************************************************************
+//:> Other methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Get the embedded string. For temporary use; AddRef is not automatically called.
+ Do not release unless you AddRef.
+----------------------------------------------------------------------------------------------*/
+ITextSource * Segment::GetString()
+{
+ return m_pgts;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Compute the ascent, height, width, and overhangs of the segment.
+ The ascent is the ascent of the font (distance from the baseline to the top)
+ plus any extra ascent height specified by the font.
+ The descent is distance from the baseline to the bottom of font, plus any extra descent
+ specified by the font (ExtraDescent).
+ The ascent overhang is the distance from the top of the font to the top of the highest
+ glyph, or zero if all the glyphs fit within the ascent.
+ The descent overhang is the distance from the bottom of the font to the bottom of the lowest
+ glyph, or zero if all the glyphs fit within the descent.
+ The height is the sum of the ascent and descent.
+----------------------------------------------------------------------------------------------*/
+void Segment::ComputeDimensions()
+{
+ if (m_fEndLine)
+ m_dxsWidth = m_dxsVisibleWidth; // don't include trailing white space.
+ else
+ m_dxsWidth = m_dxsTotalWidth;
+
+ if (m_dxsWidth == -1)
+ {
+ for (int iginf = 0; iginf < m_cginf; iginf++)
+ {
+ GlyphInfo * pginf = m_prgginf + iginf;
+ if (pginf->isSpace())
+ continue;
+ m_dxsWidth = max(m_dxsWidth, (pginf->origin() + pginf->advanceWidth()));
+ }
+ }
+
+ int dysNegFontDescent = (int)m_dysFontDescent * -1;
+
+ // if there were no glyphs in the segment then there is sometimes no EngineImpl
+ if (!EngineImpl())
+ {
+ Assert(m_cslout == 0);
+ Assert(m_cginf == 0);
+ m_dxsWidth = 0;
+ m_dysAscent = 0; // max(0.0, m_dysFontAscent);
+ m_dysHeight = 0; // max(0.0, m_dysAscent - dysNegFontDescent);
+ m_dysAscentOverhang = 0;
+ m_dysDescentOverhang = 0;
+ m_dxsLeftOverhang = 0;
+ m_dxsRightOverhang = 0;
+ return;
+ }
+
+ // Calculate the extra ascent and descent.
+ int mXAscent = EngineImpl()->ExtraAscent();
+ int mXDescent = EngineImpl()->ExtraDescent();
+
+ m_dysXAscent = GrEngine::GrIFIMulDiv(mXAscent, m_xysEmSquare, m_mFontEmUnits);
+ m_dysXDescent = GrEngine::GrIFIMulDiv(mXDescent, m_xysEmSquare, m_mFontEmUnits);
+
+ m_dysAscent = m_dysFontAscent + m_dysXAscent;
+ float dysNegDescent = dysNegFontDescent - m_dysXDescent; // dysNegDescent < 0
+ m_dysHeight = m_dysAscent - dysNegDescent;
+
+ // Calculate the overhangs.
+ float dysVisAscent = m_dysAscent;
+ float dysNegVisDescent = dysNegDescent;
+ float dxsVisLeft = 0;
+ float dxsVisRight = m_dxsTotalWidth;
+ ComputeOverhangs(&dysVisAscent, &dysNegVisDescent, &dxsVisLeft, &dxsVisRight);
+ m_dysAscentOverhang = max(float(0), (dysVisAscent - m_dysAscent));
+ m_dysDescentOverhang = max(float(0), (dysNegDescent - dysNegVisDescent));
+ m_dxsLeftOverhang = min(float(0), dxsVisLeft);
+ m_dxsRightOverhang = max(float(0), dxsVisRight - m_dxsTotalWidth);
+
+ m_dysOffset = EngineImpl()->VerticalOffset();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Compute the visible ascent and descent, based on how much the bounding box of any
+ glyph may extend beyond the ascent or descent of the font.
+ Also compute the left- and right-overhangs.
+----------------------------------------------------------------------------------------------*/
+void Segment::ComputeOverhangs(float * pdysVisAscent, float * pdysNegVisDescent,
+ float * pdxsVisLeft, float * pdxsVisRight)
+{
+ for (int iginf = 0; iginf < m_cginf; iginf++)
+ {
+ *pdysVisAscent = max(*pdysVisAscent, m_prgginf[iginf].bb().top);
+ *pdysNegVisDescent = min(*pdysNegVisDescent, m_prgginf[iginf].bb().bottom);
+
+ *pdxsVisLeft = min(*pdxsVisLeft, m_prgginf[iginf].bb().left);
+ *pdxsVisRight = max(*pdxsVisRight, m_prgginf[iginf].bb().right);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Create the arrays to store the final output and association information.
+----------------------------------------------------------------------------------------------*/
+void Segment::SetUpOutputArrays(Font * pfont, GrTableManager * ptman,
+ GrSlotStream * psstrmFinal,
+ int cchwInThisSeg, int csloutSurface, gid16 chwLB,
+ TrWsHandling twsh, bool fParaRtl, int nDirDepth, bool fEmpty)
+{
+ m_mFontEmUnits = EngineImpl()->GetFontEmUnits();
+
+ pfont->getFontMetrics(&m_dysFontAscent, &m_dysFontDescent, &m_xysEmSquare);
+// m_xsDPI = (float)pfont->getDPIx();
+// m_ysDPI = (float)pfont->getDPIy();
+
+ // Note that storing both of these values is redundant; they should be the same.
+// Assert(m_xysEmSquare == m_pixHeight);
+
+ m_twsh = twsh;
+ m_fParaRtl = fParaRtl;
+ if (m_twsh == ktwshOnlyWs)
+ m_nDirDepth = (int)fParaRtl;
+ else if (fParaRtl && nDirDepth == 0)
+ m_nDirDepth = 2;
+ else
+ m_nDirDepth = nDirDepth;
+
+ // Create association mappings and set up final versions of slots.
+
+ Assert((psstrmFinal == NULL) == fEmpty);
+
+ m_ichwAssocsMin = 0;
+ m_ichwAssocsLim = cchwInThisSeg;
+
+ m_prgisloutBefore = new int[cchwInThisSeg];
+
+ m_prgisloutAfter = new int[cchwInThisSeg];
+
+ m_prgpvisloutAssocs = new std::vector<int> * [cchwInThisSeg];
+
+ m_prgisloutLigature = new int[cchwInThisSeg];
+
+ m_prgiComponent = new sdata8[cchwInThisSeg];
+
+ int cslot = 0;
+ //m_psstrm = psstrmFinal; // TODO: make a local variable
+ if (psstrmFinal)
+ cslot = psstrmFinal->FinalSegLim();
+ else
+ Assert(fEmpty);
+
+ float xsMin = 0;
+ int islot;
+ int islotMin = (psstrmFinal) ? psstrmFinal->IndexOffset() : 0;
+ for (islot = islotMin; islot < cslot; islot++)
+ xsMin = min(xsMin, psstrmFinal->SlotAt(islot)->XPosition());
+
+ // For right-to-left segments, the draw origin is at the left side of the visible
+ // portion of the text. So if necessary, scoot everything left so that the invisible
+ // trailing white-space is to the left of the draw position.
+ Assert(m_dxsTotalWidth > -1);
+ Assert(m_dxsVisibleWidth > -1);
+ float dxsInvisible = (m_fEndLine) ? m_dxsTotalWidth - m_dxsVisibleWidth : 0;
+ for (islot = islotMin; ((m_nDirDepth % 2) && (islot < cslot)); islot++)
+ {
+ GrSlotState * pslot = psstrmFinal->SlotAt(islot);
+ // int islout = islot - islotMin;
+ if (pslot->GlyphID() == chwLB)
+ continue; // skip over linebreak markers
+ if (m_nDirDepth % 2) // redundant test
+ {
+ // RTL will have descending neg values, adjust to be positive. Also make sure
+ // invisible trailing white space is to the left of the draw origin.
+ // Review: will changing this value have side affects?
+ pslot->SetXPos(pslot->XPosition() - xsMin - dxsInvisible);
+ }
+ }
+
+ Assert(kPosInfinity > 0);
+ Assert(kNegInfinity < 0);
+ for (int ichw = 0; ichw < cchwInThisSeg; ++ichw)
+ {
+ m_prgisloutBefore[ichw] = kPosInfinity;
+ m_prgisloutAfter[ichw] = kNegInfinity;
+ m_prgpvisloutAssocs[ichw] = new std::vector<int>;
+ m_prgisloutLigature[ichw] = kNegInfinity;
+ m_prgiComponent[ichw] = 0;
+ }
+
+ m_cslout = csloutSurface;
+ if (ptman->NumUserDefn() > 0 && ptman->NumCompPerLig() > 0)
+ {
+ int x; x = 3;
+ }
+
+// m_cnUserDefn = ptman->NumUserDefn();
+ m_cnCompPerLig = ptman->NumCompPerLig();
+// m_cnFeat = ptman->NumFeat();
+ // Normal buffers, plus underlying indices of ligature components, plus
+ // map from used components to defined components.
+// int cnExtraPerSlot = m_cnUserDefn + (m_cnCompPerLig * 2) + m_cnFeat + (m_cnCompPerLig * 2);
+
+ // We don't need to store the user-defined slot attributes or the features in the segment itself.
+ // What we need is: (1) component.ref attr settings, (2) slot-attribute indices,
+ // (3) underlying indicates of ligature components, and (4) map from used components
+ // to defined components
+ int cnExtraPerSlot = m_cnCompPerLig * 4;
+ m_prgslout = new GrSlotOutput[m_cslout];
+ m_prgnSlotVarLenBuf = new u_intslot[m_cslout * cnExtraPerSlot];
+
+ m_isloutVisLim = 0;
+ if (psstrmFinal)
+ {
+ for (islot = islotMin; islot < psstrmFinal->FinalSegLim(); ++islot)
+ {
+ int isloutRel = islot - islotMin;
+
+ GrSlotState * pslot = psstrmFinal->SlotAt(islot);
+ pslot->SetPosPassIndex(isloutRel, false);
+ pslot->EnsureCacheForOutput(ptman);
+ GrSlotOutput * pslout = OutputSlot(isloutRel);
+ pslout->SetBufferPtr(m_prgnSlotVarLenBuf + (isloutRel * cnExtraPerSlot));
+ pslout->InitializeOutputFrom(pslot);
+ pslout->SetBeforeAssoc(pslot->BeforeAssoc());
+ pslout->SetAfterAssoc(pslot->AfterAssoc());
+ if (pslot->HasComponents())
+ pslot->SetComponentRefsFor(pslout);
+ Assert(pslot->HasComponents() == (pslout->NumberOfComponents() > 0));
+ //if (pslot->HasClusterMembers())
+ //{
+ //Assert(pslot->HasClusterMembers() || pslot->ClusterRootOffset() == 0);
+ pslout->SetClusterXOffset(pslot->ClusterRootOffset() * -1);
+ pslout->SetClusterAdvance(pslot->ClusterAdvWidthFrom(0));
+
+ //}
+
+ if (!ptman->IsWhiteSpace(pslot))
+ m_isloutVisLim = islot + 1;
+ }
+ }
+
+ // Set up the clusters.
+ for (islot = islotMin; islot < m_cslout; islot++)
+ {
+ GrSlotState * pslot = psstrmFinal->SlotAt(islot);
+ int isloutAdj = islot - islotMin;
+ int isloutBaseIndex = pslot->Base(psstrmFinal)->PosPassIndex();
+ if (!pslot->IsBase())
+ {
+ OutputSlot(isloutBaseIndex)->AddClusterMember(isloutBaseIndex, pslot->PosPassIndex());
+ OutputSlot(isloutAdj)->SetClusterBase(isloutBaseIndex);
+ }
+ else if (pslot->HasClusterMembers() && pslot->IsBase())
+ {
+ Assert(isloutBaseIndex == islot - islotMin);
+ OutputSlot(isloutAdj)->SetClusterBase(isloutBaseIndex);
+ }
+ }
+
+ ///AssertValidClusters(psstrmFinal);
+
+#ifdef OLD_TEST_STUFF
+ if (ptman->GlyphTable() == NULL)
+ return; // test procedures
+#endif // OLD_TEST_STUFF
+
+ // CalcPositionsUpTo() called on final pass already from Table Mgr
+
+ // Final output for draw routines.
+
+ SetUpGlyphInfo(ptman, psstrmFinal, chwLB, nDirDepth, islotMin, cslot);
+
+ //SetUpOutputArraysPlatform(ptman, chwLB, nDirDepth, islotMin, cslot);
+
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set up the data structures that represent the actual rendered glyphs for the new segment.
+----------------------------------------------------------------------------------------------*/
+void Segment::SetUpGlyphInfo(GrTableManager * ptman, GrSlotStream * psstrmFinal,
+ gid16 chwLB, int nDirDepth, int islotMin, int cslot)
+{
+ //int paraDirLevel = (ptman->State()->ParaRightToLeft()) ? 1 : 0;
+
+ m_cginf = 0;
+
+ int islot;
+ for (islot = islotMin; islot < cslot; islot++)
+ {
+ if (psstrmFinal->SlotAt(islot)->GlyphID() != chwLB)
+ {
+ m_cginf++;
+ }
+ }
+
+ // For right-to-left segments, the draw origin will be at the left side of the visible
+ // portion of the text. So if necessary, scoot everything left so that the invisible
+ // trailing white-space is to the left of the draw position.
+ Assert(m_dxsTotalWidth > -1);
+ Assert(m_dxsVisibleWidth > -1);
+ //float dxsInvisible = (m_fEndLine) ? m_dxsTotalWidth - m_dxsVisibleWidth : 0;
+
+ m_prgginf = new GlyphInfo [m_cginf];
+
+ m_isloutGinf0 = -1;
+ int iginf = 0;
+ for (int islot = islotMin; islot < cslot; islot++)
+ {
+ GrSlotState * pslot = psstrmFinal->SlotAt(islot);
+
+ if (pslot->GlyphID() == chwLB)
+ {
+ continue; // skip over linebreak markers
+ }
+
+ int islout = islot - islotMin;
+ GrSlotOutput * pslout = OutputSlot(islout);
+
+ if (m_isloutGinf0 == -1)
+ m_isloutGinf0 = islout;
+
+ m_prgginf[iginf].m_pslout = pslout;
+ m_prgginf[iginf].m_islout = islout;
+ m_prgginf[iginf].m_pseg = this;
+
+ // Fill in stuff in the output slot that is needed by the GlyphInfo object.
+ pslout->m_xsAdvanceX = pslot->GlyphMetricLogUnits(ptman, kgmetAdvWidth);
+ //pslout->m_ysAdvanceY = pslot->GlyphMetricLogUnits(ptman, kgmetAdvHeight);
+ //pslout->m_rectBB.top
+ // = pslot->YPosition() + pslot->GlyphMetricLogUnits(ptman, kgmetBbTop);
+ //pslout->m_rectBB.bottom
+ // = pslot->YPosition() + pslot->GlyphMetricLogUnits(ptman, kgmetBbBottom);
+ //pslout->m_rectBB.left
+ // = pslot->XPosition() + pslot->GlyphMetricLogUnits(ptman, kgmetBbLeft);
+ //if (pslot->IsSpace(ptman))
+ // pslout->m_rectBB.right
+ // = pslot->XPosition() + pslot->GlyphMetricLogUnits(ptman, kgmetAdvWidth);
+ //else
+ // pslout->m_rectBB.right
+ // = pslot->XPosition() + pslot->GlyphMetricLogUnits(ptman, kgmetBbRight);
+
+ iginf++;
+ }
+
+ if (cslot - islotMin == 0)
+ m_isloutGinf0 = 0;
+ if (m_isloutGinf0 == -1)
+ {
+ Assert(m_cginf == 0);
+ m_isloutGinf0 = ((OutputSlot(0)->IsInitialLineBreak()) ? 1 : 0);
+ }
+
+ Assert(m_isloutGinf0 == 0 || m_isloutGinf0 == 1);
+}
+
+/*
+// OLD VERSION
+void Segment::SetUpGlyphInfo(GrTableManager * ptman, GrSlotStream * psstrmFinal, gid16 chwLB, int nDirDepth,
+ int islotMin, int cslot)
+{
+ int paraDirLevel = (ptman->State()->ParaRightToLeft()) ? 1 : 0;
+
+ m_cginf = 0;
+ int islot;
+ for (islot = islotMin; islot < cslot; islot++)
+ {
+ if (psstrmFinal->SlotAt(islot)->GlyphID() != chwLB)
+ m_cginf++;
+ }
+
+ // For right-to-left segments, the draw origin will be at the left side of the visible
+ // portion of the text. So if necessary, scoot everything left so that the invisible
+ // trailing white-space is to the left of the draw position.
+ Assert(m_dxsTotalWidth > -1);
+ Assert(m_dxsVisibleWidth > -1);
+ float dxsInvisible = (m_fEndLine) ? m_dxsTotalWidth - m_dxsVisibleWidth : 0;
+
+ m_prgginf = new GlyphInfo [m_cginf];
+
+ // Fill in glyph information structures.
+ m_isloutGinf0 = -1;
+ for (islot = islotMin; islot < cslot; islot++)
+ {
+ GrSlotState * pslot = psstrmFinal->SlotAt(islot);
+
+ int islout = islot - islotMin;
+ if (pslot->GlyphID() == chwLB)
+ {
+ continue; // skip over linebreak markers
+ }
+ if (m_isloutGinf0 == -1)
+ m_isloutGinf0 = islout;
+
+ GrSlotOutput * pslout = OutputSlot(islout);
+
+ int iginf = islout - m_isloutGinf0;
+ GlyphInfo & ginf = m_prgginf[iginf];
+
+ ginf.glyphID = pslot->ActualGlyphForOutput(ptman);
+ ginf.pseudoGlyphID = pslot->GlyphID();
+ if (ginf.glyphID == ginf.pseudoGlyphID)
+ ginf.pseudoGlyphID = 0;
+
+ ginf.isSpace = pslot->IsSpace(ptman);
+
+ ginf.origin = pslot->XPosition();
+ ginf.yOffset = pslot->YPosition();
+
+ ginf.bbLeft = pslot->XPosition() + pslot->GlyphMetricLogUnits(ptman, kgmetBbLeft);
+ ginf.bbTop = pslot->YPosition() + pslot->GlyphMetricLogUnits(ptman, kgmetBbTop);
+ if (ginf.isSpace)
+ {
+ ginf.bbRight = pslot->XPosition() + pslot->GlyphMetricLogUnits(ptman, kgmetAdvWidth);
+ }
+ else
+ {
+ ginf.bbRight = pslot->XPosition() + pslot->GlyphMetricLogUnits(ptman, kgmetBbRight);
+ }
+ ginf.bbBottom = pslot->YPosition() + pslot->GlyphMetricLogUnits(ptman, kgmetBbBottom);
+
+ ginf.advanceWidth = pslot->GlyphMetricLogUnits(ptman, kgmetAdvWidth);
+ ginf.advanceHeight = 0;
+
+ if (pslot->AttachTo() == 0) // not attached
+ ginf.attachedTo = -1;
+ else
+ ginf.attachedTo = pslot->AttachTo() + islot;
+
+ ginf.directionality = byte(pslot->Directionality());
+ if (pslot->DirLevel() == -1)
+ ginf.directionLevel = paraDirLevel;
+ else
+ ginf.directionLevel = byte(pslot->DirLevel());
+
+ //ginf.firstChar = LogicalSurfaceToUnderlying(islout, true);
+ //ginf.lastChar = LogicalSurfaceToUnderlying(islout, false);
+
+ if (pslot->HasComponents())
+ {
+ SetUpLigInfo(ptman, ginf, pslout);
+ }
+ else
+ {
+ ginf.numberOfComponents = 0;
+ ginf.components = NULL;
+ }
+
+ ginf.insertBefore = pslot->InsertBefore();
+
+ ginf.maxStretch[0] = ptman->EmToLogUnits(pslot->JStretch());
+ ginf.maxShrink[0] = ptman->EmToLogUnits(pslot->JShrink());
+ ginf.stretchStep[0]= ptman->EmToLogUnits(pslot->JStep());
+ ginf.justWidth[0] = ptman->EmToLogUnits(pslot->JWidth());
+ ginf.justWeight[0] = pslot->JWeight();
+
+ ginf.measureStartOfLine = pslout->MeasureSolLogUnits();
+ ginf.measureEndOfLine = pslout->MeasureEolLogUnits();
+ }
+}
+*/
+
+/*----------------------------------------------------------------------------------------------
+ Set up the data structures that represent the components of a ligature glyph.
+----------------------------------------------------------------------------------------------*/
+/*
+void Segment::SetUpLigInfo(GrTableManager * ptman, GlyphInfo & ginf, GrSlotOutput * pslout)
+{
+ GrGlyphTable * pgtbl = ptman->GlyphTable();
+
+ int ccomp = pslout->NumberOfComponents();
+ ginf.numberOfComponents = ccomp;
+ ginf.components = new ComponentBox[ccomp];
+ for (int icomp = 0; icomp < ccomp; icomp++)
+ {
+ ComponentBox & cb = ginf.components[icomp];
+
+ // TODO: Rework ComponentIndexForGlyph to take slati rather than iForGlyph.
+ float xsLeft, xsRight, ysTop, ysBottom;
+ int slati = pslout->ComponentId(icomp);
+ int iForGlyph = pgtbl->ComponentIndexForGlyph(pslout->GlyphID(), slati);
+ pgtbl->ComponentBoxLogUnits(m_xysEmSquare, pslout->GlyphID(), iForGlyph,
+ m_mFontEmUnits, m_dysAscent,
+ &xsLeft, &ysTop, &xsRight, &ysBottom, false);
+
+ cb.firstChar = pslout->UnderlyingComponent(icomp);
+ cb.lastChar = cb.firstChar; // TODO: is this supported?
+ cb.left = xsLeft;
+ cb.right = xsRight;
+ cb.top = ysTop;
+ cb.bottom = ysBottom;
+ }
+}
+*/
+
+
+// --------- OBSOLETE - replaced by GrTableManager::AdjustAssocsForOverlaps() ---------------
+#if 0
+
+/*----------------------------------------------------------------------------------------------
+ Now that this segment is finished and has its associations set, handle any overlaps in
+ the associations between the previous segment and this one.
+
+ Review: Think about whether we need to distinguish between before==kPosInfinity meaning
+ that the glyph is in the next segment vs. there is no association at all.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+void Segment::AdjustForOverlapsWithPrevSeg()
+{
+ if (m_psegPrev)
+ {
+ AdjustBeforeArrayFromPrevSeg();
+ m_psegPrev->AdjustAfterArrayFromNextSeg();
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ For any characters that are officially in this segment but are rendered in
+ the previous segment, initialize this segment's before array appropriately. Specifically,
+ set this segment's before value to something invalid--negative infinity, which will
+ never be overwritten.
+ OBSOLETE - replaced by AdjustAfterArrayFromNextSeg
+----------------------------------------------------------------------------------------------*/
+void Segment::InitBeforeArrayFromPrevSeg()
+{
+ Assert(m_psegPrev);
+
+ int ichwPrevMin = m_psegPrev->m_ichwMin;
+ int ichwPrevLim = m_psegPrev->m_ichwLim;
+// int ichwPrevContextLim =
+// m_psegPrev->m_ichwAssocsLim - m_psegPrev->m_ichwAssocsMin + m_psegPrev->m_ichwMin;
+ int cchwPrevAssocsMin = m_psegPrev->m_ichwAssocsMin;
+ int cchwPrevAssocsLim = m_psegPrev->m_ichwAssocsLim;
+
+ // Loop over associations appended to the end of the previous segment;
+ // ichwPrev and ichwThis are relative to the start of their respective segments.
+ for (int ichwPrev = ichwPrevLim - ichwPrevMin; ichwPrev < cchwPrevAssocsLim; ++ichwPrev)
+ {
+ int ichwThis = ichwPrev - (ichwPrevLim - ichwPrevMin); // relative to start of this seg
+ if (m_psegPrev->m_prgisloutBefore[ichwPrev - cchwPrevAssocsMin] < kPosInfinity)
+ // The "before" value is in the previous segment, so make this segment's
+ // before value invalid.
+ m_prgisloutBefore[ichwThis - m_ichwAssocsMin] = kNegInfinity;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ For any associations that overlap between the previous segment and this, adjust
+ this segment's before array appropriately. Specifically, for any characters that
+ are rendered in both, set this segment's before value to something invalid.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+void Segment::AdjustBeforeArrayFromPrevSeg()
+{
+ Assert(m_psegPrev);
+
+ int ichwPrevMin = m_psegPrev->m_ichwMin;
+ int ichwPrevLim = m_psegPrev->m_ichwLim;
+ int ichwPrevAssocsMin = m_psegPrev->m_ichwAssocsMin;
+ int ichwPrevAssocsLim = m_psegPrev->m_ichwAssocsLim;
+
+ // Loop over associations appended to the end of the previous segment
+ // (ie, rendered in the previous segment but officially in this one);
+ // ichwPrev and ichwThis are relative to the start of their respective segments.
+ for (int ichwPrev = ichwPrevLim - ichwPrevMin; ichwPrev < ichwPrevAssocsLim; ++ichwPrev)
+ {
+ int ichwThis = ichwPrev - (ichwPrevLim - ichwPrevMin); // relative to start of this seg
+ if (m_psegPrev->m_prgisloutBefore[ichwPrev - ichwPrevAssocsMin] < kPosInfinity)
+ // The "before" value is in the previous segment, so make this segment's
+ // before value invalid.
+ m_prgisloutBefore[ichwThis - m_ichwAssocsMin] = kNegInfinity;
+ }
+ // Loop over associations prepended to the start of this segment
+ // (ie, rendered in this segment but officially in the previous one);
+ // ichwPrev and ichwThis are relative to the start of their respective segments.
+ for (int ichwThis = m_ichwAssocsMin; ichwThis < 0; ++ichwThis)
+ {
+ int ichwPrev = ichwThis + (ichwPrevLim - ichwPrevMin);
+ if (m_psegPrev->m_prgisloutBefore[ichwPrev - ichwPrevAssocsMin] < kPosInfinity)
+ // The "before" value is in the previous segment, so make this segment's
+ // before value invalid.
+ m_prgisloutBefore[ichwThis - m_ichwAssocsMin] = kNegInfinity;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ For any associations that overlap between this segment and the next, adjust
+ this segment's after array appropriately. Specifically, for any characters that
+ are rendered in both, set this segment's after value to something invalid.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+void Segment::AdjustAfterArrayFromNextSeg()
+{
+ Assert(m_psegNext);
+
+ int ichwNextMin = m_psegNext->m_ichwMin;
+ int ichwNextContextMin = ichwNextMin + m_psegNext->m_ichwAssocsMin;
+ int ichwNextAssocsMin = m_psegNext->m_ichwAssocsMin;
+
+ // Loop over associations prepended to the beginning of the following segment
+ // (ie, rendered in the next segment but officially in this one);
+ // ichwThis and ichwNext are relative to the start of their respective segments.
+ for (int ichwNext = cchwNextAssocsMin; ichwNext < 0; ++ichwNext)
+ {
+ int ichwThis = ichwNext + (m_ichwLim - m_ichwMin);
+ if (m_psegNext->m_prgisloutAfter[ichwNext - ichwNextAssocsMin] > kNegInfinity)
+ // The "after" value is in the next segment, so make this segment's
+ // after value invalid.
+ m_prgisloutAfter[ichwThis - m_ichwAssocsMin] = kPosInfinity;
+ }
+
+ // Loop over associations appended to the end of this segment
+ // (ie, rendered in this segment but officially in the next one);
+ // ichwThis and ichwNext are relative to the start of their respective segments.
+ for (int ichwThis = m_ichwLim - m_ichwMin; ichwThis < m_cchwAssocsLim; ++ichwThis)
+ {
+ int ichwNext = ichwThis - (m_ichwLim - m_ichwMin);
+ if (m_psegNext->m_prgisloutAfter[ichwNext - ichwNextAssocsMin] > kNegInfinity)
+ // The "after" value is in the next segment, so make this segment's
+ // after value invalid.
+ m_prgisloutAfter[ichwThis - m_ichwAssocsMin] = kPosInfinity;
+ }
+}
+
+#endif // -------------------------- END OF OBSOLETE CODE ----------------------------------
+
+
+/*----------------------------------------------------------------------------------------------
+ Generate a list of all the glyphs that are attached to the base with the given index.
+ Note that we want to generate glyph indices, not slot indices.
+
+ @param disloutCluster - indicates how far on either side of the base to look.
+----------------------------------------------------------------------------------------------*/
+void Segment::ClusterMembersForGlyph(int isloutBase, int disloutCluster,
+ std::vector<int> & visloutRet)
+{
+ for (int islout = max(0, isloutBase - disloutCluster);
+ islout < min(m_cslout, isloutBase + disloutCluster + 1);
+ islout++)
+ {
+ if (islout == isloutBase)
+ continue; // don't include the base itself
+ GrSlotOutput * pslout = m_prgslout + islout;
+ if (pslout->ClusterBase() == isloutBase)
+ {
+ visloutRet.push_back(islout);
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Record an underlying-to-surface association mapping, based on the fact that there is
+ a corresponding surface-to-underlying association in the streams.
+
+ @param ichwUnder - character index relative to the official beginning of the segment
+ @param islotSurface - surface glyph it maps to
+----------------------------------------------------------------------------------------------*/
+void Segment::RecordSurfaceAssoc(int ichwUnder, int islotSurface, int nDir)
+{
+ // If we are recording an association across the line boundary, make sure there
+ // is space for it.
+ EnsureSpaceAtLineBoundaries(ichwUnder);
+
+ // For left-to-right chars, the before-value is the minimum of the previous
+ // and new values, and the after-value is the maximum.
+ if (nDir % 2 == 0)
+ {
+ // left-to-right
+ m_prgisloutBefore[ichwUnder - m_ichwAssocsMin] =
+ min(m_prgisloutBefore[ichwUnder - m_ichwAssocsMin], islotSurface);
+ m_prgisloutAfter[ ichwUnder - m_ichwAssocsMin] =
+ max(m_prgisloutAfter[ ichwUnder - m_ichwAssocsMin], islotSurface);
+ }
+ else
+ {
+ // right-to-left: the before-value is the max and the after-value is the min
+ m_prgisloutBefore[ichwUnder - m_ichwAssocsMin] =
+ max(m_prgisloutBefore[ichwUnder - m_ichwAssocsMin], islotSurface);
+ m_prgisloutAfter[ ichwUnder - m_ichwAssocsMin] =
+ min(m_prgisloutAfter[ ichwUnder - m_ichwAssocsMin], islotSurface);
+ }
+
+ m_prgpvisloutAssocs[ichwUnder - m_ichwAssocsMin]->push_back(islotSurface);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Record an underlying-to-surface ligature mapping, based on the fact that there is
+ a component.ref attribute in the surface stream. Note that if there was a previous
+ ligature value there, it will be overwritten.
+
+ @param ichwUnder - character index relative to the official beginning of the segment
+ @param islotSurface - surface glyph it maps to
+ @param iComponent - which component this glyph represents
+----------------------------------------------------------------------------------------------*/
+void Segment::RecordLigature(int ichwUnder, int islotSurface, int iComponent)
+{
+ // If we are recording a mapping across the line boundary, make sure there
+ // is space for it.
+ EnsureSpaceAtLineBoundaries(ichwUnder);
+
+ Assert(m_prgisloutLigature[ichwUnder - m_ichwAssocsMin] == kNegInfinity);
+
+ m_prgisloutLigature[ichwUnder - m_ichwAssocsMin] = islotSurface;
+ Assert(iComponent < kMaxComponentsPerGlyph);
+ m_prgiComponent[ ichwUnder - m_ichwAssocsMin] = sdata8(iComponent);
+}
+
+/*----------------------------------------------------------------------------------------------
+ The given slot is one that is rendered in the previous segment.
+ If it is associated with a character officially in this segment, mark the
+ before-association kNegInfinity.
+
+ @param ichwUnder - character index relative to the official beginning of the segment
+ @param islot - processed glyph it maps to
+----------------------------------------------------------------------------------------------*/
+void Segment::MarkSlotInPrevSeg(int ichwUnder, int islot)
+{
+ if (ichwUnder >= m_ichwAssocsMin)
+ m_prgisloutBefore[ichwUnder - m_ichwAssocsMin] = kNegInfinity;
+}
+
+/*----------------------------------------------------------------------------------------------
+ The given slot is one that is rendered in the following segment.
+ If it is associated with a character officially in this segment, mark the
+ after-association kPosInfinity.
+
+ @param ichwUnder - character index relative to the official beginning of the segment
+ @param islot - processed glyph it maps to
+----------------------------------------------------------------------------------------------*/
+void Segment::MarkSlotInNextSeg(int ichwUnder, int islot)
+{
+ if (ichwUnder < m_ichwAssocsLim)
+ m_prgisloutAfter[ichwUnder - m_ichwAssocsMin] = kPosInfinity;
+}
+
+/*----------------------------------------------------------------------------------------------
+ If we are recording an association across the line boundary (in either direction),
+ make sure there is space for it. This involves adding space to the beginning or
+ the end of the association arrays, and adjusting the min and lim indicators.
+----------------------------------------------------------------------------------------------*/
+void Segment::EnsureSpaceAtLineBoundaries(int ichwUnder)
+{
+ int cchwNewMin = min(ichwUnder, m_ichwAssocsMin);
+ int cchwNewLim = max(ichwUnder+1, m_ichwAssocsLim);
+ if (cchwNewMin < m_ichwAssocsMin || cchwNewLim > m_ichwAssocsLim)
+ {
+ // Make space either at the beginning or the end of the arrays.
+ int cchwPreAdd = m_ichwAssocsMin - cchwNewMin;
+ int cchwPostAdd = cchwNewLim - m_ichwAssocsLim;
+
+ int * prgisloutTmp = m_prgisloutBefore;
+ m_prgisloutBefore = new int[cchwNewLim - cchwNewMin];
+ std::copy(prgisloutTmp, prgisloutTmp + (m_ichwAssocsLim - m_ichwAssocsMin),
+ m_prgisloutBefore + cchwPreAdd);
+ delete[] prgisloutTmp;
+
+ prgisloutTmp = m_prgisloutAfter;
+ m_prgisloutAfter = new int[cchwNewLim - cchwNewMin];
+ std::copy(prgisloutTmp, prgisloutTmp + (m_ichwAssocsLim - m_ichwAssocsMin),
+ m_prgisloutAfter + cchwPreAdd);
+ delete[] prgisloutTmp;
+
+ std::vector<int> ** ppvisloutTmp = m_prgpvisloutAssocs;
+ m_prgpvisloutAssocs = new std::vector<int> * [cchwNewLim - cchwNewMin];
+ std::swap_ranges(m_prgpvisloutAssocs + cchwPreAdd,
+ m_prgpvisloutAssocs + cchwPreAdd +
+ (m_ichwAssocsLim - m_ichwAssocsMin), ppvisloutTmp);
+ delete[] ppvisloutTmp;
+
+ prgisloutTmp = m_prgisloutLigature;
+ m_prgisloutLigature = new int[cchwNewLim - cchwNewMin];
+ std::copy(prgisloutTmp, prgisloutTmp + (m_ichwAssocsLim - m_ichwAssocsMin),
+ m_prgisloutLigature + cchwPreAdd);
+ delete[] prgisloutTmp;
+
+ sdata8 * prgiCompTmp = m_prgiComponent;
+ m_prgiComponent = new sdata8[cchwNewLim - cchwNewMin];
+ std::copy(prgiCompTmp, prgiCompTmp + (m_ichwAssocsLim - m_ichwAssocsMin),
+ m_prgiComponent + cchwPreAdd);
+ delete[] prgiCompTmp;
+
+ // Initialize new slots.
+ int i;
+ for (i = 0; i < cchwPreAdd; ++i)
+ {
+ m_prgisloutBefore[i] = kPosInfinity;
+ m_prgisloutAfter[i] = kNegInfinity;
+ m_prgpvisloutAssocs[i] = new std::vector<int>;
+ m_prgisloutLigature[i] = kNegInfinity;
+ m_prgiComponent[i] = 0;
+ }
+ for (i = m_ichwAssocsLim - m_ichwAssocsMin + cchwPreAdd;
+ i < m_ichwAssocsLim - m_ichwAssocsMin + cchwPreAdd + cchwPostAdd;
+ ++i)
+ {
+ m_prgisloutBefore[i] = kPosInfinity;
+ m_prgisloutAfter[i] = kNegInfinity;
+ m_prgpvisloutAssocs[i] = new std::vector<int>;
+ m_prgisloutLigature[i] = kNegInfinity;
+ m_prgiComponent[i] = 0;
+ }
+ m_ichwAssocsMin = cchwNewMin;
+ m_ichwAssocsLim = cchwNewLim;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the given output slot.
+----------------------------------------------------------------------------------------------*/
+GrSlotOutput * Segment::OutputSlot(int islout)
+{
+ return m_prgslout + islout;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the rendering engine to the current one.
+----------------------------------------------------------------------------------------------*/
+void Segment::SetEngine(GrEngine * pgreng)
+{
+ //if (m_preneng)
+ // m_preneng->DecRefCount();
+ m_preneng = pgreng;
+ //if (m_preneng)
+ // m_preneng->IncRefCount();
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the font.
+----------------------------------------------------------------------------------------------*/
+void Segment::SetFont(Font * pfont)
+{
+ m_pfont = pfont->copyThis();
+
+// m_fBold = pfont->bold();
+// m_fItalic = pfont->italic();
+ // Note that we store the character height (which does not include the internal leading),
+ // not the actual font height, ie, ascent + descent. This is what is used in the LOGFONT.
+ pfont->getFontMetrics(NULL, NULL, &m_xysEmSquare); // m_xysEmSquare = m_pixHeight
+}
+
+/*----------------------------------------------------------------------------------------------
+ Switch the font out.
+ ??? Do we need to change the member variables too?
+----------------------------------------------------------------------------------------------*/
+void Segment::SwitchFont(Font * pfont)
+{
+ m_pfont = pfont;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the engine implementation if it is a proper GrEngine, or NULL otherwise.
+----------------------------------------------------------------------------------------------*/
+GrEngine * Segment::EngineImpl()
+{
+ return m_preneng;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the justification agent, in case this segment will ever need to be stretched
+ or shrunk.
+----------------------------------------------------------------------------------------------*/
+void Segment::SetJustifier(IGrJustifier * pgjus)
+{
+ m_pgjus = pgjus;
+ //if (pgjus)
+ // pgjus->JustifierObject(&m_pgjus);
+ //else
+ // m_pgjus = NULL;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set the graphics object to use the base font.
+----------------------------------------------------------------------------------------------*/
+//void Segment::SetToBaseFont(IGrGraphics * pgg)
+//{
+// if (m_fUseSepBase)
+// EngineImpl()->SwitchGraphicsFont(pgg, true);
+//}
+
+/*----------------------------------------------------------------------------------------------
+ Restore the graphics object to use the font that it originally had when passed in to
+ the interface method.
+----------------------------------------------------------------------------------------------*/
+//void Segment::RestoreFont(IGrGraphics * pgg)
+//{
+// if (m_fUseSepBase)
+// EngineImpl()->SwitchGraphicsFont(pgg, false);
+//}
+
+/*----------------------------------------------------------------------------------------------
+ Given a logical surface location, return the underlying position (relative to the
+ beginning of the string). NOTE that we are returning the index of the closest charater
+ (plus an indication of which side the click was on), not a position between characters.
+
+ @param islout - output slot
+ @param xsOffset - x coordinate of physical click, relative to left of glyph;
+ kPosInfinity means all the way to the right;
+ kNegInfinity means all the way to the left
+ @param ysOffset - y coordinate of physical click, relative to TOP of segment (NOT
+ upwards from baseline); kPosInfinity means all the way at
+ the top; kNegInfinity means all the way at the bottom
+ @param dxsGlyphWidth - width of glyph clicked on, or 0 if irrelevant
+ @param dysGlyphHeight - actually line height -- CURRENTLY NOT USED
+ @param pfAfter - return true if they clicked on trailing side; possibly NULL
+----------------------------------------------------------------------------------------------*/
+int Segment::LogicalSurfaceToUnderlying(int islout, float xsOffset, float ysClick,
+ float dxsGlyphWidth, float dysGlyphHeight, bool * pfAfter)
+{
+ Assert(islout >= 0);
+ Assert(islout < m_cslout);
+
+ GrSlotOutput * pslout = OutputSlot(islout);
+ bool fGlyphRtl = SlotIsRightToLeft(pslout);
+
+ int dichw;
+ bool fAfter, fRight;
+
+ float ysForGlyph = pslout->YPosition();
+
+ float dysFontAscent = m_dysFontAscent;
+ ////GrResult res = GetFontAscentSourceUnits(pgg, &dysFontAscent);
+ ////if (ResultFailed(res))
+ //// THROW(WARN(res));
+ dysFontAscent += m_dysXAscent;
+
+ float dysOffset = ysClick - (m_dysAscent - dysFontAscent); // relative to top of 0-baseline text
+
+ // If the slot has components, see if the offset falls within one of them.
+
+ if (pslout->NumberOfComponents() > 0)
+ {
+ GrEngine * pgreng = EngineImpl();
+ if (!pgreng)
+ goto LNotLigature;
+
+ GrGlyphTable * pgtbl = pgreng->GlyphTable();
+
+ for (int icomp = 0; icomp < pslout->NumberOfComponents(); icomp++)
+ {
+ float xsLeft, xsRight, ysTop, ysBottom;
+
+ // TODO: Rework ComponentIndexForGlyph to take slati rather than iForGlyph.
+ int slati = pslout->ComponentId(icomp);
+ int iForGlyph = pgtbl->ComponentIndexForGlyph(pslout->GlyphID(), slati);
+ if (!pgtbl->ComponentBoxLogUnits(m_xysEmSquare, pslout->GlyphID(), iForGlyph,
+ m_mFontEmUnits, m_dysAscent,
+ &xsLeft, &ysTop, &xsRight, &ysBottom))
+ {
+ continue; // component not defined
+ }
+ Assert(xsLeft <= xsRight);
+ Assert(ysTop <= ysBottom);
+ if (xsOffset < xsLeft || xsOffset > xsRight)
+ continue;
+ if ((dysOffset - ysForGlyph) < ysTop || (dysOffset - ysForGlyph) > ysBottom)
+ continue;
+
+ // Click was within the component's box.
+
+ dichw = pslout->UnderlyingComponent(icomp);
+ Assert(m_ichwMin + dichw >= 0);
+ Assert(dichw < m_dichwLim);
+
+ fRight = (xsOffset - xsLeft > xsRight - xsOffset);
+ fAfter = (fGlyphRtl) ? !fRight : fRight;
+ if (pfAfter)
+ *pfAfter = fAfter;
+
+ Assert(GrCharStream::AtUnicodeCharBoundary(m_pgts, m_ichwMin + dichw));
+
+ return m_ichwMin + dichw;
+ }
+ }
+
+LNotLigature:
+
+ // No relevant ligature component.
+ // If the x-offset is less than half way across,
+ // answer the before-association; otherwise answer the after-association.
+
+ if (xsOffset == kPosInfinity)
+ fRight = true;
+ else if (xsOffset == kNegInfinity)
+ fRight = false;
+ else
+ fRight = (xsOffset > (dxsGlyphWidth / 2));
+
+ fAfter = (fGlyphRtl) ? !fRight : fRight;
+
+ int diCharAdj = 0;
+ if (fAfter)
+ {
+ dichw = pslout->AfterAssoc();
+ if (pfAfter)
+ *pfAfter = true;
+ // The following should not be necessary because of the way associations are set up:
+ //while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichwBase + dichw + diCharAdj))
+ // diCharAdj++;
+ }
+ else
+ {
+ dichw = pslout->BeforeAssoc();
+ if (pfAfter)
+ *pfAfter = false;
+ // The following should not be necessary because of the way associations are set up:
+ //while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichwBase + dichw + diCharAdj))
+ // diCharAdj--;
+ }
+
+ if (dichw == kNegInfinity || dichw == kPosInfinity)
+ return dichw;
+
+ // This should be true because of the way the associations are set up:
+ Assert(GrCharStream::AtUnicodeCharBoundary(m_pgts, m_ichwMin + dichw)); // + diCharAdj));
+
+ return m_ichwMin + dichw + diCharAdj;
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+int Segment::LogicalSurfaceToUnderlying(int islout, bool fBefore)
+{
+ if (fBefore)
+ return LogicalSurfaceToUnderlying(islout, kNegInfFloat, kNegInfFloat);
+ else
+ return LogicalSurfaceToUnderlying(islout, kPosInfFloat, kPosInfFloat);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Given a physical surface location (an index into the glyph boxes),
+ return the underlying position, relative to the beginning of the string.
+
+ @param igbb - index of glyph
+ @param xsOffset - relative to left side of glyph
+ @param ysOffset - downwards from top of segment (not upwards from baseline)
+----------------------------------------------------------------------------------------------*/
+int Segment::PhysicalSurfaceToUnderlying(
+ int iginf, float xsOffset, float ysOffset,
+ float dxsGlyphWidth, float dysGlyphHeight, bool * pfAfter)
+{
+ int islout = iginf + m_isloutGinf0;
+ return LogicalSurfaceToUnderlying(islout, xsOffset, ysOffset,
+ dxsGlyphWidth, dysGlyphHeight, pfAfter);
+}
+
+/*--------------------------------------------------------------------------------------------*/
+
+int Segment::PhysicalSurfaceToUnderlying(int iginf, bool fBefore)
+{
+ int islout = iginf + m_isloutGinf0;
+ bool fGlyphRtl = SlotIsRightToLeft(OutputSlot(islout));
+ if (fBefore == fGlyphRtl)
+ return PhysicalSurfaceToUnderlying(iginf, kPosInfFloat, kPosInfFloat);
+ else
+ return PhysicalSurfaceToUnderlying(iginf, kNegInfFloat, kNegInfFloat);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Given an underlying position (relative to the beginning of the string),
+ return the logical surface location (ignoring right-to-left).
+ NOTE that ichw indicates a CHARACTER, not a location between characters. So ichw = 3,
+ fBefore = false indicates a selection between characters 3 and 4.
+ For surrogates, it indicates the FIRST of the pair of 16-bit chars.
+----------------------------------------------------------------------------------------------*/
+int Segment::UnderlyingToLogicalSurface(int ichw, bool fBefore)
+{
+ int ichwSegOffset = ichw - m_ichwMin;
+
+ if (ichwSegOffset < m_ichwAssocsMin)
+ return kNegInfinity; // probably rendered in previous segment
+
+
+ // if the buffers aren't even allocated, then it probably means there
+ // wasn't room for any glyphs, so the following segment is most likely
+// else if (ichwSegOffset >= m_ichwAssocsLim)
+ else if (ichwSegOffset >= m_ichwAssocsLim || !m_prgisloutBefore || !m_prgisloutAfter)
+ return kPosInfinity; // probably rendered in following segment
+
+ else if (fBefore)
+ {
+ int isloutRet;
+ int ichw = ichwSegOffset;
+ // If no association has been made, loop forward to the next slot
+ // we are before. As a last resort, answer kPosInfinity, meaning we
+ // aren't before anything.
+ do
+ {
+ isloutRet = m_prgisloutBefore[ichw - m_ichwAssocsMin];
+ do { ++ichw; }
+ while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichw));
+ } while (isloutRet == kPosInfinity && ichw < m_ichwAssocsLim);
+ return isloutRet;
+ }
+ else
+ {
+ int isloutRet;
+ int ichw = ichwSegOffset;
+ // If no association has been made, loop backward to the previous slot
+ // we are after. As a last resort, answer kNegInfinity, meaning we
+ // aren't after anything.
+ do
+ {
+ isloutRet = m_prgisloutAfter[ichw - m_ichwAssocsMin];
+ do { --ichw; }
+ while (!GrCharStream::AtUnicodeCharBoundary(m_pgts, ichw));
+ } while (isloutRet == kNegInfinity && ichw >= 0);
+ return isloutRet;
+ }
+ Assert(false); // should never reach here
+}
+
+/*----------------------------------------------------------------------------------------------
+ Given an underlying position (relative to the beginning of the string),
+ return the physical surface location, the index into m_prgginf.
+----------------------------------------------------------------------------------------------*/
+int Segment::UnderlyingToPhysicalSurface(int ichw, bool fBefore)
+{
+ int islout = UnderlyingToLogicalSurface(ichw, fBefore);
+ return LogicalToPhysicalSurface(islout);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Given a logical position (index into output slots), return the physical position,
+ the index into the list of glyphs (m_prgginf).
+----------------------------------------------------------------------------------------------*/
+int Segment::LogicalToPhysicalSurface(int islout)
+{
+ if (islout == kNegInfinity || islout == kPosInfinity)
+ return islout;
+
+ Assert(m_prgginf[islout - m_isloutGinf0].logicalIndex() == (unsigned)(islout - m_isloutGinf0));
+
+ return islout - m_isloutGinf0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Given an underlying position (relative to the beginning of the string),
+ return the physical surface locations of all the associated surface glyphs.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+#if 0
+void Segment::UnderlyingToPhysicalAssocs(int ichw, std::vector<int> & viginf)
+{
+ int ichwSegOffset = ichw - m_ichwMin;
+
+ if (ichwSegOffset < m_ichwAssocsMin)
+ return; // possibly rendered in previous segment
+
+ else if (ichwSegOffset >= m_ichwAssocsLim)
+ return; // possibly rendered in following segment
+
+ else
+ {
+ std::vector<int> * pvisloutTmp = &(m_prgvisloutAssocs[ichwSegOffset - m_ichwAssocsMin]);
+
+ for (size_t i = 0; i < pvisloutTmp->size(); i++)
+ {
+ int islout = (*pvisloutTmp)[i];
+ Assert(islout != kNegInfinity);
+ Assert(islout != kPosInfinity);
+ viginf.push_back(LogicalToPhysicalSurface(islout));
+ }
+ }
+}
+#endif
+
+/*----------------------------------------------------------------------------------------------
+ Given an underlying character position (relative to the beginning of the string),
+ return a pointer to the vector containing the logical surface locations of
+ all the associated surface glyphs.
+
+ Returns an empty vector (not something containing infinities) if the character is
+ "invisible."
+----------------------------------------------------------------------------------------------*/
+std::vector<int> Segment::UnderlyingToLogicalAssocs(int ichw)
+{
+ std::vector<int> vnEmpty;
+ vnEmpty.clear();
+ Assert(vnEmpty.size() == 0);
+
+ int ichwSegOffset = ichw - m_ichwMin;
+
+ if (ichwSegOffset < m_ichwAssocsMin)
+ return vnEmpty; // probably rendered in previous segment
+
+ else if (ichwSegOffset >= m_ichwAssocsLim)
+ return vnEmpty; // probably rendered in following segment
+
+ else if (m_prgpvisloutAssocs[ichwSegOffset - m_ichwAssocsMin] == NULL)
+ {
+ // Create a vector using the before and after values.
+ std::vector<int> visloutRet;
+ int isloutBefore = m_prgisloutBefore[ichwSegOffset - m_ichwAssocsMin];
+ int isloutAfter = m_prgisloutAfter[ichwSegOffset - m_ichwAssocsMin];
+ if (isloutBefore != kPosInfinity && isloutBefore != kNegInfinity)
+ visloutRet.push_back(isloutBefore);
+ if (isloutAfter != kPosInfinity && isloutAfter != kNegInfinity && isloutBefore != isloutAfter)
+ {
+ visloutRet.push_back(isloutAfter);
+ }
+ return visloutRet;
+ }
+ else
+ {
+ std::vector<int> * pvisloutRet = m_prgpvisloutAssocs[ichwSegOffset - m_ichwAssocsMin];
+ return *pvisloutRet;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Given an underlying character position (relative to the beginning of the string),
+ return an index of a slot in this segment that can used to test things like
+ InsertBefore. Don't return kNegInfinity or kPosInfinity except as a last resort.
+----------------------------------------------------------------------------------------------*/
+int Segment::UnderlyingToLogicalInThisSeg(int ichw)
+{
+ int isloutTest = kNegInfinity;
+ std::vector<int> vislout = UnderlyingToLogicalAssocs(ichw);
+ for (size_t iislout = 0; iislout < vislout.size(); iislout++)
+ {
+ isloutTest = vislout[iislout];
+ if (isloutTest != kNegInfinity && isloutTest != kPosInfinity)
+ return isloutTest;
+ }
+ return isloutTest;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the two characters map to exactly the same set of glyphs.
+----------------------------------------------------------------------------------------------*/
+bool Segment::SameSurfaceGlyphs(int ichw1, int ichw2)
+{
+ std::vector<int> vislout1 = UnderlyingToLogicalAssocs(ichw1);
+ std::vector<int> vislout2 = UnderlyingToLogicalAssocs(ichw2);
+
+ bool fRet = true;
+ if (vislout1.size() == 0 || vislout2.size() == 0)
+ fRet = false;
+ else if (vislout1.size() != vislout2.size())
+ fRet = false;
+ else
+ {
+ for (size_t islout = 0; islout < vislout1.size(); islout++)
+ {
+ if (vislout1[islout] != vislout2[islout])
+ {
+ fRet = false;
+ break;
+ }
+ }
+ }
+ return fRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the direction level of the given character.
+----------------------------------------------------------------------------------------------*/
+int Segment::DirLevelOfChar(int ichw, bool fBefore)
+{
+ if (m_twsh == ktwshOnlyWs)
+ return m_nDirDepth;
+ int islot = UnderlyingToLogicalSurface(ichw, fBefore);
+ if (islot == kNegInfinity || islot == kPosInfinity)
+ return 0;
+ int nDir = OutputSlot(islot)->DirLevel();
+ if (nDir == -1)
+ // Not calculated: assume to be the top direction level.
+ nDir = TopDirLevel();
+
+ return nDir;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return whether the given character is right-to-left.
+----------------------------------------------------------------------------------------------*/
+int Segment::CharIsRightToLeft(int ichw, bool fBefore)
+{
+ int nDir = DirLevelOfChar(ichw, fBefore);
+ return ((nDir % 2) != 0);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return whether the given slot is right-to-left.
+----------------------------------------------------------------------------------------------*/
+int Segment::SlotIsRightToLeft(GrSlotOutput * pslout)
+{
+ if (m_twsh == ktwshOnlyWs)
+ return (m_nDirDepth % 2);
+ int nDir = pslout->DirLevel();
+ if (nDir == -1)
+ nDir = TopDirLevel();
+ return (nDir % 2);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Check to make sure that the attachments are valid. Specifically, for every glyph that
+ is part of a cluster, all glyphs between that glyph and its root must (ultimately) have
+ that root glyph as one of its roots.
+ OBSOLETE
+----------------------------------------------------------------------------------------------*/
+void Segment::AssertValidClusters(GrSlotStream * psstrm)
+{
+#ifdef _DEBUG
+ for (int islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslotThis = psstrm->SlotAt(islot);
+ GrSlotState * pslotRoot = pslotThis->AttachRoot(psstrm);
+ if (!pslotRoot)
+ continue;
+ Assert(pslotRoot != pslotThis);
+
+ int inc = (pslotThis->PosPassIndex() > pslotRoot->PosPassIndex()) ? -1 : 1;
+
+ for (int islot2 = pslotThis->PosPassIndex() + inc;
+ islot2 != pslotRoot->PosPassIndex();
+ islot2 += inc)
+ {
+ GrSlotState * pslotMid = psstrm->SlotAt(islot2);
+ Assert(pslotMid->HasAsRoot(psstrm, pslotRoot));
+ }
+ }
+#endif // _DEBUG
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return information about (editing) clusters as appropriate for Uniscribe, ie, consistent
+ with the ScriptShape funciton.
+ A cluster includes all attachments, all clumps of characters created by insert = false,
+ and clumps of reordered glyphs.
+
+ prgiginfFirstOfCluster returns the first glyph of the cluster for each CHARACTER
+ (glyph indices returned are zero-based and refer to physical order--left-to-right, etc.).
+ pfClusterStart returns a flag for each GLYPH indicating whether it is the first (left-most)
+ of a cluster.
+ Both arrays are optional.
+ CORRECTION: for now we use strictly logical order. It's not clear whether physical
+ order is needed for right-to-left text or not. See note below.
+
+ TODO: convert from GlyphInfo objects which are RTL.
+----------------------------------------------------------------------------------------------*/
+GrResult Segment::getUniscribeClusters(
+ int * prgiginfFirstOfCluster, int cchMax, int * pcch,
+ bool * pfClusterStart, int cfMax, int * pcf)
+{
+ ChkGrOutPtr(pcch);
+ if (prgiginfFirstOfCluster)
+ ChkGrArrayArg(prgiginfFirstOfCluster, cchMax);
+ ChkGrOutPtr(pcf);
+ if (pfClusterStart)
+ ChkGrArrayArg(pfClusterStart, cfMax);
+
+ GrResult res = kresOk;
+
+ //SetUpGraphics(ichwBase, pgg, true);
+
+ if (m_dxsWidth == -1)
+ ComputeDimensions();
+
+ Assert(m_dxsWidth >= 0);
+ Assert(m_dysAscent >= 0);
+
+ if (pcch)
+ *pcch = m_dichwLim;
+ if (pcf)
+ *pcf = m_cginf;
+ if (cchMax < m_dichwLim)
+ {
+ if (cchMax == 0 && cfMax == 0)
+ res = kresFalse; // just asking for size information
+ else if (prgiginfFirstOfCluster || cchMax > 0)
+ res = kresInvalidArg; // not enough space
+ }
+ if (cfMax < m_cginf)
+ {
+ if (cchMax == 0 && cfMax == 0)
+ res = kresFalse;
+ else if (pfClusterStart || cfMax > 0)
+ res = kresInvalidArg;
+ }
+ if (res != kresOk)
+ {
+ //RestoreFont(pgg);
+ ReturnResult(res);
+ }
+
+ // Generate a pair of arrays, indicating the first and last (logical) slots
+ // of the cluster for each character. Initially clusters are based just on
+ // character-to-glyph associations, but they expand as we process
+ // insert=false settings, attachments, and reordering.
+
+ std::vector<int> visloutBefore;
+ std::vector<int> visloutAfter;
+ visloutBefore.resize(m_dichwLim);
+ visloutAfter.resize(m_dichwLim);
+
+ int ich;
+ for (ich = 0; ich < m_dichwLim; ich++)
+ {
+ visloutBefore[ich] = m_prgisloutBefore[ich - m_ichwAssocsMin];
+ visloutAfter[ich] = m_prgisloutAfter[ich - m_ichwAssocsMin];
+ }
+
+ if (m_dichwLim == 1)
+ {
+ // Only one character, therefore only one cluster.
+ visloutBefore[0] = m_isloutGinf0;
+ visloutAfter[0] = max(m_cginf - 1, 0) + m_isloutGinf0;
+ }
+ else
+ {
+ // Make all glyphs attached to each other part of a cluster, or glyphs where
+ // insertion is not allowed.
+ for (ich = 0; ich < m_dichwLim; ich++)
+ {
+ std::vector<int> vislout = UnderlyingToLogicalAssocs(ich + m_ichwMin);
+
+ if (vislout.size() == 0)
+ {
+ // No glyphs represent this character. Merge it with the previous
+ // character.
+ visloutBefore[ich] = (ich == 0) ? visloutBefore[ich + 1] : visloutBefore[ich - 1];
+ visloutAfter[ich] = (ich == 0) ? visloutAfter[ich + 1] : visloutAfter[ich - 1];
+ continue;
+ }
+
+ size_t iislout;
+ for (iislout = 0; iislout < vislout.size(); iislout++)
+ {
+ int islout = vislout[iislout];
+ if (!m_prgslout[islout].InsertBefore())
+ {
+ // This glyph does not allow insertion before it; make its character part
+ // of the same cluster as the previous character.
+ MergeUniscribeCluster(visloutBefore, visloutAfter, ich - 1, ich);
+/*
++ // Keith Stribley's fix:
++ // NOTE: this is NOT always the same as the previous character, so
++ // check whether the next character actually has a glyph before this
++ // one
++ if ((ich == m_dichwLim - 1) ||
++ (std::min(visloutBefore[ich + 1], visloutAfter[ich + 1]) >
++ std::max(visloutBefore[ich], visloutAfter[ich])))
++ {
++ MergeUniscribeCluster(visloutBefore, visloutAfter, ich - 1, ich);
++ }
++ else
++ MergeUniscribeCluster(visloutBefore, visloutAfter, ich, ich + 1);
+*/
+ }
+ else if (m_prgslout[islout].ClusterBase() != -1
+ && m_prgslout[islout].ClusterBase() != islout)
+ {
+ // This glyph is attached to something; make them part of the same cluster.
+ int isloutBase = m_prgslout[islout].ClusterBase();
+ int ichBase = LogicalSurfaceToUnderlying(isloutBase, false) - m_ichwMin;
+ MergeUniscribeCluster(visloutBefore, visloutAfter,
+ ich, ichBase);
+ int ichBase1 = LogicalSurfaceToUnderlying(isloutBase, false) - m_ichwMin;
+ if (ichBase1 != ichBase)
+ MergeUniscribeCluster(visloutBefore, visloutAfter,
+ ich, ichBase1);
+ }
+ }
+ }
+
+ // Handle reordering. Whenever the islout values get out of order, we need to
+ // merge into a single cluster.
+ for (ich = 0; ich < m_dichwLim - 1; ich++)
+ {
+ Assert(visloutBefore[ich] <= visloutAfter[ich]);
+ Assert(visloutBefore[ich] != kPosInfinity);
+ Assert(visloutBefore[ich] != kNegInfinity);
+ Assert(visloutAfter[ich] != kPosInfinity);
+ Assert(visloutAfter[ich] != kNegInfinity);
+ const int b1 = visloutBefore[ich];
+ const int a1 = visloutAfter[ich];
+ const int b2 = visloutBefore[ich + 1];
+ const int a2 = visloutAfter[ich + 1];
+ if (b1 == b2 && a1 == a2)
+ continue; // already a cluster
+
+ if (std::min(b2, a2) <= std::max(b1, a1))
+ {
+ MergeUniscribeCluster(visloutBefore, visloutAfter, ich, ich + 1);
+ }
+ }
+ }
+
+ if (pfClusterStart)
+ {
+ // Initialize.
+ int iginf;
+ for (iginf = 0; iginf < m_cginf; iginf++)
+ pfClusterStart[iginf] = false;
+ }
+
+ // To skip line-break slots; remember that the number of output slots equals the
+ // number of gbbs plus initial and/or final line-break slots if any.
+ // In this case the beginning of the first cluster indicates the first real glyph.
+ int isloutFirstReal = (m_dichwLim) ? ((m_fWsRtl)? visloutAfter[0] : visloutBefore[0]) : 0;
+
+ // Kludge to make assertions below easier:
+ if (m_dichwLim > 0)
+ {
+ visloutBefore.push_back(visloutAfter.back() + 1);
+ visloutAfter.push_back(visloutAfter.back() + 1);
+ }
+
+ // Convert (logical) slots to actual glyphs.
+ for (ich = 0; ich < m_dichwLim; ich++)
+ {
+ // NOTE: to treat the first of the cluster as the left-most, use visloutAfter for
+ // right-to-left situations.
+
+ if (prgiginfFirstOfCluster)
+ prgiginfFirstOfCluster[ich]
+ = LogicalToPhysicalSurface((m_fWsRtl) ? visloutAfter[ich] : visloutBefore[ich]);
+ int clusterStartPos = ((m_fWsRtl) ? visloutAfter[ich] : visloutBefore[ich]) - isloutFirstReal;
+ if (pfClusterStart)
+ pfClusterStart[clusterStartPos] = true;
+
+ Assert((visloutBefore[ich] == visloutBefore[ich + 1] &&
+ visloutAfter[ich] == visloutAfter[ich + 1])
+ || (visloutBefore[ich] <= visloutAfter[ich] &&
+ visloutAfter[ich] < visloutBefore[ich + 1]));
+ }
+
+ //RestoreFont(pgg);
+
+ return kresOk;
+}
+
+
+// suppress GCC 4.3 warning for optimized min()/max() when called with (ich, ich+1) or similar
+#pragma GCC diagnostic ignored "-Wstrict-overflow"
+
+/*----------------------------------------------------------------------------------------------
+ Merge the given characters into the same Uniscribe cluster. This means merging any
+ intervening characters as well.
+----------------------------------------------------------------------------------------------*/
+void Segment::MergeUniscribeCluster(
+ std::vector<int> & visloutBefore, std::vector<int> & visloutAfter,
+ int ich1, int ich2)
+{
+ int ichStartOrig = min(ich1, ich2);
+ int ichStopOrig = max(ich1, ich2);
+
+ int isloutMin = visloutBefore[ichStopOrig];
+ int isloutMax = visloutAfter[ichStartOrig];
+
+ int ichStart = ichStopOrig;
+ int ichStop = ichStartOrig;
+ // Find the beginning of the cluster.
+ while (ichStart > 0 &&
+ (ichStart > ichStartOrig
+ || visloutBefore[ichStart - 1] >= visloutBefore[ichStopOrig]
+ || visloutBefore[ichStart - 1] == visloutBefore[ichStart]))
+ {
+ ichStart--;
+ isloutMin = std::min(isloutMin, visloutBefore[ichStart]);
+ isloutMax = std::max(isloutMax, visloutAfter[ichStart]);
+ }
+ // Find end of cluster.
+ while (ichStop < m_dichwLim - 1 &&
+ (ichStop < ichStopOrig
+ || visloutAfter[ichStop + 1] <= visloutAfter[ichStartOrig]
+ || visloutAfter[ichStop + 1] == visloutAfter[ichStop]))
+ {
+ ichStop++;
+ isloutMin = std::min(isloutMin, visloutBefore[ichStop]);
+ isloutMax = std::max(isloutMax, visloutAfter[ichStop]);
+ }
+
+ int ich;
+ for (ich = ichStart; ich <= ichStop; ich++)
+ {
+ visloutBefore[ich] = isloutMin;
+ visloutAfter[ich] = isloutMax;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return information about the positioning of glyphs as appropriate for Uniscribe.
+ The advance widths returned are the natural ones (what would be applied if no smart
+ rendering were happening), and the x-offsets are the difference between the
+ natural location of the glyph and what is produced by Graphite. The y-offset
+ is the same as GetGlyphsAndPositions.
+
+ This is an experimental method. Its behavior may change signficantly in the future.
+----------------------------------------------------------------------------------------------*/
+/*
+GrResult Segment::GetUniscribePositions(
+ Rect rs, Rect rd, int cgidMax, int *pcgidRet,
+ float * prgxd, float * prgyd, float * prgdxdAdv)
+{
+ ChkGrOutPtr(pcgidRet);
+ ChkGrArrayArg(prgxd, cgidMax);
+ ChkGrArrayArg(prgyd, cgidMax);
+ ChkGrArrayArg(prgdxdAdv, cgidMax);
+
+ GrResult res;
+
+ //SetUpGraphics(ichBase, pgg, true);
+
+ Assert(m_dxsWidth >= 0);
+ Assert(m_dysAscent >= 0);
+
+ *pcgidRet = m_cginf;
+ if (cgidMax < m_cginf)
+ {
+ res = (cgidMax == 0) ? kresFalse : kresInvalidArg;
+ //RestoreFont(pgg);
+ ReturnResult(res);
+ }
+
+ if (m_dxsWidth < 0)
+ ComputeDimensions();
+
+ float * rgxdTmp = new float[cgidMax];
+ float * rgdxdAdvTmp = new float[cgidMax];
+ res = GetGlyphsAndPositions(rs, rd, cgidMax, pcgidRet,
+ NULL, rgxdTmp, prgyd, rgdxdAdvTmp);
+ if (ResultFailed(res))
+ {
+ delete[] rgxdTmp;
+ delete[] rgdxdAdvTmp;
+ //RestoreFont(pgg);
+ ReturnResult(res);
+ }
+
+ float xdLeft = SegmentPainter::ScaleX(0, rs, rd);
+ float xdXPosNatural = xdLeft;
+ for (int iginf = 0; iginf < *pcgidRet; iginf++)
+ {
+ int islout = iginf + m_isloutGinf0;
+ GrSlotOutput * pslout = OutputSlot(islout);
+ float dxsAdvNatural = pslout->AdvanceXMetric();
+ float dxdAdvNatural = SegmentPainter::ScaleX(dxsAdvNatural, rs, rd) - xdLeft;
+ prgdxdAdv[iginf] = dxdAdvNatural;
+ prgxd[iginf] = rgxdTmp[iginf] - xdXPosNatural;
+
+ xdXPosNatural += dxdAdvNatural;
+ }
+
+ delete[] rgxdTmp;
+ delete[] rgdxdAdvTmp;
+
+ //RestoreFont(pgg);
+
+ ReturnResult(res);
+
+}
+*/
+
+/*----------------------------------------------------------------------------------------------
+ Return information about the positioning of glyphs as appropriate for Uniscribe.
+ The advance widths returned are the natural ones (what would be applied if no smart
+ rendering were happening), and the x-offsets are the difference between the
+ natural location of the glyph and what is produced by Graphite. The y-offset
+ is the same as GetGlyphsAndPositions.
+
+ This is an experimental method. Its behavior may change signficantly in the future.
+----------------------------------------------------------------------------------------------*/
+/*
+GrResult Segment::GetUniscribeGlyphsAndPositions(
+ Rect rs, Rect rd, int cgidMax, int *pcgidRet, utf16 * prgchGlyphs,
+ float * prgxd, float * prgyd, float * prgdxdAdv)
+{
+ ChkGrOutPtr(pcgidRet);
+ ChkGrArrayArg(prgxd, cgidMax);
+ ChkGrArrayArg(prgyd, cgidMax);
+ ChkGrArrayArg(prgdxdAdv, cgidMax);
+
+ GrResult res;
+
+ //SetUpGraphics(ichBase, pgg, true);
+
+ Assert(m_dxsWidth >= 0);
+ Assert(m_dysAscent >= 0);
+
+ *pcgidRet = m_cginf;
+ if (cgidMax < m_cginf)
+ {
+ res = (cgidMax == 0) ? kresFalse : kresInvalidArg;
+ //RestoreFont(pgg);
+ ReturnResult(res);
+ }
+
+ if (m_dxsWidth < 0)
+ ComputeDimensions();
+
+ float * rgxdTmp = new float[cgidMax];
+ float * rgdxdAdvTmp = new float[cgidMax];
+ res = GetGlyphsAndPositions(rs, rd, cgidMax, pcgidRet,
+ prgchGlyphs, rgxdTmp, prgyd, rgdxdAdvTmp);
+ if (ResultFailed(res))
+ {
+ delete[] rgxdTmp;
+ delete[] rgdxdAdvTmp;
+ //RestoreFont(pgg);
+ ReturnResult(res);
+ }
+
+ float xdLeft = SegmentPainter::ScaleX(0, rs, rd);
+ float xdXPosNatural = xdLeft;
+ for (int iginf = 0; iginf < *pcgidRet; iginf++)
+ {
+ int islout = iginf + m_isloutGinf0;
+ GrSlotOutput * pslout = OutputSlot(islout);
+ float dxsAdvNatural = pslout->AdvanceXMetric();
+ float dxdAdvNatural = SegmentPainter::ScaleX(dxsAdvNatural, rs, rd) - xdLeft;
+ prgdxdAdv[iginf] = dxdAdvNatural;
+ prgxd[iginf] = rgxdTmp[iginf] - xdXPosNatural;
+
+ xdXPosNatural += dxdAdvNatural;
+ }
+
+ delete[] rgxdTmp;
+ delete[] rgdxdAdvTmp;
+
+ //RestoreFont(pgg);
+
+ ReturnResult(res);
+}
+*/
+
+/*----------------------------------------------------------------------------------------------
+ Return the visual box for the given ligature component. Return (0,0,0,0) if the component
+ is not defined.
+----------------------------------------------------------------------------------------------*/
+Rect Segment::ComponentRect(GrSlotOutput * pslout, int icomp)
+{
+ Rect rectRet;
+ rectRet.top = rectRet.bottom = rectRet.left = rectRet.right = 0;
+ if (icomp < 0 || icomp > pslout->NumberOfComponents())
+ return rectRet;
+
+ GrEngine * pgreng = EngineImpl();
+ if (!pgreng)
+ return rectRet;
+ GrGlyphTable * pgtbl = pgreng->GlyphTable();
+ if (!pgtbl)
+ return rectRet;
+
+ float xsLeft, xsRight, ysTop, ysBottom;
+
+ // TODO: Rework ComponentIndexForGlyph to take slati rather than iForGlyph.
+ int slati = pslout->ComponentId(icomp);
+ int iForGlyph = pgtbl->ComponentIndexForGlyph(pslout->GlyphID(), slati);
+ if (!pgtbl->ComponentBoxLogUnits(m_xysEmSquare, pslout->GlyphID(), iForGlyph,
+ m_mFontEmUnits, m_dysAscent,
+ &xsLeft, &ysTop, &xsRight, &ysBottom,
+ false)) // origin is baseline
+ {
+ return rectRet;
+ }
+ rectRet.top = ysTop;
+ rectRet.bottom = ysBottom;
+ rectRet.left = xsLeft;
+ rectRet.right = xsRight;
+
+ return rectRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Shift the glyphs physically by the given amount. This happens when a right-to-left
+ segment is changed from being end-of-line to not, so we have to account for the fact
+ that the trailing white-space was previous invisible but is now visible.
+----------------------------------------------------------------------------------------------*/
+void Segment::ShiftGlyphs(float dxsShift)
+{
+ for (int islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * pslout = OutputSlot(islout);
+ pslout->AdjustPosXBy(dxsShift);
+ }
+
+ //ShiftGlyphsPlatform(dxsShift);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Find the glyph that best matches the given click location.
+
+ @param xsClick - relative to start of segment
+ @param ysClick - relative to segment baseline
+----------------------------------------------------------------------------------------------*/
+int Segment::GlyphHit(float xsClick, float ysClick)
+{
+ float xsLeft = kPosInfFloat;
+ float xsRight = kNegInfFloat;
+
+ int iginf;
+ for (iginf = 0; iginf < m_cginf; iginf++)
+ {
+ GlyphInfo * pginf = m_prgginf + iginf;
+ xsLeft = min(xsLeft, pginf->origin());
+ xsRight = max(xsRight, pginf->origin() + pginf->advanceWidth());
+ }
+
+ if (xsClick < xsLeft)
+ return m_fWsRtl ? m_cginf - 1 : 0;
+ else if (xsClick > xsRight)
+ return m_fWsRtl ? 0 : m_cginf - 1;
+
+ int iginfHit;
+ std::vector<int> viginfNear;
+ std::vector<int> viginfHit;
+ std::vector<int> viginfInside;
+
+ // Find glyph which might contain click point.
+
+ for (iginfHit = m_cginf; iginfHit-- > 0; )
+ {
+ if (m_fWsRtl)
+ {
+ if (m_prgginf[iginfHit].bb().right >= xsClick)
+ break;
+ }
+ else
+ {
+ if (m_prgginf[iginfHit].bb().left <= xsClick)
+ break;
+ }
+ }
+ if (iginfHit < 0) // click within lsb of first glyph
+ {
+ return 0;
+ }
+
+ // Find all BB that OVERLAP the click point (bb.left < XClick < bb.right).
+ for (iginf = iginfHit; iginf >= 0; iginf--)
+ {
+ Rect rectBB = m_prgginf[iginf].bb();
+ if (rectBB.left <= xsClick && xsClick <= rectBB.right)
+ {
+ viginfNear.push_back(iginf);
+ }
+ }
+
+ // Find all BB that CONTAIN the click point (considering the click's Y coor too).
+ int iiginf;
+ for (iiginf = 0; iiginf < (int)viginfNear.size(); iiginf++)
+ {
+ Rect rectBB = m_prgginf[viginfNear[iiginf]].bb();
+ if (rectBB.bottom <= ysClick && ysClick <= rectBB.top)
+ {
+ viginfHit.push_back(viginfNear[iiginf]);
+ }
+ }
+
+ if (viginfNear.size() > 2 && viginfHit.size() == 0)
+ {
+ // No hit along y-axis; find the closest thing.
+ float dy = float(10000000.0);
+ for (int iiginf2 = 0; iiginf2 < (int)viginfNear.size(); iiginf2++)
+ {
+ Rect rectBB = m_prgginf[viginfNear[iiginf2]].bb();
+ if (fabsf(rectBB.top - ysClick) < dy)
+ {
+ dy = fabsf(rectBB.top - ysClick);
+ viginfHit.clear();
+ viginfHit.push_back(viginfNear[iiginf2]);
+ }
+ if (fabsf(rectBB.bottom - ysClick) < dy)
+ {
+ dy = fabsf(rectBB.bottom - ysClick);
+ viginfHit.clear();
+ viginfHit.push_back(viginfNear[iiginf2]);
+ }
+ }
+ }
+
+ // Find all BB for which the click is within their advance width, if any.
+ for (iiginf = 0; iiginf < (int)viginfHit.size(); iiginf++)
+ {
+ //Rect rectBB = m_prgginf[viginfHit[iiginf]].bb(); -- ?? this tests the bounding box again :-/
+ //if (rectBB.left <= xsClick && xsClick <= rectBB.right)
+ gr::GlyphInfo * pginf = m_prgginf + viginfHit[iiginf];
+ if (pginf->advanceWidth() == 0 // advance width is irrelevant
+ || (pginf->origin() < xsClick && xsClick <= pginf->origin() + pginf->advanceWidth()))
+ {
+ viginfInside.push_back(viginfHit[iiginf]);
+ }
+ }
+
+ // If no BB coincides in any way with the click point, take the BB whose leading edge
+ // is closest to the click point.
+ // There could be more than one BB with the same leading x coor.
+ if (viginfHit.size() == 0 && viginfNear.size() == 0 && viginfInside.size() == 0)
+ {
+ float xsLeading;
+ if (iginfHit + 1 == m_cginf)
+ {
+ viginfNear.push_back(iginfHit);
+ }
+ else if (!m_fWsRtl)
+ {
+ // Left-to-right:
+ xsLeading = m_prgginf[iginfHit + 1].bb().left;
+ for (iginf = iginfHit + 1; iginf < m_cginf; iginf++)
+ {
+ if (m_prgginf[iginf].bb().left == xsLeading)
+ viginfNear.push_back(iginf);
+ }
+ }
+ else
+ {
+ // Right-to-left:
+ xsLeading = m_prgginf[iginfHit].bb().right;
+ for (iginf = iginfHit; iginf < m_cginf; iginf++)
+ {
+ if (m_prgginf[iginf].bb().right == xsLeading)
+ viginfNear.push_back(iginf);
+ }
+ }
+ }
+
+ Assert(viginfNear.size());
+
+ int iginfLoc;
+
+ // Select the BB based on its leading edge, offset from baseline, position in final pass.
+ if (viginfInside.size())
+ iginfLoc = SelectBb(viginfInside, m_fWsRtl);
+ else if (viginfHit.size())
+ iginfLoc = SelectBb(viginfHit, m_fWsRtl);
+ else
+ iginfLoc = SelectBb(viginfNear, m_fWsRtl);
+
+ return iginfLoc;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Select the bounding box we will use for a mouse hit.
+ First select any glyph with a significantly smaller bounding box.
+ Then, select the BB with the left-most (LTR) or right-most (RTL) edge.
+ If more than one BB has same edge of interest, select the one that is closest to the
+ the baseline.
+ If that is a tie, select the one with the lowest islout.
+
+ @param vigbb - list of indexes into m_prggbb
+ @param fRTL - writing system direction
+----------------------------------------------------------------------------------------------*/
+int Segment::SelectBb(std::vector<int> & viginf, bool fRTL)
+{
+ if (!viginf.size())
+ {
+ Assert(false);
+ return -1;
+ }
+
+ if (viginf.size() == 1)
+ return viginf[0];
+
+ // Find a glyph that has a signficantly smaller bounding box.
+ // The idea is that it is going to be harder to hit than the bigger glyph.
+ float smallestArea = float(1000000000.0);
+ float largestArea = 0.0;
+ size_t iiginfSmallest = 0;
+ size_t iiginf;
+ for (iiginf = 0; iiginf < viginf.size(); iiginf++)
+ {
+ gr::GlyphInfo * pginf = m_prgginf + viginf[iiginf];
+ Rect rectBB = pginf->bb();
+ float thisArea = (rectBB.right - rectBB.left) * (rectBB.top - rectBB.bottom);
+ if (smallestArea > thisArea)
+ {
+ smallestArea = thisArea;
+ iiginfSmallest = iiginf;
+ }
+ largestArea = max(largestArea, thisArea);
+ }
+ if (smallestArea * 2.0 < largestArea)
+ return viginf[iiginfSmallest];
+
+ // Find appropriate x coor of leading edge.
+ float xsLeading;
+ if (!fRTL)
+ xsLeading = m_prgginf[viginf[0]].bb().left;
+ else
+ xsLeading = m_prgginf[viginf[0]].bb().right;
+
+ for (iiginf = 1; iiginf < viginf.size(); iiginf++)
+ {
+ Rect rectBB = m_prgginf[viginf[iiginf]].bb();
+ if (!fRTL)
+ xsLeading = min(xsLeading, rectBB.left);
+ else
+ xsLeading = max(xsLeading, rectBB.right);
+ }
+
+ // Find BBs with the leading edge.
+ std::vector<int> viginfSameEdge;
+ for (iiginf = 0; iiginf < viginf.size(); iiginf++)
+ {
+ Rect rectBB = m_prgginf[viginf[iiginf]].bb();
+ if (!fRTL)
+ {
+ if (rectBB.left == xsLeading)
+ viginfSameEdge.push_back(viginf[iiginf]);
+ }
+ else
+ {
+ if (rectBB.right == xsLeading)
+ viginfSameEdge.push_back(viginf[iiginf]);
+ }
+ }
+
+ if (viginfSameEdge.size() == 1)
+ return viginfSameEdge[0];
+
+ // Find minimum distance from baseline.
+ float ysMin = fabsf(m_prgginf[viginfSameEdge[0]].yOffset());
+ for (iiginf = 1; iiginf < viginfSameEdge.size(); iiginf++)
+ {
+ float ysThis = fabsf(m_prgginf[viginfSameEdge[iiginf]].yOffset());
+ ysMin = min(ysMin, ysThis);
+ }
+
+ // Find BBs with minimum distance from baseline.
+ std::vector<int> viginfSameY;
+ for (iiginf = 0; iiginf < viginfSameEdge.size(); iiginf++)
+ {
+ if (fabsf(m_prgginf[viginfSameEdge[iiginf]].yOffset()) == ysMin)
+ viginfSameY.push_back(viginfSameEdge[iiginf]);
+ }
+
+ if (viginfSameY.size() == 1)
+ return viginfSameY[0];
+
+ // Find minimum index of current candidates.
+ int islout = m_prgginf[viginfSameY[0]].logicalIndex();
+ for (iiginf = 1; iiginf < viginfSameY.size(); iiginf++)
+ {
+ int isloutThis = m_prgginf[viginfSameY[iiginf]].logicalIndex();
+ islout = min(islout, isloutThis);
+ }
+
+ // Find BB with minimum islout - islout should be unique for all glyphs.
+ for (iiginf = 0; iiginf < viginfSameY.size(); iiginf++)
+ {
+ if (m_prgginf[viginfSameY[iiginf]].logicalIndex() == (unsigned)islout)
+ return viginfSameY[iiginf];
+ }
+
+ Assert(false);
+ return -1; // needed to stop compiler warning
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the right-most glyph on the physical surface. If there are ties, it will
+ prefer the one that is logically closest to the edge.
+----------------------------------------------------------------------------------------------*/
+int Segment::RightMostGlyph()
+{
+ float xsRight = kNegInfFloat;
+ int iginfRet = -1;
+ for (int iginf = 0; iginf < m_cginf; iginf++)
+ {
+ float xsThis = m_prgginf[iginf].bb().right;
+ // For RTL, we prefer the glyph that is logically first; for LTR we prefer logically last.
+ if (xsThis > xsRight || (!m_fWsRtl && xsRight == xsThis))
+ {
+ xsRight = xsThis;
+ iginfRet = iginf;
+ }
+ }
+ return iginfRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the left-most glyph on the physical surface. If there are ties, it will
+ prefer the one that is logically closest to the edge.
+----------------------------------------------------------------------------------------------*/
+int Segment::LeftMostGlyph()
+{
+ float xsLeft = kPosInfFloat;
+ int iginfRet = -1;
+ for (int iginf = 0; iginf < m_cginf; iginf++)
+ {
+ float xsThis = m_prgginf[iginf].bb().left;
+ // For RTL, we prefer the glyph that is logically last; for LTR we prefer logically first.
+ if (xsThis < xsLeft || (m_fWsRtl && xsLeft == xsThis))
+ {
+ xsLeft = xsThis;
+ iginfRet = iginf;
+ }
+ }
+ return iginfRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Convert from em-units to logical units.
+----------------------------------------------------------------------------------------------*/
+float Segment::EmToLogUnits(int m)
+{
+ return GrEngine::GrIFIMulDiv(m, m_xysEmSquare, m_mFontEmUnits);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the line-break pseudo glyph ID.
+----------------------------------------------------------------------------------------------*/
+gid16 Segment::LBGlyphID()
+{
+ return m_preneng->LBGlyphID();
+}
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/SegmentAux.cpp b/Build/source/libs/graphite/src/segment/SegmentAux.cpp
new file mode 100644
index 00000000000..9191e8724d5
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/SegmentAux.cpp
@@ -0,0 +1,256 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2005 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: SegmentAux.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Implements auxiliary class that work with Segment:
+ - GlyphInfo
+ - GlyphIterator
+ - LayoutEnvironment
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+// any other headers (not precompiled)
+#ifndef _WIN32
+#include <stdlib.h>
+#endif
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> GlyphInfo methods
+//:>********************************************************************************************
+
+gid16 GlyphInfo::glyphID()
+{
+ return m_pslout->m_chwActual;
+}
+
+gid16 GlyphInfo::pseudoGlyphID()
+{
+ if (m_pslout->m_chwActual == m_pslout->m_chwGlyphID)
+ return 0; // not a pseudo-glyph
+ return m_pslout->m_chwGlyphID;
+}
+
+bool GlyphInfo::isAttached() const throw()
+{
+ return m_pslout->IsPartOfCluster();
+}
+
+gr::GlyphIterator GlyphInfo::attachedClusterBase() const throw()
+{
+ const int islout = m_pslout->ClusterBase();
+
+ // Since we are not passing an array, the constructor expects a ginf index, not a slout index.
+ return GlyphIterator(*m_pseg, ((islout >= 0) ? islout : m_islout) - m_pseg->m_isloutGinf0);
+}
+
+float GlyphInfo::attachedClusterAdvance() const throw()
+{
+ return m_pslout->ClusterAdvance();
+}
+
+std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> GlyphInfo::attachedClusterGlyphs() const
+{
+ std::vector<int> visloutClusterMembers;
+ m_pslout->ClusterMembers(m_pseg, m_islout, visloutClusterMembers);
+ RcVector * qvislout = new RcVector(visloutClusterMembers);
+ return std::make_pair(
+ GlyphSetIterator(*m_pseg, 0, qvislout),
+ GlyphSetIterator(*m_pseg, visloutClusterMembers.size(), qvislout));
+}
+
+size_t GlyphInfo::logicalIndex()
+{
+ if (m_pseg->OutputSlot(0)->IsLineBreak())
+ return m_islout - 1;
+ else
+ return m_islout;
+}
+
+float GlyphInfo::origin()
+{
+ return m_pslout->XPosition();
+}
+
+float GlyphInfo::advanceWidth() // logical units
+{
+ return m_pslout->m_xsAdvanceX;
+}
+
+float GlyphInfo::advanceHeight() // logical units; zero for horizontal fonts
+{
+ Font & font = m_pseg->getFont();
+ return m_pslout->GlyphMetricLogUnits(&font, kgmetAdvHeight);
+}
+
+float GlyphInfo::yOffset()
+{
+ return m_pslout->YPosition();
+}
+
+Rect GlyphInfo::bb() // logical units
+{
+ return m_pslout->BoundingBox(m_pseg->getFont());
+}
+
+bool GlyphInfo::isSpace()
+{
+ return m_pslout->IsSpace();
+}
+
+// first char associated with this glyph, relative to start of the text-source
+toffset GlyphInfo::firstChar()
+{
+ return m_pseg->LogicalSurfaceToUnderlying(m_islout, true);
+}
+
+// last char associated with this glyph, relative to start of the text-source
+toffset GlyphInfo::lastChar()
+{
+ return m_pseg->LogicalSurfaceToUnderlying(m_islout, false);
+}
+
+unsigned int GlyphInfo::directionality()
+{
+ return m_pslout->Directionality();
+}
+
+// Embedding depth
+unsigned int GlyphInfo::directionLevel()
+{
+ return m_pslout->DirLevel();
+}
+
+bool GlyphInfo::insertBefore()
+{
+ return m_pslout->InsertBefore();
+}
+
+int GlyphInfo::breakweight()
+{
+ return m_pslout->BreakWeight();
+}
+
+float GlyphInfo::maxStretch(size_t level)
+{
+ return m_pslout->MaxStretch(m_pseg, (int)level);
+}
+
+float GlyphInfo::maxShrink(size_t level)
+{
+ return m_pslout->MaxShrink(m_pseg, (int)level);
+}
+
+float GlyphInfo::stretchStep(size_t level)
+{
+ return m_pslout->StretchStep(m_pseg, (int)level);
+}
+
+byte GlyphInfo::justWeight(size_t level)
+{
+ return byte(m_pslout->JustWeight((int)level));
+}
+
+float GlyphInfo::justWidth(size_t level)
+{
+ return m_pslout->JustWidth(m_pseg, (int)level);
+}
+
+float GlyphInfo::measureStartOfLine()
+{
+ return m_pslout->MeasureSolLogUnits(m_pseg);
+}
+
+float GlyphInfo::measureEndOfLine()
+{
+ return m_pslout->MeasureEolLogUnits(m_pseg);
+}
+
+size_t GlyphInfo::numberOfComponents()
+{
+ return m_pslout->NumberOfComponents();
+}
+
+Rect GlyphInfo::componentBox(size_t icomp)
+{
+ return m_pseg->ComponentRect(m_pslout, icomp);
+}
+
+toffset GlyphInfo::componentFirstChar(size_t icomp)
+{
+ Assert((int)icomp < m_pslout->NumberOfComponents());
+ return m_pslout->UnderlyingComponent(icomp) + m_pseg->startCharacter();
+}
+toffset GlyphInfo::componentLastChar(size_t icomp)
+{
+ Assert((int)icomp < m_pslout->NumberOfComponents());
+ return m_pslout->UnderlyingComponent(icomp) + m_pseg->startCharacter();
+}
+
+bool GlyphInfo::erroneous()
+{
+ return m_pseg->Erroneous();
+}
+
+
+//:>********************************************************************************************
+//:> GlyphIterator methods
+//:>********************************************************************************************
+
+// Constructor
+GlyphIterator::GlyphIterator(Segment & seg, size_t iginf)
+: m_pginf(seg.m_prgginf + iginf)
+{}
+
+// Copy constructor.
+// Check if the incoming iterator is null, as we cannot dereference
+// it to get the segment, and create a null GlyphIterator.
+// Technically this might better be an assert as converting a null
+// GlyphSetIterator into a null GlyphIterator is pointless and suggests
+// some kind of error.
+GlyphIterator::GlyphIterator(const GlyphSetIterator & sit)
+: m_pginf((sit == GlyphSetIterator())
+ ? 0
+ : sit->segment().m_prgginf + sit->logicalIndex())
+{}
+
+/*----------------------------------------------------------------------------------------------
+ Dereference the iterator, returning a GlyphInfo object.
+----------------------------------------------------------------------------------------------*/
+
+GlyphSetIterator::reference GlyphSetIterator::operator*() const
+{
+ assert(m_pseg != 0);
+ assert(m_vit != std::vector<int>::const_iterator());
+ // in the case of a non-contiguous list
+ return m_pseg->m_prgginf[(*m_vit) - m_pseg->m_isloutGinf0];
+}
+
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/TestFSM.cpp b/Build/source/libs/graphite/src/segment/TestFSM.cpp
new file mode 100644
index 00000000000..6dad1dc9dc8
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/TestFSM.cpp
@@ -0,0 +1,3416 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: TestFSM.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Hard-coded FSMs for test procedures.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:Ignore
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+#ifdef OLD_TEST_STUFF
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+#ifndef _DEBUG
+
+bool GrLineBreakPass::RunTestRules(GrTableManager * ptman, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ return false;
+}
+
+bool GrSubPass::RunTestRules(GrTableManager * ptman, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ return false;
+}
+
+bool GrPosPass::RunTestRules(GrTableManager * ptman, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ return false;
+}
+#endif // !_DEBUG
+
+
+#ifdef _DEBUG
+
+/*----------------------------------------------------------------------------------------------
+ Call the appropriate test function.
+----------------------------------------------------------------------------------------------*/
+
+bool GrLineBreakPass::RunTestRules(GrTableManager * ptman, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ return false;
+}
+
+bool GrSubPass::RunTestRules(GrTableManager * ptman, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ if (m_staBehavior == "SimpleFSM")
+ return RunSimpleFSMTest(ptman, ruln, psstrmInput, psstrmOutput);
+ else if (m_staBehavior == "RuleAction")
+ return false;
+ else if (m_staBehavior == "RuleAction2")
+ return false;
+ else if (m_staBehavior == "Assoc")
+ return false;
+ else
+ return false;
+}
+
+bool GrPosPass::RunTestRules(GrTableManager * ptman, int ruln,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ return false;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ A simple FSM.
+
+ Rules:
+ r1. clsCons clsVowel clsDiacrAcute
+ r2. clsCons clsVowelAE clsDiacr
+ r3. clsCons clsVowelI
+ r4. clsCons clsVowelI clsDiacrGrave
+ r5. clsCons clsVowelI clsDiacr
+
+ Machine classes:
+ mcCons: b,c,d / f,g,h / j,k,l,m,n / p,q,r,s,t / v,w,x,y,z
+ mcVae: a 97/ e 101
+ mcVi: i 105
+ mcVou: o 111 / u 117
+ mcDa: acute '/' 47
+ mcDg: grave '\' 92
+ mcDct: other diacritics-circumflex '^' 94 / tilde '~' 126
+
+
+ FSM: (T=transition, F=final, A=accepting, NA=non-accepting)
+
+ | mcCons mcVae mcVi mcVou mcDa mcDg mcDct
+ ---------------------------------------------------------------------------
+ T NA s0 | s1
+ | - - - - - - -
+ T NA s1 | s2 s4 s3
+ | - - - - - - -
+ T NA s2 | s5 s6 s6
+ | - - - - - - -
+ T NA s3 | s10
+ | - - - - - - -
+ T A s4 | s7 s8 s9
+ | - - - - - - -
+ F A s5 |
+ | - - - - - - -
+ F A s6 |
+ | - - - - - - -
+ F A s7 |
+ | - - - - - - -
+ F A s8 |
+ | - - - - - - -
+ F A s9 |
+ | - - - - - - -
+ F A s10 |
+ | - - - - - - -
+
+ Rules Matched:
+ s4: r3
+ s5: r1, r2
+ s6: r2
+ s7: r1, r5
+ s8: r4, r5
+ s9: r5
+ s10: r1
+
+----------------------------------------------------------------------------------------------*/
+
+void GrSubPass::SetUpSimpleFSMTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 3;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "SimpleFSM";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpSimpleFSMTest();
+}
+
+void GrFSM::SetUpSimpleFSMTest()
+{
+ // Create machine class ranges.
+ m_cmcr = 14;
+ m_prgmcr = new GrFSMClassRange[14];
+ m_prgmcr[0].m_chwFirst = 47; // forward slash (acute): mcDa
+ m_prgmcr[0].m_chwLast = 47;
+ m_prgmcr[0].m_col = 4;
+
+ m_prgmcr[1].m_chwFirst = 92; // backslash: mcDg
+ m_prgmcr[1].m_chwLast = 92;
+ m_prgmcr[1].m_col = 5;
+
+ m_prgmcr[2].m_chwFirst = 94; // caret: mcDct
+ m_prgmcr[2].m_chwLast = 94;
+ m_prgmcr[2].m_col = 6;
+
+ m_prgmcr[3].m_chwFirst = 97; // a: mcVae
+ m_prgmcr[3].m_chwLast = 97;
+ m_prgmcr[3].m_col = 1;
+
+ m_prgmcr[4].m_chwFirst = 98; // b - d: mcCons
+ m_prgmcr[4].m_chwLast = 100;
+ m_prgmcr[4].m_col = 0;
+
+ m_prgmcr[5].m_chwFirst = 101; // e: mcVae
+ m_prgmcr[5].m_chwLast = 101;
+ m_prgmcr[5].m_col = 1;
+
+ m_prgmcr[6].m_chwFirst = 102; // f - h: mcCons
+ m_prgmcr[6].m_chwLast = 104;
+ m_prgmcr[6].m_col = 0;
+
+ m_prgmcr[7].m_chwFirst = 105; // i: mcVi
+ m_prgmcr[7].m_chwLast = 105;
+ m_prgmcr[7].m_col = 2;
+
+ m_prgmcr[8].m_chwFirst = 106; // j - n: mcCons
+ m_prgmcr[8].m_chwLast = 110;
+ m_prgmcr[8].m_col = 0;
+
+ m_prgmcr[9].m_chwFirst = 111; // o: mcVou
+ m_prgmcr[9].m_chwLast = 111;
+ m_prgmcr[9].m_col = 3;
+
+ m_prgmcr[10].m_chwFirst = 112; // p - t: mcCons
+ m_prgmcr[10].m_chwLast = 116;
+ m_prgmcr[10].m_col = 0;
+
+ m_prgmcr[11].m_chwFirst = 117; // u: mcVou
+ m_prgmcr[11].m_chwLast = 117;
+ m_prgmcr[11].m_col = 3;
+
+ m_prgmcr[12].m_chwFirst = 118; // v - z: mcCons
+ m_prgmcr[12].m_chwLast = 122;
+ m_prgmcr[12].m_col = 0;
+
+ m_prgmcr[13].m_chwFirst = 126; // tilde: mcDct
+ m_prgmcr[13].m_chwLast = 126;
+ m_prgmcr[13].m_col = 6;
+
+ m_dimcrInit = 8; // (max power of 2 <= m_cmcr);
+ m_cLoop = 3; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 11;
+ m_crowNonAcpt = 4;
+ m_crowFinal = 6;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 7;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[35]; // 35 = (m_crow-m_crowFinal) * m_ccol
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 2; *psn++ = 4; *psn++ = 3; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 5; *psn++ = 6; *psn++ = 6;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ =10; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 7; *psn++ = 8; *psn++ = 9;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[10]; // 10 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[7+1]; // 7 = m_crow - m_crowNonAcpt
+
+ m_prgirulnMin[0] = 0; // s4: r3
+ m_prgrulnMatched[0] = 3;
+
+ m_prgirulnMin[1] = 1; // s5: r1, r2
+ m_prgrulnMatched[1] = 1;
+ m_prgrulnMatched[2] = 2;
+
+ m_prgirulnMin[2] = 3; // s6: r2
+ m_prgrulnMatched[3] = 2;
+
+ m_prgirulnMin[3] = 4; // s7: r1, r5
+ m_prgrulnMatched[4] = 1;
+ m_prgrulnMatched[5] = 5;
+
+ m_prgirulnMin[4] = 6; // s8: r4, r5
+ m_prgrulnMatched[6] = 4;
+ m_prgrulnMatched[7] = 5;
+
+ m_prgirulnMin[5] = 8; // s9: r5
+ m_prgrulnMatched[8] = 5;
+
+ m_prgirulnMin[6] = 9; // s10: r1
+ m_prgrulnMatched[9] = 1;
+
+ m_prgirulnMin[7] = 10;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ The "rule" does something silly: just inserts *'s--the number equals the number of the
+ rule.
+----------------------------------------------------------------------------------------------*/
+bool GrSubPass::RunSimpleFSMTest(GrTableManager * ptman, int ruln, GrSlotStream * psstrmInput,
+ GrSlotStream * psstrmOutput)
+{
+ int cslotMatched = (ruln == 3)? 2: 3;
+
+ GrSlotState * pslot0 = psstrmInput->Peek(0);
+
+ for (int islot = 0; islot < cslotMatched; islot++)
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+
+ for (islot = 0; islot < ruln; islot++)
+ {
+ GrSlotState * pslot;
+ ptman->NewSlot('*', pslot0, NULL, m_ipass, &pslot);
+ pslot->Associate(pslot0);
+ psstrmOutput->NextPut(pslot);
+ }
+
+ return true;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ A simple set of rules with actions.
+
+ Rules:
+ r0. clsDigit gSlash clsDigit _ > @3 _ @1 gTilde; // tilde = 126
+ r1. _ clsDigit gBackSlash clsDigit > gDollar @4 _ @2; // dollar sign = 36
+
+ Machine classes:
+ mcDigit: '0' - '9' 48 - 57
+ mcSlash: '/' 47
+ mcBSlash: '\' 92
+
+
+ FSM: (T=transition, F=final, A=accepting, NA=non-accepting)
+
+ | clsDig mcSlash mcBSlash
+ ------------------------------------------------------
+ T NA s0 | s1
+ | - - -
+ T NA s1 | s2 s3
+ | - - -
+ T NA s2 | s4
+ | - - -
+ T NA s3 | s5
+ | - - -
+ F A s4 |
+ | - - -
+ F A s5 |
+ | - - -
+
+ Rules Matched:
+ s4: r0
+ s5: r1
+
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetUpRuleActionTest()
+{
+ if (m_pctbl)
+ delete m_pctbl;
+
+ m_pctbl = new GrClassTable();
+ m_pctbl->SetUpRuleActionTest();
+}
+
+void GrClassTable::SetUpRuleActionTest()
+{
+ m_ccls = 2; // number of classes
+ m_cclsLinear = 2; // number of classes in linear format
+
+ m_prgchwBIGGlyphList = new data16[100];
+
+ m_prgichwOffsets = new data16[2+1];
+
+ gid16 * pchw = m_prgchwBIGGlyphList;
+
+ // Output class 0: tilde
+ m_prgichwOffsets[0] = 0;
+ *pchw++ = msbf(data16(126)); // '~'
+
+ // Output class 1: dollar
+ m_prgichwOffsets[1] = 1;
+ *pchw++ = msbf(data16(36)); // '$'
+
+ m_prgichwOffsets[2] = 2;
+}
+
+void GrSubPass::SetUpRuleActionTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 3;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "RuleAction";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpRuleActionTest();
+
+ m_crul = 2;
+
+ // Set up constraint code--succeed trivially.
+ m_prgbConstraintBlock = new byte[3];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopPushByte; *pb++ = 1; // Push true
+ *pb++ = kopPopRet; // PopAndRet
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 0;
+ m_prgibConstraintStart[1] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[30];
+ pb = m_prgbActionBlock;
+
+ // Rule 1: clsDigit gSlash clsDigit _ > @3 _ @1 gTilde;
+
+ *pb++ = kopPutCopy; *pb++ = 2; // PutCopy 2
+ *pb++ = kopNext; // Next
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopPutCopy; *pb++ = -2; // PutCopy -2
+ *pb++ = kopNext; // Next
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 0; // PutGlyph 0 ('~' = 126)
+ *pb++ = kopNext; // Next
+ *pb++ = kopPushByte; *pb++ = 0; // Push 0
+ *pb++ = kopPopRet; // PopAndRet
+
+ // Rule 2: _ clsDigit gBackSlash clsDigit > gDollar @4 _ @2;
+
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 1; // PutGlyph 1 ('$' = 36)
+ *pb++ = kopNext; // Next
+ *pb++ = kopPutCopy; *pb++ = 2; // PutCopy 2
+ *pb++ = kopNext; // Next
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopPutCopy; *pb++ = -2; // PutCopy -2
+ *pb++ = kopNext; // Next
+ *pb++ = kopPushByte; *pb++ = 0; // Push 0
+ *pb++ = kopPopRet; // PopAndRet
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 15;
+}
+
+void GrFSM::SetUpRuleActionTest()
+{
+ // Create machine class ranges.
+ m_cmcr = 3;
+ m_prgmcr = new GrFSMClassRange[3];
+ m_prgmcr[0].m_chwFirst = 47; // forward slash: mcSlash
+ m_prgmcr[0].m_chwLast = 47;
+ m_prgmcr[0].m_col = 1;
+
+ m_prgmcr[1].m_chwFirst = 48; // 0 - 9: mcDigit
+ m_prgmcr[1].m_chwLast = 57;
+ m_prgmcr[1].m_col = 0;
+
+ m_prgmcr[2].m_chwFirst = 92; // backslash
+ m_prgmcr[2].m_chwLast = 92;
+ m_prgmcr[2].m_col = 2;
+
+
+ m_dimcrInit = 2; // (max power of 2 <= m_cmcr);
+ m_cLoop = 1; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 6;
+ m_crowNonAcpt = 4;
+ m_crowFinal = 2;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 3;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[12]; // 12 = (m_crow-m_crowFinal) * m_ccol
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 2; *psn++ = 3;
+ *psn++ = 4; *psn++ = 0; *psn++ = 0;
+ *psn++ = 5; *psn++ = 0; *psn++ = 0;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[2]; // 2 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[2+1]; // 2 = m_crow - m_crowNonAcpt
+
+ m_prgirulnMin[0] = 0; // s4: r0
+ m_prgrulnMatched[0] = 0;
+
+ m_prgirulnMin[1] = 1; // s5: r1
+ m_prgrulnMatched[1] = 1;
+
+ m_prgirulnMin[2] = 2;
+}
+
+/*----------------------------------------------------------------------------------------------
+ A more complicated set of rules with actions.
+
+ PASS 1:
+ r0. clsDigit > @1 {dir = DIR_RIGHT} / ^ _ {dir == DIR_LEFT};
+ r1. clsSpecial > @2 {dir = DIR_ARABNUMBER} / clsDigit {dir != DIR_LEFT} ^ _;
+ r2. clsSpecial > @2 {dir = @1.dir} / clsSpecial ^ _;
+
+ Pass 1 machine classes:
+ mcDigit: '0' - '9' 48 - 57
+ mcSpecial: '-', '_', '=', '~' 45, 95, 61, 126
+
+ Pass 1 FSM: (T=transition, F=final, A=accepting, NA=non-accepting)
+
+ | mcDigit mcSpecial
+ ------------------------------------------
+ T NA s0 | s2 s1
+ | - _
+ T NA s1 | s4
+ | - -
+ T A s2 | s3
+ | - -
+ F A s3 |
+ | - -
+ F A s4 |
+ | - -
+
+ Rules Matched:
+ s2: r0
+ s3: r1
+ s4: r2
+
+ PASS 2:
+ r0. clsVowel gCaret > clsCirumVowel _;
+ r1. clsVowel gSlash > _ clsAcuteVowel$1;
+
+ Pass 2 machine classes:
+ mcVowel
+ mcCaret: '^' 94
+ mcSlash: '/' 47
+
+
+ Pass 2 FSM:
+ | mcVowel mcCaret mcSlash
+ -----------------------------------------------------
+ T NA s0 | s1
+ | - _
+ T NA s1 | s2 s3
+ | - -
+ F A s2 |
+ | - -
+ F A s3 |
+ | - -
+
+ Rules matched:
+ s2: r0
+ s3: r1
+
+
+ PASS 3:
+ r0. clsLeft > clsRight {dir = @1.dir} / _ clsDir {dir==DIR_RIGHT};
+ r1. clsRight > clsLeft {dir = @1.dir} / clsDir {dir==DIR_RIGHT} _;
+
+ Pass 3 machine classes:
+ mcDir: (clsDigit, clsSpecial)
+ mcLeft: '(', '[', '{' 40, 91, 123
+ mcRight: ')', ']', '}' 41, 93, 125
+
+ Pass 3 FSM:
+ | mcDir mcLeft mcRight
+ -----------------------------------------------------
+ T NA s0 | s2 s1
+ | - _
+ T NA s1 | s3
+ | - -
+ T NA s2 | s4
+ | - -
+ F A s3 |
+ | - -
+ F A s4 |
+ | - -
+
+ Rules matched:
+ s3: r0
+ s4: r1
+
+
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetUpRuleAction2Test()
+{
+ if (m_pctbl)
+ delete m_pctbl;
+
+ m_pctbl = new GrClassTable();
+ m_pctbl->SetUpRuleAction2Test();
+}
+
+void GrClassTable::SetUpRuleAction2Test()
+{
+ m_ccls = 7; // number of classes
+ m_cclsLinear = 4; // number of classes in linear format
+
+ m_prgchwBIGGlyphList = new data16[70];
+
+ m_prgichwOffsets = new data16[7+1];
+
+ data16 * pchw = m_prgchwBIGGlyphList;
+
+ // Output class 0: clsCirumVowel
+ m_prgichwOffsets[0] = 0;
+ *pchw++ = msbf(data16(226)); // a
+ *pchw++ = msbf(data16(234)); // e
+ *pchw++ = msbf(data16(238)); // i
+ *pchw++ = msbf(data16(244)); // o
+ *pchw++ = msbf(data16(251)); // u
+ *pchw++ = msbf(data16(194)); // A
+ *pchw++ = msbf(data16(202)); // E
+ *pchw++ = msbf(data16(206)); // I
+ *pchw++ = msbf(data16(212)); // O
+ *pchw++ = msbf(data16(219)); // U
+
+ // Output class 1: clsAcuteVowel
+ m_prgichwOffsets[1] = 10;
+ *pchw++ = msbf(data16(225)); // a
+ *pchw++ = msbf(data16(233)); // e
+ *pchw++ = msbf(data16(237)); // i
+ *pchw++ = msbf(data16(243)); // o
+ *pchw++ = msbf(data16(250)); // u
+ *pchw++ = msbf(data16(193)); // A
+ *pchw++ = msbf(data16(201)); // E
+ *pchw++ = msbf(data16(205)); // I
+ *pchw++ = msbf(data16(211)); // O
+ *pchw++ = msbf(data16(218)); // U
+
+ // Output class 2: clsLeft
+ m_prgichwOffsets[2] = 10 + 10;
+ *pchw++ = msbf(data16(40)); // (
+ *pchw++ = msbf(data16(91)); // [
+ *pchw++ = msbf(data16(123)); // {
+
+ // Output class 3: clsRight
+ m_prgichwOffsets[3] = 20 + 3;
+ *pchw++ = msbf(data16(41)); // )
+ *pchw++ = msbf(data16(93)); // ]
+ *pchw++ = msbf(data16(125)); // }
+
+ // Input class 4: clsVowel
+ m_prgichwOffsets[4] = 23 + 3; // 26
+ *pchw++ = msbf(data16(10));
+ *pchw++ = msbf(data16(8)); *pchw++ = msbf(data16(3)); *pchw++ = msbf(data16(10-8));
+ *pchw++ = msbf(data16(65)); *pchw++ = msbf(data16(5)); // A
+ *pchw++ = msbf(data16(69)); *pchw++ = msbf(data16(6)); // E
+ *pchw++ = msbf(data16(73)); *pchw++ = msbf(data16(7)); // I
+ *pchw++ = msbf(data16(79)); *pchw++ = msbf(data16(8)); // O
+ *pchw++ = msbf(data16(85)); *pchw++ = msbf(data16(9)); // U
+ *pchw++ = msbf(data16(97)); *pchw++ = msbf(data16(0)); // a
+ *pchw++ = msbf(data16(101)); *pchw++ = msbf(data16(1)); // e
+ *pchw++ = msbf(data16(105)); *pchw++ = msbf(data16(2)); // i
+ *pchw++ = msbf(data16(111)); *pchw++ = msbf(data16(3)); // o
+ *pchw++ = msbf(data16(117)); *pchw++ = msbf(data16(4)); // u
+
+ // Input class 5: clsLeft
+ m_prgichwOffsets[5] = 26 + 4 + 10*2; // 50
+ *pchw++ = msbf(data16(3));
+ *pchw++ = msbf(data16(2)); *pchw++ = msbf(data16(1)); *pchw++ = msbf(data16(3-2));
+ *pchw++ = msbf(data16(40)); *pchw++ = msbf(data16(0)); // (
+ *pchw++ = msbf(data16(91)); *pchw++ = msbf(data16(1)); // [
+ *pchw++ = msbf(data16(123)); *pchw++ = msbf(data16(2)); // {
+
+ // Input class 6: clsRight
+ m_prgichwOffsets[6] = 50 + 4 + 3*2; // 60
+ *pchw++ = msbf(data16(3));
+ *pchw++ = msbf(data16(2)); *pchw++ = msbf(data16(1)); *pchw++ = msbf(data16(3-2));
+ *pchw++ = msbf(data16(41)); *pchw++ = msbf(data16(0)); // )
+ *pchw++ = msbf(data16(93)); *pchw++ = msbf(data16(1)); // ]
+ *pchw++ = msbf(data16(125)); *pchw++ = msbf(data16(2)); // }
+
+ m_prgichwOffsets[7] = 60 + 4 + 3*2; // 70
+}
+
+void GrSubPass::SetUpRuleAction2Test()
+{
+ if (m_ipass == 1)
+ {
+ m_nMaxRuleContext = m_nMaxChunk = 2;
+ m_nMaxRuleLoop = 5;
+ m_staBehavior = "RuleAction2";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpRuleAction2Test(m_ipass);
+
+ m_crul = 3;
+
+ // Set up constraint code.
+ m_prgbConstraintBlock = new byte[1 + 10 + 10];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ *pb++ = kopCntxtItem; *pb++ = 0; // ContextItem 0
+ *pb++ = kopPushSlotAttr; *pb++= kslatDir; // PushSlotAttr dir 0
+ *pb++ = 0;
+ *pb++ = kopPushByte; *pb++ = kdircL; // Push DIR_LEFT
+ *pb++ = kopEqual; // Equal
+ *pb++ = kopOr; // Or
+ *pb++ = kopPopRet; // PopAndRet
+
+ *pb++ = kopCntxtItem; *pb++ = 0; // ContextItem 0
+ *pb++ = kopPushSlotAttr; *pb++= kslatDir; // PushSlotAttr dir 0
+ *pb++ = 0;
+ *pb++ = kopPushByte; *pb++ = kdircL; // Push DIR_LEFT
+ *pb++ = kopNotEq; // NotEqual
+ *pb++ = kopOr; // Or
+ *pb++ = kopPopRet; // PopAndRet
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 1;
+ m_prgibConstraintStart[1] = 11;
+ m_prgibConstraintStart[2] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[10 + 11 + 12];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: clsDigit > @1 {dir = DIR_RIGHT} / ^ _ {dir == DIR_LEFT};
+
+ *pb++ = kopPutCopy; *pb++ = 0; // PutCopy 0
+ *pb++ = kopPushByte; *pb++ = kdircR; // PushByte DIR_RIGHT
+ *pb++ = kopAttrSet; *pb++ = kslatDir; // AttrSet dir
+ *pb++ = kopNext; // Next
+ *pb++ = kopPushByte; *pb++ = -1; // Push -1
+ *pb++ = kopPopRet; // PopAndRet
+
+ // Rule 1: clsSpecial > @2 {dir = DIR_ARABNUMBER} / clsDigit {dir != DIR_LEFT} ^ _;
+
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopPutCopy; *pb++ = 0; // PutCopy 0
+ *pb++ = kopPushByte; *pb++ = kdircArabNum; // Push DIR_ARABNUMBER
+ *pb++ = kopAttrSet; *pb++ = kslatDir; // AttrSet dir
+ *pb++ = kopNext; // Next
+ *pb++ = kopPushByte; *pb++ = -1; // Push -1
+ *pb++ = kopPopRet; // PopAndRet
+
+ // Rule 2: clsSpecial > @2 {dir = @1.dir} / clsSpecial ^ _;
+
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopPutCopy; *pb++ = 0; // PutCopy 0
+ *pb++ = kopPushSlotAttr;*pb++ = kslatDir; // PushSlotAttr dir -1
+ *pb++ = -1;
+ *pb++ = kopAttrSet; *pb++ = kslatDir; // AttrSet dir
+ *pb++ = kopNext; // Next
+ *pb++ = kopPushByte; *pb++ = -1; // Push -1
+ *pb++ = kopPopRet; // PopAndRet
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 10;
+ m_prgibActionStart[2] = 10 + 11;
+ }
+ else if (m_ipass == 2)
+ {
+ m_nMaxRuleContext = m_nMaxChunk = 2;
+ m_nMaxRuleLoop = 3;
+ m_staBehavior = "RuleAction2";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpRuleAction2Test(m_ipass);
+
+ m_crul = 2;
+
+ // Set up constraint code--succeed trivially.
+ m_prgbConstraintBlock = new byte[1];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 0;
+ m_prgibConstraintStart[1] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[16];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: clsVowel gCaret > clsCirumVowel _;
+
+ *pb++ = kopPutSubs8bitObs; *pb++ = 0; // PutSubs 0 clsVowel clsCircumVowel
+ *pb++ = 4; *pb++ = 0;
+ *pb++ = kopNext; // Next
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 1: clsVowel gSlash > _ clsAcuteVowel$1;
+
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopPutSubs8bitObs; *pb++ = -1; // PutSubs -1 clsVowel clsAcuteVowel
+ *pb++ = 4; *pb++ = 1;
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 8;
+ }
+ else if (m_ipass == 3)
+ {
+ m_nMaxRuleContext = m_nMaxChunk = 2;
+ m_nMaxRuleLoop = 3;
+ m_staBehavior = "RuleAction2";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpRuleAction2Test(m_ipass);
+
+ m_crul = 2;
+
+ // Set up constraint code.
+ m_prgbConstraintBlock = new byte[1 + 10 + 10];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ *pb++ = kopCntxtItem; *pb++ = 1; // ContextItem 1
+ *pb++ = kopPushSlotAttr;*pb++ = kslatDir; // PushSlotAttr dir 0
+ *pb++ = 0;
+ *pb++ = kopPushByte; *pb++ = kdircR; // Push DIR_RIGHT
+ *pb++ = kopEqual; // Equal
+ *pb++ = kopOr; // Or
+ *pb++ = kopPopRet; // PopAndRet
+
+ *pb++ = kopCntxtItem; *pb++ = 0; // ContextItem 0
+ *pb++ = kopPushSlotAttr;*pb++ = kslatDir; // PushSlotAttr dir 0
+ *pb++ = 0;
+ *pb++ = kopPushByte; *pb++ = kdircR; // Push DIR_RIGHT
+ *pb++ = kopEqual; // Equal
+ *pb++ = kopOr; // Or
+ *pb++ = kopPopRet; // PopAndRet
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 1;
+ m_prgibConstraintStart[1] = 1 + 10;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[23];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: clsLeft > clsRight {dir = @1.dir} / _ clsDir {dir == DIR_RIGHT};
+
+ *pb++ = kopPutSubs8bitObs; *pb++ = 0; // PutSubs 0 clsLeft clsRight
+ *pb++ = 5; *pb++ = 3;
+ *pb++ = kopPushSlotAttr;*pb++ = kslatDir; // PushSlotAttr dir 1
+ *pb++ = 1;
+ *pb++ = kopAttrSet; *pb++ = kslatDir; // AttrSet dir
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 1: clsRight > clsLeft {dir = @1.dir} / clsDir {dir == DIR_RIGHT} _;
+
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopPutSubs8bitObs; *pb++ = 0; // PutSubs 0 clsRight clsLeft
+ *pb++ = 6; *pb++ = 2;
+ *pb++ = kopPushSlotAttr;*pb++ = kslatDir; // PushSlotAttr dir -1
+ *pb++ = -1;
+ *pb++ = kopAttrSet; *pb++ = kslatDir; // AttrSet dir
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 11;
+ }
+}
+
+
+void GrFSM::SetUpRuleAction2Test(int ipass)
+{
+ if (ipass == 1)
+ {
+ // Create machine class ranges.
+ m_cmcr = 5;
+ m_prgmcr = new GrFSMClassRange[5];
+ m_prgmcr[0].m_chwFirst = 45; // hyphen
+ m_prgmcr[0].m_chwLast = 45;
+ m_prgmcr[0].m_col = 1;
+
+ m_prgmcr[1].m_chwFirst = 48; // 0 - 9: mcDigit
+ m_prgmcr[1].m_chwLast = 57;
+ m_prgmcr[1].m_col = 0;
+
+ m_prgmcr[2].m_chwFirst = 61; // equals sign
+ m_prgmcr[2].m_chwLast = 61;
+ m_prgmcr[2].m_col = 1;
+
+ m_prgmcr[3].m_chwFirst = 95; // underscore
+ m_prgmcr[3].m_chwLast = 95;
+ m_prgmcr[3].m_col = 1;
+
+ m_prgmcr[4].m_chwFirst = 126; // tilde
+ m_prgmcr[4].m_chwLast = 126;
+ m_prgmcr[4].m_col = 1;
+
+ m_dimcrInit = 4; // (max power of 2 <= m_cmcr);
+ m_cLoop = 2; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 5;
+ m_crowNonAcpt = 2;
+ m_crowFinal = 2;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 2;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[6]; // 6 = (m_crow-m_crowFinal) * m_ccol
+ short * psn = m_prgrowTransitions;
+ *psn++ = 2; *psn++ = 1;
+ *psn++ = 0; *psn++ = 4;
+ *psn++ = 0; *psn++ = 3;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[3]; // 3 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[3+1]; // 3 = m_crow - m_crowNonAcpt
+
+ m_prgirulnMin[0] = 0; // s2: r0
+ m_prgrulnMatched[0] = 0;
+
+ m_prgirulnMin[1] = 1; // s3: r1
+ m_prgrulnMatched[1] = 1;
+
+ m_prgirulnMin[2] = 2; // s3: r2
+ m_prgrulnMatched[2] = 2;
+
+ m_prgirulnMin[3] = 3;
+ }
+ else if (ipass == 2)
+ {
+ // Create machine class ranges.
+ m_cmcr = 12;
+ m_prgmcr = new GrFSMClassRange[12];
+ m_prgmcr[0].m_chwFirst = 47; // slash
+ m_prgmcr[0].m_chwLast = 47;
+ m_prgmcr[0].m_col = 2;
+
+ m_prgmcr[1].m_chwFirst = 65; // A
+ m_prgmcr[1].m_chwLast = 65;
+ m_prgmcr[1].m_col = 0;
+
+ m_prgmcr[2].m_chwFirst = 69; // E
+ m_prgmcr[2].m_chwLast = 69;
+ m_prgmcr[2].m_col = 0;
+
+ m_prgmcr[3].m_chwFirst = 73; // I
+ m_prgmcr[3].m_chwLast = 73;
+ m_prgmcr[3].m_col = 0;
+
+ m_prgmcr[4].m_chwFirst = 79; // O
+ m_prgmcr[4].m_chwLast = 79;
+ m_prgmcr[4].m_col = 0;
+
+ m_prgmcr[5].m_chwFirst = 85; // U
+ m_prgmcr[5].m_chwLast = 85;
+ m_prgmcr[5].m_col = 0;
+
+ m_prgmcr[6].m_chwFirst = 94; // caret
+ m_prgmcr[6].m_chwLast = 94;
+ m_prgmcr[6].m_col = 1;
+
+ m_prgmcr[7].m_chwFirst = 97; // a
+ m_prgmcr[7].m_chwLast = 97;
+ m_prgmcr[7].m_col = 0;
+
+ m_prgmcr[8].m_chwFirst = 101; // e
+ m_prgmcr[8].m_chwLast = 101;
+ m_prgmcr[8].m_col = 0;
+
+ m_prgmcr[9].m_chwFirst = 105; // i
+ m_prgmcr[9].m_chwLast = 105;
+ m_prgmcr[9].m_col = 0;
+
+ m_prgmcr[10].m_chwFirst = 111; // o
+ m_prgmcr[10].m_chwLast = 111;
+ m_prgmcr[10].m_col = 0;
+
+ m_prgmcr[11].m_chwFirst = 117; // u
+ m_prgmcr[11].m_chwLast = 117;
+ m_prgmcr[11].m_col = 0;
+
+ m_dimcrInit = 8; // (max power of 2 <= m_cmcr);
+ m_cLoop = 3; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 4;
+ m_crowNonAcpt = 2;
+ m_crowFinal = 2;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 3;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[6]; // 6 = (m_crow-m_crowFinal) * m_ccol
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 2; *psn++ = 3;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[2]; // 2 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[2+1]; // 2 = m_crow - m_crowNonAcpt
+
+ m_prgirulnMin[0] = 0; // s1: r0
+ m_prgrulnMatched[0] = 0;
+
+ m_prgirulnMin[1] = 1; // s2: r1
+ m_prgrulnMatched[1] = 1;
+
+ m_prgirulnMin[2] = 2;
+ }
+ else if (ipass == 3)
+ {
+ // Create machine class ranges.
+ m_cmcr = 11;
+ m_prgmcr = new GrFSMClassRange[11];
+ m_prgmcr[0].m_chwFirst = 40; // (
+ m_prgmcr[0].m_chwLast = 40;
+ m_prgmcr[0].m_col = 1;
+
+ m_prgmcr[1].m_chwFirst = 41; // )
+ m_prgmcr[1].m_chwLast = 41;
+ m_prgmcr[1].m_col = 2;
+
+ m_prgmcr[2].m_chwFirst = 45; // hyphen
+ m_prgmcr[2].m_chwLast = 45;
+ m_prgmcr[2].m_col = 0;
+
+ m_prgmcr[3].m_chwFirst = 48; // 0 - 9: mcDigit
+ m_prgmcr[3].m_chwLast = 57;
+ m_prgmcr[3].m_col = 0;
+
+ m_prgmcr[4].m_chwFirst = 61; // =
+ m_prgmcr[4].m_chwLast = 61;
+ m_prgmcr[4].m_col = 0;
+
+ m_prgmcr[5].m_chwFirst = 91; // [
+ m_prgmcr[5].m_chwLast = 91;
+ m_prgmcr[5].m_col = 1;
+
+ m_prgmcr[6].m_chwFirst = 93; // ]
+ m_prgmcr[6].m_chwLast = 93;
+ m_prgmcr[6].m_col = 2;
+
+ m_prgmcr[7].m_chwFirst = 95; // underscore
+ m_prgmcr[7].m_chwLast = 95;
+ m_prgmcr[7].m_col = 0;
+
+ m_prgmcr[8].m_chwFirst = 123; // {
+ m_prgmcr[8].m_chwLast = 123;
+ m_prgmcr[8].m_col = 1;
+
+ m_prgmcr[9].m_chwFirst = 125; // }
+ m_prgmcr[9].m_chwLast = 125;
+ m_prgmcr[9].m_col = 2;
+
+ m_prgmcr[10].m_chwFirst = 126; // tilde
+ m_prgmcr[10].m_chwLast = 126;
+ m_prgmcr[10].m_col = 0;
+
+ m_dimcrInit = 8; // (max power of 2 <= m_cmcr);
+ m_cLoop = 3; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 5;
+ m_crowNonAcpt = 3;
+ m_crowFinal = 2;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 3;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[9]; // 9 = (m_crow-m_crowFinal) * m_ccol
+ short * psn = m_prgrowTransitions;
+ *psn++ = 2; *psn++ = 1; *psn++ = 0;
+ *psn++ = 3; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 4;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[2]; // 2 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[2+1]; // 2 = m_crow - m_crowNonAcpt
+
+ m_prgirulnMin[0] = 0; // s3: r0
+ m_prgrulnMatched[0] = 0;
+
+ m_prgirulnMin[1] = 1; // s4: r1
+ m_prgrulnMatched[1] = 1;
+
+ m_prgirulnMin[2] = 2;
+ }
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Tests of various kinds of assocations.
+
+ PASS 1 (line-break):
+ r0. gX / # _ ^ ; // do nothing
+ r1. gX {break = -2};
+
+ Pass 1 machine classes:
+ mcX: 'x' 120
+ mcLB: 35
+
+ Pass 1 FSM: (T=transition, F=final, A=accepting, NA=non-accepting)
+
+ | gX gLB
+ --------------------------------
+ T NA s0 | s2 s1
+ |
+ T NA s1 | s3
+ |
+ F A s2 |
+ |
+ F A s3 |
+
+
+ Rules Matched:
+ s2: r1
+ s3: r0
+
+
+
+ PASS 2:
+ r0. clsOA clsE > clsELig:(1 2) _;
+ r1. clsLC _ _ gX > @1 @5 @1 @5 / _ _ # {break==2} _ _ ;
+ r2. _ clsFraction _ > clsNumerator:2 gSlash:2 clsDenom:2;
+
+ Pass 2 machine classes:
+ mcOA: O A 79 65
+ mcOAlc: o a 111 97
+ mcE E e 69 101
+ mcFraction: 188 189 190
+ mcX: x 120
+ mcLCother
+ mcLB: 35
+
+
+ Pass 2 FSM: mcLC
+ | mcOA mcOAlc mcE mcElc other mcX mcFractn mcLB
+ -----------------------------------------------------------------------------------------
+ T NA s0 | s1 s2 s4 s3 s3 s6
+ | - - - - - - -
+ T NA s1 | s7
+ | - - - - - - -
+ T NA s2 | s7 s5
+ | - - - - - - -
+ T NA s3 | s5
+ | - - - - - - -
+ T NA s4 | s5
+ | - - - - - - -
+ T NA s5 | s8
+ | - - - - - - -
+ F A s6 |
+ | - - - - - -
+ F A s7 |
+ | - - - - - -
+ F A s8 |
+ | - - - - - -
+
+ Rules matched:
+ s6: r2
+ s7: r0
+ s8: r1
+
+
+ PASS 3:
+ r0. _ > gHyphen / _ # {break == 2} ^;
+
+ Pass 3 machine classes:
+ mcLB: 35
+
+ Pass 3 FSM:
+
+ | gLB
+ --------------------------------
+ T NA s0 | s1
+ |
+ F A s1 |
+ |
+
+ Rules Matched:
+ s1: r0
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetUpAssocTest()
+{
+ if (m_pctbl)
+ delete m_pctbl;
+
+ m_pctbl = new GrClassTable();
+ m_pctbl->SetUpAssocTest();
+
+ m_fLineBreak = true;
+ m_cchwPreXlbContext = 1;
+ m_cchwPostXlbContext = 1;
+}
+
+void GrClassTable::SetUpAssocTest()
+{
+ m_ccls = 11; // number of classes
+ m_cclsLinear = 5; // number of classes in linear format (output classes)
+
+ m_prgchwBIGGlyphList = new data16[143];
+
+ m_prgichwOffsets = new data16[m_ccls+1];
+
+ data16 * pchw = m_prgchwBIGGlyphList;
+
+ // Output class 0: clsELig
+ m_prgichwOffsets[0] = 0;
+ *pchw++ = msbf(data16(140)); // OE
+ *pchw++ = msbf(data16(198)); // AE
+ *pchw++ = msbf(data16(156)); // oe
+ *pchw++ = msbf(data16(230)); // ae
+
+ // Output class 1: clsNumerator
+ m_prgichwOffsets[1] = 4;
+ *pchw++ = msbf(data16(49)); // 1
+ *pchw++ = msbf(data16(49)); // 1
+ *pchw++ = msbf(data16(51)); // 3
+
+ // Output class 2: clsDenom
+ m_prgichwOffsets[2] = 4 + 3;
+ *pchw++ = msbf(data16(52)); // 4
+ *pchw++ = msbf(data16(50)); // 2
+ *pchw++ = msbf(data16(52)); // 4
+
+ // Output class 3: gSlash
+ m_prgichwOffsets[3] = 7 + 3;
+ *pchw++ = msbf(data16(47)); // '/'
+
+ // Output class 4: gHyphen
+ m_prgichwOffsets[4] = 10 + 1;
+ *pchw++ = msbf(data16(45)); // '-'
+
+ // Input class 5: clsOA
+ m_prgichwOffsets[5] = 11 + 1;
+ *pchw++ = msbf(data16(4));
+ *pchw++ = msbf(data16(4)); *pchw++ = msbf(data16(2)); *pchw++ = msbf(data16(0));
+ *pchw++ = msbf(data16(65)); *pchw++ = msbf(data16(1)); // A
+ *pchw++ = msbf(data16(79)); *pchw++ = msbf(data16(0)); // O
+ *pchw++ = msbf(data16(97)); *pchw++ = msbf(data16(3)); // a
+ *pchw++ = msbf(data16(111)); *pchw++ = msbf(data16(2)); // o
+
+ // Input class 6: clsE
+ m_prgichwOffsets[6] = 12 + 4 + 4*2; // 24
+ *pchw++ = msbf(data16(3));
+ *pchw++ = msbf(data16(2)); *pchw++ = msbf(data16(1)); *pchw++ = msbf(data16(3-2));
+ *pchw++ = msbf(data16(40)); *pchw++ = msbf(data16(0)); // E
+ *pchw++ = msbf(data16(91)); *pchw++ = msbf(data16(1)); // e
+
+ // Input class 7: clsLC
+ m_prgichwOffsets[7] = 24 + 4 + 2*2; // 32
+ *pchw++ = msbf(data16(26));
+ *pchw++ = msbf(data16(16)); *pchw++ = msbf(data16(4)); *pchw++ = msbf(data16(26-16));
+ for (int i = 0; i < 26; ++i)
+ {
+ *pchw++ = msbf(data16(97+i)); *pchw++ = msbf(data16(i));
+ }
+
+ // Input class 8: gX
+ m_prgichwOffsets[8] = 32 + 4 + 26*2; // 88
+ *pchw++ = msbf(data16(1));
+ *pchw++ = msbf(data16(1)); *pchw++ = msbf(data16(0)); *pchw++ = msbf(data16(0));
+ *pchw++ = msbf(data16(120)); *pchw++ = msbf(data16(0));
+
+ // Input class 9: clsFraction
+ m_prgichwOffsets[9] = 88 + 4 + 1*2; // 127
+ *pchw++ = msbf(data16(3));
+ *pchw++ = msbf(data16(2)); *pchw++ = msbf(data16(1)); *pchw++ = msbf(data16(3-2));
+ *pchw++ = msbf(data16(188)); *pchw++ = msbf(data16(0)); // 1/4
+ *pchw++ = msbf(data16(189)); *pchw++ = msbf(data16(1)); // 1/2
+ *pchw++ = msbf(data16(190)); *pchw++ = msbf(data16(2)); // 3/4
+
+ // Input class 10: #
+ m_prgichwOffsets[10] = 127 + 4 + 3*2; // 137
+ *pchw++ = msbf(data16(1));
+ *pchw++ = msbf(data16(1)); *pchw++ = msbf(data16(0)); *pchw++ = msbf(data16(0));
+ *pchw++ = msbf(data16(35)); *pchw++ = msbf(data16(0)); // 1/4
+
+ m_prgichwOffsets[11] = 137 + 4 + 1*2; // 143
+}
+
+void GrLineBreakPass::SetUpAssocTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 5;
+ m_staBehavior = "Assoc";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpAssocTest(m_ipass);
+
+ m_crul = 2;
+
+ // Set up constraint code--succeed trivially.
+ m_prgbConstraintBlock = new byte[1];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 0;
+ m_prgibConstraintStart[1] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[7 + 8];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: gX / # _ ^ ; // do nothing
+
+ *pb++ = kopPutCopy; *pb++ = 0; // PutCopy 0
+ *pb++ = kopNext; // Next
+ *pb++ = kopPutCopy; *pb++ = 0; // PutCopy 0
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 1: gX {break = -2};
+
+ *pb++ = kopPutCopy; *pb++ = 0; // PutCopy 0
+ *pb++ = kopPushByte; *pb++ = -2; // PushByte -2
+ *pb++ = kopAttrSet; *pb++ = kslatBreak; // AttrSet breakweight
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 7;
+}
+
+void GrSubPass::SetUpAssocTest()
+{
+ if (m_ipass == 2)
+ {
+ m_nMaxRuleContext = m_nMaxChunk = 3;
+ m_nMaxRuleLoop = 5;
+ m_staBehavior = "Assoc";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpAssocTest(m_ipass);
+
+ m_crul = 3;
+
+ // Set up constraint code.
+ m_prgbConstraintBlock = new byte[1 + 10];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ *pb++ = kopCntxtItem; *pb++ = 1; // ContextItem 1
+ *pb++ = kopPushSlotAttr;*pb++ = kslatBreak; // PushSlotAttr break 0
+ *pb++ = 0;
+ *pb++ = kopPushByte; *pb++ = 2; // Push 2
+ *pb++ = kopEqual; // Equal
+ *pb++ = kopOr; // Or
+ *pb++ = kopPopRet; // PopAndRet
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 0;
+ m_prgibConstraintStart[1] = 1;
+ m_prgibConstraintStart[2] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[12 + 12 + 22];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: clsOA clsE > clsELig:(1 2) _ ;
+
+ *pb++ = kopPutSubs8bitObs; *pb++ = 0; // PutSubs 0 clsOA clsELig
+ *pb++ = 5; *pb++ = 0;
+ *pb++ = kopAssoc; *pb++ = 2; // Assoc 2 0 1
+ *pb++ = 0; *pb++ = 1;
+ *pb++ = kopNext; // Next
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 1: clsLC _ _ gX > @1 @5 @1 @5 / _ _ # {break==2} _ _ ;
+
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutCopy; *pb++ = 2; // PutCopy 2
+ *pb++ = kopNext; // Next
+ *pb++ = kopCopyNext; // CopyNext - line break
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutCopy; *pb++ = -1; // PutCopy -1
+ *pb++ = kopNext; // Next
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 2: _ clsFraction _ > clsNumerator:2 gSlash:2 clsDenom:2;
+
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutSubs8bitObs; *pb++ = 1; // PutSubs 1 clsFraction clsNumerator
+ *pb++ = 9; *pb++ = 1;
+ *pb++ = kopAssoc; *pb++ = 1; // Assoc 1 1
+ *pb++ = 1;
+ *pb++ = kopNext; // Next
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 3; // PutGlyph gSlash
+ *pb++ = kopNext; // Next
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutSubs8bitObs; *pb++ = 0; // PutSubs 0 clsFraction clsDenom
+ *pb++ = 9; *pb++ = 2;
+ *pb++ = kopAssoc; *pb++ = 1; // Assoc 1 0
+ *pb++ = 0;
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 12;
+ m_prgibActionStart[2] = 12 + 12;
+ }
+ else if (m_ipass == 3)
+ {
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 3;
+ m_staBehavior = "Assoc";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpAssocTest(m_ipass);
+
+ m_crul = 1;
+
+ // Set up constraint code.
+ m_prgbConstraintBlock = new byte[1 + 10];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ *pb++ = kopCntxtItem; *pb++ = 0; // ContextItem 0
+ *pb++ = kopPushSlotAttr;*pb++ = kslatBreak; // PushSlotAttr break 0
+ *pb++ = 0;
+ *pb++ = kopPushByte; *pb++ = 2; // Push 2
+ *pb++ = kopEqual; // Equal
+ *pb++ = kopOr; // Or
+ *pb++ = kopPopRet; // PopAndRet
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 1;
+
+ m_prgbActionBlock = new byte[7];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: _ > gHyphen / _ # {break == 2} ^;
+
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 4; // PutGlyph 4 ('-' = 45)
+ *pb++ = kopNext; // Next
+ *pb++ = kopPushByte; *pb++ = 1; // Push 1
+ *pb++ = kopPopRet; // PopAndRet
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ }
+ else
+ Assert(false);
+}
+
+
+void GrFSM::SetUpAssocTest(int ipass)
+{
+ if (ipass == 1)
+ {
+ // Create machine class ranges.
+ m_cmcr = 2;
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ m_prgmcr[0].m_chwFirst = 35; // #
+ m_prgmcr[0].m_chwLast = 35;
+ m_prgmcr[0].m_col = 1;
+
+ m_prgmcr[1].m_chwFirst = 120; // x
+ m_prgmcr[1].m_chwLast = 120;
+ m_prgmcr[1].m_col = 0;
+
+ m_dimcrInit = 2; // (max power of 2 <= m_cmcr);
+ m_cLoop = 1; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 4;
+ m_crowNonAcpt = 2;
+ m_crowFinal = 2;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 2;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[(m_crow-m_crowFinal) * m_ccol]; // 4
+ short * psn = m_prgrowTransitions;
+ *psn++ = 2; *psn++ = 1;
+ *psn++ = 3; *psn++ = 0;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[2]; // 2 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[m_crow - m_crowNonAcpt + 1];
+
+ m_prgirulnMin[0] = 0; // s2: r1
+ m_prgrulnMatched[0] = 1;
+
+ m_prgirulnMin[1] = 1; // s3: r0
+ m_prgrulnMatched[1] = 0;
+
+ m_prgirulnMin[2] = 2;
+ }
+ else if (ipass == 2)
+ {
+ // Create machine class ranges.
+ m_cmcr = 13;
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ m_prgmcr[0].m_chwFirst = 35; // #
+ m_prgmcr[0].m_chwLast = 35;
+ m_prgmcr[0].m_col = 7;
+
+ m_prgmcr[1].m_chwFirst = 65; // A
+ m_prgmcr[1].m_chwLast = 65;
+ m_prgmcr[1].m_col = 0;
+
+ m_prgmcr[2].m_chwFirst = 69; // E
+ m_prgmcr[2].m_chwLast = 69;
+ m_prgmcr[2].m_col = 2;
+
+ m_prgmcr[3].m_chwFirst = 79; // O
+ m_prgmcr[3].m_chwLast = 79;
+ m_prgmcr[3].m_col = 0;
+
+ m_prgmcr[4].m_chwFirst = 97; // a
+ m_prgmcr[4].m_chwLast = 97;
+ m_prgmcr[4].m_col = 1;
+
+ m_prgmcr[5].m_chwFirst = 98; // b - d
+ m_prgmcr[5].m_chwLast = 100;
+ m_prgmcr[5].m_col = 4;
+
+ m_prgmcr[6].m_chwFirst = 101; // e
+ m_prgmcr[6].m_chwLast = 101;
+ m_prgmcr[6].m_col = 3;
+
+ m_prgmcr[7].m_chwFirst = 102; // f - n
+ m_prgmcr[7].m_chwLast = 110;
+ m_prgmcr[7].m_col = 4;
+
+ m_prgmcr[8].m_chwFirst = 111; // o
+ m_prgmcr[8].m_chwLast = 111;
+ m_prgmcr[8].m_col = 1;
+
+ m_prgmcr[9].m_chwFirst = 112; // p - w
+ m_prgmcr[9].m_chwLast = 119;
+ m_prgmcr[9].m_col = 4;
+
+ m_prgmcr[10].m_chwFirst = 120; // x
+ m_prgmcr[10].m_chwLast = 120;
+ m_prgmcr[10].m_col = 5;
+
+ m_prgmcr[11].m_chwFirst = 121; // y - z
+ m_prgmcr[11].m_chwLast = 122;
+ m_prgmcr[11].m_col = 4;
+
+ m_prgmcr[12].m_chwFirst = 188; // 1/4, 1/2, 3/4
+ m_prgmcr[12].m_chwLast = 190;
+ m_prgmcr[12].m_col = 6;
+
+
+ m_dimcrInit = 8; // (max power of 2 <= m_cmcr);
+ m_cLoop = 3; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 9;
+ m_crowNonAcpt = 6;
+ m_crowFinal = 3;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 8;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[(m_crow-m_crowFinal) * m_ccol]; // 48
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1; *psn++ = 2; *psn++ = 0; *psn++ = 4; *psn++ = 3; *psn++ = 3; *psn++ = 6; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 7; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 7; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 5;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 5;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 5;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 8; *psn++ = 0; *psn++ = 0;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[3]; // 3 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[3+1]; // 3 = m_crow - m_crowNonAcpt
+
+ m_prgirulnMin[0] = 0; // s6: r2
+ m_prgrulnMatched[0] = 2;
+
+ m_prgirulnMin[1] = 1; // s7: r0
+ m_prgrulnMatched[1] = 0;
+
+ m_prgirulnMin[2] = 2; // s8: r1
+ m_prgrulnMatched[2] = 1;
+
+ m_prgirulnMin[3] = 3;
+ }
+ else if (ipass == 3)
+ {
+ // Create machine class ranges.
+ m_cmcr = 1;
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ m_prgmcr[0].m_chwFirst = 35; // #
+ m_prgmcr[0].m_chwLast = 35;
+ m_prgmcr[0].m_col = 0;
+
+ m_dimcrInit = 1; // (max power of 2 <= m_cmcr);
+ m_cLoop = 0; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 2;
+ m_crowNonAcpt = 1;
+ m_crowFinal = 1;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 1;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[(m_crow-m_crowFinal) * m_ccol]; // 1
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[1]; // 1 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[m_crow - m_crowNonAcpt + 1];
+
+ m_prgirulnMin[0] = 0; // s1: r0
+ m_prgrulnMatched[0] = 0;
+
+ m_prgirulnMin[1] = 1;
+ }
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Second batch of association tests.
+
+ PASS 1:
+ r0. clsSymbol _ > _ @1 / _ gNumber gHyphen # gNumber _;
+ r1. clsSymbol _ > _ @1 / _ gHyphen # _;
+ r2. _ clsSymbol > @6 _ / _ gNumber gHyphen # gNumber _;
+ r3. _ clsSymbol > @4 _ / _ gHyphen # _;
+ r4. clsLeft _ > @1 clsRight$1:1 / _ clsLetter gHyphen # _ gSpace;
+ r5. clsLeft _ > @1 clsRight$1:1 / _ clsLetter gHyphen # clsLetter _ gSpace;
+ r6. clsLeft _ > @1 clsRight$1:1 / _ clsLetter _ gSpace;
+ r7. clsLeft _ > @1 clsRight$1:1 / _ clsLetter clsLetter _ gSpace;
+
+ Pass 1 machine classes:
+ mcSym: @, $, %, & 64, 36, 37, 38
+ mcNum: 48-57
+ mcHyphen: 45
+ mcSpace: 32
+ mcLet: 97-122
+ mcLeft: ( [ { 40, 91, 123
+ mcRight: ) ] } 41, 93, 125
+
+ Pass 1 FSM: (T=transition, F=final, A=accepting, NA=non-accepting)
+
+ | mcSym mcNum mcHyph mcSpace mcLet mcLeft mcLB
+ ----------------------------------------------------------------------------------
+ T NA s0 | s1 s2 s3 s4
+ |
+ T NA s1 | s5 s6
+ |
+ T NA s2 | s7
+ |
+ T NA s3 | s8
+ |
+ T NA s4 | s9
+ |
+ T NA s5 | s10
+ |
+ T NA s6 | s18
+ |
+ T NA s7 | s11
+ |
+ T NA s8 | s19
+ |
+ T NA s9 | s12 s20 s13
+ |
+ T NA s10 | s14
+ |
+ T NA s11 | s15
+ |
+ T NA s12 | s16
+ |
+ T NA s13 | s21
+ |
+ T NA s14 | s22
+ |
+ T NA s15 | s23
+ |
+ T NA s16 | s24 s17
+ |
+ T NA s17 | s25
+ |
+ F A s18 |
+ |
+ F A s19 |
+ |
+ F A s20 |
+ |
+ F A s21 |
+ |
+ F A s22 |
+ |
+ F A s23 |
+ |
+ F A s24 |
+ |
+ F A s25 |
+
+
+ Rules Matched:
+ s18: r1
+ s19: r3
+ s20: r6
+ s21: r7
+ s22: r0
+ s23: r2
+ s24: r4
+ s25: r5
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetUpAssoc2Test()
+{
+ if (m_pctbl)
+ delete m_pctbl;
+
+ m_pctbl = new GrClassTable();
+ m_pctbl->SetUpAssoc2Test();
+
+ m_fLineBreak = true;
+ m_cchwPreXlbContext = 3;
+ m_cchwPostXlbContext = 2;
+}
+
+void GrClassTable::SetUpAssoc2Test()
+{
+ m_ccls = 2; // number of classes
+ m_cclsLinear = 1; // number of classes in linear format (output classes)
+
+ m_prgchwBIGGlyphList = new data16[13];
+
+ m_prgichwOffsets = new data16[m_ccls+1];
+
+ data16 * pchw = m_prgchwBIGGlyphList;
+
+ // Output class 0: clsRight
+ m_prgichwOffsets[0] = 0;
+ *pchw++ = msbf(data16(41)); // )
+ *pchw++ = msbf(data16(93)); // ]
+ *pchw++ = msbf(data16(125)); // }
+
+ // Input class 1: clsLeft
+ m_prgichwOffsets[1] = 3;
+ *pchw++ = msbf(data16(3));
+ *pchw++ = msbf(data16(2)); *pchw++ = msbf(data16(1)); *pchw++ = msbf(data16(3-2));
+ *pchw++ = msbf(data16(40)); *pchw++ = msbf(data16(0)); // (
+ *pchw++ = msbf(data16(91)); *pchw++ = msbf(data16(1)); // [
+ *pchw++ = msbf(data16(123)); *pchw++ = msbf(data16(2)); // {
+
+ m_prgichwOffsets[2] = 3 + 4 + 3*2; // 13
+}
+
+void GrSubPass::SetUpAssoc2Test()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 6;
+ m_nMaxRuleLoop = 5;
+ m_staBehavior = "Assoc2";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpAssoc2Test(m_ipass);
+
+ m_crul = 8;
+
+ // Set up constraint code.
+ m_prgbConstraintBlock = new byte[1];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 0;
+ m_prgibConstraintStart[1] = 0;
+ m_prgibConstraintStart[2] = 0;
+ m_prgibConstraintStart[3] = 0;
+ m_prgibConstraintStart[4] = 0;
+ m_prgibConstraintStart[5] = 0;
+ m_prgibConstraintStart[6] = 0;
+ m_prgibConstraintStart[7] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[11 + 9 + 11 + 9 + 14 + 15 + 12 + 13];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: clsSymbol _ > _ @1 / _ gNumber gHyphen # gNumber _;
+
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutCopy; *pb++ = -4; // PutCopy -4
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 1: clsSymbol _ > _ @1 / _ gHyphen # _;
+
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutCopy; *pb++ = -2; // PutCopy -2
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 2: _ clsSymbol > @6 _ / _ gNumber gHyphen # gNumber _;
+
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutCopy; *pb++ = 5; // PutCopy 5
+ *pb++ = kopNext; // Next
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 3: _ clsSymbol > @4 _ / _ gHyphen # _;
+
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutCopy; *pb++ = 3; // PutCopy 3
+ *pb++ = kopNext; // Next
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 4: clsLeft _ > @1 clsRight$1 / _ clsLetter gHyphen # _ gSpace;
+
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutSubs8bitObs; *pb++ = -3; // PutSubs -3 1 0
+ *pb++ = 1; *pb++ = 0;
+ *pb++ = kopAssoc; *pb++ = 1; // Assoc 1 -3
+ *pb++ = -3;
+ *pb++ = kopNext; // Next;
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 5: clsLeft _ > @1 clsRight$1 / _ clsLetter gHyphen # clsLetter _ gSpace;
+
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutSubs8bitObs; *pb++ = -4; // PutSubs -4 1 0
+ *pb++ = 1; *pb++ = 0;
+ *pb++ = kopAssoc; *pb++ = 1; // Assoc 1 -4
+ *pb++ = -4;
+ *pb++ = kopNext; // Next;
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 6: clsLeft _ > @1 clsRight$1 / _ clsLetter _ gSpace;
+
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutSubs8bitObs; *pb++ = -1; // PutSubs -1 1 0
+ *pb++ = 1; *pb++ = 0;
+ *pb++ = kopAssoc; *pb++ = 1; // Assoc 1 -1
+ *pb++ = -1;
+ *pb++ = kopNext; // Next;
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 7: clsLeft _ > @1 clsRight$1 / _ clsLetter clsLetter _ gSpace;
+
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutSubs8bitObs; *pb++ = -2; // PutSubs -2 1 0
+ *pb++ = 1; *pb++ = 0;
+ *pb++ = kopAssoc; *pb++ = 1; // Assoc 1 -2
+ *pb++ = -2;
+ *pb++ = kopNext; // Next;
+ *pb++ = kopRetZero; // RetZero
+
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 11;
+ m_prgibActionStart[2] = 11 + 9;
+ m_prgibActionStart[3] = 20 + 11;
+ m_prgibActionStart[4] = 31 + 9;
+ m_prgibActionStart[5] = 40 + 14;
+ m_prgibActionStart[6] = 54 + 15;
+ m_prgibActionStart[7] = 69 + 12;
+}
+
+
+void GrFSM::SetUpAssoc2Test(int ipass)
+{
+ // Create machine class ranges.
+ m_cmcr = 10;
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ m_prgmcr[0].m_chwFirst = 32; // space
+ m_prgmcr[0].m_chwLast = 32;
+ m_prgmcr[0].m_col = 3;
+
+ m_prgmcr[1].m_chwFirst = 35; // #
+ m_prgmcr[1].m_chwLast = 35;
+ m_prgmcr[1].m_col = 6;
+
+ m_prgmcr[2].m_chwFirst = 36; // $, %, &
+ m_prgmcr[2].m_chwLast = 38;
+ m_prgmcr[2].m_col = 0;
+
+ m_prgmcr[3].m_chwFirst = 40; // (
+ m_prgmcr[3].m_chwLast = 40;
+ m_prgmcr[3].m_col = 5;
+
+ m_prgmcr[4].m_chwFirst = 45; // -
+ m_prgmcr[4].m_chwLast = 45;
+ m_prgmcr[4].m_col = 2;
+
+ m_prgmcr[5].m_chwFirst = 48; // 0 - 9
+ m_prgmcr[5].m_chwLast = 57;
+ m_prgmcr[5].m_col = 1;
+
+ m_prgmcr[6].m_chwFirst = 64; // @
+ m_prgmcr[6].m_chwLast = 64;
+ m_prgmcr[6].m_col = 0;
+
+ m_prgmcr[7].m_chwFirst = 91; // [
+ m_prgmcr[7].m_chwLast = 91;
+ m_prgmcr[7].m_col = 5;
+
+ m_prgmcr[8].m_chwFirst = 97; // a - z
+ m_prgmcr[8].m_chwLast = 122;
+ m_prgmcr[8].m_col = 4;
+
+ m_prgmcr[9].m_chwFirst = 123; // {
+ m_prgmcr[9].m_chwLast = 123;
+ m_prgmcr[9].m_col = 5;
+
+
+ m_dimcrInit = 8; // (max power of 2 <= m_cmcr);
+ m_cLoop = 3; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 26;
+ m_crowNonAcpt = 18;
+ m_crowFinal = 8;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 7;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[(m_crow-m_crowFinal) * m_ccol]; // 126
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1; *psn++ = 2; *psn++ = 3; *psn++ = 0; *psn++ = 0; *psn++ = 4; *psn++ = 0;
+ *psn++ = 0; *psn++ = 5; *psn++ = 6; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 7; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 8;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 9; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ =10; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ =18;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ =11;
+ *psn++ =19; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ =12; *psn++ =20; *psn++ =13; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ =14;
+ *psn++ = 0; *psn++ =15; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ =16;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ =21; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ =22; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ =23; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ =24; *psn++ =17; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ =25; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[8]; // 3 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[m_crow - m_crowNonAcpt + 1];
+
+ m_prgirulnMin[0] = 0; // s18: r1
+ m_prgrulnMatched[0] = 1;
+
+ m_prgirulnMin[1] = 1; // s19: r3
+ m_prgrulnMatched[1] = 3;
+
+ m_prgirulnMin[2] = 2; // s20: r6
+ m_prgrulnMatched[2] = 6;
+
+ m_prgirulnMin[3] = 3; // s21: r7
+ m_prgrulnMatched[3] = 7;
+
+ m_prgirulnMin[4] = 4; // s22: r0
+ m_prgrulnMatched[4] = 0;
+
+ m_prgirulnMin[5] = 5; // s23: r2
+ m_prgrulnMatched[5] = 2;
+
+ m_prgirulnMin[6] = 6; // s24: r4
+ m_prgrulnMatched[6] = 4;
+
+ m_prgirulnMin[7] = 7; // s25: r5
+ m_prgrulnMatched[7] = 5;
+
+ m_prgirulnMin[8] = 8;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Test of default associations
+
+ PASS 1:
+ r0. gDollar _ > @1 gEquals;
+ r1. gAtSign > _ ;
+
+ Pass 1 machine classes:
+ mcDollar: $ 36
+ mcAt: @ 64
+
+ Pass 1 FSM: (T=transition, F=final, A=accepting, NA=non-accepting)
+
+ | mcDollar mcAt
+ --------------------------------------
+ T NA s0 | s1 s2
+ |
+ F A s1 |
+ |
+ F A s2 |
+
+
+ Rules Matched:
+ s1: r0
+ s2: r1
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetUpDefaultAssocTest()
+{
+ if (m_pctbl)
+ delete m_pctbl;
+
+ m_pctbl = new GrClassTable();
+ m_pctbl->SetUpDefaultAssocTest();
+}
+
+void GrClassTable::SetUpDefaultAssocTest()
+{
+ m_ccls = 1; // number of classes
+ m_cclsLinear = 1; // number of classes in linear format
+
+ m_prgchwBIGGlyphList = new data16[1];
+
+ m_prgichwOffsets = new data16[m_ccls+1];
+
+ data16 * pchw = m_prgchwBIGGlyphList;
+
+ // Output class 0: gEquals
+ m_prgichwOffsets[0] = 0;
+ *pchw++ = msbf(data16(61));
+
+ m_prgichwOffsets[1] = 1;
+}
+
+void GrSubPass::SetUpDefaultAssocTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 5;
+ m_staBehavior = "DefaultAssoc";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpDefaultAssocTest();
+
+ m_crul = 2;
+
+ // Set up constraint code.
+ m_prgbConstraintBlock = new byte[1];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue;
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 0;
+ m_prgibConstraintStart[1] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[6 + 3];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: gDollar _ > @1 gEquals;
+
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopInsert; // Insert
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 0; // PutGlyph 0
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 1: gAtSign > _ ;
+
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 6;
+}
+
+
+void GrFSM::SetUpDefaultAssocTest()
+{
+ // Create machine class ranges.
+ m_cmcr = 2;
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ m_prgmcr[0].m_chwFirst = 36; // $
+ m_prgmcr[0].m_chwLast = 36;
+ m_prgmcr[0].m_col = 0;
+
+ m_prgmcr[1].m_chwFirst = 64; // @
+ m_prgmcr[1].m_chwLast = 64;
+ m_prgmcr[1].m_col = 1;
+
+
+ m_dimcrInit = 2; // (max power of 2 <= m_cmcr);
+ m_cLoop = 1; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 3;
+ m_crowNonAcpt = 1;
+ m_crowFinal = 2;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 2;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[(m_crow-m_crowFinal) * m_ccol]; // 2
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1; *psn++ = 2;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[2]; // 2 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[m_crow - m_crowNonAcpt + 1];
+
+ m_prgirulnMin[0] = 0; // s1: r0
+ m_prgrulnMatched[0] = 0;
+
+ m_prgirulnMin[1] = 1; // s2: r1
+ m_prgrulnMatched[1] = 1;
+
+ m_prgirulnMin[2] = 2;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Test of features. The ID of "theFeature" == 234, its index is 0. The default value is 1.
+
+ PASS 1:
+ if (theFeature == 0) // * -> $
+ r0. gAsterisk > gDollar ;
+ else if (theFeature == 1) // * -> %
+ r1. gAsterisk > gPercent ;
+ else // * -> @
+ r2. gAsterisk > gAt ;
+
+ Pass 1 machine classes:
+ mcAsterisk: * 42
+
+ Pass 1 FSM: (T=transition, F=final, A=accepting, NA=non-accepting)
+
+ | mcAsterisk
+ --------------------------------
+ T NA s0 | s1
+ |
+ F A s1 |
+
+
+ Rules Matched:
+ s1: r0, r1, r2
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetUpFeatureTest()
+{
+ AddFeature(234, 0, 1, 1);
+
+ if (m_pctbl)
+ delete m_pctbl;
+
+ m_pctbl = new GrClassTable();
+ m_pctbl->SetUpFeatureTest();
+}
+
+void GrClassTable::SetUpFeatureTest()
+{
+ m_ccls = 4; // number of classes
+ m_cclsLinear = 4; // number of classes in linear format
+
+ m_prgchwBIGGlyphList = new data16[4];
+
+ m_prgichwOffsets = new data16[m_ccls + 1];
+
+ data16 * pchw = m_prgchwBIGGlyphList;
+
+ m_prgichwOffsets[0] = 0;
+ *pchw++ = msbf(data16(36)); // $
+
+ m_prgichwOffsets[1] = 1;
+ *pchw++ = msbf(data16(37)); // %
+
+ m_prgichwOffsets[2] = 2;
+ *pchw++ = msbf(data16(64)); // @
+
+ m_prgichwOffsets[3] = 3;
+ *pchw++ = msbf(data16(42)); // *
+
+ m_prgichwOffsets[4] = 4;
+}
+
+void GrSubPass::SetUpFeatureTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 5;
+ m_staBehavior = "Feature";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpFeatureTest();
+
+ m_crul = 3;
+
+ // Set up constraint code.
+ m_prgbConstraintBlock = new byte[1 + 6 + 12 + 12];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue;
+
+ // (theFeature == 0)
+ *pb++ = kopPushFeat; *pb++ = 0; // PushFeat 0
+ *pb++ = kopPushByte; *pb++ = 0; // PushByte 0
+ *pb++ = kopEqual; // Equal
+ *pb++ = kopPopRet; // PopAndRet
+
+ // (theFeature != 0 && theFeature == 1)
+ *pb++ = kopPushFeat; *pb++ = 0; // PushFeat 0
+ *pb++ = kopPushByte; *pb++ = 0; // PushByte 0
+ *pb++ = kopNotEq; // NotEq
+ *pb++ = kopPushFeat; *pb++ = 0; // PushFeat 0
+ *pb++ = kopPushByte; *pb++ = 1; // PushByte 1
+ *pb++ = kopEqual; // Equal
+ *pb++ = kopAnd; // And
+ *pb++ = kopPopRet; // PopAndRet
+
+ // (theFeature != 0 && theFeature != 1)
+ *pb++ = kopPushFeat; *pb++ = 0; // PushFeat 0
+ *pb++ = kopPushByte; *pb++ = 0; // PushByte 0
+ *pb++ = kopNotEq; // NotEq
+ *pb++ = kopPushFeat; *pb++ = 0; // PushFeat 0
+ *pb++ = kopPushByte; *pb++ = 1; // PushByte 1
+ *pb++ = kopNotEq; // NotEq
+ *pb++ = kopAnd; // And
+ *pb++ = kopPopRet; // PopAndRet
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 1;
+ m_prgibConstraintStart[1] = 1 + 6;
+ m_prgibConstraintStart[2] = 1 + 6 + 12;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[4 + 4 + 4];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: gAsterisk > gDollar ;
+
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 0; // PutGlyph 0
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 1: gAsterisk > gPercent ;
+
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 1; // PutGlyph 1
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 2: gAsterisk > gAt ;
+
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 2; // PutGlyph 2
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 4;
+ m_prgibActionStart[2] = 4 + 4;
+}
+
+
+void GrFSM::SetUpFeatureTest()
+{
+ // Create machine class ranges.
+ m_cmcr = 1;
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ m_prgmcr[0].m_chwFirst = 42; // *
+ m_prgmcr[0].m_chwLast = 42;
+ m_prgmcr[0].m_col = 0;
+
+
+ m_dimcrInit = 1; // (max power of 2 <= m_cmcr);
+ m_cLoop = 0; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 2;
+ m_crowNonAcpt = 1;
+ m_crowFinal = 1;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 1;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[(m_crow-m_crowFinal) * m_ccol]; // 1
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[3]; // 3 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[m_crow - m_crowNonAcpt + 1];
+
+ m_prgirulnMin[0] = 0; // s1: r0, r1, r2
+ m_prgrulnMatched[0] = 0;
+ m_prgrulnMatched[1] = 1;
+ m_prgrulnMatched[2] = 2;
+
+ m_prgirulnMin[1] = 3;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Tests of ligatures and components.
+
+ PASS 1 (line-break):
+ r0. clsLetter { break = 2 }
+
+ Pass 1 machine classes:
+ mcLetter: a - z 97 - 122
+
+ Pass 1 FSM: (T=transition, F=final, A=accepting, NA=non-accepting)
+
+ | clsLetter
+ --------------------------------
+ T NA s0 | s1
+ |
+ F A s1 |
+
+
+ Rules Matched:
+ s1: r0
+
+
+ PASS 2 (substitution):
+ r0. gX gY gZ > gCapX:(1 2 4) { comp {X.ref=@1; Y.ref=@2; Z.ref=@4 }} _ _
+ / _ _ # {break==2} _;
+ r1. gX gY gZ > _ _ gCapZ:(1 3 4) { comp {X.ref=@1; Y.ref=@3; Z.ref=@4 }}
+ / _ # {break==2} _ _;
+ r2. gX gY gZ > _ gCapY:(1 2 3) { comp {X.ref=@1; Y.ref=@2; Z.ref=@3 }} gPlus;
+
+ Pass 2 machine classes:
+ mcX: x 120
+ mcY: y 121
+ mcZ: z 122
+ mcLB: 35
+
+
+ Pass 2 FSM:
+ | mcX mcY mcZ mcLB
+ ----------------------------------------------------
+ T NA s0 | s1
+ | - - -
+ T NA s1 | s2 s3
+ | - - -
+ T NA s2 | s6 s4
+ | - - -
+ T NA s3 | s5
+ | - - -
+ T NA s4 | s7
+ | - - -
+ T NA s5 | s8
+ | - - -
+ F A s6 |
+ | - - -
+ F A s7 |
+ | - - -
+ F A s8 |
+ | - - -
+
+ Rules matched:
+ s6: r2
+ s7: r0
+ s8: r1
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetUpLigatureTest()
+{
+ if (m_pctbl)
+ delete m_pctbl;
+
+ m_pctbl = new GrClassTable();
+ m_pctbl->SetUpLigatureTest();
+
+ m_pgtbl = new GrGlyphTable();
+ m_pgtbl->SetUpLigatureTest();
+
+ m_fLineBreak = true;
+ m_cchwPreXlbContext = 2;
+ m_cchwPostXlbContext = 2;
+}
+
+void GrClassTable::SetUpLigatureTest()
+{
+ m_ccls = 7; // number of classes
+ m_cclsLinear = 7; // number of classes in linear format (all classes are single-item)
+
+ m_prgchwBIGGlyphList = new data16[7];
+
+ m_prgichwOffsets = new data16[m_ccls+1];
+
+ data16 * pchw = m_prgchwBIGGlyphList;
+
+ // Class 0: gCapX
+ m_prgichwOffsets[0] = 0;
+ *pchw++ = msbf(data16(88)); // X
+
+ // Class 1: gCapY
+ m_prgichwOffsets[1] = 1;
+ *pchw++ = msbf(data16(89)); // Y
+
+ // Class 2: gCapZ
+ m_prgichwOffsets[2] = 2;
+ *pchw++ = msbf(data16(90)); // Z
+
+ // Class 3: gPlus
+ m_prgichwOffsets[3] = 3;
+ *pchw++ = msbf(data16(43)); // +
+
+ // Class 4: gX
+ m_prgichwOffsets[4] = 4;
+ *pchw++ = msbf(data16(120)); // x
+
+ // Class 5: gY
+ m_prgichwOffsets[5] = 5;
+ *pchw++ = msbf(data16(121)); // y
+
+ // Class 6: gZ
+ m_prgichwOffsets[6] = 6;
+ *pchw++ = msbf(data16(122)); // z
+
+ m_prgichwOffsets[7] = 7;
+}
+
+void GrGlyphTable::SetUpLigatureTest()
+{
+ SetNumberOfGlyphs(128);
+ SetNumberOfStyles(1);
+
+ GrGlyphSubTable * pgstbl = new GrGlyphSubTable();
+ Assert(pgstbl);
+
+ pgstbl->Initialize(1, 0, 128, 10, 4);
+ SetSubTable(0, pgstbl);
+
+ SetNumberOfComponents(4); // comp.w, comp.x, comp.y, comp.z
+
+ pgstbl->SetUpLigatureTest();
+}
+
+/***********************************************************************************************
+ TODO: This method is BROKEN because m_prgibBIGAttrValues has been changed. It is no
+ longer a data16 *. The Gloc table can contain 16-bit or 32-bit entries and must be
+ accessed accordingly.
+***********************************************************************************************/
+void GrGlyphSubTable::SetUpLigatureTest()
+{
+ m_nAttrIDLim = 20;
+
+ m_pgatbl = new GrGlyphAttrTable();
+ m_pgatbl->Initialize(0, 102);
+
+ for (int i = 0; i < 88; i++)
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(0));
+
+ m_prgibBIGAttrValues[88] = (byte)msbf(data16(0));
+ m_prgibBIGAttrValues[89] = (byte)msbf(data16(34));
+ m_prgibBIGAttrValues[90] = (byte)msbf(data16(68));
+
+ for (i = 91; i < 128; i++)
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(102));
+
+ m_pgatbl->SetUpLigatureTest();
+}
+
+void GrGlyphAttrTable::SetUpLigatureTest()
+{
+ // Glyph 88 'X' (2 runs; offset = 0):
+ // 0 = 0 comp.w undefined
+ // 1 = 8 comp.x: (0,0, 25,100)
+ // 2 = 12 comp.y: (25,0, 75,100)
+ // 3 = 16 comp.z: (75,0, 100,100)
+ // 4-7 = 0 comp.w box corners
+ // 8 = 100 comp.x. top
+ // 9 = 0 bottom
+ // 10= 0 left
+ // 11= 25 right
+ // 12= 100 comp.y. top
+ // 13= 0 bottom
+ // 14= 25 left
+ // 15= 75 right
+ // 16= 100 comp.z. top
+ // 17= 0 bottom
+ // 18= 75 left
+ // 19= 100 right
+ //
+ // Glyph 89 (2 runs; offset = 34):
+ // 0 = 0 comp.w undefined
+ // 1 = 8 comp.x: (0,0, 33,100)
+ // 2 = 12 comp.y: (33,0, 67,100)
+ // 3 = 16 comp.z: (67,0, 100,100)
+ // 4-7 = 0 comp.w box corners
+ // 8 = 100 comp.x. top
+ // 9 = 0 bottom
+ // 10= 0 left
+ // 11= 33 right
+ // 12= 100 comp.y. top
+ // 13= 0 bottom
+ // 14= 33 left
+ // 15= 67 right
+ // 16= 100 comp.z. top
+ // 17= 0 bottom
+ // 18= 67 left
+ // 19= 100 right
+ //
+ // Glyph 90 (2 runs; offset = 68):
+ // 0 = 0 comp.w undefined
+ // 1 = 8 comp.x: (0,0, 10,100)
+ // 2 = 12 comp.y: (10,0, 90,100)
+ // 3 = 16 comp.z: (90,0, 100,100)
+ // 4-7 = 0 comp.w box corners
+ // 8 = 100 comp.x. top
+ // 9 = 0 bottom
+ // 10= 0 left
+ // 11= 10 right
+ // 12= 100 comp.y. top
+ // 13= 0 bottom
+ // 14= 10 left
+ // 15= 90 right
+ // 16= 100 comp.z. top
+ // 17= 0 bottom
+ // 18= 90 left
+ // 19= 100 right
+
+ byte * pbBIG = m_prgbBIGEntries;
+
+ GrGlyphAttrRun gatrun;
+
+ // Glyph 88 'X'
+ gatrun.m_bMinAttrID = 1;
+ gatrun.m_cAttrs = 3;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(8));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(12));
+ gatrun.m_rgchwBIGValues[2] = msbf(data16(16));
+ memcpy(pbBIG, &gatrun, 8); // 8 = 3*2 + 2
+ pbBIG += 8;
+ gatrun.m_bMinAttrID = 8; // comp.x.top
+ gatrun.m_cAttrs = 12;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[2] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[3] = msbf(data16(25));
+ gatrun.m_rgchwBIGValues[4] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[5] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[6] = msbf(data16(25));
+ gatrun.m_rgchwBIGValues[7] = msbf(data16(75));
+ gatrun.m_rgchwBIGValues[8] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[9] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[10] = msbf(data16(75));
+ gatrun.m_rgchwBIGValues[11] = msbf(data16(100));
+ memcpy(pbBIG, &gatrun, 26); // 26 = 12*2 + 2
+ pbBIG += 26;
+
+ // Glyph 89 'Y'
+ gatrun.m_bMinAttrID = 1;
+ gatrun.m_cAttrs = 3;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(8));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(12));
+ gatrun.m_rgchwBIGValues[2] = msbf(data16(16));
+ memcpy(pbBIG, &gatrun, 8); // 8 = 3*2 + 2
+ pbBIG += 8;
+ gatrun.m_bMinAttrID = 8; // comp.x.top
+ gatrun.m_cAttrs = 12;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[2] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[3] = msbf(data16(33));
+ gatrun.m_rgchwBIGValues[4] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[5] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[6] = msbf(data16(33));
+ gatrun.m_rgchwBIGValues[7] = msbf(data16(67));
+ gatrun.m_rgchwBIGValues[8] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[9] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[10] = msbf(data16(67));
+ gatrun.m_rgchwBIGValues[11] = msbf(data16(100));
+ memcpy(pbBIG, &gatrun, 26); // 26 = 12*2 + 2
+ pbBIG += 26;
+
+ // Glyph 90 'Z'
+ gatrun.m_bMinAttrID = 1;
+ gatrun.m_cAttrs = 3;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(8));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(12));
+ gatrun.m_rgchwBIGValues[2] = msbf(data16(16));
+ memcpy(pbBIG, &gatrun, 8); // 8 = 3*2 + 2
+ pbBIG += 8;
+ gatrun.m_bMinAttrID = 8; // comp.x.top
+ gatrun.m_cAttrs = 12;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[2] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[3] = msbf(data16(10));
+ gatrun.m_rgchwBIGValues[4] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[5] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[6] = msbf(data16(10));
+ gatrun.m_rgchwBIGValues[7] = msbf(data16(90));
+ gatrun.m_rgchwBIGValues[8] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[9] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[10] = msbf(data16(90));
+ gatrun.m_rgchwBIGValues[11] = msbf(data16(100));
+ memcpy(pbBIG, &gatrun, 26); // 26 = 12*2 + 2
+ pbBIG += 26;
+
+ Assert(pbBIG == m_prgbBIGEntries + 102);
+}
+
+void GrLineBreakPass::SetUpLigatureTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 5;
+ m_staBehavior = "Ligatures";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpLigatureTest(m_ipass);
+
+ m_crul = 1;
+
+ // Set up constraint code--succeed trivially.
+ m_prgbConstraintBlock = new byte[1];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[8];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: clsLetter { break = 2 }
+
+ *pb++ = kopPutCopy; *pb++ = 0; // PutCopy 0
+ *pb++ = kopPushByte; *pb++ = 2; // PushByte 2
+ *pb++ = kopAttrSet; *pb++ = kslatBreak; // AttrSet breakweight
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+}
+
+void GrSubPass::SetUpLigatureTest()
+{
+ if (m_ipass == 2)
+ {
+ m_nMaxRuleContext = m_nMaxChunk = 4;
+ m_nMaxRuleLoop = 5;
+ m_staBehavior = "Ligatures";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpLigatureTest(m_ipass);
+
+ m_crul = 3;
+
+ // Set up constraint code.
+ m_prgbConstraintBlock = new byte[1 + 10 + 10];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ *pb++ = kopCntxtItem; *pb++ = 2; // ContextItem 2
+ *pb++ = kopPushSlotAttr;*pb++ = kslatBreak; // PushSlotAttr break 0
+ *pb++ = 0;
+ *pb++ = kopPushByte; *pb++ = 2; // Push 2
+ *pb++ = kopEqual; // Equal
+ *pb++ = kopOr; // Or
+ *pb++ = kopPopRet; // PopAndRet
+
+ *pb++ = kopCntxtItem; *pb++ = 1; // ContextItem 1
+ *pb++ = kopPushSlotAttr;*pb++ = kslatBreak; // PushSlotAttr break 0
+ *pb++ = 0;
+ *pb++ = kopPushByte; *pb++ = 2; // Push 2
+ *pb++ = kopEqual; // Equal
+ *pb++ = kopOr; // Or
+ *pb++ = kopPopRet; // PopAndRet
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 1;
+ m_prgibConstraintStart[1] = 11;
+ m_prgibConstraintStart[2] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[29 + 29 + 29];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: gX gY gZ > gCapX:(1 2 4) { comp {X.ref=@1; Y.ref=@2; Z.ref=@4 }} _ _
+ // / _ _ # {break==2} _;
+
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 0; // PutGlyph 0 (gCapX)
+ *pb++ = kopAssoc; *pb++ = 3; // Assoc 3 0 1 3
+ *pb++ = 0; *pb++ = 1; *pb++ = 3;
+ *pb++ = kopPushByte; *pb++ = 0; // Push 0
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot comp_ref x
+ *pb++ = kslatCompRef; *pb++ = 1;
+ *pb++ = kopPushByte; *pb++ = 1; // Push 1
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot comp_ref y
+ *pb++ = kslatCompRef; *pb++ = 2;
+ *pb++ = kopPushByte; *pb++ = 3; // Push 3
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot comp_ref z
+ *pb++ = kslatCompRef; *pb++ = 3;
+ *pb++ = kopNext; // Next
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 1: gX gY gZ > _ _ gCapZ:(1 3 4) { comp {X.ref=@1; Y.ref=@3; Z.ref=@4 }}
+ // / _ # {break==2} _ _;
+
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopCopyNext; // CopyNext
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 2; // PutGlyph 2 (gCapZ)
+ *pb++ = kopAssoc; *pb++ = 3; // Assoc 3 -3 -1 0
+ *pb++ = -3; *pb++ = -1; *pb++ = 0;
+ *pb++ = kopPushByte; *pb++ = -3; // Push -3
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot comp_ref x
+ *pb++ = kslatCompRef; *pb++ = 1;
+ *pb++ = kopPushByte; *pb++ = -1; // Push -1
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot comp_ref y
+ *pb++ = kslatCompRef; *pb++ = 2;
+ *pb++ = kopPushByte; *pb++ = 0; // Push 0
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot comp_ref z
+ *pb++ = kslatCompRef; *pb++ = 3;
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 2: gX gY gZ > _ gCapY:(1 2 3) { comp {X.ref=@1; Y.ref=@2; Z.ref=@3 }} gPlus;
+
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 1; // PutGlyph 1 (gCapY)
+ *pb++ = kopAssoc; *pb++ = 3; // Assoc 3 -1 0 1
+ *pb++ = -1; *pb++ = 0; *pb++ = 1;
+ *pb++ = kopPushByte; *pb++ = -1; // Push -1
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot comp_ref x
+ *pb++ = kslatCompRef; *pb++ = 1;
+ *pb++ = kopPushByte; *pb++ = 0; // Push 0
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot comp_ref y
+ *pb++ = kslatCompRef; *pb++ = 2;
+ *pb++ = kopPushByte; *pb++ = 1; // Push 1
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot comp_ref z
+ *pb++ = kslatCompRef; *pb++ = 3;
+ *pb++ = kopNext; // Next
+ *pb++ = kopPutGlyph8bitObs; *pb++ = 3; // PutGlyph 3 (gPlus)
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 29;
+ m_prgibActionStart[2] = 29 + 29;
+ }
+ else
+ Assert(false);
+}
+
+
+void GrFSM::SetUpLigatureTest(int ipass)
+{
+ if (ipass == 1)
+ {
+ // Create machine class ranges.
+ m_cmcr = 1;
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ m_prgmcr[0].m_chwFirst = 97; // a - z
+ m_prgmcr[0].m_chwLast = 122;
+ m_prgmcr[0].m_col = 0;
+
+ m_dimcrInit = 1; // (max power of 2 <= m_cmcr);
+ m_cLoop = 0; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 2;
+ m_crowNonAcpt = 1;
+ m_crowFinal = 1;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 1;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[(m_crow-m_crowFinal) * m_ccol]; // 1
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[1]; // 1 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[m_crow - m_crowNonAcpt + 1];
+
+ m_prgirulnMin[0] = 0; // s1: r0
+ m_prgrulnMatched[0] = 0;
+
+ m_prgirulnMin[1] = 1;
+ }
+ else if (ipass == 2)
+ {
+ // Create machine class ranges.
+ m_cmcr = 4;
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ m_prgmcr[0].m_chwFirst = 35; // #
+ m_prgmcr[0].m_chwLast = 35;
+ m_prgmcr[0].m_col = 3;
+
+ m_prgmcr[1].m_chwFirst = 120; // x
+ m_prgmcr[1].m_chwLast = 120;
+ m_prgmcr[1].m_col = 0;
+
+ m_prgmcr[2].m_chwFirst = 121; // y
+ m_prgmcr[2].m_chwLast = 121;
+ m_prgmcr[2].m_col = 1;
+
+ m_prgmcr[3].m_chwFirst = 122; // z
+ m_prgmcr[3].m_chwLast = 123;
+ m_prgmcr[3].m_col = 2;
+
+
+ m_dimcrInit = 4; // (max power of 2 <= m_cmcr);
+ m_cLoop = 2; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 9;
+ m_crowNonAcpt = 6;
+ m_crowFinal = 3;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 4;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[(m_crow-m_crowFinal) * m_ccol]; // 24
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1; *psn++ = 0; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 2; *psn++ = 0; *psn++ = 3;
+ *psn++ = 0; *psn++ = 0; *psn++ = 6; *psn++ = 4;
+ *psn++ = 0; *psn++ = 5; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 7; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 8; *psn++ = 0;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[3]; // 3 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[3+1]; // 3 = m_crow - m_crowNonAcpt
+
+ m_prgirulnMin[0] = 0; // s6: r2
+ m_prgrulnMatched[0] = 2;
+
+ m_prgirulnMin[1] = 1; // s7: r0
+ m_prgrulnMatched[1] = 0;
+
+ m_prgirulnMin[2] = 2; // s8: r1
+ m_prgrulnMatched[2] = 1;
+
+ m_prgirulnMin[3] = 3;
+ }
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Tests of ligatures and components where the components are modified glyphs.
+
+ PASS 1:
+ r0. gX gI > @2 @1;
+ r1. clsPlainVowel gAcute > clsVowelAcute:(1 2) _;
+ r2. clsPlainVowel gGrave > clsVowelGrave:(1 2) _;
+
+ Pass 1 machine classes:
+ mcX: x 120
+ mcI: i 105
+ mcPV: a e o u 97 101 111 117
+ mcAcute: / 47
+ mcGrave: \ 92
+
+ Pass 1 FSM: (T=transition, F=final, A=accepting, NA=non-accepting)
+
+ | mcX mcPV mcI mcAcute mcGrave
+ ---------------------------------------------------------------
+ T NA s0 | s1 s2 s2
+ | - - - -
+ T NA s1 | s3
+ | - - - -
+ T NA s2 | s4 s5
+ | - - - -
+ F A s3 |
+ | - - - -
+ F A s4 |
+ | - - - -
+ F A s5 |
+ | - - - -
+
+
+ Rules Matched:
+ s3: r0
+ s4: r1
+ s5: r2
+
+
+ PASS 2:
+ r0. clsVowel gI > clsCapVowel:(1 2) { comp {v.ref = @1; i.ref = @2}} _;
+
+ Pass 2 machine classes:
+ mcV: 97 101 111 117
+ 224 225 232 233 236 237 242 243 249 250
+ mcI: i 105
+
+
+ Pass 2 FSM:
+ | mcV mcI
+ ----------------------------------------------------
+ T NA s0 | s1 s1
+ | -
+ T NA s1 | s2
+ | -
+ F A s2 |
+ | -
+
+ Rules matched:
+ s2: r0
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetUpLigature2Test()
+{
+ if (m_pctbl)
+ delete m_pctbl;
+
+ m_pctbl = new GrClassTable();
+ m_pctbl->SetUpLigature2Test();
+
+ m_pgtbl = new GrGlyphTable();
+ m_pgtbl->SetUpLigature2Test();
+}
+
+void GrClassTable::SetUpLigature2Test()
+{
+ m_ccls = 5; // number of classes
+ m_cclsLinear = 3; // number of classes in linear format
+
+ m_prgchwBIGGlyphList = new data16[73];
+
+ m_prgichwOffsets = new data16[m_ccls+1];
+
+ data16 * pchw = m_prgchwBIGGlyphList;
+
+ // Output class 0: clsVowelAcute
+ m_prgichwOffsets[0] = 0;
+ *pchw++ = msbf(data16(225)); // a-acute
+ *pchw++ = msbf(data16(233)); // e-acute
+ *pchw++ = msbf(data16(237)); // i-acute
+ *pchw++ = msbf(data16(243)); // o-acute
+ *pchw++ = msbf(data16(250)); // u-acute
+
+ // Output class 1: clsVowelGrave
+ m_prgichwOffsets[1] = 5;
+ *pchw++ = msbf(data16(224)); // a-grave
+ *pchw++ = msbf(data16(232)); // e-grave
+ *pchw++ = msbf(data16(236)); // i-grave
+ *pchw++ = msbf(data16(242)); // o-grave
+ *pchw++ = msbf(data16(249)); // u-grave
+
+ // Output class 2: clsCapVowel
+ m_prgichwOffsets[2] = 5 + 5; // 10
+ *pchw++ = msbf(data16(65)); // A
+ *pchw++ = msbf(data16(69)); // E
+ *pchw++ = msbf(data16(73)); // I
+ *pchw++ = msbf(data16(79)); // O
+ *pchw++ = msbf(data16(85)); // U
+ *pchw++ = msbf(data16(193)); // A-acute
+ *pchw++ = msbf(data16(201)); // E-acute
+ *pchw++ = msbf(data16(205)); // I-acute
+ *pchw++ = msbf(data16(211)); // O-acute
+ *pchw++ = msbf(data16(218)); // U-acute
+ *pchw++ = msbf(data16(192)); // A-grave
+ *pchw++ = msbf(data16(200)); // E-grave
+ *pchw++ = msbf(data16(204)); // I-grave
+ *pchw++ = msbf(data16(210)); // O-grave
+ *pchw++ = msbf(data16(217)); // U-grave
+
+ // Input class 3: clsPlainVowel
+ m_prgichwOffsets[3] = 10 + 15; // 25
+ *pchw++ = msbf(data16(5));
+ *pchw++ = msbf(data16(4)); *pchw++ = msbf(data16(2)); *pchw++ = msbf(data16(5-4));
+ *pchw++ = msbf(data16(97)); *pchw++ = msbf(data16(0)); // a
+ *pchw++ = msbf(data16(101)); *pchw++ = msbf(data16(1)); // e
+ *pchw++ = msbf(data16(105)); *pchw++ = msbf(data16(2)); // i
+ *pchw++ = msbf(data16(111)); *pchw++ = msbf(data16(3)); // o
+ *pchw++ = msbf(data16(117)); *pchw++ = msbf(data16(4)); // u
+
+ // Input class 4: clsVowel
+ m_prgichwOffsets[4] = 25 + 4+(5*2); // 39
+ *pchw++ = msbf(data16(15));
+ *pchw++ = msbf(data16(8)); *pchw++ = msbf(data16(3)); *pchw++ = msbf(data16(15-8));
+ *pchw++ = msbf(data16(97)); *pchw++ = msbf(data16(0)); // a
+ *pchw++ = msbf(data16(101)); *pchw++ = msbf(data16(1)); // e
+ *pchw++ = msbf(data16(105)); *pchw++ = msbf(data16(2)); // i
+ *pchw++ = msbf(data16(111)); *pchw++ = msbf(data16(3)); // o
+ *pchw++ = msbf(data16(117)); *pchw++ = msbf(data16(4)); // u
+ *pchw++ = msbf(data16(224)); *pchw++ = msbf(data16(10)); // a-grave
+ *pchw++ = msbf(data16(225)); *pchw++ = msbf(data16(5)); // a-acute
+ *pchw++ = msbf(data16(232)); *pchw++ = msbf(data16(11)); // e-grave
+ *pchw++ = msbf(data16(233)); *pchw++ = msbf(data16(6)); // e-acute
+ *pchw++ = msbf(data16(236)); *pchw++ = msbf(data16(12)); // i-grave
+ *pchw++ = msbf(data16(237)); *pchw++ = msbf(data16(7)); // i-acute
+ *pchw++ = msbf(data16(242)); *pchw++ = msbf(data16(13)); // o-grave
+ *pchw++ = msbf(data16(243)); *pchw++ = msbf(data16(8)); // o-acute
+ *pchw++ = msbf(data16(249)); *pchw++ = msbf(data16(14)); // u-grave
+ *pchw++ = msbf(data16(250)); *pchw++ = msbf(data16(9)); // u-acute
+
+ m_prgichwOffsets[5] = 39 + 4+(15*2); // 73
+}
+
+void GrGlyphTable::SetUpLigature2Test()
+{
+ SetNumberOfGlyphs(256);
+ SetNumberOfStyles(1);
+
+ GrGlyphSubTable * pgstbl = new GrGlyphSubTable();
+ Assert(pgstbl);
+
+ pgstbl->Initialize(1, 0, 256, 10, 4);
+ SetSubTable(0, pgstbl);
+
+ SetNumberOfComponents(2); // comp.base, comp.i
+
+ pgstbl->SetUpLigature2Test();
+}
+
+/***********************************************************************************************
+ TODO: This method is BROKEN because m_prgibBIGAttrValues has been changed. It is no
+ longer a data16 *. The Gloc table can contain 16-bit or 32-bit entries and must be
+ accessed accordingly.
+***********************************************************************************************/
+void GrGlyphSubTable::SetUpLigature2Test()
+{
+ m_nAttrIDLim = 10;
+
+ m_pgatbl = new GrGlyphAttrTable();
+ m_pgatbl->Initialize(0, 330);
+
+ for (int i = 0; i <= 65; i++) // A
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(0));
+
+ for (i = 66; i <= 69; i++) // E
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(22));
+
+ for (i = 70; i <= 73; i++) // I
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(44));
+
+ for (i = 74; i <= 79; i++) // O
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(66));
+
+ for (i = 80; i <= 85; i++) // U
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(88));
+
+ for (i = 86; i <= 192; i++) // A-grave
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(110));
+
+ m_prgibBIGAttrValues[193] = (byte)msbf(data16(132)); // A-acute
+
+ for (i = 194; i <= 200; i++) // E-grave
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(154));
+
+ m_prgibBIGAttrValues[201] = (byte)msbf(data16(176)); // E-acute
+
+ for (i = 202; i <= 204; i++) // I-grave
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(198));
+
+ m_prgibBIGAttrValues[205] = (byte)msbf(data16(220)); // I-acute
+
+ for (i = 206; i <= 210; i++) // O-grave
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(242));
+
+ m_prgibBIGAttrValues[211] = (byte)msbf(data16(264)); // O-acute
+
+ for (i = 212; i <= 217; i++) // U-grave
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(286));
+
+ m_prgibBIGAttrValues[218] = (byte)msbf(data16(308)); // O-acute
+
+ for (i = 219; i < 256; i++)
+ m_prgibBIGAttrValues[i] = (byte)msbf(data16(330));
+
+ m_pgatbl->SetUpLigature2Test();
+}
+
+void GrGlyphAttrTable::SetUpLigature2Test()
+{
+ // All ligatures have the following defined:
+ //
+ // 0 = 2 comp.base (0,30, 100,100)
+ // 1 = 6 comp.i (0,0, 100,30)
+ // 2= 100 comp.base.top
+ // 3= 30 bottom
+ // 4= 0 left
+ // 5= 100 right
+ // 6 = 30 comp.i.top
+ // 7 = 0 bottom
+ // 8= 0 left
+ // 9= 100 right
+
+ byte * pbBIG = m_prgbBIGEntries;
+
+ GrGlyphAttrRun gatrun;
+
+ for (int i = 0; i < 15; i++)
+ {
+ gatrun.m_bMinAttrID = 0;
+ gatrun.m_cAttrs = 10;
+ gatrun.m_rgchwBIGValues[0] = msbf(data16(2));
+ gatrun.m_rgchwBIGValues[1] = msbf(data16(6));
+ gatrun.m_rgchwBIGValues[2] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[3] = msbf(data16(30));
+ gatrun.m_rgchwBIGValues[4] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[5] = msbf(data16(100));
+ gatrun.m_rgchwBIGValues[6] = msbf(data16(30));
+ gatrun.m_rgchwBIGValues[7] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[8] = msbf(data16(0));
+ gatrun.m_rgchwBIGValues[9] = msbf(data16(100));
+ memcpy(pbBIG, &gatrun, 22); // 22 = 10*2 + 2
+ pbBIG += 22;
+ }
+
+ Assert(pbBIG == m_prgbBIGEntries + (22 * 15));
+}
+
+void GrSubPass::SetUpLigature2Test()
+{
+ if (m_ipass == 1)
+ {
+ m_nMaxRuleContext = m_nMaxChunk = 2;
+ m_nMaxRuleLoop = 5;
+ m_staBehavior = "Ligatures2";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpLigature2Test(m_ipass);
+
+ m_crul = 3;
+
+ // Set up constraint code.
+ m_prgbConstraintBlock = new byte[1];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 0;
+ m_prgibConstraintStart[1] = 0;
+ m_prgibConstraintStart[2] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[7 + 12 + 12];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: gX gI > @2 @1;
+
+ *pb++ = kopPutCopy; *pb++ = 1; // PutCopy 1
+ *pb++ = kopNext; // Next
+ *pb++ = kopPutCopy; *pb++ = -1; // PutCopy -1
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 1: clsPlainVowel gAcute > clsVowelAcute:(1 2) _;
+
+ *pb++ = kopPutSubs8bitObs; *pb++ = 0; // PutSubs 0 3 0
+ *pb++ = 3; *pb++ = 0;
+ *pb++ = kopAssoc; *pb++ = 2; // Assoc 2 0 1
+ *pb++ = 0; *pb++ = 1;
+ *pb++ = kopNext; // Next
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ // Rule 2: clsPlainVowel gGrave > clsVowelGrave:(1 2) _;
+
+ *pb++ = kopPutSubs8bitObs; *pb++ = 0; // PutSubs 0 3 1
+ *pb++ = 3; *pb++ = 1;
+ *pb++ = kopAssoc; *pb++ = 2; // Assoc 2 0 1
+ *pb++ = 0; *pb++ = 1;
+ *pb++ = kopNext; // Next
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ m_prgibActionStart[1] = 7;
+ m_prgibActionStart[2] = 7 + 12;
+ }
+ else if (m_ipass == 2)
+ {
+ m_nMaxRuleContext = m_nMaxChunk = 2;
+ m_nMaxRuleLoop = 5;
+ m_staBehavior = "Ligatures2";
+
+ m_pfsm = new GrFSM();
+ Assert(m_pfsm);
+ m_pfsm->SetUpLigature2Test(m_ipass);
+
+ m_crul = 1;
+
+ // Set up constraint code.
+ m_prgbConstraintBlock = new byte[1];
+ byte * pb = m_prgbConstraintBlock;
+ *pb++ = kopRetTrue; // RetTrue
+
+ m_prgibConstraintStart = new data16[m_crul];
+ m_prgibConstraintStart[0] = 0;
+
+ // Set up rule action code.
+ m_prgbActionBlock = new byte[7 + 12 + 12];
+ pb = m_prgbActionBlock;
+
+ // Rule 0: clsVowel gI > clsCapVowel:(1 2) { comp {v.ref = @1; i.ref = @2}} _;
+
+ *pb++ = kopPutSubs8bitObs; *pb++ = 0; // PutSubs 0 4 2
+ *pb++ = 4; *pb++ = 2;
+ *pb++ = kopAssoc; *pb++ = 2; // Assoc 2 0 1
+ *pb++ = 0; *pb++ = 1;
+ *pb++ = kopPushByte; *pb++ = 0; // Push 0
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot compRef v
+ *pb++ = kslatCompRef; *pb++ = 0;
+ *pb++ = kopPushByte; *pb++ = 1; // Push 1
+ *pb++ = kopIAttrSetSlot; // IAttrSetSlot compRef i
+ *pb++ = kslatCompRef; *pb++ = 1;
+ *pb++ = kopNext; // Next
+ *pb++ = kopDelete; // Delete
+ *pb++ = kopNext; // Next
+ *pb++ = kopRetZero; // RetZero
+
+ m_prgibActionStart = new data16[m_crul];
+ m_prgibActionStart[0] = 0;
+ }
+ else
+ Assert(false);
+}
+
+
+void GrFSM::SetUpLigature2Test(int ipass)
+{
+ if (ipass == 1)
+ {
+ // Create machine class ranges.
+ m_cmcr = 8;
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ m_prgmcr[0].m_chwFirst = 47; // acute
+ m_prgmcr[0].m_chwLast = 47;
+ m_prgmcr[0].m_col = 3;
+
+ m_prgmcr[1].m_chwFirst = 92; // grave
+ m_prgmcr[1].m_chwLast = 92;
+ m_prgmcr[1].m_col = 4;
+
+ m_prgmcr[2].m_chwFirst = 97; // a
+ m_prgmcr[2].m_chwLast = 97;
+ m_prgmcr[2].m_col = 1;
+
+ m_prgmcr[3].m_chwFirst = 101; // e
+ m_prgmcr[3].m_chwLast = 101;
+ m_prgmcr[3].m_col = 1;
+
+ m_prgmcr[4].m_chwFirst = 105; // i
+ m_prgmcr[4].m_chwLast = 105;
+ m_prgmcr[4].m_col = 2;
+
+ m_prgmcr[5].m_chwFirst = 111; // o
+ m_prgmcr[5].m_chwLast = 111;
+ m_prgmcr[5].m_col = 1;
+
+ m_prgmcr[6].m_chwFirst = 117; // u
+ m_prgmcr[6].m_chwLast = 117;
+ m_prgmcr[6].m_col = 1;
+
+ m_prgmcr[7].m_chwFirst = 120; // x
+ m_prgmcr[7].m_chwLast = 120;
+ m_prgmcr[7].m_col = 0;
+
+ m_dimcrInit = 8; // (max power of 2 <= m_cmcr);
+ m_cLoop = 3; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 6;
+ m_crowNonAcpt = 3;
+ m_crowFinal = 3;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 5;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[(m_crow-m_crowFinal) * m_ccol]; // 15
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1; *psn++ = 2; *psn++ = 2; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 3; *psn++ = 0; *psn++ = 0;
+ *psn++ = 0; *psn++ = 0; *psn++ = 0; *psn++ = 4; *psn++ = 5;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[3]; // 3 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[3+1]; // 3 = m_crow - m_crowNonAcpt
+
+ m_prgirulnMin[0] = 0; // s3: r0
+ m_prgrulnMatched[0] = 0;
+
+ m_prgirulnMin[1] = 1; // s4: r1
+ m_prgrulnMatched[1] = 1;
+
+ m_prgirulnMin[2] = 2; // s5: r2
+ m_prgrulnMatched[2] = 2;
+
+ m_prgirulnMin[3] = 3;
+ }
+ else if (ipass == 2)
+ {
+ // Create machine class ranges.
+ m_cmcr = 10;
+ m_prgmcr = new GrFSMClassRange[m_cmcr];
+ m_prgmcr[0].m_chwFirst = 97; // a
+ m_prgmcr[0].m_chwLast = 97;
+ m_prgmcr[0].m_col = 0;
+
+ m_prgmcr[1].m_chwFirst = 101; // e
+ m_prgmcr[1].m_chwLast = 101;
+ m_prgmcr[1].m_col = 0;
+
+ m_prgmcr[2].m_chwFirst = 105; // i
+ m_prgmcr[2].m_chwLast = 105;
+ m_prgmcr[2].m_col = 1;
+
+ m_prgmcr[3].m_chwFirst = 111; // o
+ m_prgmcr[3].m_chwLast = 111;
+ m_prgmcr[3].m_col = 0;
+
+ m_prgmcr[4].m_chwFirst = 117; // u
+ m_prgmcr[4].m_chwLast = 117;
+ m_prgmcr[4].m_col = 0;
+
+ m_prgmcr[5].m_chwFirst = 224; // a-grave, a-acute
+ m_prgmcr[5].m_chwLast = 225;
+ m_prgmcr[5].m_col = 0;
+
+ m_prgmcr[6].m_chwFirst = 232; // e-grave, e-acute
+ m_prgmcr[6].m_chwLast = 233;
+ m_prgmcr[6].m_col = 0;
+
+ m_prgmcr[7].m_chwFirst = 236; // i-grave, i-acute
+ m_prgmcr[7].m_chwLast = 237;
+ m_prgmcr[7].m_col = 0;
+
+ m_prgmcr[8].m_chwFirst = 242; // o-grave, o-acute
+ m_prgmcr[8].m_chwLast = 243;
+ m_prgmcr[8].m_col = 0;
+
+ m_prgmcr[9].m_chwFirst = 249; // u-grave, u-acute
+ m_prgmcr[9].m_chwLast = 250;
+ m_prgmcr[9].m_col = 0;
+
+
+ m_dimcrInit = 8; // (max power of 2 <= m_cmcr);
+ m_cLoop = 3; // log2(max power of 2 <= m_cmcr);
+ m_imcrStart = m_cmcr - m_dimcrInit;
+
+
+ m_crow = 3;
+ m_crowNonAcpt = 2;
+ m_crowFinal = 1;
+ m_rowFinalMin = m_crow - m_crowFinal;
+ m_ccol = 2;
+
+ // Set up transition table.
+ m_prgrowTransitions = new short[(m_crow-m_crowFinal) * m_ccol]; // 4
+ short * psn = m_prgrowTransitions;
+ *psn++ = 1; *psn++ = 1;
+ *psn++ = 0; *psn++ = 2;
+
+ // Set up matched-rules tables.
+ m_prgrulnMatched = new data16[1]; // 1 = sum of rules matched for each accepting state
+ m_prgirulnMin = new data16[1+1]; // 1 = m_crow - m_crowNonAcpt
+
+ m_prgirulnMin[0] = 0; // s2: r0
+ m_prgrulnMatched[0] = 0;
+
+ m_prgirulnMin[1] = 1;
+ }
+}
+
+#endif // _DEBUG
+
+} // namespace gr
+
+#endif // OLD_TEST_STUFF
+
+//:End Ignore
diff --git a/Build/source/libs/graphite/src/segment/TestPasses.cpp b/Build/source/libs/graphite/src/segment/TestPasses.cpp
new file mode 100644
index 00000000000..a85e6c56207
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/TestPasses.cpp
@@ -0,0 +1,1005 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: TestPasses.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Hard-coded passes for test procedures.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:Ignore
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+#ifdef OLD_TEST_STUFF
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ For release version.
+----------------------------------------------------------------------------------------------*/
+#ifndef _DEBUG
+
+bool GrLineBreakPass::RunTestRules(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ return false;
+}
+
+bool GrSubPass::RunTestRules(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ return false;
+}
+
+bool GrPosPass::RunTestRules(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ return false;
+}
+
+#endif // !_DEBUG
+
+
+#ifdef _DEBUG
+
+/*----------------------------------------------------------------------------------------------
+ Set up a table manager for testing.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::SetUpTest(std::wstring stuRendBehavior)
+{
+ if (stuRendBehavior == L"NoRules")
+ {
+ m_cpass = 2;
+ m_cpassLB = 0;
+ m_ipassPos1 = 1;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrPosPass(1);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"JustReorder" || stuRendBehavior == "RightToLeftLayout")
+ {
+ m_cpass = 4;
+ m_cpassLB = 0;
+ m_ipassPos1 = 3;
+ m_fBidi = true;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrBidiPass(2);
+ m_prgppass[3] = new GrPosPass(3);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpReverseNumbersTest();
+ m_prgppass[2]->SetUpTestData();
+ m_prgppass[3]->SetUpTestData();
+
+ m_prgppass[2]->SetTopDirLevel(TopDirectionLevel());
+ }
+ else if (stuRendBehavior == L"CrossLineContext")
+ {
+ m_cpass = 4;
+ m_cpassLB = 1;
+ m_ipassPos1 = 3;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrLineBreakPass(1);
+ m_prgppass[2] = new GrSubPass(2);
+ m_prgppass[3] = new GrPosPass(3);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpCrossLineContextTest();
+ m_prgppass[2]->SetUpCrossLineContextTest();
+ m_prgppass[3]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"Reprocess")
+ {
+ m_cpass = 6;
+ m_cpassLB = 1;
+ m_ipassPos1 = 5;
+ m_fBidi = true;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrLineBreakPass(1);
+ m_prgppass[2] = new GrSubPass(2);
+ m_prgppass[3] = new GrSubPass(3);
+ m_prgppass[4] = new GrBidiPass(4);
+ m_prgppass[5] = new GrPosPass(5);
+
+ m_prgppass[0]->SetUpTestData(); // glyph-gen pass
+ m_prgppass[1]->SetUpReprocessTest(); // line-break pass
+ m_prgppass[2]->SetUpReverseNumbersTest(); // sub pass 1
+ m_prgppass[3]->SetUpReprocessTest(); // sub pass 2
+ m_prgppass[4]->SetUpTestData(); // bidi pass
+ m_prgppass[5]->SetUpTestData(); // pos pass
+
+ m_prgppass[4]->SetTopDirLevel(TopDirectionLevel());
+ }
+ else if (stuRendBehavior == L"LineEdgeContext")
+ {
+ m_cpass = 4;
+ m_cpassLB = 0;
+ m_ipassPos1 = 3;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrSubPass(2);
+ m_prgppass[3] = new GrPosPass(3);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpLineEdgeContextTest(1);
+ m_prgppass[2]->SetUpLineEdgeContextTest(2);
+ m_prgppass[3]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"BidiAlgorithm")
+ {
+ m_cpass = 4;
+ m_cpassLB = 0;
+ m_ipassPos1 = 3;
+ m_fBidi = true;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrBidiPass(2);
+ m_prgppass[3] = new GrPosPass(3);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpBidiAlgorithmTest();
+ m_prgppass[2]->SetUpBidiAlgorithmTest();
+ m_prgppass[3]->SetUpTestData();
+
+ m_prgppass[2]->SetTopDirLevel(TopDirectionLevel());
+ }
+ else if (stuRendBehavior == L"PseudoGlyphs")
+ {
+ m_cpass = 3;
+ m_cpassLB = 0;
+ m_ipassPos1 = 2;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrPosPass(2);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpPseudoGlyphsTest();
+ m_prgppass[2]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"SimpleFSM")
+ {
+ m_cpass = 3;
+ m_cpassLB = 0;
+ m_ipassPos1 = 2;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrPosPass(2);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpSimpleFSMTest();
+ m_prgppass[2]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"RuleAction")
+ {
+ m_cpass = 3;
+ m_cpassLB = 0;
+ m_ipassPos1 = 2;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrPosPass(2);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpRuleActionTest();
+ m_prgppass[2]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"RuleAction2")
+ {
+ m_cpass = 6;
+ m_cpassLB = 0;
+ m_ipassPos1 = 5;
+ m_fBidi = true;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrSubPass(2);
+ m_prgppass[3] = new GrSubPass(3);
+ m_prgppass[4] = new GrBidiPass(4);
+ m_prgppass[5] = new GrPosPass(5);
+
+ m_prgppass[0]->SetUpTestData(); // glyph-gen pass
+ m_prgppass[1]->SetUpRuleAction2Test(); // sub pass 1
+ m_prgppass[2]->SetUpRuleAction2Test(); // sub pass 2
+ m_prgppass[3]->SetUpRuleAction2Test(); // sub pass 3
+ m_prgppass[4]->SetUpTestData(); // bidi pass
+ m_prgppass[5]->SetUpTestData(); // pos pass
+
+ m_prgppass[4]->SetTopDirLevel(TopDirectionLevel());
+ }
+ else if (stuRendBehavior == L"Assoc")
+ {
+ m_cpass = 5;
+ m_cpassLB = 1;
+ m_ipassPos1 = 4;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrLineBreakPass(1);
+ m_prgppass[2] = new GrSubPass(2);
+ m_prgppass[3] = new GrSubPass(3);
+ m_prgppass[4] = new GrPosPass(4);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpAssocTest();
+ m_prgppass[2]->SetUpAssocTest();
+ m_prgppass[3]->SetUpAssocTest();
+ m_prgppass[4]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"Assoc2")
+ {
+ m_cpass = 3;
+ m_cpassLB = 0;
+ m_ipassPos1 = 2;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrPosPass(2);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpAssoc2Test();
+ m_prgppass[2]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"DefaultAssoc")
+ {
+ m_cpass = 3;
+ m_cpassLB = 0;
+ m_ipassPos1 = 2;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrPosPass(2);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpDefaultAssocTest();
+ m_prgppass[2]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"BidiNumbers")
+ {
+ m_cpass = 4;
+ m_cpassLB = 0;
+ m_ipassPos1 = 3;
+ m_fBidi = true;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrBidiPass(2);
+ m_prgppass[3] = new GrPosPass(3);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpBidiNumbersTest();
+ m_prgppass[2]->SetUpBidiNumbersTest();
+ m_prgppass[3]->SetUpTestData();
+
+ m_prgppass[2]->SetTopDirLevel(TopDirectionLevel());
+ }
+ else if (stuRendBehavior == L"Feature")
+ {
+ m_cpass = 3;
+ m_cpassLB = 0;
+ m_ipassPos1 = 2;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrPosPass(2);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpFeatureTest();
+ m_prgppass[2]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"Ligatures")
+ {
+ m_cpass = 4;
+ m_cpassLB = 1;
+ m_ipassPos1 = 3;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrLineBreakPass(1);
+ m_prgppass[2] = new GrSubPass(2);
+ m_prgppass[3] = new GrPosPass(3);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpLigatureTest();
+ m_prgppass[2]->SetUpLigatureTest();
+ m_prgppass[3]->SetUpTestData();
+ }
+ else if (stuRendBehavior == L"Ligatures2")
+ {
+ m_cpass = 4;
+ m_cpassLB = 1;
+ m_ipassPos1 = 3;
+ m_fBidi = false;
+
+ m_prgppass = new GrPass*[m_cpass];
+ m_prgppass[0] = new GrGlyphGenPass(0);
+ m_prgppass[1] = new GrSubPass(1);
+ m_prgppass[2] = new GrSubPass(2);
+ m_prgppass[3] = new GrPosPass(3);
+
+ m_prgppass[0]->SetUpTestData();
+ m_prgppass[1]->SetUpLigature2Test();
+ m_prgppass[2]->SetUpLigature2Test();
+ m_prgppass[3]->SetUpTestData();
+ }
+ else
+ Assert(false);
+
+ m_engst.m_prgpsstrm = new GrSlotStream*[m_cpass];
+ for (int ipass = 0; ipass < m_cpass; ++ipass)
+ m_engst.m_prgpsstrm[ipass] = new GrSlotStream(ipass);
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Set the pass variables that normally will be read from the ECF.
+----------------------------------------------------------------------------------------------*/
+
+void GrPass::SetUpTestData()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 2;
+ m_nMaxRuleLoop = 2;
+}
+
+//void GrBidiPass::SetUpTestData()
+//{
+// m_nMaxRuleContext = m_nMaxChunk = 1;
+// m_nMaxRuleLoop = 2;
+//}
+
+/*----------------------------------------------------------------------------------------------
+ Call the appropriate test function.
+----------------------------------------------------------------------------------------------*/
+
+bool GrLineBreakPass::RunTestRules(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ if (m_staBehavior == "Reprocess")
+ return RunReprocessTest(ptman, psstrmInput, psstrmOutput);
+ else if (m_staBehavior == "CrossLineContext")
+ return RunCrossLineContextTest(ptman, psstrmInput, psstrmOutput);
+ else
+ return false;
+}
+
+bool GrSubPass::RunTestRules(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ if (m_staBehavior == "ReverseNumbers")
+ return RunReverseNumbersTest(ptman, psstrmInput, psstrmOutput);
+ else if (m_staBehavior == "CrossLineContext")
+ return RunCrossLineContextTest(ptman, psstrmInput, psstrmOutput);
+ else if (m_staBehavior == "Reprocess")
+ return RunReprocessTest(ptman, psstrmInput, psstrmOutput);
+ else if (m_staBehavior == "LineEdgeContext")
+ return RunLineEdgeContextTest(ptman, psstrmInput, psstrmOutput);
+ else if (m_staBehavior == "BidiAlgorithm")
+ return RunBidiAlgorithmTest(ptman, psstrmInput, psstrmOutput);
+ else if (m_staBehavior == "PseudoGlyphs")
+ return RunPseudoGlyphsTest(ptman, psstrmInput, psstrmOutput);
+ else if (m_staBehavior == "BidiNumbers")
+ return RunBidiNumbersTest(ptman, psstrmInput, psstrmOutput);
+ else
+ return false;
+}
+
+bool GrPosPass::RunTestRules(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ A substitution pass that causes numbers to be reversed. Used by both the JustReorder test
+ and the Reprocess test.
+----------------------------------------------------------------------------------------------*/
+
+void GrSubPass::SetUpReverseNumbersTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "ReverseNumbers";
+}
+
+bool GrSubPass::RunReverseNumbersTest(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ data16 chw0;
+
+ // clsDigit { dir = DIR_RIGHT };
+ if (psstrmInput->SlotsPending() >= 1)
+ {
+ bool fRtl = ptman->RightToLeft();
+ chw0 = psstrmInput->Peek(0)->GlyphID();
+ if ((chw0 >= '0') && (chw0 <= '9'))
+ {
+ GrSlotState * pslot0 = psstrmInput->NextGet();
+// GrFeatureValues fval0;
+// pslot0->GetFeatureValues(&fval0);
+
+ GrSlotState * pslotNew;
+ ptman->NewSlotCopy(pslot0, m_ipass, &pslotNew);
+ pslotNew->SetDirectionality(fRtl ? kdircArabNum : kdircR);
+ pslotNew->Associate(pslot0);
+ psstrmOutput->NextPut(pslotNew);
+
+ return true;
+ }
+ else
+ {
+ GrSlotState * pslot0 = psstrmInput->NextGet();
+// GrFeatureValues fval0;
+// pslot0->GetFeatureValues(&fval0);
+
+ GrSlotState * pslotNew;
+ ptman->NewSlotCopy(pslot0, m_ipass, &pslotNew);
+ if (chw0 == 32)
+ pslotNew->SetDirectionality(kdircWhiteSpace);
+ else if (chw0 == '.')
+ pslotNew->SetDirectionality(kdircComSep);
+ else
+ pslotNew->SetDirectionality(fRtl ? kdircR : kdircL);
+ pslotNew->Associate(pslot0);
+ psstrmOutput->NextPut(pslotNew);
+
+ return true;
+ }
+ }
+ else
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ A substitution pass that will do some hard-coded actions resulting in cross-line-boundary
+ contextuals.
+----------------------------------------------------------------------------------------------*/
+void GrEngine::SetUpCrossLineContextTest()
+{
+ m_fLineBreak = true;
+ m_cchwPreXlbContext = 2;
+ m_cchwPostXlbContext = 0;
+}
+
+void GrLineBreakPass::SetUpCrossLineContextTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "CrossLineContext";
+}
+
+void GrSubPass::SetUpCrossLineContextTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 3;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "CrossLineContext";
+}
+
+bool GrLineBreakPass::RunCrossLineContextTest(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ // '=' { break = intra };
+ if ((psstrmInput->SlotsPending() >= 1) &&
+ (psstrmInput->Peek(0)->GlyphID() == 61))
+ {
+ GrSlotState * pslotNew0;
+ ptman->NewSlotCopy(psstrmInput->NextGet(), m_ipass, &pslotNew0);
+ pslotNew0->SetBreakWeight(int(klbHyphenBreak));
+ psstrmOutput->NextPut(pslotNew0);
+
+ psstrmOutput->SetPosForNextRule(0, psstrmInput, false);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+bool GrSubPass::RunCrossLineContextTest(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ // any '=' _ _ > any '=' '=':2 any:1 / _ _ # _ _
+ if ((psstrmInput->SlotsPending() >= 3) &&
+ (psstrmInput->Peek(1)->GlyphID() == 61) &&
+ (psstrmInput->Peek(2)->GlyphID() == ptman->LBGlyphID()))
+ {
+ GrSlotState * pslot0 = psstrmInput->Peek(0);
+ GrSlotState * pslot1 = psstrmInput->Peek(1);
+ gid16 chw0 = pslot0->GlyphID();
+// GrFeatureValues fval0;
+// pslot0->GetFeatureValues(&fval0);
+// GrFeatureValues fval1;
+// pslot1->GetFeatureValues(&fval1);
+
+ // copy the first 3 slots
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+
+ // insert 2 more
+ GrSlotState * pslot3;
+ ptman->NewSlot(61, pslot1, NULL, m_ipass, &pslot3);
+ pslot3->Associate(pslot1);
+ psstrmOutput->NextPut(pslot3);
+
+ GrSlotState * pslot4;
+ ptman->NewSlot(chw0, pslot0, NULL, m_ipass, &pslot4);
+ pslot4->Associate(pslot0);
+ psstrmOutput->NextPut(pslot4);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Line break and substitution passes that cause intra-pass reprocessing (ie, the ^ mechanism).
+----------------------------------------------------------------------------------------------*/
+
+void GrLineBreakPass::SetUpReprocessTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 2;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "Reprocess";
+}
+
+bool GrLineBreakPass::RunReprocessTest(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ gid16 chw;
+
+ // '^' {lb=2} / _ lc
+ if ((psstrmInput->SlotsPending() >=2) &&
+ (psstrmInput->Peek(0)->GlyphID() == '^') &&
+ (((chw = psstrmInput->Peek(1)->GlyphID()) >= 'a') &&
+ (chw <= 'z')))
+ {
+ GrSlotState * pslotNew0;
+ ptman->NewSlotCopy(psstrmInput->NextGet(), m_ipass, &pslotNew0);
+ pslotNew0->SetBreakWeight(int(klbHyphenBreak));
+ psstrmOutput->NextPut(pslotNew0);
+
+ psstrmOutput->SetPosForNextRule(0, psstrmInput, false);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+
+void GrSubPass::SetUpReprocessTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 3;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "Reprocess";
+}
+
+bool GrSubPass::RunReprocessTest(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ gid16 chw;
+ gid16 chwLB = ptman->LBGlyphID();
+
+ // symbol > @2 {dir = DIR_ARABNUMBER} / any {dir != DIR_LEFT} ^ _
+ if ((psstrmInput->SlotsPending() >= 2) &&
+ (psstrmInput->Peek(0)->Directionality() != kdircL) &&
+ (((chw = psstrmInput->Peek(1)->GlyphID()) == '@') ||
+ (chw == '@') || (chw == '$') || (chw == '%') ||
+ (chw == '^') || (chw == '&') || (chw == '*')))
+ {
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+ GrSlotState * pslotNew1;
+ ptman->NewSlotCopy(psstrmInput->NextGet(), m_ipass, &pslotNew1);
+ pslotNew1->SetDirectionality(kdircArabNum);
+ psstrmOutput->NextPut(pslotNew1);
+
+ psstrmOutput->SetPosForNextRule(-1, psstrmInput, false);
+
+ return true;
+ }
+
+ // '^' lc > @1 uc
+ else if ((psstrmInput->SlotsPending() >= 2) &&
+ (psstrmInput->Peek(0)->GlyphID() == '^') &&
+ (((chw = psstrmInput->Peek(1)->GlyphID()) >= 'a') &&
+ (chw <= 'z')))
+ {
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+
+ gid16 chwNew = chw - 'a' + 'A';
+ GrSlotState * pslotNew1;
+ ptman->NewSlotCopy(psstrmInput->NextGet(), m_ipass, &pslotNew1);
+ pslotNew1->SetGlyphID(chwNew);
+ psstrmOutput->NextPut(pslotNew1);
+
+ psstrmOutput->SetPosForNextRule(0, psstrmInput, false);
+
+ return true;
+ }
+
+ // '^' lc > @1 uc / _ # _
+ else if ((psstrmInput->SlotsPending() >= 3) &&
+ (psstrmInput->Peek(0)->GlyphID() == '^') &&
+ (psstrmInput->Peek(1)->IsLineBreak(chwLB)) &&
+ (((chw = psstrmInput->Peek(2)->GlyphID()) >= 'a') &&
+ (chw <= 'z')))
+ {
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+
+ gid16 chwNew = chw - 'a' + 'A';
+ GrSlotState * pslotNew1;
+ ptman->NewSlotCopy(psstrmInput->NextGet(), m_ipass, &pslotNew1);
+ pslotNew1->SetGlyphID(chwNew);
+ psstrmOutput->NextPut(pslotNew1);
+
+ psstrmOutput->SetPosForNextRule(0, psstrmInput, false);
+
+ return true;
+ }
+
+ else
+ return false;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Substitution passes that create contextual forms at the line breaks; also a cross-line-
+ boundary contextual.
+----------------------------------------------------------------------------------------------*/
+
+void GrSubPass::SetUpLineEdgeContextTest(int ipass)
+{
+ m_nMaxRuleContext = (ipass == 2)? 5: 2;
+ m_nMaxChunk = m_nMaxRuleContext;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "LineEdgeContext";
+}
+
+bool GrSubPass::RunLineEdgeContextTest(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ gid16 chwLB = ptman->LBGlyphID();
+
+ // any _ _ > @1 '-' '-' / _ _ _ #
+ if ((m_ipass == 1) &&
+ (psstrmInput->SlotsPending() >= 2) &&
+ (psstrmInput->Peek(1)->IsLineBreak(chwLB)))
+ {
+ GrSlotState * pslot0 = psstrmInput->Peek(0);
+// GrFeatureValues fval;
+// pslot0->GetFeatureValues(&fval);
+
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+
+ GrSlotState * pslotNew1;
+ ptman->NewSlot('-', pslot0, NULL, m_ipass, &pslotNew1);
+ pslotNew1->Associate(pslot0);
+ psstrmOutput->NextPut(pslotNew1);
+
+ GrSlotState * pslotNew2;
+ ptman->NewSlot('-', pslot0, NULL, m_ipass, &pslotNew2);
+ pslotNew2->Associate(pslot0);
+ psstrmOutput->NextPut(pslotNew2);
+
+ return true;
+ }
+
+ // _ _ any > '+' '+' @4 / # _ _ _
+ else if ((m_ipass == 1) &&
+ (psstrmInput->SlotsPending() >= 2) &&
+ (psstrmInput->Peek(0)->IsLineBreak(chwLB)))
+ {
+ GrSlotState * pslot2 = psstrmInput->Peek(1);
+// GrFeatureValues fval;
+// pslot2->GetFeatureValues(&fval);
+
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+
+ GrSlotState * pslotNew0;
+ ptman->NewSlot('+', pslot2, NULL, m_ipass, &pslotNew0);
+ pslotNew0->Associate(pslot2);
+ psstrmOutput->NextPut(pslotNew0);
+
+ GrSlotState * pslotNew1;
+ ptman->NewSlot('+', pslot2, NULL, m_ipass, &pslotNew1);
+ pslotNew1->Associate(pslot2);
+ psstrmOutput->NextPut(pslotNew1);
+
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+
+ return true;
+ }
+
+ // '-' '-' '+' '+' > @1 _ _ @4 / _ _ # _ _
+ else if ((m_ipass == 2) &&
+ (psstrmInput->SlotsPending() >= 5) &&
+ (psstrmInput->Peek(0)->GlyphID() == '-') &&
+ (psstrmInput->Peek(1)->GlyphID() == '-') &&
+ (psstrmInput->Peek(2)->IsLineBreak(chwLB)) &&
+ (psstrmInput->Peek(3)->GlyphID() == '+') &&
+ (psstrmInput->Peek(4)->GlyphID() == '+'))
+ {
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+ psstrmInput->Skip(1);
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+ psstrmInput->Skip(1);
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+
+ return true;
+ }
+
+ else
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Substitution passes that do something special with pseudo glyphs.
+----------------------------------------------------------------------------------------------*/
+
+void GrSubPass::SetUpPseudoGlyphsTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 3;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "PseudoGlyphs";
+}
+
+bool GrSubPass::RunPseudoGlyphsTest(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ gid16 chwLB = ptman->LBGlyphID();
+
+ // pseudo > uppercase / _ ' '
+ if ((psstrmInput->SlotsPending() >= 2) &&
+ (psstrmInput->Peek(0)->GlyphID() > 1000) && // pseudo
+ (psstrmInput->Peek(1)->GlyphID() == 32))
+ {
+ GrSlotState * pslot0 = psstrmInput->NextGet();
+// GrFeatureValues fval;
+// pslot0->GetFeatureValues(&fval);
+
+ GrSlotState * pslotNew;
+ ptman->NewSlotCopy(pslot0, m_ipass, &pslotNew);
+ pslotNew->SetGlyphID(pslot0->GlyphID() - 1000);
+ pslotNew->Associate(pslot0);
+ psstrmOutput->NextPut(pslotNew);
+
+ psstrmOutput->SetPosForNextRule(0, psstrmInput, false);
+
+ return true;
+ }
+
+ // pseudo > uppercase / _ |
+ // pseudo > uppercase / _ #
+ else if ((psstrmInput->SlotsPending() <= 2) &&
+ (psstrmInput->Peek(0)->GlyphID() > 1000) && // pseudo
+ (psstrmInput->SlotsPending() < 2 || psstrmInput->Peek(1)->GlyphID() == 35))
+ {
+ GrSlotState * pslot0 = psstrmInput->NextGet();
+// GrFeatureValues fval;
+// pslot0->GetFeatureValues(&fval);
+
+ GrSlotState * pslotNew;
+ ptman->NewSlotCopy(pslot0, m_ipass, &pslotNew);
+ pslotNew->SetGlyphID(pslot0->GlyphID() - 1000);
+ pslotNew->Associate(pslot0);
+ psstrmOutput->NextPut(pslotNew);
+
+ psstrmOutput->SetPosForNextRule(0, psstrmInput, false);
+
+ return true;
+ }
+
+ // pseudo any _ > lowercase:1 @2 @1 / _ _ ^ _;
+ else if ((psstrmInput->SlotsPending() >= 3) &&
+ (psstrmInput->Peek(0)->GlyphID() > 1000)) // pseudo
+ {
+ GrSlotState * pslot0 = psstrmInput->NextGet();
+// GrFeatureValues fval;
+// pslot0->GetFeatureValues(&fval);
+
+ GrSlotState * pslotNew0;
+ ptman->NewSlot(pslot0->GlyphID()-1000-65+97, pslot0, NULL, m_ipass, &pslotNew0);
+ pslotNew0->Associate(pslot0);
+ psstrmOutput->NextPut(pslotNew0);
+
+ psstrmOutput->CopyOneSlotFrom(psstrmInput);
+
+ GrSlotState * pslotNew2;
+ ptman->NewSlot(pslot0->GlyphID(), pslot0, NULL, m_ipass, &pslotNew2);
+ pslotNew2->Associate(pslot0);
+ psstrmOutput->NextPut(pslotNew2);
+
+ psstrmOutput->SetPosForNextRule(-1, psstrmInput, false);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Substitution pass that tests reversing numbers.
+----------------------------------------------------------------------------------------------*/
+void GrSubPass::SetUpBidiNumbersTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "BidiNumbers";
+}
+
+bool GrSubPass::RunBidiNumbersTest(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ gid16 chw0;
+
+ // clsDigit > clsDigit { dir = DIR_ARABNUMBER };
+ if ((psstrmInput->SlotsPending() >= 1) &&
+ (((chw0 = psstrmInput->Peek(0)->GlyphID()) >= '0' && chw0 <= '9') ||
+ (chw0 >= 'A' && chw0 <= 'Z') || (chw0 >= 'a' && chw0 <= 'z')))
+ {
+ GrSlotState * pslot0 = psstrmInput->NextGet();
+// GrFeatureValues fval0;
+// pslot0->GetFeatureValues(&fval0);
+
+ GrSlotState * pslotNew;
+ ptman->NewSlot(chw0, pslot0, NULL, m_ipass, &pslotNew);
+ if (chw0 >= '0' && chw0 <= '9')
+ pslotNew->SetDirectionality(kdircArabNum);
+ else // a-z and A-Z
+ pslotNew->SetDirectionality(kdircR);
+ pslotNew->Associate(pslot0);
+ psstrmOutput->NextPut(pslotNew);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+void GrBidiPass::SetUpBidiNumbersTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 2;
+ m_nTopDirection = 1;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Substitution pass that tests the bidi algorithm thoroughly.
+----------------------------------------------------------------------------------------------*/
+void GrSubPass::SetUpBidiAlgorithmTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 2;
+ m_staBehavior = "BidiAlgorithm";
+}
+
+bool GrSubPass::RunBidiAlgorithmTest(GrTableManager * ptman,
+ GrSlotStream * psstrmInput, GrSlotStream * psstrmOutput)
+{
+ gid16 chw0;
+
+ if (psstrmInput->SlotsPending() >= 1)
+ {
+ chw0 = psstrmInput->Peek(0)->GlyphID();
+
+ DirCode dircNew;
+
+ if (chw0 >= '0' && chw0 <= '9')
+ dircNew = kdircEuroNum;
+ else if (chw0 >= 'a' && chw0 <= 'z')
+ dircNew = kdircL;
+ else if (chw0 >= 'A' && chw0 <= 'M')
+ dircNew = kdircR;
+ else if (chw0 >= 'N' && chw0 <= 'T')
+ dircNew = kdircRArab;
+ else if (chw0 >= 'U' && chw0 <= 'Z')
+ dircNew = kdircArabNum;
+ else if (chw0 == '$' || chw0 == '%')
+ dircNew = kdircEuroTerm;
+ else if (chw0 == '.' || chw0 == '*' || chw0 == '+')
+ dircNew = kdircEuroSep;
+ else if (chw0 == '@')
+ dircNew = kdircComSep;
+ else if (chw0 == '_' || chw0 == '=')
+ dircNew = kdircNeutral;
+ else if (chw0 == ':')
+ dircNew = kdircNSM;
+ else
+ return false;
+
+ GrSlotState * pslot0 = psstrmInput->NextGet();
+// GrFeatureValues fval0;
+// pslot0->GetFeatureValues(&fval0);
+
+ GrSlotState * pslotNew;
+ ptman->NewSlot(chw0, pslot0, NULL, m_ipass, &pslotNew);
+ pslotNew->SetDirectionality(dircNew);
+ pslotNew->Associate(pslot0);
+ psstrmOutput->NextPut(pslotNew);
+
+ return true;
+ }
+ else
+ return false;
+}
+
+void GrBidiPass::SetUpBidiAlgorithmTest()
+{
+ m_nMaxRuleContext = m_nMaxChunk = 1;
+ m_nMaxRuleLoop = 2;
+ m_nTopDirection = 0;
+}
+
+
+#endif // _DEBUG
+
+} // namespace gr
+
+#endif // OLD_TEST_STUFF
+
+//:End Ignore
diff --git a/Build/source/libs/graphite/src/segment/TransductionLog.cpp b/Build/source/libs/graphite/src/segment/TransductionLog.cpp
new file mode 100644
index 00000000000..73273ae3feb
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/TransductionLog.cpp
@@ -0,0 +1,2091 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2000 - 2008 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: TransductionLog.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Contains the functions for writing a log of the transduction process.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+
+#include <math.h>
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+#define SP_PER_SLOT 7
+#define LEADING_SP 15
+#define MAX_SLOTS 128
+
+/*----------------------------------------------------------------------------------------------
+ Output a file showing a log of the transduction process and the resulting segment.
+----------------------------------------------------------------------------------------------*/
+//bool GrTableManager::WriteTransductionLog(GrCharStream * pchstrm, Segment * psegRet,
+// int cbPrevSegDat, byte * pbPrevSegDat, byte * pbNextSegDat, int * pcbNextSegDat)
+//{
+//#ifdef TRACING
+// std::string staFile;
+// if (!LogFileName(staFile))
+// return false;
+//
+// std::ofstream strmOut;
+// if (cbPrevSegDat > 0)
+// strmOut.open(staFile.c_str(), std::ios::app); // append
+// else
+// strmOut.open(staFile.c_str());
+// if (strmOut.fail())
+// return false;
+//
+// WriteXductnLog(strmOut, pchstrm, psegRet, cbPrevSegDat, pbPrevSegDat);
+//
+// strmOut.close();
+// return true;
+//#else
+// return false;
+//#endif // TRACING
+//}
+
+bool GrTableManager::WriteTransductionLog(std::ostream * pstrmLog,
+ GrCharStream * pchstrm, Segment * psegRet, int cbPrevSegDat, byte * pbPrevSegDat)
+{
+#ifdef TRACING
+ if (!pstrmLog)
+ return false;
+ std::ostream & strmOut = *pstrmLog;
+ WriteXductnLog(strmOut, pchstrm, psegRet, cbPrevSegDat, pbPrevSegDat);
+ return true;
+#else
+ return false;
+#endif // TRACING
+}
+
+/*----------------------------------------------------------------------------------------------
+ Append to the file, showing the surface/underlying mappings. This must be done after
+ figuring out all the associations.
+
+ Also write the final glyph positions, since they are now determined.
+----------------------------------------------------------------------------------------------*/
+//bool GrTableManager::WriteAssociationLog(GrCharStream * pchstrm, Segment * psegRet)
+//{
+//#ifdef TRACING
+// std::string staFile;
+// if (!LogFileName(staFile))
+// return false;
+//
+// std::ofstream strmOut;
+// strmOut.open(staFile.c_str(), std::ios::app); // append
+// if (strmOut.fail())
+// return false;
+//
+// LogFinalPositions(strmOut);
+//
+// strmOut << "\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n";
+//
+// psegRet->LogUnderlyingToSurface(this, strmOut, pchstrm);
+// psegRet->LogSurfaceToUnderlying(this, strmOut);
+//
+// strmOut << "\n\n=======================================================================\n\n";
+//
+// strmOut.close();
+// return true;
+//#else
+// return false;
+//#endif // TRACING
+//}
+
+
+bool GrTableManager::WriteAssociationLog(std::ostream * pstrmLog,
+ GrCharStream * pchstrm, Segment * psegRet)
+{
+#ifdef TRACING
+ if (!pstrmLog)
+ return false;
+
+ std::ostream & strmOut = *pstrmLog;
+
+ psegRet->LogUnderlyingToSurface(this, strmOut, pchstrm);
+ psegRet->LogSurfaceToUnderlying(this, strmOut);
+
+ strmOut << "\n\n=======================================================================\n\n";
+
+ return true;
+#else
+ return false;
+#endif // TRACING
+}
+
+#ifdef TRACING
+
+/*----------------------------------------------------------------------------------------------
+ Generate the name of the file where the log will be written. It goes in the directory
+ defined by either the TEMP or TMP environment variable.
+
+ TODO: remove
+----------------------------------------------------------------------------------------------*/
+//bool GrTableManager::LogFileName(std::string & staFile)
+//{
+// char * pchTmpEnv = getenv("TEMP");
+// if (pchTmpEnv == 0)
+// pchTmpEnv = getenv("TMP");
+// if (pchTmpEnv == 0)
+// return false;
+//
+// staFile.assign(pchTmpEnv);
+// if (staFile[staFile.size() - 1] != '\\')
+// staFile.append("\\");
+// staFile.append("gr_xductn.log");
+//
+// return true;
+//}
+
+/*----------------------------------------------------------------------------------------------
+ Output a file showing a log of the transduction process and the resulting segment.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::WriteXductnLog(std::ostream & strmOut,
+ GrCharStream * pchstrm, Segment * psegRet,
+ int cbPrevSegDat, byte * pbPrevSegDat)
+{
+ if (cbPrevSegDat == 0)
+ LogUnderlying(strmOut, pchstrm, 0);
+ else
+ {
+ Assert(*(pbPrevSegDat + 4) == 0); // skip offset for first pass
+ LogUnderlying(strmOut, pchstrm, *(pbPrevSegDat + 3));
+ }
+
+ LogPass1Input(strmOut);
+
+ for (int ipass = 1; ipass < m_cpass; ipass++)
+ {
+ if (cbPrevSegDat == 0)
+ LogPassOutput(strmOut, ipass, 0);
+ else
+ LogPassOutput(strmOut, ipass, *(pbPrevSegDat + 4 + ipass));
+ }
+
+ LogFinalPositions(strmOut);
+
+ strmOut << "\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\n";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out a log of the underlying input.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogUnderlying(std::ostream & strmOut, GrCharStream * pchstrm,
+ int cchwBackup)
+{
+ strmOut << "UNDERLYING INPUT\n\n";
+
+ int rgnChars[MAX_SLOTS];
+ bool rgfNewRun[MAX_SLOTS];
+ std::fill_n(rgfNewRun, MAX_SLOTS, false);
+ GrFeatureValues rgfval[MAX_SLOTS];
+ int cchwMaxRawChars;
+
+ int cnUtf32 = pchstrm->GetLogData(this, rgnChars, rgfNewRun, rgfval,
+ cchwBackup, &cchwMaxRawChars);
+ cnUtf32 = min(cnUtf32, MAX_SLOTS);
+
+ int ichw;
+
+ // For UTF-8 and surrogate representation:
+ utf16 rgchwChars2[MAX_SLOTS];
+ utf16 rgchwChars3[MAX_SLOTS];
+ utf16 rgchwChars4[MAX_SLOTS];
+ utf16 rgchwChars5[MAX_SLOTS];
+ utf16 rgchwChars6[MAX_SLOTS];
+ int rgcchwRaw[MAX_SLOTS];
+
+ if (cchwMaxRawChars > 1)
+ {
+ cchwMaxRawChars = min(cchwMaxRawChars, 6); // max of 6 raw (UTF-8 or UTF-16) chars per slot
+ pchstrm->GetLogDataRaw(this, cnUtf32, cchwBackup, cchwMaxRawChars,
+ rgnChars, rgchwChars2, rgchwChars3, rgchwChars4, rgchwChars5, rgchwChars6,
+ rgcchwRaw);
+ }
+ else
+ {
+ for (ichw = 0; ichw < cnUtf32; ichw++)
+ {
+ rgcchwRaw[ichw] = 1;
+ rgchwChars2[ichw] = 0;
+ rgchwChars3[ichw] = 0;
+ rgchwChars4[ichw] = 0;
+ rgchwChars5[ichw] = 0;
+ rgchwChars6[ichw] = 0;
+ }
+ }
+
+ LogUnderlyingHeader(strmOut, pchstrm->Min(), (pchstrm->Min() + cnUtf32 - cchwBackup),
+ cchwBackup, rgcchwRaw);
+
+ // Text
+ strmOut << "Text: "; // 15 spaces
+ for (ichw = 0; ichw < cnUtf32; ichw++)
+ {
+ if (rgnChars[ichw] < 0x0100 && rgchwChars2[ichw] == 0) // ANSI
+ strmOut << (char)rgnChars[ichw] << " "; // 6 spaces
+ else if (rgnChars[ichw] == knLRM)
+ strmOut << "<LRM> ";
+ else if (rgnChars[ichw] == knRLM)
+ strmOut << "<RLM> ";
+ else if (rgnChars[ichw] == knLRO)
+ strmOut << "<LRO> ";
+ else if (rgnChars[ichw] == knRLO)
+ strmOut << "<RLO> ";
+ else if (rgnChars[ichw] == knLRE)
+ strmOut << "<LRE> ";
+ else if (rgnChars[ichw] == knRLE)
+ strmOut << "<RLE> ";
+ else if (rgnChars[ichw] == knPDF)
+ strmOut << "<PDF> ";
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+
+ // Unicode
+ strmOut << "Unicode: ";
+ for (ichw = 0; ichw < cnUtf32; ichw++)
+ LogHexInTable(strmOut, utf16(rgnChars[ichw]));
+ strmOut << "\n";
+ for (int icchRaw = 2; icchRaw <= cchwMaxRawChars; icchRaw++)
+ {
+ strmOut << " ";
+ for (ichw = 0; ichw < cnUtf32; ichw++)
+ {
+ utf16 chw;
+ switch (icchRaw)
+ {
+ case 2: chw = rgchwChars2[ichw]; break;
+ case 3: chw = rgchwChars3[ichw]; break;
+ case 4: chw = rgchwChars4[ichw]; break;
+ case 5: chw = rgchwChars5[ichw]; break;
+ case 6: chw = rgchwChars6[ichw]; break;
+ default: chw = 0;
+ }
+ if (chw == 0)
+ strmOut << " ";
+ else
+ LogHexInTable(strmOut, chw);
+ }
+ strmOut << "\n";
+ }
+
+ // Runs
+ strmOut << "Runs: ";
+ int crun = 0;
+ for (ichw = 0; ichw < cnUtf32; ichw++)
+ {
+ if (rgfNewRun[ichw])
+ {
+ crun++;
+ strmOut << "|" << crun << ((crun < 10) ? " " : " ");
+ }
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+
+ // Features
+ strmOut << "Features and character properties:\n";
+ crun = 0;
+ for (ichw = 0; ichw < cnUtf32; ichw++)
+ {
+ if (rgfNewRun[ichw])
+ {
+ crun++;
+ strmOut << " Run " << crun << ": ";
+ rgfval[ichw].WriteXductnLog(this, strmOut);
+
+ }
+ }
+}
+
+
+void GrFeatureValues::WriteXductnLog(GrTableManager * ptman, std::ostream & strmOut)
+{
+ bool fFirst = true;
+ for (int i = 0; i < kMaxFeatures; i++)
+ {
+ if (m_rgnFValues[i] != 0)
+ {
+ GrFeature * pfeat = ptman->Feature(i);
+ if (!fFirst)
+ strmOut << ",";
+ strmOut << pfeat->ID() << "=" << m_rgnFValues[i];
+ fFirst = false;
+ }
+ }
+ if (fFirst)
+ strmOut << "all features=0";
+
+ strmOut << "\n\n";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Loop through the input stream of underlying characters, storing information in the
+ arrays for the log.
+ ENHANCE SharonC: do we need to show the underline properties?
+----------------------------------------------------------------------------------------------*/
+int GrCharStream::GetLogData(GrTableManager * ptman, int * rgchl, bool * rgfNewRun,
+ GrFeatureValues * rgfval, int cchrBackup, int * pcchrMax)
+{
+ Assert(cchrBackup <= m_cchrBackedUp);
+
+ int ichrPosToStop = m_ichrPos;
+ int ichrStart = m_ichrMin - max(cchrBackup, m_cchrBackedUp);
+
+ *pcchrMax = 0;
+
+ // Restart the stream.
+ m_ichrPos = ichrStart;
+ m_ichrRunMin = 0;
+ m_ichrRunLim = 0;
+ m_ichrRunOffset = kPosInfinity;
+ m_vislotNextChunkMap.clear();
+
+ int cchrSkipBackup = m_cchrBackedUp - cchrBackup;
+
+ int c = 0;
+ int cchr = 0;
+
+ while (m_ichrPos < ichrPosToStop)
+ {
+ if ((c < MAX_SLOTS) && (m_ichrPos >= m_ichrRunLim))
+ {
+ rgfNewRun[c] = true;
+ }
+
+ GrFeatureValues fval;
+ int ichrOffset, cchrThis;
+ int chl = NextGet(ptman, &fval, &ichrOffset, &cchrThis);
+ cchr += cchrThis;
+ if (cchr <= cchrSkipBackup)
+ {} // ignore - this is before the pre-segment stuff that we want to skip
+ else if (c < MAX_SLOTS)
+ {
+ rgchl[c] = chl;
+ *pcchrMax = max(*pcchrMax, cchrThis);
+ if (rgfNewRun[c])
+ {
+ rgfval[c] = fval;
+ }
+ c++;
+ }
+ }
+
+ ////return (m_ichwPos - (m_ichwMin - cchwBackup));
+ return c;
+}
+
+/*----------------------------------------------------------------------------------------------
+ If any of the characters are comprised of surrogates or UTF-8, fill in the arrays with
+ the raw (UTF-16 or UTF-8) chars for display. To do this we get the raw characters
+ directly from the text source.
+----------------------------------------------------------------------------------------------*/
+void GrCharStream::GetLogDataRaw(GrTableManager * ptman, int cchl, int cchrBackup,
+ int cchrMaxRaw, int * prgchl,
+ utf16 * prgchw2, utf16 * prgchw3, utf16 * prgchw4, utf16 * prgchw5, utf16 * prgchw6,
+ int * prgcchr)
+{
+ for (int i = 0; i < cchl; i++)
+ {
+ prgchw2[i] = 0;
+ }
+
+ int ichrLim = m_ichrPos;
+ int ichrMin = m_ichrMin - cchrBackup;
+
+ int cchrRange = ichrLim - ichrMin;
+ int ichr;
+ utf16 * prgchwRunText = new utf16[cchrRange];
+ utf8 * prgchsRunText8 = NULL;
+
+ UtfType utf = m_pgts->utfEncodingForm();
+
+ switch (utf)
+ {
+ case kutf8:
+ prgchsRunText8 = new utf8[cchrRange];
+ m_pgts->fetch(ichrMin, cchrRange, prgchsRunText8);
+ for (int ichr = 0; ichr < cchrRange; ichr++)
+ prgchwRunText[ichr] = (utf16)prgchsRunText8[ichr]; // zero-extend into UTF-16 buffer
+ break;
+ case kutf16:
+ m_pgts->fetch(ichrMin, cchrRange, prgchwRunText);
+ break;
+ default:
+ case kutf32: // this method should never have been called
+ Assert(false);
+ for (int ichrLp = 0; ichrLp < cchrRange; ichrLp++)
+ {
+ prgcchr[ichrLp] = 1;
+ prgchw2[ichrLp] = 0;
+ prgchw3[ichrLp] = 0;
+ prgchw4[ichrLp] = 0;
+ prgchw5[ichrLp] = 0;
+ prgchw6[ichrLp] = 0;
+ }
+ return;
+ }
+
+ ichr = ichrMin;
+ int ichl = 0;
+ while (ichr < ichrLim)
+ {
+ int cchrThis = 1;
+ // Replace 32-bit char with (first) 16-bit or 8-bit char.
+ prgchl[ichl] = (int)prgchwRunText[ichr - ichrMin];
+ prgcchr[ichr] = cchrThis;
+ ichr++;
+
+ while (!AtUnicodeCharBoundary(prgchwRunText, cchrRange, ichr - ichrMin, utf))
+ {
+ cchrThis++;
+ switch (cchrThis)
+ {
+ case 2: prgchw2[ichl] = prgchwRunText[ichr - ichrMin]; break;
+ case 3: prgchw3[ichl] = prgchwRunText[ichr - ichrMin]; break;
+ case 4: prgchw4[ichl] = prgchwRunText[ichr - ichrMin]; break;
+ case 5: prgchw5[ichl] = prgchwRunText[ichr - ichrMin]; break;
+ case 6: prgchw6[ichl] = prgchwRunText[ichr - ichrMin]; break;
+ default:
+ break;
+ }
+ prgcchr[ichr] = cchrThis;
+ ichr++;
+ }
+ switch (cchrThis)
+ {
+ case 1:
+ prgchw2[ichl] = 0;
+ // fall through
+ case 2:
+ prgchw3[ichl] = 0;
+ // fall through
+ case 3:
+ prgchw4[ichl] = 0;
+ // fall through
+ case 4:
+ prgchw5[ichl] = 0;
+ // fall through
+ case 5:
+ prgchw6[ichl] = 0;
+ }
+ ichl++;
+ }
+
+ delete[] prgchwRunText;
+ delete[] prgchsRunText8;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Output the glyph IDs generated by the glyph generation pass (pass 0).
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogPass1Input(std::ostream & strmOut)
+{
+ strmOut << "INPUT TO PASS 1\n\n";
+
+ GrSlotStream * psstrm = OutputStream(0);
+
+ LogSlotHeader(strmOut, psstrm->WritePos(), SP_PER_SLOT, LEADING_SP);
+
+ LogSlotGlyphs(strmOut, psstrm);
+
+ strmOut << "\n";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Output the the results of pass.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogPassOutput(std::ostream & strmOut, int ipass, int cslotSkipped)
+{
+ strmOut << "\n";
+
+ GrPass * ppass = Pass(ipass);
+ GrSlotStream * psstrmIn = InputStream(ipass);
+ GrSlotStream * psstrmOut = OutputStream(ipass);
+
+ int islot;
+ // Mark each slot with its index in the input and output streams.
+ for (islot = 0; islot < psstrmIn->ReadPos(); islot++)
+ psstrmIn->SlotAt(islot)->m_islotTmpIn = islot;
+
+ for (islot = 0; islot < psstrmOut->WritePos(); islot++)
+ psstrmOut->SlotAt(islot)->m_islotTmpOut = islot;
+
+ if (!dynamic_cast<GrBidiPass *>(ppass))
+ ppass->LogRulesFiredAndFailed(strmOut, psstrmIn);
+
+ strmOut << "\nOUTPUT OF PASS " << ipass;
+ if (dynamic_cast<GrBidiPass *>(ppass))
+ strmOut << " (bidi)";
+ else if (dynamic_cast<GrSubPass *>(ppass))
+ {
+ if (ipass >= m_ipassJust1)
+ strmOut << " (justification)";
+ else
+ strmOut << " (substitution)";
+ }
+ else if (dynamic_cast<GrPosPass *>(ppass))
+ strmOut << " (positioning)";
+ else if (dynamic_cast<GrLineBreakPass *>(ppass))
+ strmOut << " (linebreak)";
+ strmOut << "\n";
+
+ ppass->LogInsertionsAndDeletions(strmOut, psstrmOut);
+
+ LogSlotHeader(strmOut, psstrmOut->WritePos(), SP_PER_SLOT, LEADING_SP);
+
+ LogSlotGlyphs(strmOut, psstrmOut);
+
+ bool fAnyPseudos = false;
+ if (dynamic_cast<GrPosPass *>(ppass))
+ {
+ for (islot = 0; islot < psstrmOut->WritePos(); islot++)
+ {
+ GrSlotState * pslotTmp = psstrmOut->SlotAt(islot);
+ if (pslotTmp->GlyphID() != pslotTmp->ActualGlyphForOutput(this))
+ {
+ fAnyPseudos = true;
+ break;
+ }
+ }
+ }
+ if (fAnyPseudos)
+ {
+ strmOut << "Actual glyphs: ";
+ for (islot = 0; islot < psstrmOut->WritePos(); islot++)
+ {
+ GrSlotState * pslotTmp = psstrmOut->SlotAt(islot);
+ if (pslotTmp->GlyphID() != pslotTmp->ActualGlyphForOutput(this))
+ LogHexInTable(strmOut, pslotTmp->ActualGlyphForOutput(this));
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+ }
+
+ LogAttributes(strmOut, ipass);
+
+ // Do this later, after we're sure the positions have been set:
+ //if (ipass == m_cpass - 1)
+ // LogFinalPositions(strmOut);
+
+ if (cslotSkipped > 0)
+ {
+ strmOut << "\n ";
+ for (islot = 0; islot < cslotSkipped; islot++)
+ strmOut << "SKIP ";
+ strmOut << "\n";
+ }
+
+ // If this was the pass just before the justification routines get run, output a
+ // special line that just shows the results, ie, the values of justify.width.
+ // TODO: adjust this when measure mode get functioning.
+ if (ipass == m_ipassJust1 - 1 && ShouldLogJustification()
+ && m_engst.m_jmodi == kjmodiJustify)
+ {
+ strmOut << "\nJUSTIFICATION\n\n";
+ LogSlotHeader(strmOut, psstrmOut->WritePos(), SP_PER_SLOT, LEADING_SP);
+ LogSlotGlyphs(strmOut, psstrmOut);
+ LogAttributes(strmOut, ipass, true);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write the list of rules fired and failed for a given pass.
+----------------------------------------------------------------------------------------------*/
+void GrPass::LogRulesFiredAndFailed(std::ostream & strmOut, GrSlotStream * psstrmIn)
+{
+ m_pzpst->LogRulesFiredAndFailed(strmOut, psstrmIn);
+}
+
+void PassState::LogRulesFiredAndFailed(std::ostream & strmOut, GrSlotStream * psstrmIn)
+{
+
+ strmOut << "PASS " << m_ipass << "\n\n" << "Rules matched: ";
+ if (m_crulrec == 0)
+ strmOut << "none";
+ strmOut << "\n";
+
+ for (int irulrec = 0; irulrec < m_crulrec; irulrec++)
+ {
+ if (m_rgrulrec[irulrec].m_fFired)
+ strmOut << " * ";
+ else
+ strmOut << " ";
+
+ strmOut << m_rgrulrec[irulrec].m_islot << ". ";
+
+ if (m_rgrulrec[irulrec].m_irul == PassState::kHitMaxRuleLoop)
+ strmOut << "hit MaxRuleLoop\n";
+ else if (m_rgrulrec[irulrec].m_irul == PassState::kHitMaxBackup)
+ strmOut << "hit MaxBackup\n";
+ else
+ {
+ strmOut << "rule " << m_ipass << "." << m_rgrulrec[irulrec].m_irul;
+
+ if (m_rgrulrec[irulrec].m_fFired)
+ strmOut << " FIRED\n";
+ else
+ strmOut << " failed\n";
+ }
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out the marks on top of the slot table indicating insertions and deletions.
+----------------------------------------------------------------------------------------------*/
+void GrPass::LogInsertionsAndDeletions(std::ostream & strmOut, GrSlotStream * psstrmOut)
+{
+ m_pzpst->LogInsertionsAndDeletions(strmOut, psstrmOut);
+}
+
+void PassState::LogInsertionsAndDeletions(std::ostream & strmOut, GrSlotStream * psstrmOut)
+{
+ int cslotDel = m_rgcslotDeletions[0];
+ bool fIns;
+ if (cslotDel > 1)
+ strmOut << "\n DEL-" << cslotDel;
+ else if (cslotDel == 1)
+ strmOut << "\n DEL ";
+ else
+ strmOut << "\n ";
+
+ for (int islot = 0; islot < psstrmOut->WritePos(); islot++)
+ {
+ cslotDel = (islot + 1 >= MAX_SLOTS) ? 0 : m_rgcslotDeletions[islot + 1];
+ fIns = (islot >= MAX_SLOTS) ? 0 : m_rgfInsertion[islot];
+
+ if (fIns)
+ {
+ strmOut << "INS";
+ if (cslotDel > 0)
+ {
+ if (cslotDel > 1)
+ strmOut << "/D-" << cslotDel;
+ else
+ strmOut << "/DEL";
+ }
+ else
+ strmOut << " ";
+
+ }
+ else if (cslotDel > 0)
+ {
+ if (cslotDel >= 10)
+ strmOut << "DEL-" << cslotDel << " ";
+ else if (cslotDel > 1)
+ strmOut << " DEL-" << cslotDel << " ";
+ else
+ strmOut << " DEL ";
+ }
+ else
+ strmOut << " ";
+ }
+
+ strmOut << "\n";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out a line for each slot attribute that changed during the pass.
+
+ @param fJustWidths - a special pass that writes out just the effects of the justification
+ routines, ie, the values of justify.width
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogAttributes(std::ostream & strmOut, int ipass,
+ bool fJustWidths)
+{
+ // Figure out which slot attributes were modified for some slot during the pass.
+ bool * prgfMods = new bool[kslatMax + NumUserDefn() - 1];
+
+ bool fPreJust = (!fJustWidths && ipass == m_ipassJust1 - 1 && ShouldLogJustification());
+ bool fPostJust = ((fJustWidths || ipass == m_ipassJust1) && ShouldLogJustification());
+
+ int ccomp; // max number of components per slot
+ int cassoc; // max number of associations per slot
+ SlotAttrsModified(ipass, prgfMods, fPreJust, &ccomp, &cassoc);
+
+ if (fPreJust)
+ {
+ // prgfMods[kslatJStretch] = true;
+ // prgfMods[kslatJShrink] = true;
+ // prgfMods[kslatJStep] = true;
+ // prgfMods[kslatWeight] = true;
+ prgfMods[kslatJWidth] = false; // output j.width in its own line (we call this
+ // method with fJustWidths == true)
+ }
+ else if (fPostJust)
+ prgfMods[kslatJWidth] = true;
+
+ GrPass * ppass = Pass(ipass);
+ GrPass * ppassNext = (ipass < m_cpass - 1) ? Pass(ipass + 1) : NULL;
+ GrSlotStream * psstrm = OutputStream(ipass);
+
+ if (fJustWidths)
+ {}
+ else if (dynamic_cast<GrBidiPass *>(ppass))
+ {
+ // Special stuff for Bidi pass:
+ // Log value of directionality attribute.
+ strmOut << "directionality ";
+ int islot;
+ for (islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ LogDirCodeInTable(strmOut, pslot->DirProcessed());
+ }
+ strmOut << "\n";
+
+ // Log final direction level for bidi pass.
+ strmOut << "dir level ";
+ for (islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ LogInTable(strmOut, pslot->DirLevel());
+ }
+ strmOut << "\n";
+ }
+ else if (ppassNext && dynamic_cast<GrBidiPass *>(ppassNext))
+ {
+ // Next pass is Bidi: log input values of directionality attribute that are input for it.
+ strmOut << "directionality ";
+ for (int islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ LogDirCodeInTable(strmOut, pslot->Directionality());
+ }
+ strmOut << "\n";
+ }
+
+ for (int slat = 0; slat < kslatMax + NumUserDefn() - 1; slat++)
+ {
+ int cIndexLim = 1;
+ if (slat == kslatCompRef)
+ cIndexLim = ccomp;
+ else if (slat == kslatUserDefn)
+ cIndexLim = 1; // kMaxUserDefinedSlotAttributes;
+
+ if (fJustWidths && slat != kslatJWidth)
+ continue;
+
+ bool fValidAttr = true;
+ for (int iIndex = 0; iIndex < cIndexLim; iIndex++)
+ {
+ if (prgfMods[slat])
+ {
+ switch(slat)
+ {
+ case kslatAdvX: strmOut << "advance.x "; break;
+ case kslatAdvY: strmOut << "advance.y "; break;
+ case kslatAttTo: strmOut << "att.to "; break;
+ case kslatAttAtX: strmOut << "att.at.x "; break;
+ case kslatAttAtY: strmOut << "att.at.y "; break;
+ case kslatAttAtGpt: strmOut << "att.at.gpt "; break;
+ case kslatAttAtXoff: strmOut << "att.at.xoff "; break;
+ case kslatAttAtYoff: strmOut << "att.at.yoff "; break;
+ case kslatAttWithX: strmOut << "att.with.x "; break;
+ case kslatAttWithY: strmOut << "att.with.y "; break;
+ case kslatAttWithGpt: strmOut << "att.with.gpt "; break;
+ case kslatAttWithXoff: strmOut << "att.with.xoff "; break;
+ case kslatAttWithYoff: strmOut << "att.with.yoff "; break;
+ case kslatAttLevel: strmOut << "att.level "; break;
+ case kslatBreak: strmOut << "breakweight "; break;
+ case kslatCompRef: strmOut << "component " << iIndex + 1 // 1-based
+ << " "; break;
+ case kslatDir: strmOut << "dir "; break;
+ case kslatInsert: strmOut << "insert "; break;
+ case kslatMeasureSol: strmOut << "measure.sol "; break;
+ case kslatMeasureEol: strmOut << "measure.eol "; break;
+ case kslatJStretch: strmOut << "j.stretch "; break;
+ case kslatJShrink: strmOut << "j.shrink "; break;
+ case kslatJStep: strmOut << "j.step "; break;
+ case kslatJWeight: strmOut << "j.weight "; break;
+ case kslatJWidth: strmOut << "j.width "; break;
+ case kslatPosX:
+ case kslatPosY:
+ Assert(false);
+ break;
+ case kslatShiftX: strmOut << "shift.x "; break;
+ case kslatShiftY: strmOut << "shift.y "; break;
+ default:
+ if (kslatUserDefn <= slat &&
+ slat < kslatUserDefn + NumUserDefn())
+ {
+ strmOut << "user" << (slat - kslatUserDefn + 1) // 1-based
+ << ((iIndex >= 9) ? " " : " ");
+ }
+ else
+ {
+ // Invalid attribute:
+ Warn("bad slot attribute");
+ fValidAttr = false;
+ break;
+ }
+ }
+
+ if (!fValidAttr)
+ break; // out of iIndex loop
+
+ for (int islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ pslot->LogSlotAttributeValue(this, strmOut, ipass, slat, iIndex,
+ fPreJust, fPostJust);
+ }
+
+ strmOut << "\n";
+ }
+ }
+ }
+
+ if (fJustWidths)
+ goto LDone;
+
+ for (int iassoc = 0; iassoc < cassoc; iassoc++)
+ {
+ // Log associations. Put them on one line it that will work; otherwise use several.
+ bool fBoth = (cassoc <= 2);
+ bool fAfter = (iassoc == (cassoc - 1));
+ if (fBoth)
+ strmOut << "assocs ";
+ else if (iassoc == 0)
+ strmOut << "assocs-before ";
+ else if (fAfter)
+ strmOut << " -after ";
+ else
+ strmOut << " -other ";
+
+ for (int islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ pslot->LogAssociation(this, strmOut, ipass, iassoc, fBoth, fAfter);
+ }
+
+ strmOut << "\n";
+
+ if (fBoth)
+ break;
+ }
+
+ if (cassoc == 0 && dynamic_cast<GrBidiPass *>(ppass))
+ {
+ strmOut << "assocs ";
+
+ // Log associations for all slots moved during the Bidi pass.
+ for (int islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ if (pslot->m_islotTmpIn != pslot->m_islotTmpOut)
+ LogInTable(strmOut, pslot->m_islotTmpIn);
+ else
+ strmOut << " ";
+ }
+
+ strmOut << "\n";
+ }
+
+LDone:
+
+ delete[] prgfMods;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out the final positions.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogFinalPositions(std::ostream & strmOut)
+{
+ GrSlotStream * psstrm = OutputStream(m_cpass - 1);
+
+ strmOut << "x position ";
+ for (int islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ if (pslot->IsLineBreak(LBGlyphID()))
+ {
+ strmOut << " ";
+ continue;
+ }
+ LogInTable(strmOut, pslot->XPosition());
+ }
+ strmOut << "\n";
+
+ strmOut << "y position ";
+ for (int islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ if (pslot->IsLineBreak(LBGlyphID()))
+ {
+ strmOut << " ";
+ continue;
+ }
+ LogInTable(strmOut, pslot->YPosition());
+ }
+ strmOut << "\n";
+}
+#endif // TRACING
+
+/*----------------------------------------------------------------------------------------------
+ Write out the final underlying-to-surface associations.
+----------------------------------------------------------------------------------------------*/
+void Segment::LogUnderlyingToSurface(GrTableManager * ptman, std::ostream & strmOut,
+ GrCharStream * pchstrm)
+{
+#ifdef TRACING
+ strmOut << "\n\nUNDERLYING TO SURFACE MAPPINGS\n\n";
+
+ size_t cassocs = 0;
+ int fLigs = false;
+ int ichw;
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ if (m_prgpvisloutAssocs[ichw])
+ cassocs = max(cassocs, m_prgpvisloutAssocs[ichw]->size());
+ if (m_prgisloutLigature[ichw] != kNegInfinity)
+ fLigs = true;
+ }
+
+// ptman->LogSlotHeader(strmOut, m_ichwAssocsLim, SP_PER_SLOT, LEADING_SP, m_ichwAssocsMin);
+ ptman->LogUnderlyingHeader(strmOut, pchstrm->Min(), (pchstrm->Min() + m_ichwAssocsLim),
+ -m_ichwAssocsMin, NULL);
+
+ int rgnChars[MAX_SLOTS];
+ bool rgfNewRun[MAX_SLOTS];
+ std::fill_n(rgfNewRun, MAX_SLOTS, false);
+ GrFeatureValues rgfval[MAX_SLOTS];
+ int cchwMaxRawChars;
+
+ int cchw = pchstrm->GetLogData(ptman, rgnChars, rgfNewRun, rgfval,
+ -m_ichwAssocsMin, &cchwMaxRawChars);
+ cchw = min(cchw, MAX_SLOTS);
+
+ utf16 rgchwChars2[MAX_SLOTS];
+ utf16 rgchwChars3[MAX_SLOTS];
+ utf16 rgchwChars4[MAX_SLOTS];
+ utf16 rgchwChars5[MAX_SLOTS];
+ utf16 rgchwChars6[MAX_SLOTS];
+ int rgcchwRaw[MAX_SLOTS];
+ if (cchwMaxRawChars > 1)
+ {
+ cchwMaxRawChars = min(cchwMaxRawChars, 6);
+ pchstrm->GetLogDataRaw(ptman, cchw, -m_ichwAssocsMin, cchwMaxRawChars,
+ rgnChars, rgchwChars2, rgchwChars3, rgchwChars4, rgchwChars5, rgchwChars6,
+ rgcchwRaw);
+ }
+ else
+ {
+ for (ichw = 0 ; ichw <(m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ rgcchwRaw[ichw] = 1;
+ rgchwChars2[ichw] = 0;
+ rgchwChars3[ichw] = 0;
+ rgchwChars4[ichw] = 0;
+ rgchwChars5[ichw] = 0;
+ rgchwChars6[ichw] = 0;
+ }
+ }
+
+ // Text
+ strmOut << "Text: "; // 15 spaces
+ int inUtf32 = 0;
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ utf16 chw, chwNext;
+ switch (rgcchwRaw[ichw])
+ {
+ default:
+ case 1: chw = utf16(rgnChars[inUtf32]); chwNext = rgchwChars2[inUtf32]; break;
+ case 2: chw = rgchwChars2[inUtf32]; chwNext = rgchwChars3[inUtf32]; break;
+ case 3: chw = rgchwChars3[inUtf32]; chwNext = rgchwChars4[inUtf32]; break;
+ case 4: chw = rgchwChars4[inUtf32]; chwNext = rgchwChars5[inUtf32]; break;
+ case 5: chw = rgchwChars5[inUtf32]; chwNext = rgchwChars6[inUtf32]; break;
+ case 6: chw = rgchwChars6[inUtf32]; chwNext = 0; break;
+ }
+ if (rgcchwRaw[ichw] == 1 && chwNext == 0 && chw < 0x0100) // ANSI
+ strmOut << (char)chw << " "; // 6 spaces
+ else
+ strmOut << " "; // 7 spaces
+ if (chwNext == 0)
+ inUtf32++;
+ }
+ strmOut << "\n";
+
+ // Unicode
+ strmOut << "Unicode: ";
+ inUtf32 = 0;
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ utf16 chw, chwNext;
+ switch (rgcchwRaw[ichw])
+ {
+ default:
+ case 1: chw = utf16(rgnChars[inUtf32]); chwNext = rgchwChars2[inUtf32]; break;
+ case 2: chw = rgchwChars2[inUtf32]; chwNext = rgchwChars3[inUtf32]; break;
+ case 3: chw = rgchwChars3[inUtf32]; chwNext = rgchwChars4[inUtf32]; break;
+ case 4: chw = rgchwChars4[inUtf32]; chwNext = rgchwChars5[inUtf32]; break;
+ case 5: chw = rgchwChars5[inUtf32]; chwNext = rgchwChars6[inUtf32]; break;
+ case 6: chw = rgchwChars6[inUtf32]; chwNext = 0; break;
+ }
+ ptman->LogHexInTable(strmOut, chw, chwNext != 0);
+ if (chwNext == 0)
+ inUtf32++;
+ }
+ strmOut << "\n";
+
+ strmOut << "before ";
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ if (rgcchwRaw[ichw] > 1)
+ // continuation of Unicode codepoint
+ strmOut << " ";
+ else if (m_prgisloutBefore[ichw] == kNegInfinity)
+ strmOut << "<-- ";
+ else if (m_prgisloutBefore[ichw] == kPosInfinity)
+ strmOut << "--> ";
+ else
+ ptman->LogInTable(strmOut, m_prgisloutBefore[ichw]);
+ }
+ strmOut <<"\n";
+
+ for (int ix = 1; ix < signed(cassocs) - 1; ix++) //(cassocs > 2)
+ {
+ if (ix == 1)
+ strmOut << "other ";
+ else
+ strmOut << " ";
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ std::vector<int> * pvislout = m_prgpvisloutAssocs[ichw];
+ if (pvislout == NULL)
+ strmOut << " ";
+ else if (signed(pvislout->size()) <= ix)
+ strmOut << " ";
+ else if ((*pvislout)[ix] != m_prgisloutAfter[ichw])
+ ptman->LogInTable(strmOut, (*pvislout)[ix]);
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+ }
+
+ strmOut << "after ";
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ if (rgcchwRaw[ichw] > 1)
+ // continuation of Unicode codepoint
+ strmOut << " ";
+ else if (m_prgisloutAfter[ichw] == kNegInfinity)
+ strmOut << "<-- ";
+ else if (m_prgisloutAfter[ichw] == kPosInfinity)
+ strmOut << "--> ";
+ else
+ ptman->LogInTable(strmOut, m_prgisloutAfter[ichw]);
+ }
+ strmOut <<"\n";
+
+ if (fLigs)
+ {
+ strmOut << "ligature ";
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ if (rgcchwRaw[ichw] > 1)
+ // continuation of Unicode codepoint
+ strmOut << " ";
+ else if (m_prgisloutLigature[ichw] != kNegInfinity)
+ ptman->LogInTable(strmOut, m_prgisloutLigature[ichw]);
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+
+ strmOut << "component ";
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ if (rgcchwRaw[ichw] > 1)
+ // continuation of Unicode codepoint
+ strmOut << " ";
+ else if (m_prgisloutLigature[ichw] != kNegInfinity)
+ ptman->LogInTable(strmOut, m_prgiComponent[ichw] + 1); // 1-based
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+ }
+
+ strmOut << "\n";
+#endif
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out the final surface-to-underlying associations.
+----------------------------------------------------------------------------------------------*/
+void Segment::LogSurfaceToUnderlying(GrTableManager * ptman, std::ostream & strmOut)
+{
+#ifdef TRACING
+ strmOut << "\nSURFACE TO UNDERLYING MAPPINGS\n\n";
+
+ ptman->LogSlotHeader(strmOut, m_cslout, SP_PER_SLOT, LEADING_SP);
+
+ int ccomp = 0;
+
+ strmOut << "Glyph IDs: ";
+ int islout;
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->SpecialSlotFlag() == kspslLbInitial ||
+ psloutTmp->SpecialSlotFlag() == kspslLbFinal)
+ {
+ strmOut << "# ";
+ }
+ else
+ {
+ ptman->LogHexInTable(strmOut, psloutTmp->GlyphID());
+ ccomp = max(ccomp, psloutTmp->NumberOfComponents());
+ }
+ }
+ strmOut << "\n";
+
+ bool fAnyPseudos = false;
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->GlyphID() != psloutTmp->ActualGlyphForOutput(ptman))
+ {
+ fAnyPseudos = true;
+ break;
+ }
+ }
+ if (fAnyPseudos)
+ {
+ strmOut << "Actual glyphs: ";
+ for (int islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->GlyphID() != psloutTmp->ActualGlyphForOutput(ptman))
+ ptman->LogHexInTable(strmOut, psloutTmp->ActualGlyphForOutput(ptman));
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+ }
+
+ strmOut << "before ";
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->SpecialSlotFlag() == kspslLbInitial ||
+ psloutTmp->SpecialSlotFlag() == kspslLbFinal)
+ {
+ strmOut << " ";
+ }
+ else
+ ptman->LogInTable(strmOut, psloutTmp->BeforeAssoc());
+ }
+ strmOut << "\n";
+
+ strmOut << "after ";
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->SpecialSlotFlag() == kspslLbInitial ||
+ psloutTmp->SpecialSlotFlag() == kspslLbFinal)
+ {
+ strmOut << " ";
+ }
+ else
+ ptman->LogInTable(strmOut, psloutTmp->AfterAssoc());
+ }
+ strmOut << "\n";
+
+ for (int icomp = 0; icomp < ccomp; icomp++)
+ {
+ strmOut << "component " << icomp + 1 // 1=based
+ << " ";
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->SpecialSlotFlag() == kspslLbInitial ||
+ psloutTmp->SpecialSlotFlag() == kspslLbFinal)
+ {
+ strmOut << " ";
+ }
+ else if (icomp < psloutTmp->NumberOfComponents())
+ ptman->LogInTable(strmOut, psloutTmp->UnderlyingComponent(icomp));
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+ }
+#endif
+}
+
+#ifdef TRACING
+/*----------------------------------------------------------------------------------------------
+ Write out the header lines for the underlying data.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogUnderlyingHeader(std::ostream & strmOut, int iMin,
+ int iLim, int cBackup, int * prgichr)
+{
+ strmOut << "string ";
+ int i, iLabel;
+ int * pichr = prgichr;
+ for (i = iMin - cBackup, iLabel = i; i < iLim; i++, iLabel++, pichr++)
+ {
+ while (prgichr && *pichr > 1)
+ {
+ // continuation of upper-plane char
+ iLabel++;
+ pichr++;
+ }
+ LogInTable(strmOut, iLabel);
+ }
+ strmOut << "\n";
+
+ strmOut << "segment ";
+ pichr = prgichr;
+ for (i = 0 - cBackup, iLabel = i; i < (iLim - iMin); i++, iLabel++, pichr++)
+ {
+ while (prgichr && *pichr > 1)
+ {
+ // continuation of upper-plane char
+ iLabel++;
+ pichr++;
+ }
+ LogInTable(strmOut, iLabel);
+ }
+ strmOut << "\n\n";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out the header lines for the slot contents.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogSlotHeader(std::ostream & strmOut, int islotLim,
+ int cspPerSlot, int cspLeading, int islotMin)
+{
+ islotLim = min(islotLim, MAX_SLOTS);
+
+ int isp, islot;
+
+ for (isp = 0; isp < cspLeading; isp++)
+ strmOut << " ";
+
+ for (islot = islotMin; islot < islotLim; islot++)
+ LogInTable(strmOut, islot);
+ strmOut << "\n\n";
+
+/****
+ if (cslot >= 100)
+ {
+ for (isp = 0; isp < cspLeading; isp++)
+ strmOut << " ";
+
+ for (islot = 0; islot < 100; islot++)
+ {
+ for (isp = 0; isp < cspPerSlot; isp++)
+ strmOut << " ";
+ }
+
+ for (islot = 100; islot < cslot; islot++)
+ {
+ strmOut << "1";
+ for (isp = 1; isp < cspPerSlot; isp++)
+ strmOut << " ";
+ }
+ }
+
+ if (cslot > 10)
+ {
+ for (isp = 0; isp < cspLeading; isp++)
+ strmOut << " ";
+
+ for (islot = 0; islot < 10; islot++)
+ {
+ for (isp = 0; isp < cspPerSlot; isp++)
+ strmOut << " ";
+ }
+
+ for (islot = 10; islot < cslot; islot++)
+ {
+ if (true) // (islot % 10 == 0)
+ {
+ if (islot >= 100)
+ strmOut << ((islot - 100) / 10);
+ else
+ strmOut << (islot / 10);
+ }
+ else
+ strmOut << " ";
+
+ for (isp = 1; isp < cspPerSlot; isp++)
+ strmOut << " ";
+ }
+ strmOut << "\n";
+ }
+
+ for (isp = 0; isp < cspLeading; isp++)
+ strmOut << " ";
+
+ for (islot = 0; islot < cslot; islot++)
+ {
+ strmOut << (islot % 10);
+ for (isp = 1; isp < cspPerSlot; isp++)
+ strmOut << " ";
+
+ }
+ strmOut << "\n";
+****/
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out the glyph numbers for the given stream.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogSlotGlyphs(std::ostream & strmOut, GrSlotStream * psstrm)
+{
+ strmOut << "Glyph IDs: ";
+ int islot;
+ for (islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslotTmp = psstrm->SlotAt(islot);
+ if (pslotTmp->IsLineBreak(LBGlyphID()))
+ strmOut << "# ";
+ else
+ LogHexInTable(strmOut, pslotTmp->GlyphID());
+ }
+ strmOut << "\n";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return flags indicating which attributes were modified for some slot during the pass
+ and therefore need a line in the log file.
+
+ The 'pfMods' array has one flag per slot attribute; the final group are the user-
+ definable attributes. 'pccomp' returns the maximum number of ligature components
+ in this pass. Associations are assumed to have changed if anything else for the slot did.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::SlotAttrsModified(int ipass, bool * rgfMods, bool fPreJust,
+ int * pccomp, int * pcassoc)
+{
+ // Zero the flags
+ std::fill_n(rgfMods, kslatMax + NumUserDefn() - 1, false);
+ *pccomp = 0;
+ *pcassoc = 0;
+
+ //GrSlotStream * psstrmIn = InputStream(ipass);
+ GrSlotStream * psstrmOut = OutputStream(ipass);
+
+ for (int islot = 0; islot < psstrmOut->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrmOut->SlotAt(islot);
+ Assert(pslot->PassModified() <= ipass);
+ if (pslot->PassModified() < ipass && !fPreJust)
+ continue; // not modified during this pass
+
+ pslot->SlotAttrsModified(rgfMods, fPreJust, pccomp, pcassoc);
+ }
+}
+
+void GrSlotState::SlotAttrsModified(bool * rgfMods, bool fPreJust, int * pccomp, int * pcassoc)
+{
+ // To handle reprocessing, in which case there may be a chain of slots modified
+ // in the same pass:
+ GrSlotState * pslotPrev = m_pslotPrevState;
+ while (pslotPrev && pslotPrev->PassModified() == PassModified())
+ pslotPrev = pslotPrev->m_pslotPrevState;
+
+ if (!pslotPrev)
+ {
+ // Inserted slot?
+ if (m_fAdvXSet)
+ rgfMods[kslatAdvX] = true;
+ if (m_fAdvYSet)
+ rgfMods[kslatAdvY] = true;
+
+ if (m_srAttachTo != 0)
+ rgfMods[kslatAttTo] = true;
+
+ if (m_mAttachAtX != kNotYetSet || m_mAttachAtY != 0)
+ { // always do these in pairs
+ rgfMods[kslatAttAtX] = true;
+ rgfMods[kslatAttAtY] = true;
+ }
+ if (m_nAttachAtGpoint != kNotYetSet)
+ rgfMods[kslatAttAtGpt] = true;
+ if (m_mAttachAtXOffset != 0 || m_mAttachAtYOffset != 0)
+ { // always do these in pairs
+ rgfMods[kslatAttAtXoff] = true;
+ rgfMods[kslatAttAtYoff] = true;
+ }
+
+ if (m_mAttachWithX != kNotYetSet || m_mAttachWithY != 0)
+ { // always do these in pairs
+ rgfMods[kslatAttWithX] = true;
+ rgfMods[kslatAttWithY] = true;
+ }
+ if (m_nAttachWithGpoint != kNotYetSet)
+ rgfMods[kslatAttWithGpt] = true;
+ if (m_mAttachWithXOffset != 0 || m_mAttachWithYOffset != 0)
+ { // always do these in pairs
+ rgfMods[kslatAttWithXoff] = true;
+ rgfMods[kslatAttWithYoff] = true;
+ }
+
+ if (m_nAttachLevel != 0)
+ rgfMods[kslatAttLevel] = true;
+
+ if (m_lb != kNotYetSet8)
+ rgfMods[kslatBreak] = true;
+ if (m_dirc != kNotYetSet8)
+ rgfMods[kslatDir] = true;
+ if (m_fInsertBefore != true)
+ rgfMods[kslatInsert] = true;
+
+ if (m_mMeasureSol != kNotYetSet && m_mMeasureSol != 0)
+ rgfMods[kslatMeasureSol] = true;
+ if (m_mMeasureEol != kNotYetSet && m_mMeasureEol != 0)
+ rgfMods[kslatMeasureEol] = true;
+
+ if (m_mJStretch0 != kNotYetSet && m_mJStretch0 != 0)
+ rgfMods[kslatJStretch] = true;
+ if (m_mJShrink0 != kNotYetSet && m_mJShrink0 != 0)
+ rgfMods[kslatJShrink] = true;
+ if (m_mJStep0 != kNotYetSet && m_mJStep0 != 0)
+ rgfMods[kslatJStep] = true;
+ if (m_nJWeight0 != byte(kNotYetSet) &&
+ m_nJWeight0 != 0 && m_nJWeight0 != 1)
+ rgfMods[kslatJWeight] = true;
+ if (m_mJWidth0 != kNotYetSet && m_mJWidth0 != 0)
+ rgfMods[kslatJWidth] = true;
+
+ if (m_mShiftX != 0)
+ rgfMods[kslatShiftX] = true;
+ if (m_mShiftY != 0)
+ rgfMods[kslatShiftY] = true;
+
+ int i;
+ for (i = 0; i < m_cnCompPerLig; i++)
+ {
+ if (CompRef(i) != NULL)
+ rgfMods[kslatCompRef] = true;
+ if (CompRef(i))
+ *pccomp = max(*pccomp, i + 1); // max number of ligatures in this pass
+ }
+
+ for (i = 0; i < m_cnUserDefn; i++)
+ {
+ if (UserDefn(i) != 0)
+ rgfMods[kslatUserDefn + i] = true;
+ }
+ }
+ else
+ {
+ if (m_fAdvXSet && m_mAdvanceX != pslotPrev->m_mAdvanceX)
+ rgfMods[kslatAdvX] = true;
+ if (m_fAdvYSet && m_mAdvanceY != pslotPrev->m_mAdvanceY)
+ rgfMods[kslatAdvY] = true;
+
+ if (m_srAttachTo != pslotPrev->m_srAttachTo)
+ rgfMods[kslatAttTo] = true;
+
+ if (m_mAttachAtX != pslotPrev->m_mAttachAtX || m_mAttachAtY != pslotPrev->m_mAttachAtY)
+ {
+ rgfMods[kslatAttAtX] = true;
+ rgfMods[kslatAttAtY] = true;
+ }
+ if (m_nAttachAtGpoint != pslotPrev->m_nAttachAtGpoint)
+ rgfMods[kslatAttAtGpt] = true;
+ if (m_mAttachAtXOffset != pslotPrev->m_mAttachAtXOffset ||
+ m_mAttachAtYOffset != pslotPrev->m_mAttachAtYOffset)
+ {
+ rgfMods[kslatAttAtXoff] = true;
+ rgfMods[kslatAttAtYoff] = true;
+ }
+
+ if (m_mAttachWithX != pslotPrev->m_mAttachWithX ||
+ m_mAttachWithY != pslotPrev->m_mAttachWithY)
+ {
+ rgfMods[kslatAttWithX] = true;
+ rgfMods[kslatAttWithY] = true;
+ }
+ if (m_nAttachWithGpoint != pslotPrev->m_nAttachWithGpoint)
+ rgfMods[kslatAttWithGpt] = true;
+ if (m_mAttachWithXOffset != pslotPrev->m_mAttachWithXOffset ||
+ m_mAttachWithYOffset != pslotPrev->m_mAttachWithYOffset)
+ {
+ rgfMods[kslatAttWithXoff] = true;
+ rgfMods[kslatAttWithYoff] = true;
+ }
+
+ if (m_nAttachLevel != pslotPrev->m_nAttachLevel)
+ rgfMods[kslatAttLevel] = true;
+
+ if (m_lb != pslotPrev->m_lb)
+ rgfMods[kslatBreak] = true;
+ if (m_dirc != pslotPrev->m_dirc)
+ rgfMods[kslatDir] = true;
+ if (m_fInsertBefore != pslotPrev->m_fInsertBefore)
+ rgfMods[kslatInsert] = true;
+
+ if (m_mMeasureSol != pslotPrev->m_mMeasureSol)
+ rgfMods[kslatMeasureSol] = true;
+ if (m_mMeasureEol != pslotPrev->m_mMeasureEol)
+ rgfMods[kslatMeasureEol] = true;
+
+ if (m_mJStretch0 != pslotPrev->m_mJStretch0 || (fPreJust && m_mJStretch0 != 0))
+ rgfMods[kslatJStretch] = true;
+ if (m_mJShrink0 != pslotPrev->m_mJShrink0 || (fPreJust && m_mJShrink0 != 0))
+ rgfMods[kslatJShrink] = true;
+ if (m_mJStep0 != pslotPrev->m_mJStep0 || (fPreJust && m_mJStep0 != 0))
+ rgfMods[kslatJStep] = true;
+ if (m_nJWeight0 != pslotPrev->m_nJWeight0 || (fPreJust && m_nJWeight0 != 0))
+ rgfMods[kslatJWeight] = true;
+ if (m_mJWidth0 != pslotPrev->m_mJWidth0)
+ rgfMods[kslatJWidth] = true;
+
+ if (m_mShiftX != pslotPrev->m_mShiftX)
+ rgfMods[kslatShiftX] = true;
+ if (m_mShiftY != pslotPrev->m_mShiftY)
+ rgfMods[kslatShiftY] = true;
+
+ int i;
+ for (i = 0; i < m_cnCompPerLig; i++)
+ {
+ if (CompRef(i) != pslotPrev->CompRef(i))
+ rgfMods[kslatCompRef] = true;
+ if (CompRef(i))
+ *pccomp = max(*pccomp, i + 1); // max number of ligatures in this pass
+ }
+
+ for (i = 0; i < m_cnUserDefn; i++)
+ {
+ if (UserDefn(i) != pslotPrev->UserDefn(i))
+ rgfMods[kslatUserDefn + i] = true;
+ }
+ }
+
+ *pcassoc = max(*pcassoc, AssocsSize());
+}
+
+/*----------------------------------------------------------------------------------------------
+ Log the value of the slot attribute for the given slot, if it changed.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::LogSlotAttributeValue(GrTableManager * ptman,
+ std::ostream & strmOut, int ipass, int slat, int iIndex,
+ bool fPreJust, bool fPostJust)
+{
+ if (m_ipassModified != ipass && !fPreJust && !fPostJust)
+ {
+ strmOut << " ";
+ return;
+ }
+
+ // To handle reprocessing, in which case there may be a chain of slots modified
+ // in the same pass:
+ GrSlotState * pslotPrev = m_pslotPrevState;
+ while (pslotPrev && pslotPrev->PassModified() == PassModified())
+ pslotPrev = pslotPrev->m_pslotPrevState;
+
+ // General-purpose variables for em-unit attributes:
+ int mThis = 0;
+ int mPrev = 0;
+ switch (slat)
+ {
+ case kslatShiftX:
+ mThis = m_mShiftX;
+ mPrev = (pslotPrev) ? pslotPrev->m_mShiftX : 0;
+ break;
+ case kslatShiftY:
+ mThis = m_mShiftY;
+ mPrev = (pslotPrev) ? pslotPrev->m_mShiftY : 0;
+ break;
+ case kslatMeasureSol:
+ mThis = m_mMeasureSol;
+ mPrev = (pslotPrev) ? pslotPrev->m_mMeasureSol : 0;
+ break;
+ case kslatMeasureEol:
+ mThis = m_mMeasureEol;
+ mPrev = (pslotPrev) ? pslotPrev->m_mMeasureEol : 0;
+ break;
+ case kslatJStretch:
+ mThis = m_mJStretch0;
+ mPrev = (pslotPrev) ? pslotPrev->m_mJStretch0 : 0;
+ mPrev = (fPreJust && mThis > 0) ? -1 : mPrev; // log it even if it didn't change
+ break;
+ case kslatJShrink:
+ mThis = m_mJShrink0;
+ mPrev = (pslotPrev) ? pslotPrev->m_mJShrink0 : 0;
+ mPrev = (fPreJust && mThis > 0) ? -1 : mPrev; // log it even if it didn't change
+ break;
+ case kslatJStep:
+ mThis = m_mJStep0;
+ mPrev = (pslotPrev) ? pslotPrev->m_mJStep0 : 0;
+ mPrev = (fPreJust && mThis > 1) ? -1 : mPrev; // log it even if it didn't change
+ break;
+ case kslatJWeight:
+ mThis = m_nJWeight0;
+ mPrev = (pslotPrev) ? pslotPrev->m_nJWeight0 : 0;
+ mPrev = (fPreJust && mThis > 1) ? -1 : mPrev; // log it even if it didn't change
+ break;
+ case kslatJWidth:
+ mThis = m_mJWidth0;
+ mPrev = (pslotPrev) ? pslotPrev->m_mJWidth0 : 0;
+ mPrev = (fPostJust && mThis > 0) ? -1 : mPrev; // log it even if it didn't change
+ break;
+ default:
+ // don't use these variables
+ break;
+ }
+
+ switch (slat)
+ {
+ case kslatAdvX:
+ if (m_fAdvXSet && (!pslotPrev || m_mAdvanceX != pslotPrev->m_mAdvanceX))
+ {
+ ptman->LogInTable(strmOut, m_mAdvanceX);
+ return;
+ }
+ break;
+ case kslatAdvY:
+ if (m_fAdvYSet && (!pslotPrev || m_mAdvanceY != pslotPrev->m_mAdvanceY))
+ {
+ ptman->LogInTable(strmOut, m_mAdvanceY);
+ return;
+ }
+ break;
+
+ case kslatAttTo:
+ if (m_srAttachTo != (pslotPrev ? pslotPrev->m_srAttachTo : 0))
+ {
+ ptman->LogInTable(strmOut, m_srAttachTo);
+ return;
+ }
+ break;
+
+ case kslatAttAtX: // always do these in pairs
+ case kslatAttAtY:
+ if (m_mAttachAtX != (pslotPrev ? pslotPrev->m_mAttachAtX : kNotYetSet) ||
+ m_mAttachAtY != (pslotPrev ? pslotPrev->m_mAttachAtY : 0))
+ {
+ ptman->LogInTable(strmOut,
+ ((slat == kslatAttAtX) ? m_mAttachAtX : m_mAttachAtY));
+ return;
+ }
+ break;
+ case kslatAttAtGpt:
+ if (m_nAttachAtGpoint != (pslotPrev ? pslotPrev->m_nAttachAtGpoint : kNotYetSet))
+ {
+ ptman->LogInTable(strmOut,
+ ((m_nAttachAtGpoint == kGpointZero) ? 0 : m_nAttachAtGpoint));
+ return;
+ }
+ break;
+ case kslatAttAtXoff: // always do these in pairs
+ case kslatAttAtYoff:
+ if (m_mAttachAtXOffset != (pslotPrev ? pslotPrev->m_mAttachAtXOffset : 0) ||
+ m_mAttachAtYOffset != (pslotPrev ? pslotPrev->m_mAttachAtYOffset : 0))
+ {
+ ptman->LogInTable(strmOut,
+ ((slat == kslatAttAtXoff) ? m_mAttachAtXOffset : m_mAttachAtYOffset));
+ return;
+ }
+ break;
+
+ case kslatAttWithX: // always do these in pairs
+ case kslatAttWithY:
+ if (m_mAttachWithX != (pslotPrev ? pslotPrev->m_mAttachWithX : kNotYetSet) ||
+ m_mAttachWithY != (pslotPrev ? pslotPrev->m_mAttachWithY : 0))
+ {
+ ptman->LogInTable(strmOut,
+ ((slat == kslatAttWithX) ? m_mAttachWithX : m_mAttachWithY));
+ return;
+ }
+ break;
+ case kslatAttWithGpt:
+ if (m_nAttachWithGpoint != (pslotPrev ? pslotPrev->m_nAttachWithGpoint : kNotYetSet))
+ {
+ ptman->LogInTable(strmOut,
+ ((m_nAttachWithGpoint == kGpointZero) ? 0 : m_nAttachWithGpoint));
+ return;
+ }
+ break;
+ case kslatAttWithXoff: // always do these in pairs
+ case kslatAttWithYoff:
+ if (m_mAttachWithXOffset != (pslotPrev ? pslotPrev->m_mAttachWithXOffset : 0) ||
+ m_mAttachWithYOffset != (pslotPrev ? pslotPrev->m_mAttachWithYOffset : 0))
+ {
+ ptman->LogInTable(strmOut,
+ ((slat == kslatAttWithXoff) ? m_mAttachWithXOffset : m_mAttachWithYOffset));
+ return;
+ }
+ break;
+
+ case kslatAttLevel:
+ if (m_nAttachLevel != (pslotPrev ? pslotPrev->m_nAttachLevel : 0))
+ {
+ ptman->LogInTable(strmOut, m_nAttachLevel);
+ return;
+ }
+ break;
+
+ case kslatBreak:
+ if (m_lb != (pslotPrev ? pslotPrev->m_lb : kNotYetSet8))
+ {
+ ptman->LogBreakWeightInTable(strmOut, m_lb);
+ return;
+ }
+ break;
+ case kslatDir:
+ if (m_dirc != (pslotPrev ? pslotPrev->m_dirc : kNotYetSet8))
+ {
+ ptman->LogDirCodeInTable(strmOut, m_dirc);
+ return;
+ }
+ break;
+ case kslatInsert:
+ if (m_fInsertBefore != (pslotPrev ? pslotPrev->m_fInsertBefore : true))
+ {
+ if (m_fInsertBefore)
+ strmOut << "true ";
+ else
+ strmOut << "false ";
+ return;
+ }
+ break;
+
+ case kslatJWeight:
+ if (m_mJStretch0 == 0 && m_mJShrink0 == 0)
+ mPrev = mThis; // don't log; weight is irrelevant
+ // fall through
+ case kslatShiftX:
+ case kslatShiftY:
+ case kslatMeasureSol:
+ case kslatMeasureEol:
+ case kslatJStretch:
+ case kslatJShrink:
+ case kslatJStep:
+ case kslatJWidth:
+ if (mThis != mPrev)
+ {
+ ptman->LogInTable(strmOut, mThis);
+ return;
+ }
+ break;
+
+ case kslatCompRef:
+ if (CompRef(iIndex) != (pslotPrev ? pslotPrev->CompRef(iIndex) : 0))
+ {
+ GrSlotState * pslotComp = reinterpret_cast<GrSlotState *>(CompRef(iIndex));
+ ptman->LogInTable(strmOut, pslotComp->m_islotTmpIn);
+ return;
+ }
+ break;
+
+ default:
+ if (kslatUserDefn <= slat && slat <= kslatUserDefn + m_cnUserDefn)
+ {
+ int iTmp = slat - kslatUserDefn;
+ if (UserDefn(iTmp) != (pslotPrev ? pslotPrev->UserDefn(iTmp) : 0))
+ {
+ ptman->LogInTable(strmOut, UserDefn(iTmp));
+ return;
+ }
+ }
+ else
+ gAssert(false);
+ }
+
+ strmOut << " ";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Log the value of the association, if the slot changed.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::LogAssociation(GrTableManager * ptman,
+ std::ostream & strmOut, int ipass, int iassoc, bool fBoth, bool fAfter)
+{
+ if (m_ipassModified != ipass)
+ {
+ strmOut << " ";
+ return;
+ }
+
+ if (fBoth)
+ {
+ GrSlotState * pslotBefore = AssocSlot(0);
+ GrSlotState * pslotAfter = AssocSlot(m_vpslotAssoc.size() - 1);
+
+ int nBefore, nAfter;
+
+ int csp = 4;
+ if (pslotBefore)
+ {
+ nBefore = pslotBefore->m_islotTmpIn;
+ strmOut << nBefore;
+ if (nBefore > 99) csp--;
+ if (nBefore > 9) csp--;
+ }
+ else
+ {
+ strmOut << "??";
+ csp--;
+ }
+ if (pslotAfter)
+ {
+ nAfter = pslotAfter->m_islotTmpIn;
+ strmOut << "/" << nAfter;
+ if (nAfter > 99) csp--;
+ if (nAfter > 9) csp--;
+ }
+ else
+ {
+ if (pslotBefore)
+ {
+ strmOut << "/" << "??";
+ csp--;
+ }
+ else
+ csp = 5;
+ }
+
+ for (int isp = 0; isp < csp; isp++)
+ strmOut << " ";
+ }
+
+ else if (fAfter)
+ {
+ Assert(m_vpslotAssoc.size());
+ GrSlotState * pslotAfter = AssocSlot(m_vpslotAssoc.size() - 1);
+
+ if (pslotAfter)
+ {
+ int nAfter = pslotAfter->m_islotTmpIn;
+ ptman->LogInTable(strmOut, nAfter);
+ }
+ else
+ strmOut << "?? ";
+ }
+ else if (iassoc < signed(m_vpslotAssoc.size() - 1))
+ {
+ GrSlotState * pslot = AssocSlot(iassoc);
+
+ if (pslot)
+ {
+ int n = pslot->m_islotTmpIn;
+ ptman->LogInTable(strmOut, n);
+ }
+ else
+ strmOut << "?? ";
+ }
+ else
+ strmOut << " ";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write a hex value (a glyphID or Unicode codepoint) into the table.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogInTable(std::ostream & strmOut, int n)
+{
+ if (n == kNegInfinity)
+ {
+ strmOut << "-inf ";
+ return;
+ }
+ if (n == kPosInfinity)
+ {
+ strmOut << "+inf ";
+ return;
+ }
+ if (n > 999999)
+ {
+ strmOut << "****** ";
+ return;
+ }
+ if (n < -99999)
+ {
+ strmOut << "-***** ";
+ return;
+ }
+
+ strmOut << n;
+ int csp = SP_PER_SLOT - 1;
+
+ if (abs(n) > 99999) csp--;
+ if (abs(n) > 9999) csp--;
+ if (abs(n) > 999) csp--;
+ if (abs(n) > 99) csp--;
+ if (abs(n) > 9) csp--;
+
+ if (n < 0) csp--;
+
+ for (int isp = 0; isp < csp; isp++)
+ strmOut << " ";
+}
+
+void GrTableManager::LogInTable(std::ostream & strmOut, float n)
+{
+ if (n == kNegInfFloat)
+ {
+ strmOut << "-inf ";
+ return;
+ }
+ if (n == kPosInfFloat)
+ {
+ strmOut << "+inf ";
+ return;
+ }
+ if (n > 9999)
+ {
+ strmOut << "****.* ";
+ return;
+ }
+ if (n < -999)
+ {
+ strmOut << "-***.* ";
+ return;
+ }
+
+ int csp = SP_PER_SLOT - 4;
+
+ int nInt = (int)(fabsf(n));
+ int nTenths = (int)fabsf((fabsf(n) - float(nInt) + 0.05f) * 10);
+ if (nTenths >= 10)
+ {
+ nTenths = 0;
+ nInt++;
+ }
+
+ if (nInt >= 1000) csp--;
+ if (nInt >= 100) csp--;
+ if (nInt >= 10) csp--;
+
+ if (n < 0) csp--;
+
+ for (int isp = 0; isp < csp; isp++)
+ strmOut << " ";
+ if (n < 0)
+ strmOut << "-";
+ strmOut << nInt << "." << nTenths << " ";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write a hex value (a glyphID or Unicode codepoint) into the table.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogHexInTable(std::ostream & strmOut, utf16 chw, bool fPlus)
+{
+ //char rgch[20];
+ if (chw <= 0x0fff) strmOut << "0";
+ if (chw <= 0x00ff) strmOut << "0";
+ if (chw <= 0x000f) strmOut << "0";
+
+ strmOut << std::hex << chw << std::dec;
+
+ for (int i = 4; i < SP_PER_SLOT - 2; i++)
+ strmOut << " ";
+
+ if (fPlus)
+ strmOut << "+ ";
+ else
+ strmOut << " ";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write a directionality code to the table.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogDirCodeInTable(std::ostream & strmOut, int dirc)
+{
+ switch (dirc)
+ {
+ case kdircUnknown: strmOut << "??? "; break;
+ case kdircNeutral: strmOut << "ON "; break;
+ case kdircL: strmOut << "L "; break;
+ case kdircR: strmOut << "R "; break;
+ case kdircRArab: strmOut << "AR "; break;
+ case kdircEuroNum: strmOut << "EN "; break;
+ case kdircEuroSep: strmOut << "ES "; break;
+ case kdircEuroTerm: strmOut << "ET "; break;
+ case kdircArabNum: strmOut << "AN "; break;
+ case kdircComSep: strmOut << "CS "; break;
+ case kdircWhiteSpace: strmOut << "WS "; break;
+ case kdircBndNeutral: strmOut << "BN "; break;
+ case kdircNSM: strmOut << "NSM "; break;
+ case kdircLRO: strmOut << "LRO "; break;
+ case kdircRLO: strmOut << "RLO "; break;
+ case kdircLRE: strmOut << "LRE "; break;
+ case kdircRLE: strmOut << "RLE "; break;
+ case kdircPDF: strmOut << "PDF "; break;
+ case kdircPdfL: strmOut << "PDF-L "; break;
+ case kdircPdfR: strmOut << "PDF-R "; break;
+ case kdircLlb: strmOut << "L "; break;
+ case kdircRlb: strmOut << "R "; break;
+ default: LogInTable(strmOut, dirc); break;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write a breakweight code to the table.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogBreakWeightInTable(std::ostream & strmOut, int lb)
+{
+ if (lb < 0)
+ {
+ lb = lb * -1;
+ switch (lb)
+ {
+ case klbWsBreak: strmOut << "-ws "; break;
+ case klbWordBreak: strmOut << "-word "; break;
+ case klbHyphenBreak: strmOut << "-intra "; break;
+ case klbLetterBreak: strmOut << "-lettr "; break;
+ case klbClipBreak: strmOut << "-clip "; break;
+ default: LogInTable(strmOut, lb*-1); break;
+ }
+ }
+ else
+ {
+ switch (lb)
+ {
+ case klbNoBreak: strmOut << "none "; break;
+ case klbWsBreak: strmOut << "ws "; break;
+ case klbWordBreak: strmOut << "word "; break;
+ case klbHyphenBreak: strmOut << "intra "; break;
+ case klbLetterBreak: strmOut << "letter "; break;
+ case klbClipBreak: strmOut << "clip "; break;
+ default: LogInTable(strmOut, lb); break;
+ }
+ }
+}
+
+#endif // TRACING
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/XmlTransductionLog.cpp b/Build/source/libs/graphite/src/segment/XmlTransductionLog.cpp
new file mode 100644
index 00000000000..d0dfcaafbe8
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/XmlTransductionLog.cpp
@@ -0,0 +1,1583 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2008 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: TransductionLog.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Contains the functions for writing a log of the transduction process using an XML format.
+----------------------------------------------------------------------------------------------*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#include "Main.h"
+
+#ifdef _MSC_VER
+#pragma hdrstop
+#endif
+
+#include <math.h>
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:End Ignore
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Local Constants and static variables
+//:>********************************************************************************************
+
+namespace gr
+{
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+#define SP_PER_SLOT 7
+#define LEADING_SP 15
+#define MAX_SLOTS 128
+
+/*----------------------------------------------------------------------------------------------
+ Output a file showing a log of the transduction process and the resulting segment.
+----------------------------------------------------------------------------------------------*/
+bool GrTableManager::WriteXmlLog(std::ostream * pstrmLog,
+ GrCharStream * pchstrm, Segment * psegRet, int cbPrevSegDat, byte * pbPrevSegDat)
+{
+#ifdef TRACING
+ if (!pstrmLog)
+ return false;
+ std::ostream & strmOut = *pstrmLog;
+ WriteXmlLogAux(strmOut, pchstrm, psegRet, cbPrevSegDat, pbPrevSegDat);
+ return true;
+#else
+ return false;
+#endif // TRACING
+}
+
+
+bool GrTableManager::WriteXmlAssocLog(std::ostream * pstrmLog,
+ GrCharStream * pchstrm, Segment * psegRet)
+{
+#ifdef TRACING
+ if (!pstrmLog)
+ return false;
+
+ std::ostream & strmOut = *pstrmLog;
+ LogFinalPositions(strmOut);
+
+ LogXmlTagOpen(strmOut, "Mappings", 1, true);
+ LogXmlTagPostAttrs(strmOut, true);
+
+ //psegRet->LogXmlUnderlyingToSurface(strmOut, this, pchstrm, 2);
+ //psegRet->LogXmlSurfaceToUnderlying(strmOut, this, 2);
+
+ LogXmlTagClose(strmOut, "Mappings", 1, true);
+
+ strmOut << "\n";
+ LogXmlTagClose(strmOut, "GraphiteTraceLog", 0, true);
+
+ return true;
+#else
+ return false;
+#endif // TRACING
+}
+
+#ifdef TRACING
+
+/*----------------------------------------------------------------------------------------------
+ Output a file showing a log of the transduction process and the resulting segment.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::WriteXmlLogAux(std::ostream & strmOut,
+ GrCharStream * pchstrm, Segment * psegRet,
+ int cbPrevSegDat, byte * pbPrevSegDat)
+{
+ strmOut
+ << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ << "<!DOCTYPE GraphiteTraceLog SYSTEM \"GraphiteTraceLog.dtd\">\n"
+ << "\n";
+
+ LogXmlTagOpen(strmOut, "GraphiteTraceLog", 0, true);
+ LogXmlTagPostAttrs(strmOut, true);
+ strmOut << "\n";
+
+ LogXmlTagOpen(strmOut, "SegmentRun", 1, true);
+ LogXmlTagAttr(strmOut, "stringOffset", pchstrm->Min(), 0);
+ LogXmlTagPostAttrs(strmOut, true);
+
+ if (cbPrevSegDat == 0)
+ LogXmlUnderlying(strmOut, pchstrm, 0, 2);
+ else
+ {
+ Assert(*(pbPrevSegDat + 4) == 0); // skip offset for first pass
+ LogXmlUnderlying(strmOut, pchstrm, *(pbPrevSegDat + 3), 2);
+ }
+
+ //LogXmlPass1Input(strmOut);
+
+ for (int ipass = 0; ipass < m_cpass; ipass++)
+ {
+ if (cbPrevSegDat == 0)
+ LogXmlPass(strmOut, ipass, 0, 2);
+ else
+ LogXmlPass(strmOut, ipass, *(pbPrevSegDat + 4 + ipass), 2);
+ }
+
+ LogXmlTagClose(strmOut, "SegmentRun", 1, true);
+ strmOut << "\n";
+
+ // Don't do this until after we've logged the associations.
+ //LogXmlTagClose(strmOut, "GraphiteTraceLog", 0, true);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out a log of the underlying input.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogXmlUnderlying(std::ostream & strmOut, GrCharStream * pchstrm,
+ int cchwBackup, size_t nIndent)
+{
+ LogXmlTagOpen(strmOut, "Input", nIndent, true);
+ LogXmlTagPostAttrs(strmOut, true);
+
+ LogXmlUnderlyingAux(strmOut, pchstrm, cchwBackup, -1, nIndent,
+ true, // text
+ true, // features
+ true, // color
+ false, // string offset
+ false, // ligature components
+ false); // glyph associations
+
+ LogXmlTagClose(strmOut, "Input", nIndent, true);
+}
+
+void GrTableManager::LogXmlUnderlyingAux(std::ostream & strmOut, GrCharStream * pchstrm,
+ int cch32Backup, int cch32Lim, size_t nIndent,
+ bool fLogText, bool fLogFeatures, bool fLogColor, bool fLogStrOff, bool fLogLig, bool fLogGlyphs)
+{
+ int rgnChars[MAX_SLOTS];
+ bool rgfNewRun[MAX_SLOTS];
+ std::fill_n(rgfNewRun, MAX_SLOTS, false);
+ GrFeatureValues rgfval[MAX_SLOTS];
+ int cchwMaxRawChars;
+
+ int cch32 = pchstrm->GetLogData(this, rgnChars, rgfNewRun, rgfval,
+ cch32Backup, &cchwMaxRawChars);
+ cch32 = min(cch32, MAX_SLOTS);
+ if (cch32Lim > -1)
+ cch32 = min(cch32Lim, cch32);
+
+ int ichw;
+
+ // For UTF-8 and surrogate representation:
+ int rgchwChars1[MAX_SLOTS];
+ utf16 rgchwChars2[MAX_SLOTS];
+ utf16 rgchwChars3[MAX_SLOTS];
+ utf16 rgchwChars4[MAX_SLOTS];
+ utf16 rgchwChars5[MAX_SLOTS];
+ utf16 rgchwChars6[MAX_SLOTS];
+ utf16 rgiRawString[MAX_SLOTS]; // indices from underlying slots to text-source chars (0-based)
+
+ int rgichwRaw[MAX_SLOTS]; // index of input char with in the given UTF32, 1-based
+
+ if (cchwMaxRawChars > 1)
+ {
+ cchwMaxRawChars = min(cchwMaxRawChars, 6); // max of 6 raw (UTF-8 or UTF-16) chars per slot
+ pchstrm->GetLogDataRaw(this, cch32, cch32Backup, cchwMaxRawChars,
+ rgchwChars1, rgchwChars2, rgchwChars3, rgchwChars4, rgchwChars5, rgchwChars6,
+ rgichwRaw);
+ }
+ else
+ {
+ for (ichw = 0; ichw < cch32; ichw++)
+ {
+ rgichwRaw[ichw] = 1;
+ rgchwChars1[ichw] = rgnChars[ichw];
+ rgchwChars2[ichw] = 0;
+ rgchwChars3[ichw] = 0;
+ rgchwChars4[ichw] = 0;
+ rgchwChars5[ichw] = 0;
+ rgchwChars6[ichw] = 0;
+ }
+ }
+
+ int ichUtf32 = 0;
+ ichw = 0;
+ while (ichUtf32 < cch32)
+ {
+ if (rgichwRaw[ichw] == 1)
+ {
+ rgiRawString[ichUtf32++] = (utf16)ichw;
+ }
+ ichw++;
+ }
+
+ int ichwFeat = 0;
+ for (ichw = 0; ichw < cch32; ichw++)
+ {
+ if (rgfNewRun[ichw])
+ ichwFeat = ichw; // because rgfval only saves features for first of run
+
+ // See if there are any features.
+ bool fFeatures = false;
+ size_t ifeat;
+ for (ifeat = 0; fLogFeatures && ifeat < kMaxFeatures; ifeat++)
+ {
+ if (rgfval[ichwFeat].FeatureValue(ifeat) != 0)
+ {
+ fFeatures = true;
+ break;
+ }
+ }
+
+ bool fContent = fFeatures;
+
+ LogXmlTagOpen(strmOut, "Char", nIndent+1, fContent);
+
+ LogXmlTagAttr(strmOut, "index", rgiRawString[ichw] - cch32Backup, 0);
+ LogXmlTagAttrHex(strmOut, "usv", rgnChars[ichw], 0);
+
+ if (fLogText)
+ {
+ char rgch[20];
+ rgch[0] = (char)rgnChars[ichw];
+ rgch[1] = 0;
+ if (rgnChars[ichw] < 0x0100 && rgchwChars2[ichw] == 0) // ANSI
+ LogXmlTagAttr(strmOut, "text", rgch);
+ else if (rgnChars[ichw] == knLRM)
+ LogXmlTagAttr(strmOut, "text", "<LRM>");
+ else if (rgnChars[ichw] == knRLM)
+ LogXmlTagAttr(strmOut, "text", "<RLM>");
+ else if (rgnChars[ichw] == knLRO)
+ LogXmlTagAttr(strmOut, "text", "<LRO>");
+ else if (rgnChars[ichw] == knRLO)
+ LogXmlTagAttr(strmOut, "text", "<RLO>");
+ else if (rgnChars[ichw] == knLRE)
+ LogXmlTagAttr(strmOut, "text", "<LRE>");
+ else if (rgnChars[ichw] == knRLE)
+ LogXmlTagAttr(strmOut, "text", "<RLE>");
+ else if (rgnChars[ichw] == knPDF)
+ LogXmlTagAttr(strmOut, "text", "<PDF>");
+ }
+
+ if (fLogStrOff)
+ LogXmlTagAttr(strmOut, "stringOffset", pchstrm->Min() + rgiRawString[ichw] - cch32Backup, 0);
+
+ if (rgchwChars2[ichw] != 0)
+ {
+ std::string strHex = HexString(rgchwChars1[ichw], rgchwChars2[ichw], rgchwChars3[ichw],
+ rgchwChars4[ichw], rgchwChars5[ichw], rgchwChars6[ichw]);
+ if (pchstrm->TextSrc()->utfEncodingForm() == kutf8)
+ LogXmlTagAttr(strmOut, "textSourceUtf8", strHex.c_str());
+ else
+ LogXmlTagAttr(strmOut, "textSourceUtf16", strHex.c_str());
+ }
+
+ if (fLogColor)
+ {
+ IColorTextSource * tscolor = dynamic_cast<IColorTextSource *>(pchstrm->TextSrc());
+ if (tscolor)
+ {
+ int clrFore, clrBack;
+ tscolor->getColors(ichw, &clrFore, &clrBack);
+ LogXmlTagColor(strmOut, "color", clrFore, false);
+ LogXmlTagColor(strmOut, "background", clrBack, true);
+ }
+ }
+
+ if (fLogLig)
+ {
+
+ }
+
+//if (fLogLig || fLogGlyphs)
+//{
+// size_t cassocs = 0;
+// int fLigs = false;
+// int ichw;
+// for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+// {
+// if (m_prgpvisloutAssocs[ichw])
+// cassocs = max(cassocs, m_prgpvisloutAssocs[ichw]->size());
+// if (m_prgisloutLigature[ichw] != kNegInfinity)
+// fLigs = true;
+// }
+//}
+
+ LogXmlTagPostAttrs(strmOut, fContent);
+
+ if (fLogFeatures)
+ {
+ for (ifeat = 0; ifeat < kMaxFeatures; ifeat++)
+ {
+ if (rgfval[ichwFeat].FeatureValue(ifeat) != 0)
+ {
+ GrFeature * pfeat = Feature(ifeat);
+
+ LogXmlTagOpen(strmOut, "Feature", nIndent+2, false);
+ LogXmlTagAttr(strmOut, "id", pfeat->ID());
+ LogXmlTagAttr(strmOut, "value", rgfval[ichwFeat].FeatureValue(ifeat));
+ //LogXmlTagPostAttrs(strmOut, false);
+ LogXmlTagClose(strmOut, "Feature", nIndent+1, false);
+ }
+ }
+ }
+
+ if (fLogGlyphs)
+ {
+ }
+
+ LogXmlTagClose(strmOut, "Char", nIndent+1, fContent);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Output the the results of pass.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogXmlPass(std::ostream & strmOut, int ipass, int cslotSkipped, int nIndent)
+{
+ strmOut << "\n";
+
+ GrPass * ppass = Pass(ipass);
+ GrSlotStream * psstrmIn = (ipass == 0) ? NULL : InputStream(ipass);
+ GrSlotStream * psstrmOut = OutputStream(ipass);
+
+ int islot;
+ // Mark each slot with its index in the input and output streams.
+ for (islot = 0; ipass > 0 && islot < psstrmIn->ReadPos(); islot++)
+ psstrmIn->SlotAt(islot)->m_islotTmpIn = islot;
+
+ for (islot = 0; islot < psstrmOut->WritePos(); islot++)
+ psstrmOut->SlotAt(islot)->m_islotTmpOut = islot;
+
+ LogXmlTagOpen(strmOut, "Pass", nIndent, true);
+ LogXmlTagAttr(strmOut, "number", ipass);
+
+ std::string strType;
+ if (dynamic_cast<GrGlyphGenPass *>(ppass))
+ strType = "glyphGeneration";
+ else if (dynamic_cast<GrBidiPass *>(ppass))
+ strType = "bidi";
+ else if (dynamic_cast<GrSubPass *>(ppass))
+ {
+ if (ipass >= m_ipassJust1)
+ strType = "justification";
+ else
+ strType = "substitution";
+ }
+ else if (dynamic_cast<GrPosPass *>(ppass))
+ strType = "positioning";
+ else if (dynamic_cast<GrLineBreakPass *>(ppass))
+ strType = "linebreak";
+ LogXmlTagAttr(strmOut, "type", strType.c_str());
+
+ LogXmlTagPostAttrs(strmOut, true);
+
+ if (!dynamic_cast<GrBidiPass *>(ppass) && !dynamic_cast<GrGlyphGenPass *>(ppass))
+ {
+ LogXmlTagOpen(strmOut, "RulesMatched", nIndent+1, true);
+ LogXmlTagPostAttrs(strmOut, true);
+ ppass->LogXmlRules(strmOut, this, psstrmIn, nIndent+2);
+ LogXmlTagClose(strmOut, "RulesMatched", nIndent+1, true);
+ }
+
+ bool fJustWidths = false;
+ if (ipass == m_ipassJust1 - 1 && ShouldLogJustification()
+ && m_engst.m_jmodi == kjmodiJustify)
+ {
+ fJustWidths = true;
+ }
+
+ LogXmlTagOpen(strmOut, "Output", nIndent+1, true);
+ LogXmlTagPostAttrs(strmOut, true);
+ bool fPreJust = (!fJustWidths && ipass == m_ipassJust1 - 1 && ShouldLogJustification());
+ bool fPostJust = (fJustWidths || ipass == m_ipassJust1 && ShouldLogJustification());
+ ppass->LogXmlGlyphs(strmOut, this, psstrmOut, m_ipassJust1, fPreJust, fPostJust, cslotSkipped, nIndent+2);
+ LogXmlTagClose(strmOut, "Output", nIndent+1, true);
+
+ LogXmlTagClose(strmOut, "Pass", nIndent, true);
+
+#ifdef XMLOMIT
+
+ // If this was the pass just before the justification routines get run, output a
+ // special line that just shows the results, ie, the values of justify.width.
+ // TODO: adjust this when measure mode get functioning.
+ if (ipass == m_ipassJust1 - 1 && ShouldLogJustification()
+ && m_engst.m_jmodi == kjmodiJustify)
+ {
+ strmOut << "\nJUSTIFICATION\n\n";
+ LogSlotHeader(strmOut, psstrmOut->WritePos(), SP_PER_SLOT, LEADING_SP);
+ LogSlotGlyphs(strmOut, psstrmOut);
+ LogAttributes(strmOut, ipass, true);
+ }
+
+#endif // XMLOMIT
+
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write the list of rules fired and failed for a given pass.
+----------------------------------------------------------------------------------------------*/
+void GrPass::LogXmlRules(std::ostream & strmOut, GrTableManager * ptman,
+ GrSlotStream * psstrmIn, int nIndent)
+{
+ m_pzpst->LogXmlRules(strmOut, ptman, psstrmIn, nIndent);
+}
+
+void PassState::LogXmlRules(std::ostream & strmOut, GrTableManager * ptman,
+ GrSlotStream * psstrmIn, int nIndent)
+{
+ if (m_crulrec == 0)
+ {
+ ptman->LogXmlComment(strmOut, "none", nIndent);
+ return;
+ }
+
+ for (int irulrec = 0; irulrec < m_crulrec; irulrec++)
+ {
+ bool fSourceAvailable = false;
+
+ ptman->LogXmlTagOpen(strmOut, "Rule", nIndent, fSourceAvailable);
+
+ ptman->LogXmlTagAttr(strmOut, "slot", m_rgrulrec[irulrec].m_islot);
+
+ if (m_rgrulrec[irulrec].m_irul == PassState::kHitMaxRuleLoop)
+ ptman->LogXmlTagAttr(strmOut, "hitMaxRuleLoop", "true");
+ else if (m_rgrulrec[irulrec].m_irul == PassState::kHitMaxBackup)
+ ptman->LogXmlTagAttr(strmOut, "hitMaxBackup", "true");
+ else
+ {
+ ptman->LogXmlTagAttr(strmOut, "debugNumber", m_rgrulrec[irulrec].m_irul);
+ ptman->LogXmlTagAttr(strmOut, "fired", (m_rgrulrec[irulrec].m_fFired) ? "true" : "false");
+ }
+
+ ptman->LogXmlTagPostAttrs(strmOut, fSourceAvailable);
+
+ // TODO: output Source
+
+ ptman->LogXmlTagClose(strmOut, "Rule", nIndent, fSourceAvailable);
+ }
+}
+
+void GrPass::LogXmlGlyphs(std::ostream & strmOut, GrTableManager * ptman, GrSlotStream * psstrmOut,
+ int ipassJust1, bool fPreJust, bool fPostJust, int cslotSkipped, int nIndent)
+{
+ GrBidiPass * ppassBidi = dynamic_cast<GrBidiPass *>(this);
+ GrBidiPass * ppassBidiNext = (m_ipass + 1 >= ptman->NumberOfPasses()) ?
+ NULL :
+ dynamic_cast<GrBidiPass *>(ptman->Pass(m_ipass + 1));
+ m_pzpst->LogXmlGlyphs(strmOut, ptman, psstrmOut, ipassJust1, fPreJust, fPostJust,
+ (ppassBidi != NULL), (ppassBidiNext != NULL), cslotSkipped, nIndent);
+}
+
+void PassState::LogXmlGlyphs(std::ostream & strmOut, GrTableManager * ptman, GrSlotStream * psstrmOut,
+ int ipassJust1, bool fPreJust, bool fPostJust, bool fBidi, bool fBidiNext, int cslotSkipped,
+ int nIndent)
+{
+ ptman->LogXmlTagOpen(strmOut, "Output", nIndent, true);
+ ptman->LogXmlTagPostAttrs(strmOut, true);
+
+ for (int islot = 0; islot < psstrmOut->WritePos() + 1; islot++) // +1 allows us to handle final deletion
+ {
+ if (islot > MAX_SLOTS)
+ break;
+
+ for (int islotDel = 0; islotDel < m_rgcslotDeletions[islot]; islotDel++)
+ {
+ ptman->LogXmlTagOpen(strmOut, "Glyph", nIndent+1, false);
+ ptman->LogXmlTagAttr(strmOut, "slot", "deleted");
+ ptman->LogXmlTagPostAttrs(strmOut, false);
+ ptman->LogXmlTagClose(strmOut, "Glyph", nIndent+1, false);
+ }
+ if (islot >= psstrmOut->WritePos())
+ break;
+
+ GrSlotState * pslot = psstrmOut->SlotAt(islot);
+
+ bool fMod = (pslot->PassModified() >= m_ipass && m_ipass > 0);
+ if (fBidi || fBidiNext)
+ fMod = true;
+
+ ptman->LogXmlTagOpen(strmOut, "Glyph", nIndent+1, fMod);
+
+ ptman->LogXmlTagAttr(strmOut, "slot", islot);
+ if (pslot->GlyphID() == ptman->LBGlyphID())
+ ptman->LogXmlTagAttr(strmOut, "gid", "linebreak");
+ else
+ ptman->LogXmlTagAttr(strmOut, "gid", pslot->GlyphID());
+ if (pslot->GlyphID() != pslot->ActualGlyphForOutput(ptman))
+ ptman->LogXmlTagAttr(strmOut, "actual", pslot->ActualGlyphForOutput(ptman));
+ if (m_rgfInsertion[islot])
+ ptman->LogXmlTagAttr(strmOut, "inserted", "true");
+ if (islot < cslotSkipped)
+ ptman->LogXmlTagAttr(strmOut, "nextPassSkips", "true");
+
+ ptman->LogXmlTagPostAttrs(strmOut, fMod);
+
+ if (fMod)
+ {
+ pslot->LogXmlAttributes(strmOut, ptman, psstrmOut, m_ipass, islot,
+ fPreJust, fPostJust, fBidi, fBidiNext, nIndent+2);
+ }
+
+ ptman->LogXmlTagClose(strmOut, "Glyph", nIndent+1, fMod);
+ }
+
+ ptman->LogXmlTagClose(strmOut, "Output", nIndent, true);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write out the attributes that have changes.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::LogXmlAttributes(std::ostream & strmOut, GrTableManager * ptman,
+ GrSlotStream * psstrmOut, int ipass,
+ int islot, bool fPreJust, bool fPostJust, bool fBidi, bool fBidiNext, int nIndent)
+{
+ // To handle reprocessing, in which case there may be a chain of slots modified
+ // in the same pass:
+ GrSlotState * pslotPrev = PrevState();
+ while (pslotPrev && pslotPrev->PassModified() == PassModified())
+ pslotPrev = pslotPrev->m_pslotPrevState;
+
+ bool * prgfMods = new bool[kslatMax + ptman->NumUserDefn() - 1];
+ memset(prgfMods, 0, (kslatMax + ptman->NumUserDefn() - 1) * sizeof(bool));
+ int ccomp;
+ int cassoc;
+ SlotAttrsModified(prgfMods, fPreJust, &ccomp, &cassoc); // just for this one slot
+
+ if (fPreJust)
+ prgfMods[kslatJWidth] = false;
+ else if (fPostJust)
+ prgfMods[kslatJWidth] = true;
+
+ //if (fJustWidths)
+ //{}
+
+ bool fLogAssocs = false;
+
+ for (int slat = 0; slat < kslatMax + ptman->NumUserDefn() - 1; slat++)
+ {
+ if (!prgfMods[slat] && (slat != kslatDir || (!fBidi && !fBidiNext)))
+ continue;
+
+ if (slat == kslatPosX)
+ continue;
+ if (slat == kslatPosY)
+ continue;
+
+ std::string strAttrName;
+ switch (slat)
+ {
+ case kslatAdvX: strAttrName = "advance.x"; break;
+ case kslatAdvY: strAttrName = "advance.y"; break;
+ case kslatAttTo: strAttrName = "att.to"; break;
+ case kslatAttAtX: strAttrName = "att.at.x"; break;
+ case kslatAttAtY: strAttrName = "att.at.y"; break;
+ case kslatAttAtGpt: strAttrName = "att.at.gpt"; break;
+ case kslatAttAtXoff: strAttrName = "att.at.xoff"; break;
+ case kslatAttAtYoff: strAttrName = "att.at.yoff"; break;
+ case kslatAttWithX: strAttrName = "att.with.x"; break;
+ case kslatAttWithY: strAttrName = "att.with.y"; break;
+ case kslatAttWithGpt: strAttrName = "att.with.gpt"; break;
+ case kslatAttWithXoff: strAttrName = "att.with.xoff"; break;
+ case kslatAttWithYoff: strAttrName = "att.with.yoff"; break;
+ case kslatAttLevel: strAttrName = "att.level"; break;
+ case kslatBreak: strAttrName = "breakweight"; break;
+ case kslatCompRef: strAttrName = "component"; break; // << iIndex + 1 - 1-based
+ case kslatDir: strAttrName = "dir"; break;
+ case kslatInsert: strAttrName = "insert"; break;
+ case kslatMeasureSol: strAttrName = "measure.sol"; break;
+ case kslatMeasureEol: strAttrName = "measure.eol"; break;
+ case kslatJStretch: strAttrName = "just.stretch"; break;
+ case kslatJShrink: strAttrName = "just.shrink"; break;
+ case kslatJStep: strAttrName = "just.step"; break;
+ case kslatJWeight: strAttrName = "just.weight"; break;
+ case kslatJWidth: strAttrName = "just.width"; break;
+ case kslatPosX:
+ case kslatPosY:
+ Assert(false);
+ break;
+ case kslatShiftX: strAttrName = "shift.x"; break;
+ case kslatShiftY: strAttrName = "shift.y"; break;
+ default:
+ if (kslatUserDefn <= slat &&
+ slat < kslatUserDefn + ptman->NumUserDefn())
+ {
+ strAttrName.assign("user");
+ char rgch[20];
+ itoa(slat - kslatUserDefn + 1, rgch, 10); // 1-based
+ strAttrName.append(rgch);
+ }
+ else
+ {
+ // Invalid attribute:
+ Warn("bad slot attribute");
+ break;
+ }
+ }
+
+ fLogAssocs = (fLogAssocs || prgfMods[slat]);
+
+ if (slat == kslatCompRef)
+ {
+ for (int icomp = 0; icomp < ccomp; icomp++)
+ {
+ ptman->LogXmlTagOpen(strmOut, "Attribute", nIndent, false);
+ ptman->LogXmlTagAttr(strmOut, "name", strAttrName.c_str());
+ ptman->LogXmlTagAttr(strmOut, "index", icomp+1);
+ int nValue = GetSlotAttrValue(strmOut, ptman, ipass, slat, icomp, fPreJust, fPostJust);
+ ptman->LogXmlTagAttr(strmOut, "newValue", nValue);
+ ptman->LogXmlTagPostAttrs(strmOut, false);
+ ptman->LogXmlTagClose(strmOut, "Attribute", nIndent, false);
+ }
+ }
+ else
+ {
+ std::string strValue = "newValue";
+ if ((!prgfMods[slat] && fBidiNext) || fBidi)
+ strValue = "value";
+
+ ptman->LogXmlTagOpen(strmOut, "Attribute", nIndent, false);
+ ptman->LogXmlTagAttr(strmOut, "name", strAttrName.c_str());
+ int nValue = GetSlotAttrValue(strmOut, ptman, ipass, slat, 0, fPreJust, fPostJust);
+ switch (slat)
+ {
+ case kslatDir: ptman->LogXmlDirCode(strmOut, strValue.c_str(), nValue);break;
+ case kslatBreak: ptman->LogXmlBreakWeight(strmOut, "newValue", nValue); break;
+ default: ptman->LogXmlTagAttr(strmOut, "newValue", nValue); break;
+ }
+ ptman->LogXmlTagPostAttrs(strmOut, false);
+ ptman->LogXmlTagClose(strmOut, "Attribute", nIndent, false);
+ }
+ }
+
+ if (fBidi)
+ {
+ // Output final directionality level
+ ptman->LogXmlTagOpen(strmOut, "Attribute", nIndent, false);
+ ptman->LogXmlTagAttr(strmOut, "name", "directionLevel");
+ ptman->LogXmlTagAttr(strmOut, "value", DirLevel());
+ ptman->LogXmlTagPostAttrs(strmOut, false);
+ ptman->LogXmlTagClose(strmOut, "Attribute", nIndent, false);
+ }
+
+ if (m_vpslotAssoc.size() > 1)
+ fLogAssocs = true; // multiple associations
+ else if (m_vpslotAssoc.size() == 1)
+ {
+ // association change from previous stream
+ GrSlotState * pslotAssoc = AssocSlot(0);
+ if (pslotAssoc == NULL || pslotAssoc->m_islotTmpIn != islot)
+ fLogAssocs = true;
+ }
+ if (fLogAssocs)
+ {
+ std::string strAssocs;
+ char rgch[20];
+ for (size_t iassoc = 0; iassoc < m_vpslotAssoc.size(); iassoc++)
+ {
+ GrSlotState * pslotAssoc = AssocSlot(iassoc);
+ if (pslotAssoc)
+ {
+ int n = pslotAssoc->m_islotTmpIn;
+ memset(rgch,0,20);
+ itoa(n,rgch,10);
+ if (iassoc > 0)
+ strAssocs.append(" ");
+ strAssocs.append(rgch);
+ }
+ }
+ if (strAssocs.length() == 0)
+ strAssocs.assign("??");
+ ptman->LogXmlTagOpen(strmOut, "Associations", nIndent, false);
+ ptman->LogXmlTagAttr(strmOut, "slots", strAssocs.c_str());
+ //ptman->LogXmlTagPostAttrs(strmOut, false);
+ ptman->LogXmlTagClose(strmOut, "Associations", nIndent, false);
+ }
+
+ delete prgfMods;
+}
+
+#if XMLOMIT
+/*----------------------------------------------------------------------------------------------
+ Write out the final positions.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogFinalPositions(std::ostream & strmOut)
+{
+ GrSlotStream * psstrm = OutputStream(m_cpass - 1);
+
+ strmOut << "x position ";
+ for (int islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ if (pslot->IsLineBreak(LBGlyphID()))
+ {
+ strmOut << " ";
+ continue;
+ }
+ LogInTable(strmOut, pslot->XPosition());
+ }
+ strmOut << "\n";
+
+ strmOut << "y position ";
+ for (int islot = 0; islot < psstrm->WritePos(); islot++)
+ {
+ GrSlotState * pslot = psstrm->SlotAt(islot);
+ if (pslot->IsLineBreak(LBGlyphID()))
+ {
+ strmOut << " ";
+ continue;
+ }
+ LogInTable(strmOut, pslot->YPosition());
+ }
+ strmOut << "\n";
+}
+
+#endif // XMLOMIT
+
+/*----------------------------------------------------------------------------------------------
+ Log the value of the slot attribute for the given slot. Assume it has changed.
+----------------------------------------------------------------------------------------------*/
+int GrSlotState::GetSlotAttrValue(std::ostream & strmOut, GrTableManager * ptman,
+ int ipass, int slat, int iIndex, bool fPreJust, bool fPostJust)
+{
+ switch (slat)
+ {
+ case kslatAdvX:
+ return int(m_mAdvanceX);
+ case kslatAdvY:
+ return int(m_mAdvanceY);
+
+ case kslatAttTo:
+ return m_srAttachTo;
+
+ case kslatAttAtX: // always do these in pairs
+ return m_mAttachAtX;
+ case kslatAttAtY:
+ return m_mAttachAtY;
+ case kslatAttAtGpt:
+ return m_nAttachAtGpoint;
+
+ case kslatAttAtXoff: // always do these in pairs
+ return m_mAttachAtXOffset;
+ case kslatAttAtYoff:
+ return m_mAttachAtYOffset;
+
+ case kslatAttWithX: // always do these in pairs
+ return m_mAttachWithX;
+ case kslatAttWithY:
+ return m_mAttachWithY;
+
+ case kslatAttWithGpt:
+ return m_nAttachWithGpoint;
+
+ case kslatAttWithXoff: // always do these in pairs
+ return m_mAttachWithXOffset;
+ case kslatAttWithYoff:
+ return m_mAttachWithYOffset;
+
+ case kslatAttLevel:
+ return m_nAttachLevel;
+
+ case kslatBreak:
+ return m_lb;
+
+ case kslatDir:
+ return m_dirc;
+
+ case kslatInsert:
+ return m_fInsertBefore;
+
+ case kslatShiftX:
+ return m_mShiftX;
+ case kslatShiftY:
+ return m_mShiftY;
+ case kslatMeasureSol:
+ return m_mMeasureSol;
+ case kslatMeasureEol:
+ return m_mMeasureEol;
+ case kslatJStretch:
+ return m_mJStretch0;
+ case kslatJShrink:
+ return m_mJShrink0;
+ case kslatJStep:
+ return m_mJStep0;
+ case kslatJWeight:
+ return m_nJWeight0;
+ case kslatJWidth:
+ return m_mJWidth0;
+
+ case kslatCompRef:
+ {
+ GrSlotState * pslotComp = reinterpret_cast<GrSlotState *>(CompRef(iIndex));
+ return pslotComp->m_islotTmpIn;
+ }
+
+ default:
+ if (kslatUserDefn <= slat && slat <= kslatUserDefn + m_cnUserDefn)
+ {
+ int iTmp = slat - kslatUserDefn;
+ return UserDefn(iTmp);
+ }
+ else
+ gAssert(false);
+ }
+
+ return 0;
+}
+
+#endif // TRACING
+
+
+/*----------------------------------------------------------------------------------------------
+ Write out the final underlying-to-surface associations.
+----------------------------------------------------------------------------------------------*/
+void Segment::LogXmlUnderlyingToSurface(std::ostream & strmOut, GrTableManager * ptman,
+ GrCharStream * pchstrm, int nIndent)
+{
+#ifdef TRACING
+
+ ptman->LogXmlTagOpen(strmOut, "UnderlyingToSurface", nIndent, true);
+ ptman->LogXmlTagPostAttrs(strmOut, true);
+
+ ptman->LogXmlUnderlyingAux(strmOut, pchstrm, -m_ichwAssocsMin, (m_ichwAssocsLim - m_ichwAssocsMin),
+ nIndent+1,
+ true, // text
+ false, // features
+ false, // color
+ true, // string offset
+ true, // ligature components
+ true // glyph associations
+ );
+
+ ptman->LogXmlTagClose(strmOut, "UnderlyingToSurface", nIndent, true);
+
+
+#ifdef XMLOMIT
+ ptman->LogXmlTagOpen(strmOut, "UnderlyingToSurface", nIndent, true);
+
+ size_t cassocs = 0;
+ int fLigs = false;
+ int ichw;
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ if (m_prgpvisloutAssocs[ichw])
+ cassocs = max(cassocs, m_prgpvisloutAssocs[ichw]->size());
+ if (m_prgisloutLigature[ichw] != kNegInfinity)
+ fLigs = true;
+ }
+
+ ptman->LogUnderlyingHeader(strmOut, pchstrm->Min(), (pchstrm->Min() + m_ichwAssocsLim),
+ -m_ichwAssocsMin, NULL);
+
+ int rgnChars[MAX_SLOTS];
+ bool rgfNewRun[MAX_SLOTS];
+ std::fill_n(rgfNewRun, MAX_SLOTS, false);
+ GrFeatureValues rgfval[MAX_SLOTS];
+ int cchwMaxRawChars;
+
+ int cchw = pchstrm->GetLogData(ptman, rgnChars, rgfNewRun, rgfval,
+ -m_ichwAssocsMin, &cchwMaxRawChars);
+ cchw = min(cchw, MAX_SLOTS);
+
+ utf16 rgchwChars2[MAX_SLOTS];
+ utf16 rgchwChars3[MAX_SLOTS];
+ utf16 rgchwChars4[MAX_SLOTS];
+ utf16 rgchwChars5[MAX_SLOTS];
+ utf16 rgchwChars6[MAX_SLOTS];
+ int rgcchwRaw[MAX_SLOTS];
+ if (cchwMaxRawChars > 1)
+ {
+ cchwMaxRawChars = min(cchwMaxRawChars, 6);
+ pchstrm->GetLogDataRaw(ptman, cchw, -m_ichwAssocsMin, cchwMaxRawChars,
+ rgnChars, rgchwChars2, rgchwChars3, rgchwChars4, rgchwChars5, rgchwChars6,
+ rgcchwRaw);
+ }
+ else
+ {
+ for (ichw = 0 ; ichw <(m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ rgcchwRaw[ichw] = 1;
+ rgchwChars2[ichw] = 0;
+ rgchwChars3[ichw] = 0;
+ rgchwChars4[ichw] = 0;
+ rgchwChars5[ichw] = 0;
+ rgchwChars6[ichw] = 0;
+ }
+ }
+
+ // Text
+ strmOut << "Text: "; // 15 spaces
+ int inUtf32 = 0;
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ utf16 chw, chwNext;
+ switch (rgcchwRaw[ichw])
+ {
+ default:
+ case 1: chw = utf16(rgnChars[inUtf32]); chwNext = rgchwChars2[inUtf32]; break;
+ case 2: chw = rgchwChars2[inUtf32]; chwNext = rgchwChars3[inUtf32]; break;
+ case 3: chw = rgchwChars3[inUtf32]; chwNext = rgchwChars4[inUtf32]; break;
+ case 4: chw = rgchwChars4[inUtf32]; chwNext = rgchwChars5[inUtf32]; break;
+ case 5: chw = rgchwChars5[inUtf32]; chwNext = rgchwChars6[inUtf32]; break;
+ case 6: chw = rgchwChars6[inUtf32]; chwNext = 0; break;
+ }
+ if (rgcchwRaw[ichw] == 1 && chwNext == 0 && chw < 0x0100) // ANSI
+ strmOut << (char)chw << " "; // 6 spaces
+ else
+ strmOut << " "; // 7 spaces
+ if (chwNext == 0)
+ inUtf32++;
+ }
+ strmOut << "\n";
+
+ // Unicode
+ strmOut << "Unicode: ";
+ inUtf32 = 0;
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ utf16 chw, chwNext;
+ switch (rgcchwRaw[ichw])
+ {
+ default:
+ case 1: chw = utf16(rgnChars[inUtf32]); chwNext = rgchwChars2[inUtf32]; break;
+ case 2: chw = rgchwChars2[inUtf32]; chwNext = rgchwChars3[inUtf32]; break;
+ case 3: chw = rgchwChars3[inUtf32]; chwNext = rgchwChars4[inUtf32]; break;
+ case 4: chw = rgchwChars4[inUtf32]; chwNext = rgchwChars5[inUtf32]; break;
+ case 5: chw = rgchwChars5[inUtf32]; chwNext = rgchwChars6[inUtf32]; break;
+ case 6: chw = rgchwChars6[inUtf32]; chwNext = 0; break;
+ }
+ ptman->LogHexInTable(strmOut, chw, chwNext != 0);
+ if (chwNext == 0)
+ inUtf32++;
+ }
+ strmOut << "\n";
+
+ strmOut << "before ";
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ if (rgcchwRaw[ichw] > 1)
+ // continuation of Unicode codepoint
+ strmOut << " ";
+ else if (m_prgisloutBefore[ichw] == kNegInfinity)
+ strmOut << "<-- ";
+ else if (m_prgisloutBefore[ichw] == kPosInfinity)
+ strmOut << "--> ";
+ else
+ ptman->LogInTable(strmOut, m_prgisloutBefore[ichw]);
+ }
+ strmOut <<"\n";
+
+ for (int ix = 1; ix < signed(cassocs) - 1; ix++) //(cassocs > 2)
+ {
+ if (ix == 1)
+ strmOut << "other ";
+ else
+ strmOut << " ";
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ std::vector<int> * pvislout = m_prgpvisloutAssocs[ichw];
+ if (pvislout == NULL)
+ strmOut << " ";
+ else if (signed(pvislout->size()) <= ix)
+ strmOut << " ";
+ else if ((*pvislout)[ix] != m_prgisloutAfter[ichw])
+ ptman->LogInTable(strmOut, (*pvislout)[ix]);
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+ }
+
+ strmOut << "after ";
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ if (rgcchwRaw[ichw] > 1)
+ // continuation of Unicode codepoint
+ strmOut << " ";
+ else if (m_prgisloutAfter[ichw] == kNegInfinity)
+ strmOut << "<-- ";
+ else if (m_prgisloutAfter[ichw] == kPosInfinity)
+ strmOut << "--> ";
+ else
+ ptman->LogInTable(strmOut, m_prgisloutAfter[ichw]);
+ }
+ strmOut <<"\n";
+
+ if (fLigs)
+ {
+ strmOut << "ligature ";
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ if (rgcchwRaw[ichw] > 1)
+ // continuation of Unicode codepoint
+ strmOut << " ";
+ else if (m_prgisloutLigature[ichw] != kNegInfinity)
+ ptman->LogInTable(strmOut, m_prgisloutLigature[ichw]);
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+
+ strmOut << "component ";
+ for (ichw = 0; ichw < (m_ichwAssocsLim - m_ichwAssocsMin); ichw++)
+ {
+ if (rgcchwRaw[ichw] > 1)
+ // continuation of Unicode codepoint
+ strmOut << " ";
+ else if (m_prgisloutLigature[ichw] != kNegInfinity)
+ ptman->LogInTable(strmOut, m_prgiComponent[ichw] + 1); // 1-based
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+ }
+
+ strmOut << "\n";
+#endif // XMLOMIT
+#endif // TRACING
+
+}
+
+#ifdef XMLOMIT
+
+/*----------------------------------------------------------------------------------------------
+ Write out the final surface-to-underlying associations.
+----------------------------------------------------------------------------------------------*/
+void Segment::LogSurfaceToUnderlying(GrTableManager * ptman, std::ostream & strmOut)
+{
+#ifdef TRACING
+ strmOut << "\nSURFACE TO UNDERLYING MAPPINGS\n\n";
+
+ ptman->LogSlotHeader(strmOut, m_cslout, SP_PER_SLOT, LEADING_SP);
+
+ int ccomp = 0;
+
+ strmOut << "Glyph IDs: ";
+ int islout;
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->SpecialSlotFlag() == kspslLbInitial ||
+ psloutTmp->SpecialSlotFlag() == kspslLbFinal)
+ {
+ strmOut << "# ";
+ }
+ else
+ {
+ ptman->LogHexInTable(strmOut, psloutTmp->GlyphID());
+ ccomp = max(ccomp, psloutTmp->NumberOfComponents());
+ }
+ }
+ strmOut << "\n";
+
+ bool fAnyPseudos = false;
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->GlyphID() != psloutTmp->ActualGlyphForOutput(ptman))
+ {
+ fAnyPseudos = true;
+ break;
+ }
+ }
+ if (fAnyPseudos)
+ {
+ strmOut << "Actual glyphs: ";
+ for (int islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->GlyphID() != psloutTmp->ActualGlyphForOutput(ptman))
+ ptman->LogHexInTable(strmOut, psloutTmp->ActualGlyphForOutput(ptman));
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+ }
+
+ strmOut << "before ";
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->SpecialSlotFlag() == kspslLbInitial ||
+ psloutTmp->SpecialSlotFlag() == kspslLbFinal)
+ {
+ strmOut << " ";
+ }
+ else
+ ptman->LogInTable(strmOut, psloutTmp->BeforeAssoc());
+ }
+ strmOut << "\n";
+
+ strmOut << "after ";
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->SpecialSlotFlag() == kspslLbInitial ||
+ psloutTmp->SpecialSlotFlag() == kspslLbFinal)
+ {
+ strmOut << " ";
+ }
+ else
+ ptman->LogInTable(strmOut, psloutTmp->AfterAssoc());
+ }
+ strmOut << "\n";
+
+ for (int icomp = 0; icomp < ccomp; icomp++)
+ {
+ strmOut << "component " << icomp + 1 // 1=based
+ << " ";
+ for (islout = 0; islout < m_cslout; islout++)
+ {
+ GrSlotOutput * psloutTmp = m_prgslout + islout;
+ if (psloutTmp->SpecialSlotFlag() == kspslLbInitial ||
+ psloutTmp->SpecialSlotFlag() == kspslLbFinal)
+ {
+ strmOut << " ";
+ }
+ else if (icomp < psloutTmp->NumberOfComponents())
+ ptman->LogInTable(strmOut, psloutTmp->UnderlyingComponent(icomp));
+ else
+ strmOut << " ";
+ }
+ strmOut << "\n";
+ }
+#endif // TRACING
+}
+
+#ifdef TRACING
+/*----------------------------------------------------------------------------------------------
+ Log the value of the association, if the slot changed.
+----------------------------------------------------------------------------------------------*/
+void GrSlotState::LogAssociation(GrTableManager * ptman,
+ std::ostream & strmOut, int ipass, int iassoc, bool fBoth, bool fAfter)
+{
+ if (m_ipassModified != ipass)
+ {
+ strmOut << " ";
+ return;
+ }
+
+ if (fBoth)
+ {
+ GrSlotState * pslotBefore = (m_vpslotAssoc.size()) ? m_vpslotAssoc[0] : NULL;
+ GrSlotState * pslotAfter = (m_vpslotAssoc.size()) ? m_vpslotAssoc.back() : NULL;
+ // handle possible reprocessing
+ while (pslotBefore && pslotBefore->PassModified() == m_ipassModified)
+ pslotBefore = pslotBefore->m_pslotPrevState;
+ while (pslotAfter && pslotAfter->PassModified() == m_ipassModified)
+ pslotAfter = pslotAfter->m_pslotPrevState;
+
+ int nBefore, nAfter;
+
+
+ int csp = 4;
+ if (pslotBefore)
+ {
+ nBefore = pslotBefore->m_islotTmpIn;
+ strmOut << nBefore;
+ if (nBefore > 99) csp--;
+ if (nBefore > 9) csp--;
+ }
+ else
+ {
+ strmOut << "??";
+ csp--;
+ }
+ if (pslotAfter)
+ {
+ nAfter = pslotAfter->m_islotTmpIn;
+ strmOut << "/" << nAfter;
+ if (nAfter > 99) csp--;
+ if (nAfter > 9) csp--;
+ }
+ else
+ {
+ if (pslotBefore)
+ {
+ strmOut << "/" << "??";
+ csp--;
+ }
+ else
+ csp = 5;
+ }
+
+ for (int isp = 0; isp < csp; isp++)
+ strmOut << " ";
+ }
+
+ else if (fAfter)
+ {
+ Assert(m_vpslotAssoc.size());
+ GrSlotState * pslotAfter = m_vpslotAssoc.back();
+ // handle possible reprocessing
+ while (pslotAfter && pslotAfter->PassModified() == m_ipassModified)
+ pslotAfter = pslotAfter->m_pslotPrevState;
+
+ if (pslotAfter)
+ {
+ int nAfter = pslotAfter->m_islotTmpIn;
+ ptman->LogInTable(strmOut, nAfter);
+ }
+ else
+ strmOut << "?? ";
+ }
+ else if (iassoc < signed(m_vpslotAssoc.size()))
+ {
+ GrSlotState * pslot = m_vpslotAssoc[iassoc];
+ // handle possible reprocessing
+ while (pslot && pslot->PassModified() == m_ipassModified)
+ pslot = pslot->m_pslotPrevState;
+
+ if (pslot)
+ {
+ int n = pslot->m_islotTmpIn;
+ ptman->LogInTable(strmOut, n);
+ }
+ else
+ strmOut << "?? ";
+ }
+ else
+ strmOut << " ";
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Write a directionality code to the table.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogDirCodeInTable(std::ostream & strmOut, int dirc)
+{
+ switch (dirc)
+ {
+ case kdircUnknown: strmOut << "??? "; break;
+ case kdircNeutral: strmOut << "ON "; break;
+ case kdircL: strmOut << "L "; break;
+ case kdircR: strmOut << "R "; break;
+ case kdircRArab: strmOut << "AR "; break;
+ case kdircEuroNum: strmOut << "EN "; break;
+ case kdircEuroSep: strmOut << "ES "; break;
+ case kdircEuroTerm: strmOut << "ET "; break;
+ case kdircArabNum: strmOut << "AN "; break;
+ case kdircComSep: strmOut << "CS "; break;
+ case kdircWhiteSpace: strmOut << "WS "; break;
+ case kdircBndNeutral: strmOut << "BN "; break;
+ case kdircNSM: strmOut << "NSM "; break;
+ case kdircLRO: strmOut << "LRO "; break;
+ case kdircRLO: strmOut << "RLO "; break;
+ case kdircLRE: strmOut << "LRE "; break;
+ case kdircRLE: strmOut << "RLE "; break;
+ case kdircPDF: strmOut << "PDF "; break;
+ case kdircPdfL: strmOut << "PDF-L "; break;
+ case kdircPdfR: strmOut << "PDF-R "; break;
+ case kdircLlb: strmOut << "L "; break;
+ case kdircRlb: strmOut << "R "; break;
+ default: LogInTable(strmOut, dirc); break;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write a breakweight code to the table.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogBreakWeightInTable(std::ostream & strmOut, int lb)
+{
+ if (lb < 0)
+ {
+ lb = lb * -1;
+ switch (lb)
+ {
+ case klbWsBreak: strmOut << "-ws "; break;
+ case klbWordBreak: strmOut << "-word "; break;
+ case klbHyphenBreak: strmOut << "-intra "; break;
+ case klbLetterBreak: strmOut << "-lettr "; break;
+ case klbClipBreak: strmOut << "-clip "; break;
+ default: LogInTable(strmOut, lb); break;
+ }
+ }
+ else
+ {
+ switch (lb)
+ {
+ case klbNoBreak: strmOut << "none "; break;
+ case klbWsBreak: strmOut << "ws "; break;
+ case klbWordBreak: strmOut << "word "; break;
+ case klbHyphenBreak: strmOut << "intra "; break;
+ case klbLetterBreak: strmOut << "letter "; break;
+ case klbClipBreak: strmOut << "clip "; break;
+ default: LogInTable(strmOut, lb); break;
+ }
+ }
+}
+
+#endif // TRACING
+
+#endif // XMLOMIT
+
+#ifdef TRACING
+/*----------------------------------------------------------------------------------------------
+ Write an XML tag, leaving it open to possibly add attributes.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogXmlTagOpen(std::ostream & strmOut, std::string strTag, size_t nIndent,
+ bool fContent)
+{
+ for (size_t i = 0; i < nIndent; i++)
+ strmOut << " ";
+
+ strmOut << "<" << strTag;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write the termination of the opening XML tag.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogXmlTagPostAttrs(std::ostream & strmOut,
+ bool fContent)
+{
+ if (fContent)
+ strmOut << ">\n";
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write the closing form of the XML tag.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogXmlTagClose(std::ostream & strmOut, std::string strTag, size_t nIndent,
+ bool fContent)
+{
+ if (fContent)
+ {
+ for (size_t i = 0; i < nIndent; i++)
+ strmOut << " ";
+ strmOut << "</" << strTag << ">\n";
+ }
+ else
+ {
+ strmOut << " />\n";
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write an attribute/value pair inside of a tag.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogXmlTagAttr(std::ostream & strmOut, std::string strAttr, int nValue,
+ size_t nIndent)
+{
+ char chBuf[20];
+ itoa(nValue, chBuf, 10);
+ LogXmlTagAttr(strmOut, strAttr, chBuf, nIndent);
+}
+
+void GrTableManager::LogXmlTagAttr(std::ostream & strmOut, std::string strAttr, const char * szValue,
+ size_t nIndent)
+{
+ if (nIndent > 0)
+ {
+ strmOut << "\n";
+ for (size_t i = 0; i < nIndent + 2; i++)
+ strmOut << " ";
+ }
+ else
+ strmOut << " ";
+
+ strmOut << strAttr << "=\"" << szValue << "\"";
+}
+
+void GrTableManager::LogXmlTagAttrHex(std::ostream & strmOut, std::string strAttr, int nValue,
+ size_t nIndent)
+{
+ char chBuf[20];
+ chBuf[0] = chBuf[1] = chBuf[2] = '0';
+ if (nValue < 0x10)
+ itoa(nValue, chBuf+3, 16); // prepend 3 zeros
+ else if (nValue < 0x100)
+ itoa(nValue, chBuf+2, 16); // prepend 2 zeros
+ else if (nValue < 0x1000)
+ itoa(nValue, chBuf+1, 16); // prepend 1 zero
+ else
+ itoa(nValue, chBuf, 16);
+ LogXmlTagAttr(strmOut, strAttr, chBuf, nIndent);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Concatenate the hex form of the given numbers into a string.
+----------------------------------------------------------------------------------------------*/
+std::string GrTableManager::HexString(std::vector<int> vn)
+{
+ std::string strRet;
+ for (size_t in = 0; in < vn.size(); in++)
+ {
+ char rgch[20];
+ itoa(vn[in],rgch,16);
+ strRet.append(rgch);
+ if (in < vn.size() - 1)
+ strRet.append(" ");
+ }
+ return strRet;
+}
+
+std::string GrTableManager::HexString(int n1, int n2, int n3, int n4, int n5, int n6)
+{
+ std::vector<int> vn;
+ if (n1 > 0)
+ {
+ vn.push_back(n1);
+ if (n2 > 0)
+ {
+ vn.push_back(n2);
+ if (n3 > 0)
+ {
+ vn.push_back(n3);
+ if (n4 > 0)
+ {
+ vn.push_back(n4);
+ if (n5 > 0)
+ {
+ vn.push_back(n5);
+ if (n6 > 0)
+ vn.push_back(n6);
+ }
+ }
+ }
+ }
+ }
+ return HexString(vn);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write an attribute/value pair inside of a tag.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogXmlTagColor(std::ostream & strmOut, std::string strAttr, int clrValue,
+ bool fBack, size_t nIndent)
+{
+ // Ignore black foreground and white background.
+ if (!fBack && clrValue == kclrBlack)
+ return;
+ if (fBack && (clrValue == kclrWhite || clrValue == kclrTransparent))
+ return;
+
+ std::string strValue;
+ char rgch[20];
+ switch (clrValue)
+ {
+ case kclrBlack: strValue = "black"; break;
+ case kclrWhite: strValue = "white"; break;
+ case kclrRed: strValue = "red"; break;
+ case kclrGreen: strValue = "green"; break;
+ case kclrBlue: strValue = "blue"; break;
+ case 0x00ffff: strValue = "yellow"; break;
+ case 0xff00ff: strValue = "magenta"; break;
+ case 0xffff00: strValue = "cyan"; break;
+ default:
+ rgch[0] = '#';
+ itoa(clrValue, rgch+1, 16);
+ strValue.assign(rgch);
+ break;
+ }
+
+ LogXmlTagAttr(strmOut, strAttr, strValue.c_str(), nIndent);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write a directionality code to the table.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogXmlDirCode(std::ostream & strmOut, std::string strAttr, int dircValue,
+ size_t nIndent)
+{
+ std::string strValue;
+ char rgch[20];
+ switch (dircValue)
+ {
+ case kdircUnknown: strValue = "unknown"; break;
+ case kdircNeutral: strValue = "ON"; break;
+ case kdircL: strValue = "L"; break;
+ case kdircR: strValue = "R"; break;
+ case kdircRArab: strValue = "AR"; break;
+ case kdircEuroNum: strValue = "EN"; break;
+ case kdircEuroSep: strValue = "ES"; break;
+ case kdircEuroTerm: strValue = "ET"; break;
+ case kdircArabNum: strValue = "AN"; break;
+ case kdircComSep: strValue = "CS"; break;
+ case kdircWhiteSpace: strValue = "WS"; break;
+ case kdircBndNeutral: strValue = "BN"; break;
+ case kdircNSM: strValue = "NSM"; break;
+ case kdircLRO: strValue = "LRO"; break;
+ case kdircRLO: strValue = "RLO"; break;
+ case kdircLRE: strValue = "LRE"; break;
+ case kdircRLE: strValue = "RLE"; break;
+ case kdircPDF: strValue = "PDF"; break;
+ case kdircPdfL: strValue = "PDF-L"; break;
+ case kdircPdfR: strValue = "PDF-R"; break;
+ case kdircLlb: strValue = "L"; break;
+ case kdircRlb: strValue = "R"; break;
+ default:
+ itoa(dircValue, rgch, 10);
+ strValue.assign(rgch);
+ break;
+ }
+ LogXmlTagAttr(strmOut, strAttr, strValue.c_str(), nIndent);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write a breakweight code to the table.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogXmlBreakWeight(std::ostream & strmOut, std::string strAttr, int lbValue,
+ size_t nIndent)
+{
+ std::string strValue;
+ char rgch[20];
+ if (lbValue < 0)
+ {
+ lbValue = lbValue * -1;
+ switch (lbValue)
+ {
+ case klbWsBreak: strValue = "-ws"; break;
+ case klbWordBreak: strValue = "-word"; break;
+ case klbHyphenBreak: strValue = "-intra"; break;
+ case klbLetterBreak: strValue = "-letter"; break;
+ case klbClipBreak: strValue = "-clip"; break;
+ default:
+ itoa(lbValue * -1, rgch, 10);
+ strValue.assign(rgch);
+ break;
+ }
+ }
+ else
+ {
+ switch (lbValue)
+ {
+ case klbNoBreak: strValue = "none"; break;
+ case klbWsBreak: strValue = "ws"; break;
+ case klbWordBreak: strValue = "word"; break;
+ case klbHyphenBreak: strValue = "intra"; break;
+ case klbLetterBreak: strValue = "letter"; break;
+ case klbClipBreak: strValue = "clip"; break;
+ default:
+ itoa(lbValue, rgch, 10);
+ strValue.assign(rgch);
+ break;
+ }
+ }
+ LogXmlTagAttr(strmOut, strAttr, strValue.c_str(), nIndent);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Add a comment to the log file.
+----------------------------------------------------------------------------------------------*/
+void GrTableManager::LogXmlComment(std::ostream & strmOut, std::string strComment,
+ size_t nIndent)
+{
+ for (size_t i = 0; i < nIndent; i++)
+ strmOut << " ";
+
+ strmOut << "<!-- " << strComment << " -->\n";
+}
+
+
+#endif // TRACING
+
+} // namespace gr
diff --git a/Build/source/libs/graphite/src/segment/resource.h b/Build/source/libs/graphite/src/segment/resource.h
new file mode 100644
index 00000000000..775418f76bf
--- /dev/null
+++ b/Build/source/libs/graphite/src/segment/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by Graphite.rc
+//
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/Build/source/libs/graphite/test/Makefile.am b/Build/source/libs/graphite/test/Makefile.am
new file mode 100644
index 00000000000..96570ad125a
--- /dev/null
+++ b/Build/source/libs/graphite/test/Makefile.am
@@ -0,0 +1,2 @@
+SUBDIRS = ProfileHarness RegressionTest
+EXTRA_DIST = fonterrors
diff --git a/Build/source/libs/graphite/test/Makefile.in b/Build/source/libs/graphite/test/Makefile.in
new file mode 100644
index 00000000000..29d0d87eeb5
--- /dev/null
+++ b/Build/source/libs/graphite/test/Makefile.in
@@ -0,0 +1,478 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LSB_RELEASE = @LSB_RELEASE@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+REL_CODENAME = @REL_CODENAME@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZEOF_WCHAR_T = @SIZEOF_WCHAR_T@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = ProfileHarness RegressionTest
+EXTRA_DIST = fonterrors
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-recursive ctags \
+ ctags-recursive distclean distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-generic mostlyclean-libtool \
+ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/libs/graphite/test/ProfileHarness/GrUtfTextSrc.cpp b/Build/source/libs/graphite/test/ProfileHarness/GrUtfTextSrc.cpp
new file mode 100644
index 00000000000..30bfac34a9f
--- /dev/null
+++ b/Build/source/libs/graphite/test/ProfileHarness/GrUtfTextSrc.cpp
@@ -0,0 +1,310 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is sila.mozdev.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Keith Stribley.
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#include <graphite/GrClient.h>
+#include <graphite/ITextSource.h>
+#include <graphite/IGrJustifier.h>
+#include <graphite/IGrEngine.h>
+#include <graphite/SegmentAux.h>
+#include <graphite/Font.h>
+#include <graphite/Segment.h>
+#include <graphite/GraphiteProcess.h>
+#include <graphite/FileFont.h>
+
+#include "GrUtfTextSrc.h"
+
+
+
+GrUtfTextSrc::GrUtfTextSrc()
+: mLength(0),
+ mBufferLength8(64), mBufferLength16(64), mBufferLength32(64),
+ mData8(NULL), mData16(NULL), mData32(NULL),
+ mType(gr::kutf16),
+ mForeground(gr::kclrBlack), mBackground(gr::kclrTransparent),
+ mSelectForeground(0), mSelectBackground(0),
+ mIsSelected(false),
+ mFont(NULL),
+ mRtl(false)
+{
+
+}
+
+GrUtfTextSrc::~GrUtfTextSrc()
+{
+ if (mData8) delete [] mData8;
+ if (mData16) delete [] mData16;
+ if (mData32) delete [] mData32;
+ mSelectionVector.clear();
+}
+
+bool GrUtfTextSrc::setText(const char * pszText, int len)
+{
+ return setText((gr::utf8*)pszText, len);
+}
+
+bool GrUtfTextSrc::setText(const gr::utf8 * pszText, int len)
+{
+ mType = gr::kutf8;
+ mLength = len;
+ if (!checkBuffer8()) return false;
+
+ for(size_t i = 0; i < mLength; i++)
+ {
+ mData8[i] = pszText[i];
+ // stray line feeds and other control characters from the html file
+ // cause artificial truncation of segments
+ if (mData8[i] < 0x0020)//(pszText[i] == '\n' || pszText[i] == '\r')
+ mData8[i] = 0x20; // ZWSP
+ }
+ mData8[mLength] = '\0'; // zero-terminate
+ mSelectionVector.clear();
+ mIsSelected = false;
+ return true;
+}
+
+
+bool GrUtfTextSrc::setText(const gr::utf16 * pszText, int len)
+{
+ mType = gr::kutf16;
+ mLength = len;
+ if (!checkBuffer16()) return false;
+
+ for(size_t i = 0; i < mLength; i++)
+ {
+ mData16[i] = pszText[i];
+ // stray line feeds and other control characters from the html file
+ // cause artificial truncation of segments
+ if (mData16[i] < 0x0020)//(pszText[i] == '\n' || pszText[i] == '\r')
+ mData16[i] = 0x200B; // ZWSP
+ }
+ mData16[mLength] = '\0'; // zero-terminate
+ mSelectionVector.clear();
+ mIsSelected = false;
+ return true;
+}
+
+bool GrUtfTextSrc::setText(const gr::utf32 * pszText, int len)
+{
+ mType = gr::kutf32;
+ mLength = len;
+ if (!checkBuffer32()) return false;
+
+ for(size_t i = 0; i < mLength; i++)
+ {
+ mData32[i] = pszText[i];
+ }
+ mData32[mLength] = '\0'; // zero-terminate
+ mSelectionVector.clear();
+ mIsSelected = false;
+ return true;
+}
+
+bool GrUtfTextSrc::checkBuffer8(void)
+{
+ if (!mData8 || mBufferLength8 < mLength + 1)
+ {
+ do
+ {
+ mBufferLength8 *= 2;
+ } while (mBufferLength8 < mLength + 1);
+ if (mData8) delete [] mData8;
+ mData8 = new gr::utf8[mBufferLength8];
+ }
+ return (mData8) ? true : false;
+}
+
+bool GrUtfTextSrc::checkBuffer16(void)
+{
+ if (!mData16 || mBufferLength16 < mLength + 1)
+ {
+ do
+ {
+ mBufferLength16 *= 2;
+ } while (mBufferLength16 < mLength + 1);
+ if (mData16) delete [] mData16;
+ mData16 = new gr::utf16[mBufferLength16];
+ }
+ return (mData16) ? true : false;
+}
+
+bool GrUtfTextSrc::checkBuffer32(void)
+{
+ if (!mData32 || mBufferLength32 < mLength + 1)
+ {
+ do
+ {
+ mBufferLength32 *= 2;
+ } while (mBufferLength32 < mLength + 1);
+ if (mData32) delete [] mData32;
+ mData32 = new gr::utf32[mBufferLength32];
+ }
+ return (mData32) ? true : false;
+}
+
+size_t GrUtfTextSrc::fetch(gr::toffset ichMin, size_t cch, gr::utf8 * prgchwBuffer)
+{
+ assert(cch <= mLength);
+ if (cch > mLength)
+ {
+ return 0;
+ }
+ std::copy(mData8 + ichMin, mData8 + ichMin + cch, prgchwBuffer);
+ return (cch - ichMin);
+}
+
+size_t GrUtfTextSrc::fetch(gr::toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer)
+{
+ assert(cch <= mLength);
+ if (cch > mLength)
+ {
+ return 0;
+ }
+ std::copy(mData16 + ichMin, mData16 + ichMin + cch, prgchwBuffer);
+ return (cch - ichMin);
+}
+
+size_t GrUtfTextSrc::fetch(gr::toffset ichMin, size_t cch, gr::utf32 * prgchwBuffer)
+{
+ assert(cch <= mLength);
+ if (cch > mLength)
+ {
+ return 0;
+ }
+ std::copy(mData32 + ichMin, mData32 + ichMin + cch, prgchwBuffer);
+ return (cch - ichMin);
+}
+
+
+bool GrUtfTextSrc::getRightToLeft(gr::toffset ich)
+{
+ return mRtl; // assumes src only contains one direction
+}
+
+unsigned int GrUtfTextSrc::getDirectionDepth(gr::toffset ich)
+{
+ return (mRtl) ? 1 : 0; // TBD
+}
+
+std::pair<gr::toffset, gr::toffset> GrUtfTextSrc::propertyRange(gr::toffset ich)
+{
+ std::pair<gr::toffset, gr::toffset> range(0, mLength);
+ if (mIsSelected)
+ {
+ bool selectState = mSelectionVector[ich];
+ // find start
+ int s = ich - 1;
+ int e = ich + 1;
+ if (s > -1)
+ for ( ; s >= 0; s--)
+ {
+ if (mSelectionVector[s] != selectState)
+ {
+ s++; // backup
+ break;
+ }
+ }
+ if (s < 0) s = 0;
+ // find end
+ for ( ; e < static_cast<int>(mLength); e++)
+ {
+ if (mSelectionVector[e] != selectState)
+ {
+ // don't need to backup for end
+ break;
+ }
+ }
+ range.first = s;
+ range.second = e;
+ }
+ return range;
+}
+
+size_t GrUtfTextSrc::getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset)
+{
+ return 0;
+}
+
+void GrUtfTextSrc::getColors(gr::toffset ich, int * pclrFore, int * pclrBack)
+{
+ // selections are handled here
+ if (mIsSelected && mSelectionVector[ich])
+ {
+ *pclrFore = mSelectForeground;
+ *pclrBack = mSelectBackground;
+ }
+ else
+ {
+ *pclrFore = mForeground;
+ *pclrBack = mBackground;
+ }
+}
+
+
+// these should be called I hope
+float
+GrUtfTextSrc::getFontSize(gr::toffset ich)
+{
+ assert(mFont);
+ return mPointSize;
+}
+
+bool
+GrUtfTextSrc::getBold(gr::toffset ich)
+{
+ assert(mFont);
+// NS_ASSERTION(false, "unexpected call to getBold");
+// return false;
+ return mFont->bold();
+}
+
+bool
+GrUtfTextSrc::getItalic(gr::toffset ich)
+{
+ assert(mFont);
+ //NS_ASSERTION(false, "unexpected call to getItalic");
+ //return false;
+ return mFont->italic();
+}
+
+gr::isocode GrUtfTextSrc::getLanguage(gr::toffset ich)
+{
+ gr::isocode unknown;
+ std::fill_n(unknown.rgch, 4, '\0');
+ return unknown;
+}
+
diff --git a/Build/source/libs/graphite/test/ProfileHarness/GrUtfTextSrc.h b/Build/source/libs/graphite/test/ProfileHarness/GrUtfTextSrc.h
new file mode 100644
index 00000000000..cae0a4850b5
--- /dev/null
+++ b/Build/source/libs/graphite/test/ProfileHarness/GrUtfTextSrc.h
@@ -0,0 +1,146 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Netscape Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/NPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is sila.mozdev.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Keith Stribley.
+ * Portions created by the Initial Developer are Copyright (C) 2004
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the NPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the NPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GRUTFTXTSRC_INCLUDED
+#define GRUTFTXTSRC_INCLUDED
+
+#include <vector>
+#include <assert.h>
+
+#include <graphite/GrAppData.h>
+#include <graphite/GrStructs.h>
+#include <graphite/ITextSource.h>
+
+class nsIGrSegWrapper;
+
+/*-----------------------------------------------------------------------------
+ Class: ITextSource
+ This class provides an interface of a text source for the Graphite engine.
+------------------------------------------------------------------------------*/
+class GrUtfTextSrc : public gr::IColorTextSource
+{
+public:
+ GrUtfTextSrc();
+ ~GrUtfTextSrc();
+ bool setText(const gr::utf8 * pszText, int len);
+ bool setText(const char * pszText, int len);
+ bool setText(const gr::utf16 * pszText, int len);
+ bool setText(const gr::utf32 * pszText, int len);
+ void setColors(int foreground, int background)
+ {
+ mForeground = foreground;
+ mBackground = background;
+ };
+ //void setSelectionDetails(nsIGrSegWrapper * wrapper);
+ void setFont(gr::Font * font) { mFont = font; };
+ void setPointSize(float & pointSize) { mPointSize = pointSize; };
+ // --------------------------------------------------------------------------
+ // New V2 interface:
+
+ virtual gr::UtfType utfEncodingForm() { return mType; };
+ virtual size_t getLength() { return mLength; };
+ virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf32 * prgchBuffer);
+ virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer);
+ virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf8 * prgchsBuffer);
+ virtual gr::GrResult getFaceName(int ich, unsigned int cchMax,
+ gr::utf16 * prgchFaceName, unsigned int * pcchLen)
+ {
+ prgchFaceName[0] = 0;
+ *pcchLen = 0;
+ return gr::kresNotImpl;
+ };
+ //virtual std::wstring getFaceName(int ich) { return mFont->getFaceName(); };
+ virtual float getFontSize(gr::toffset ich);
+ virtual bool getBold(gr::toffset ich);
+ virtual bool getItalic(gr::toffset ich);
+ virtual bool getRightToLeft(gr::toffset ich);
+ virtual unsigned int getDirectionDepth(gr::toffset ich);
+ virtual float getVerticalOffset(gr::toffset ich) { return 0;};
+ virtual gr::isocode getLanguage(gr::toffset ich);
+
+ virtual std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich);
+ virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset);
+ virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2) { return true; };
+
+protected:
+ bool checkBuffer8();
+ bool checkBuffer16();
+ bool checkBuffer32();
+
+private:
+ size_t mLength;
+ size_t mBufferLength8;
+ size_t mBufferLength16;
+ size_t mBufferLength32;
+ gr::utf8 * mData8;
+ gr::utf16 * mData16;
+ gr::utf32 * mData32;
+ gr::UtfType mType;
+ int mForeground;
+ int mBackground;
+ int mSelectForeground;
+ int mSelectBackground;
+ bool mIsSelected;
+ std::wstring mFaceName;
+ std::vector<bool> mSelectionVector;
+ gr::Font * mFont;
+ bool mRtl;
+ float mPointSize;
+
+public: // methods that will go
+ // Temporary--eventually these will be of interest only to SegmentPainter.
+ virtual void getColors(gr::toffset ich, int * pclrFore, int * pclrBack);
+
+ // Shouldn't be here!
+ virtual gr::GrResult Fetch(int ichMin, int ichLim, gr::utf16 * prgchBuf) { return gr::kresNotImpl; };
+ virtual gr::GrResult get_Length(int * pcch) { return gr::kresNotImpl; };
+ virtual gr::GrResult GetFontVariations(int ich,
+ wchar_t * prgchFontVar, int ichMax, int * pich,
+ int * pichMin, int * pichLim) { return gr::kresNotImpl; };
+
+};
+
+
+#if !defined(GR_NAMESPACE)
+using namespace gr;
+#endif
+
+#endif // !GRUTFTXTSRC_INCLUDED
+
diff --git a/Build/source/libs/graphite/test/ProfileHarness/Makefile.am b/Build/source/libs/graphite/test/ProfileHarness/Makefile.am
new file mode 100644
index 00000000000..07d07348eff
--- /dev/null
+++ b/Build/source/libs/graphite/test/ProfileHarness/Makefile.am
@@ -0,0 +1,14 @@
+AUTOMAKE_OPTIONS = 1.6
+
+noinst_PROGRAMS = profile-graphite
+
+AM_CPPFLAGS = -I$(top_srcdir)/include
+
+profile_graphite_LDFLAGS = -L$(top_builddir)/src -lgraphite
+
+profile_graphite_SOURCES = \
+ GrUtfTextSrc.cpp GrUtfTextSrc.h \
+ ProfileHarness.cpp
+
+#dist-hook:
+# rm -f grregtest.log tracelog.txt
diff --git a/Build/source/libs/graphite/test/ProfileHarness/Makefile.in b/Build/source/libs/graphite/test/ProfileHarness/Makefile.in
new file mode 100644
index 00000000000..a9d264683b2
--- /dev/null
+++ b/Build/source/libs/graphite/test/ProfileHarness/Makefile.in
@@ -0,0 +1,447 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = profile-graphite$(EXEEXT)
+subdir = test/ProfileHarness
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_profile_graphite_OBJECTS = GrUtfTextSrc.$(OBJEXT) \
+ ProfileHarness.$(OBJEXT)
+profile_graphite_OBJECTS = $(am_profile_graphite_OBJECTS)
+profile_graphite_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(profile_graphite_SOURCES)
+DIST_SOURCES = $(profile_graphite_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LSB_RELEASE = @LSB_RELEASE@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+REL_CODENAME = @REL_CODENAME@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZEOF_WCHAR_T = @SIZEOF_WCHAR_T@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+AUTOMAKE_OPTIONS = 1.6
+AM_CPPFLAGS = -I$(top_srcdir)/include
+profile_graphite_LDFLAGS = -L$(top_builddir)/src -lgraphite
+profile_graphite_SOURCES = \
+ GrUtfTextSrc.cpp GrUtfTextSrc.h \
+ ProfileHarness.cpp
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/ProfileHarness/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/ProfileHarness/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+profile-graphite$(EXEEXT): $(profile_graphite_OBJECTS) $(profile_graphite_DEPENDENCIES)
+ @rm -f profile-graphite$(EXEEXT)
+ $(CXXLINK) $(profile_graphite_LDFLAGS) $(profile_graphite_OBJECTS) $(profile_graphite_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrUtfTextSrc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ProfileHarness.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-info-am
+
+
+#dist-hook:
+# rm -f grregtest.log tracelog.txt
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/libs/graphite/test/ProfileHarness/ProfileHarness.cpp b/Build/source/libs/graphite/test/ProfileHarness/ProfileHarness.cpp
new file mode 100644
index 00000000000..361d6a6b734
--- /dev/null
+++ b/Build/source/libs/graphite/test/ProfileHarness/ProfileHarness.cpp
@@ -0,0 +1,476 @@
+/*-----------------------------------------------------------------------------
+Copyright (C) 2007 SIL International
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File:
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+A simple console app that creates a segment using FileFont and dumps a
+diagnostic table of the resulting glyph vector to the console.
+If graphite has been built with -DTRACING then it will also produce a
+diagnostic log of the segment creation in grSegmentLog.txt
+-----------------------------------------------------------------------------*/
+
+//#include <stdlib.h>
+#include <stdio.h>
+#include <assert.h>
+#include <iostream>
+#include <iomanip>
+#include <string>
+#include <sstream>
+#include <cstring>
+
+#include <graphite/GrClient.h>
+#include <graphite/ITextSource.h>
+///#include <graphite/IGrJustifier.h>
+#include <graphite/IGrEngine.h>
+#include <graphite/SegmentAux.h>
+#include <graphite/Font.h>
+#include <graphite/Segment.h>
+#include <graphite/GraphiteProcess.h>
+#include <graphite/FileFont.h>
+
+#include "GrUtfTextSrc.h"
+
+typedef std::pair< gr::GlyphIterator, gr::GlyphIterator > GlyphRange;
+
+#ifndef HAVE_STRTOF
+float strtof(char * text, char ** ignore)
+{
+ return static_cast<float>(atof(text));
+}
+#endif
+
+#ifndef HAVE_STRTOL
+long strtol(char * text, char ** ignore)
+{
+ return atol(text);
+}
+#endif
+
+struct Parameters
+{
+ const char * textFile;
+ const char * fontFile;
+ float pointSize;
+ int dpi;
+ bool lineStart;
+ bool lineEnd;
+ bool useLineFill;
+ bool useCodes;
+ float width;
+ int textArgIndex;
+ gr::utf16 * pText16;
+ gr::utf32 * pText32;
+ size_t charLength;
+ size_t offset;
+};
+
+#ifdef HAVE_ICONV
+void
+convertUtf8ToUtf32(char* pText, Parameters & parameters)
+{
+ int length = strlen(reinterpret_cast<char*>(pText));
+ //gr::utf8 * pText = reinterpret_cast<gr::utf8*>(argv[2]);
+ // convert text to utf32 using iconv because its easier to debug string placements
+ size_t bytesLeft = length;
+ size_t outBytesLeft = (length + 1) * sizeof(gr::utf32);
+ size_t outBufferSize = outBytesLeft;
+ gr::utf32 * text32 = new gr::utf32[length + 1];
+ iconv_t utf8to32 = iconv_open("utf32","utf8");
+ assert(utf8to32 != (iconv_t)(-1));
+ char * pText32 = reinterpret_cast<char*>(&text32[0]);
+ size_t convertLength = iconv(utf8to32, &pText, &bytesLeft, &pText32, &outBytesLeft);
+ if (convertLength == size_t(-1)) perror("iconv failed:");
+ size_t charLength = (outBufferSize - outBytesLeft) / sizeof(gr::utf32);
+ assert(convertLength != size_t(-1));
+ // size_t offset = 0;
+ // offset by 1 to avoid bom
+ if (text32[0] == 0xfeff)
+ {
+ parameters.offset = 1;
+ charLength--;
+ }
+ std::cout << "String has " << charLength << " characters (" << length << " bytes)" << std::endl;
+ size_t ci;
+ for (ci = 0; ci < 10 && ci < charLength; ci++)
+ {
+ std::cout << std::setw(4) << ci << '\t';
+ }
+ std::cout << std::endl;
+ for (ci = 0; ci < charLength; ci++)
+ {
+ std::cout << std::setw(4) << std::hex
+ << text32[ci+parameters.offset] << '\t';
+ if (((ci + 1) % 10) == 0) std::cout << std::endl;
+ }
+ std::cout << std::endl;
+ parameters.charLength = charLength;
+ parameters.pText32 = text32;
+ iconv_close(utf8to32);
+}
+#endif
+
+bool parseArgs(int argc, char *argv[], Parameters & parameters)
+{
+ int mainArgOffset = 0;
+ bool argError = false;
+ char* pText = NULL;
+ typedef enum
+ {
+ NONE,
+ POINT_SIZE,
+ DPI,
+ LINE_START,
+ LINE_END,
+ LINE_FILL,
+ CODES
+ } TestOptions;
+ TestOptions option = NONE;
+ char * pIntEnd = NULL;
+ char * pFloatEnd = NULL;
+ long lTestSize = 0;
+ float fTestSize = 0.0f;
+ for (int a = 1; a < argc; a++)
+ {
+ switch (option)
+ {
+ case DPI:
+ pIntEnd = NULL;
+ lTestSize = strtol(argv[a],&pIntEnd, 10);
+ if (lTestSize > 0 && lTestSize < INT_MAX && lTestSize != LONG_MAX)
+ {
+ parameters.dpi = lTestSize;
+ }
+ else
+ {
+ fprintf(stderr,"Invalid dpi %s\n", argv[a]);
+ }
+ option = NONE;
+ break;
+ case POINT_SIZE:
+ pFloatEnd = NULL;
+ fTestSize = strtof(argv[a],&pFloatEnd);
+ // what is a reasonable maximum here
+ if (fTestSize > 0 && fTestSize < 5000.0f)
+ {
+ parameters.pointSize = fTestSize;
+ }
+ else
+ {
+ fprintf(stderr,"Invalid point size %s\n", argv[a]);
+ argError = true;
+ }
+ option = NONE;
+ break;
+ case LINE_FILL:
+ pFloatEnd = NULL;
+ fTestSize = strtof(argv[a],&pFloatEnd);
+ // what is a good max width?
+ if (fTestSize > 0 && fTestSize < 10000)
+ {
+ parameters.width = fTestSize;
+ }
+ else
+ {
+ fprintf(stderr,"Invalid line width %s\n", argv[a]);
+ argError = true;
+ }
+ option = NONE;
+ break;
+ default:
+ option = NONE;
+ if (argv[a][0] == '-')
+ {
+ if (strcmp(argv[a], "-pt") == 0)
+ {
+ option = POINT_SIZE;
+ }
+ else if (strcmp(argv[a], "-dpi") == 0)
+ {
+ option = DPI;
+ }
+ else if (strcmp(argv[a], "-ls") == 0)
+ {
+ option = NONE;
+ parameters.lineStart = true;
+ }
+ else if (strcmp(argv[a], "-le") == 0)
+ {
+ option = NONE;
+ parameters.lineEnd = true;
+ }
+ else if (strcmp(argv[a], "-linefill") == 0)
+ {
+ option = LINE_FILL;
+ parameters.useLineFill = true;
+ }
+ else if (strcmp(argv[a], "-codes") == 0)
+ {
+ option = NONE;
+ parameters.useCodes = true;
+ // must be less than argc
+ parameters.pText32 = new gr::utf32[argc];
+ printf("\nText codes\n");
+ }
+ else
+ {
+ argError = true;
+ fprintf(stderr,"Unknown option %s\n",argv[a]);
+ }
+ }
+ else if (mainArgOffset == 0)
+ {
+ parameters.textFile = argv[a];
+ mainArgOffset++;
+ }
+ else if (mainArgOffset == 1)
+ {
+ parameters.fontFile = argv[a];
+ mainArgOffset++;
+ }
+ else if (parameters.useCodes)
+ {
+ pIntEnd = NULL;
+ mainArgOffset++;
+ gr::utf32 code = strtol(argv[a],&pIntEnd, 16);
+ if (code > 0)
+ {
+ parameters.pText32[parameters.charLength++] = code;
+ if (parameters.charLength % 10 == 0)
+ printf("%4x\n",code);
+ else
+ printf("%4x\t",code);
+ }
+ else
+ {
+ fprintf(stderr,"Invalid dpi %s\n", argv[a]);
+ }
+ }
+ else if (mainArgOffset == 1)
+ {
+ mainArgOffset++;
+ pText = argv[a];
+ parameters.textArgIndex = a;
+ }
+ else
+ {
+ argError = true;
+ fprintf(stderr,"too many arguments %s\n",argv[a]);
+ }
+ }
+ }
+ if (mainArgOffset < 2) argError = true;
+ else
+ {
+ if (!parameters.useCodes && pText != NULL)
+ {
+#ifdef HAVE_ICONV
+ convertUtf8ToUtf32(pText, parameters);
+#else
+ fprintf(stderr,"Only the -codes option is supported on Win32\r\n");
+ argError = true;
+#endif
+ }
+ else
+ {
+ ///parameters.pText32[parameters.charLength] = 0;
+ printf("\n");
+ }
+ }
+ return (argError) ? false : true;
+}
+
+
+void initParameters(Parameters & parameters)
+{
+ parameters.textFile = "";
+ parameters.fontFile = "";
+ parameters.pointSize = 12.0f;
+ parameters.dpi = 72;
+ parameters.lineStart = false;
+ parameters.lineEnd = false;
+ parameters.useLineFill = false;
+ parameters.useCodes = false;
+ parameters.width = 100.0f;
+ parameters.pText16 = NULL;
+ parameters.pText32 = NULL;
+ parameters.textArgIndex = 0;
+ parameters.charLength = 0;
+ parameters.offset = 0;
+}
+
+
+
+int runGraphite(Parameters parameters)
+{
+ int returnCode = 0;
+ FILE * file = fopen(parameters.fontFile, "rb");
+ gr::FileFont * fileFont = NULL;
+
+ // Put the text into an array of string, each string is one paragraph.
+ std::ifstream textFileStrm(parameters.textFile);
+ std::cout << "FILE: " << parameters.textFile << "\n";
+ std::string stringArray[100];
+
+ std::stringbuf buf;
+ textFileStrm >> &buf;
+ std::cout << "read " << buf.str().length() << " characters" << std::endl;
+ std::cout << "====BEGIN===" << buf.str() << "====END====" << std::endl;
+ const std::string strTemp = buf.str();
+ stringArray[0] = strTemp;
+ int cpara = 1;
+
+ try
+ {
+ if (file)
+ {
+ fileFont = new gr::FileFont(file, parameters.pointSize, parameters.dpi);
+ if (!fileFont || !fileFont->isValid())
+ {
+ fprintf(stderr,"graphitejni:Invalid font!");
+ delete fileFont;
+ fileFont = NULL;
+ return 2;
+ }
+ printf("Font: %s bold=%d italic=%d %4.1fpt dpi %d\n",
+ parameters.fontFile,
+ fileFont->bold(), fileFont->italic(),
+ parameters.pointSize, parameters.dpi);
+ bool isGraphite = fileFont->fontHasGraphiteTables();
+ if (!isGraphite)
+ {
+ fprintf(stderr,"graphitejni: %s does not have graphite tables",
+ parameters.fontFile);
+ delete fileFont;
+ fileFont = NULL;
+ return 3;
+ }
+ }
+ else
+ {
+ fprintf(stderr, "Failed to open %s\n", parameters.fontFile);
+ return 4;
+ }
+
+ for (int ipara = 0; ipara < cpara; ipara++)
+ {
+ GrUtfTextSrc textSrc;
+ gr::LayoutEnvironment layout;
+
+ textSrc.setText(stringArray[ipara].data(), stringArray[ipara].length());
+ textSrc.setPointSize(parameters.pointSize);
+ textSrc.setFont(fileFont);
+
+ layout.setStartOfLine(parameters.lineStart);
+ layout.setEndOfLine(parameters.lineEnd);
+ layout.setDumbFallback(true);
+ layout.setJustifier(NULL);
+
+ gr::Segment * pSegment = NULL;
+ //try
+ //{
+ if (parameters.useLineFill)
+ {
+ pSegment = new gr::LineFillSegment(fileFont, &textSrc, &layout,
+ 0, stringArray[ipara].length(),
+ parameters.width);
+ printf("LineFillSegment overing char %d - %d\nline start=%d line end=%d\n",
+ pSegment->startCharacter(), pSegment->stopCharacter(),
+ parameters.lineStart, parameters.lineEnd);
+ }
+ else
+ {
+ pSegment = new gr::RangeSegment(fileFont, &textSrc, &layout,
+ 0, stringArray[ipara].length());
+ printf("RangeSegment covering char %d - %d\nline start=%d line end=%d\n",
+ pSegment->startCharacter(), pSegment->stopCharacter(),
+ parameters.lineStart, parameters.lineEnd);
+ }
+ //}
+ //catch (...)
+ //{
+ // printf("Exception occurred while creating segment\n");
+ // returnCode = 5;
+ // throw;
+ //}
+
+ if (!pSegment) return returnCode;
+
+ // for justifier testing
+ /*
+ gr::GrJustifier justifier;
+ pSegment->SetJustifier(&justifier);
+ gr::Segment * justified = gr::Segment::JustifiedSegment(*pSegment, 2.0f * advanceWidth);
+ delete justified;
+ */
+
+ delete pSegment;
+ }
+ }
+ catch (...)
+ {
+ printf("Exception occurred\n");
+ returnCode = 5;
+ }
+
+ delete fileFont;
+
+ return returnCode;
+}
+
+#ifdef WIN32
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+ Parameters parameters;
+ initParameters(parameters);
+
+ if (!parseArgs(argc, argv, parameters))
+ {
+ fprintf(stderr,"Usage: %s [options] textfile fontfile \n",argv[0]);
+ return 1;
+ }
+ // UTF16 arguments
+ //if (parameters.textArgIndex > 0)
+ //{
+ // parameters.pText16 = reinterpret_cast<wchar_t*>(argv[parameters.textArgIndex]);
+ // std::wstring text(parameters.pText16);
+ // parameters.charLength = text.size();
+ // for (int i = 0; i < text.size(); i++)
+ // {
+ // if (i % 10 == 0)
+ // printf("\r\n%4x", text[i]);
+ // else
+ // printf("\t%4x", text[i]);
+ // }
+ //}
+ //else
+ //{
+ // assert(parameters.pText32);
+ //}
+
+ return runGraphite(parameters);
+}
+
+#else
+
+int main(int argc, char *argv[])
+{
+
+ Parameters parameters;
+ initParameters(parameters);
+
+ if (!parseArgs(argc, argv, parameters))
+ {
+ fprintf(stderr,"Usage: %s [options] textfile fontfile \n",argv[0]);
+ return 1;
+ }
+ return runGraphite(parameters);
+}
+
+#endif
diff --git a/Build/source/libs/graphite/test/ProfileHarness/makefile.vc b/Build/source/libs/graphite/test/ProfileHarness/makefile.vc
new file mode 100644
index 00000000000..5f42ba97b3b
--- /dev/null
+++ b/Build/source/libs/graphite/test/ProfileHarness/makefile.vc
@@ -0,0 +1,111 @@
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+!IF "$(CFG)" == ""
+CFG=DEBUG
+!ENDIF
+
+!IF "$(CFG)" == "RELEASE"
+
+OUTDIR=.\release
+INTDIR=.\release_temp
+
+all : "$(OUTDIR)\ProfileHarness.exe"
+
+clean :
+ @- rd /s/q .\release_temp
+
+realclean : clean
+ @- rd /s/q .\release
+
+CPP_PROJ=/nologo /MT /W3 /GR /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /c
+LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib shell32.lib uuid.lib graphite.lib /nologo /subsystem:console /incremental:no /machine:I386 /out:"$(OUTDIR)\ProfileHarness.exe" /libpath:"..\..\release"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\ProfileHarness.bsc"
+
+!ELSEIF "$(CFG)" == "DEBUG"
+
+OUTDIR=.\debug
+INTDIR=.\debug_temp
+
+all : "$(OUTDIR)\ProfileHarness.exe" "$(OUTDIR)\ProfileHarness.bsc"
+
+clean :
+ @- rd /s/q .\debug_temp
+
+realclean : clean
+ @- rd /s/q .\debug
+
+CPP_PROJ=/nologo /MTd /W3 /Gm /GR /GX /GZ /ZI /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /c
+LINK32_FLAGS=kernel32.lib user32.lib advapi32.lib shell32.lib uuid.lib graphite.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\ProfileHarness.pdb" /debug /machine:I386 /out:"$(OUTDIR)\ProfileHarness.exe" /libpath:"..\..\debug"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\ProfileHarness.bsc"
+
+!ENDIF
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(APPLIB)}.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(APPLIB)}.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(TEXTSRCDIR)}.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(TEXTSRCDIR)}.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+
+CPP=cl.exe
+RSC=rc.exe
+BSC32=bscmake.exe
+LINK32=link.exe
+
+LINK32_OBJS= \
+ "$(INTDIR)\ProfileHarness.obj" \
+ "$(INTDIR)\GrUtfTextSrc.obj" \
+
+"$(OUTDIR)\ProfileHarness.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+BSC32_SBRS= \
+ "$(INTDIR)\ProfileHarness.sbr" \
+ "$(INTDIR)\GrUtfTextSrc.sbr"
+
+"$(OUTDIR)\ProfileHarness.bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+
+"$(INTDIR)\ProfileHarness.obj" "$(INTDIR)\ProfileHarness.sbr" : ".\ProfileHarness.cpp" "$(INTDIR)"
+"$(INTDIR)\GrTxtSrc.obj" "$(INTDIR)\GrUtfTextSrc.sbr" : ".\GrUtfTextSrc.cpp" "$(INTDIR)"
+
+
diff --git a/Build/source/libs/graphite/test/RegressionTest/GrJustifier.cpp b/Build/source/libs/graphite/test/RegressionTest/GrJustifier.cpp
new file mode 100644
index 00000000000..566811c9907
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/GrJustifier.cpp
@@ -0,0 +1,566 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2003 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrJustifier.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ A default justification agent for Graphite.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+//#include "main.h" // This is used by clients, so main.h is not available
+
+#pragma hdrstop
+// any other headers (not precompiled)
+#include "GrClient.h"
+#include "ITextSource.h"
+#include "IGrJustifier.h"
+#include "GraphiteProcess.h"
+#include "GrDebug.h"
+
+#include "GrJustifier.h"
+
+#ifdef WIN32
+#include <string>
+#endif
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:>********************************************************************************************
+//:> Global constants
+//:>********************************************************************************************
+
+const int g_cnPrimes = 7;
+static const int g_rgnPrimes[] =
+{
+ 2, 3, 5, 7, 11, 13, 17, // these primes will allow a range of weights up to 255
+ // 19, 23, 31, 37, 41, 43, 47, 53, 59, 61
+};
+
+//:>********************************************************************************************
+//:> Forward declarations
+//:>********************************************************************************************
+
+//:>********************************************************************************************
+//:> Methods
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Constructors.
+----------------------------------------------------------------------------------------------*/
+GrJustifier::GrJustifier()
+{
+ m_cref = 1; // COM-like behavior
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Destructor.
+----------------------------------------------------------------------------------------------*/
+GrJustifier::~GrJustifier()
+{
+}
+
+/*----------------------------------------------------------------------------------------------
+ Determine how to adjust the widths of the glyphs to get a justified effect.
+ Return kresFalse if we can't achieve the desired width.
+----------------------------------------------------------------------------------------------*/
+gr::GrResult GrJustifier::adjustGlyphWidths(gr::GraphiteProcess * pgje,
+ int iGlyphMin, int iGlyphLim,
+ float dxCurrentWidthArg, float dxDesiredWidthArg)
+{
+ if (dxCurrentWidthArg == dxDesiredWidthArg)
+ return gr::kresOk; // no stretch needed
+
+ int dxCurrentWidth = (int)dxCurrentWidthArg;
+ int dxDesiredWidth = (int)dxDesiredWidthArg;
+
+ bool fShrinking = (dxDesiredWidth < dxCurrentWidth);
+
+ // First, get the relevant values for each glyph out of the Graphite engine.
+
+ int dxsStretchAvail = 0;
+ std::vector<int> viGlyphs;
+ std::vector<int> vdxStretchLeft;
+ std::vector<int> vdxStep;
+ std::vector<int> vnWeight;
+ std::vector<int> vdxWidth;
+ std::vector<int> vdxStretchOrig;
+ bool fStep = false;
+ int nMaxWt = 1;
+ int cUnits = 0; // glyph-weight units
+ int cStretchable = 0;
+ for (int iGlyph = iGlyphMin; iGlyph < iGlyphLim; iGlyph++)
+ {
+ int dx;
+ pgje->getGlyphAttribute(iGlyph,
+ (fShrinking ? gr::kjgatShrink : gr::kjgatStretch), 1, &dx);
+ if (dx > 0)
+ {
+ int dxStep = 0;
+ pgje->getGlyphAttribute(iGlyph, gr::kjgatStep, 1, &dxStep);
+ if (fShrinking)
+ dxStep = (dxStep > 0) ? 0 : dxStep; // step is applicable if it is negative
+ else // stretching
+ dxStep = (dxStep < 0) ? 0 : dxStep; // step is applicable if it is positive
+ if (dxStep != 0)
+ {
+ // Get the actual number of steps allowed. This is more accurate than
+ // trying to calculate it, due to rounding when converting between
+ // font units and pixels.
+ int cSteps;
+ pgje->getGlyphAttribute(iGlyph, gr::kjgatStretchInSteps, 1, &cSteps);
+ dx = abs(dxStep * cSteps);
+ fStep = true;
+ }
+ dxStep = abs(dxStep);
+
+ int nWt;
+ pgje->getGlyphAttribute(iGlyph, gr::kjgatWeight, 1, &nWt);
+ nWt = max(nWt, 0);
+ nMaxWt = max(nMaxWt, nWt);
+
+ viGlyphs.push_back(iGlyph);
+ vdxStretchLeft.push_back(dx);
+ vdxStep.push_back(dxStep);
+ vnWeight.push_back(nWt);
+ vdxWidth.push_back(0);
+ vdxStretchOrig.push_back(dx);
+
+ dxsStretchAvail += dx;
+ cUnits += nWt;
+ cStretchable++;
+ }
+ }
+
+ int dxStretchNeeded = dxDesiredWidth - dxCurrentWidth;
+ if (fShrinking)
+ dxStretchNeeded *= -1; // always a positive number
+ int dxStretchAchieved = 0;
+ bool fIgnoreStepGlyphs = false;
+ int iiGlyph;
+ std::vector<int> vnMFactor;
+
+ if (viGlyphs.size() > 0)
+ {
+
+ // The way weights are handled is the following: we calculate the least common multiple
+ // of all the weights, and then scale each stretch value accordingly before distributing
+ // widths. In other words, we put the stretch values into an alternate "common" scaled
+ // system based on the LCM. "cUnits" represents the total number of stretch-units
+ // available, where each glyph contributes a number of units equal to its weight.
+ // To get into this scaled system, small-weight stretches are scaled by a large amount
+ // and large-weight stretches are scaled by a small amount. After assigning the width,
+ // we do the reverse scaling on that width. Since large-weight stretches are scaled
+ // back by less, this results in more width being assigned to glyphs with a large weight.
+
+ int nLcm = 1;
+ if (nMaxWt > 1)
+ nLcm = Lcm(vnWeight, vnMFactor);
+ else
+ {
+ vnMFactor.push_back(1); // weight 0 - bogus
+ vnMFactor.push_back(1); // weight 1
+ }
+
+ // Loop over the glyphs until we have assigned all the available space. (If a small amount
+ // is left over it will be distributed using a special method.)
+
+LMainLoop:
+
+ int dxStretchStillNeeded = dxStretchNeeded - dxStretchAchieved;
+ int dxNonStepMore = 0;
+ int dxNonStepLess = 0;
+ while (cUnits > 0 && dxStretchStillNeeded >= cStretchable)
+ // && dxStretchStillNeeded * nLcm >= cUnits)
+ {
+ // This is the scaled stretch per glyph, that is, in the scaled system of the LCM.
+ int dxwStretchPerGlyph = dxStretchStillNeeded * nLcm / cUnits;
+
+ // Recalculate these for the next round:
+ cUnits = 0;
+ cStretchable = 0;
+
+ for (iiGlyph = 0; iiGlyph < (signed)viGlyphs.size(); iiGlyph++)
+ {
+ if (vdxStep[iiGlyph] > 0 && fIgnoreStepGlyphs)
+ continue; // leave step-glyphs as they are
+
+ int nWt = vnWeight[iiGlyph];
+ int dxwThis = vdxStretchLeft[iiGlyph] * vnMFactor[nWt]; // weighted stretch
+ dxwThis = min(dxwStretchPerGlyph, dxwThis);
+ int dxThis = dxwThis / vnMFactor[nWt]; // scale back to unweighted stretch
+ vdxWidth[iiGlyph] += dxThis;
+ dxStretchAchieved += dxThis;
+ vdxStretchLeft[iiGlyph] -= dxThis;
+ if (vdxStretchLeft[iiGlyph] > 0)
+ {
+ cUnits += nWt; // can do some more on the next round
+ cStretchable++;
+ }
+
+ // Keep track of how much we could adjust in either direction
+ // on the second round to handle steps.
+ if (vdxStep[iiGlyph] == 0)
+ {
+ dxNonStepMore += vdxStretchOrig[iiGlyph] - vdxWidth[iiGlyph];
+ dxNonStepLess += vdxWidth[iiGlyph];
+ }
+ }
+ dxStretchStillNeeded = dxStretchNeeded - dxStretchAchieved;
+ }
+
+ Assert(dxStretchAchieved <= dxStretchNeeded);
+
+ // Make adjustments so that the step values are honored.
+
+ if (fStep // there are some step-glyphs
+ && !fIgnoreStepGlyphs) // and we didn't already do this
+ {
+ // First make some basic adjustments, alternating making more and fewer steps
+ // and see how much that buys us.
+ int dxAdjusted = 0;
+ int cNonStepUnits = 0;
+ int cStretchableNonStep = 0;
+ bool fReloop = false;
+ for (iiGlyph = 0; iiGlyph < (signed)viGlyphs.size(); iiGlyph++)
+ {
+ if (vdxStep[iiGlyph] > 1)
+ {
+ int dxRem = vdxWidth[iiGlyph] % vdxStep[iiGlyph];
+ int dxFewer = vdxWidth[iiGlyph] - dxRem; // round down
+ int dxMore = dxFewer + vdxStep[iiGlyph]; // round up
+ int dxAdd = dxMore - vdxWidth[iiGlyph];
+ if (dxRem == 0)
+ { // Step is okay; no adjustment needed.
+ }
+ else if (
+ // this glyph has stretch available to make more steps:
+ (dxMore <= vdxStretchOrig[iiGlyph])
+ // and we need at least this much extra:
+ && (dxAdd + dxStretchAchieved <= dxStretchNeeded)
+ // and we still have enough slack in the non-step-glyphs:
+ && (dxNonStepLess - dxAdjusted - dxAdd > 0)
+ // and we don't have to adjust much to get to the next step
+ // (we're 75% of the way there):
+ && ((dxRem > ((vdxStep[iiGlyph] * 3) << 2))
+ // or this glyph has a high weight:
+ || (vnWeight[iiGlyph] > (nMaxWt >> 2))
+ // or we've removed a fair amount already:
+ || (dxAdjusted < (dxAdd * -2))
+ // or we don't have enough slack to remove more:
+ || (dxNonStepMore + dxAdjusted - dxRem < 0)))
+ {
+ // Use the next larger number of steps.
+ vdxWidth[iiGlyph] += dxAdd;
+ dxStretchAchieved += dxAdd;
+ dxAdjusted += dxAdd;
+ fReloop = true;
+ }
+ else
+ {
+ // Use the next smaller number of steps.
+ vdxWidth[iiGlyph] -= dxRem;
+ dxStretchAchieved -= dxRem;
+ dxAdjusted -= dxRem;
+ fReloop = true;
+ }
+ }
+ else if (vdxStep[iiGlyph] == 0)
+ {
+ cNonStepUnits += vnWeight[iiGlyph];
+ cStretchableNonStep++;
+ }
+ }
+
+ if (cNonStepUnits < cUnits || cStretchableNonStep < cStretchable)
+ {
+ // Even if no step-glyphs need to be adjusted, there is a different number
+ // of (non-step) glyphs to divide the space over. (The first time through
+ // there may not have been enough space per glyph to run the main loop,
+ // but now there may be.)
+ fReloop = true;
+ }
+
+ // Any left over adjustments need to be made by adjusting the items with
+ // step = 1 (ie, the glyphs that allow fine-grained adjustments).
+ // Do the main loop again, but only adjust the non-step glyphs.
+ if (fReloop)
+ {
+ cUnits = cNonStepUnits;
+ cStretchable = cStretchableNonStep;
+ fIgnoreStepGlyphs = true;
+ goto LMainLoop;
+ }
+ }
+
+ // Divide up any remainder that is due to rounding errors.
+
+ int dxRemainder = dxStretchNeeded - dxStretchAchieved;
+ if (0 < dxRemainder && dxRemainder < cStretchable)
+ {
+ if (cStretchable < (signed)viGlyphs.size() || fStep)
+ {
+ // Make sub-lists using the glyphs that are still stretchable.
+ std::vector<int> vdxStretchRem;
+ std::vector<int> vdxWidthRem;
+ std::vector<int> viiGlyphsRem;
+ for (iiGlyph = 0; iiGlyph < (signed)viGlyphs.size(); iiGlyph++)
+ {
+ if (vdxStretchLeft[iiGlyph] > 0 && vdxStep[iiGlyph] == 0)
+ {
+ viiGlyphsRem.push_back(iiGlyph);
+ vdxStretchRem.push_back(vdxStretchLeft[iiGlyph]);
+ vdxWidthRem.push_back(vdxWidth[iiGlyph]);
+ }
+ }
+ Assert(viiGlyphsRem.size() == size_t(cStretchable));
+ DistributeRemainder(vdxWidthRem, vdxStretchRem, dxRemainder, 0, vdxWidthRem.size(),
+ &dxStretchAchieved);
+ for (int iiiGlyph = 0; iiiGlyph < cStretchable; iiiGlyph++)
+ {
+ int iiGlyph = viiGlyphsRem[iiiGlyph];
+ vdxStretchLeft[iiGlyph] = vdxStretchRem[iiiGlyph];
+ vdxWidth[iiGlyph] = vdxWidthRem[iiiGlyph];
+ }
+ }
+ else
+ {
+ // All glyphs are still stretchable.
+ DistributeRemainder(vdxWidth, vdxStretchLeft, dxRemainder, 0, vdxWidth.size(),
+ &dxStretchAchieved);
+ }
+ }
+ // otherwise we assume left-over is cannot be handled
+
+ // Assign the widths to the glyphs.
+
+ for (iiGlyph = 0; iiGlyph < (signed)viGlyphs.size(); iiGlyph++)
+ {
+ int dxThis = vdxWidth[iiGlyph] * ((fShrinking) ? -1 : 1);
+ if (vdxStep[iiGlyph] == 0)
+ pgje->setGlyphAttribute(viGlyphs[iiGlyph], gr::kjgatWidth, 1, dxThis);
+ else
+ {
+ // Set the actual number of steps allowed. This is more accurate than
+ // setting the pixels and then converting to font em-units.
+ Assert(int(dxThis) % vdxStep[iiGlyph] == 0); // width divides evenly into steps
+ int cSteps = dxThis/vdxStep[iiGlyph];
+ pgje->setGlyphAttribute(viGlyphs[iiGlyph], gr::kjgatWidthInSteps, 1, cSteps);
+ }
+ }
+ }
+//LLeave:
+
+ if (dxStretchAchieved == dxStretchNeeded)
+ return gr::kresOk;
+ else
+ {
+#ifdef WIN32
+ wchar_t rgchw[20];
+ std::fill_n(rgchw, 20, 0);
+ _itow(dxStretchNeeded - dxStretchAchieved, rgchw, 10);
+ std::wstring strTmp(L"justification failed by ");
+ strTmp += rgchw;
+ strTmp += L" units (width needed = ";
+ std::fill_n(rgchw, 10, 0);
+ _itow(dxDesiredWidth, rgchw, 10);
+ strTmp += rgchw;
+ strTmp += L")\n";
+ OutputDebugString(strTmp.c_str());
+#else
+ Assert(fprintf(stderr,
+ "justification failed by %d units (width needed = %d)\n",
+ dxStretchNeeded - dxStretchAchieved, dxDesiredWidth));
+#endif
+ return gr::kresFalse;
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Distribute the remainder of the width evenly over the stretchable glyphs.
+----------------------------------------------------------------------------------------------*/
+void GrJustifier::DistributeRemainder(std::vector<int> & vdxWidths, std::vector<int> & vdxStretch,
+ int dx, int iiMin, int iiLim,
+ int * pdxStretchAchieved)
+{
+ if (dx == 0)
+ return;
+
+ Assert(dx <= iiLim - iiMin);
+ if (iiMin + 1 == iiLim)
+ {
+ int dxThis = min(dx, vdxStretch[iiMin]);
+ Assert(dxThis == 1); // we're never adjusting by more than 1, and the glyph should be
+ // adjustable by that much
+ vdxWidths[iiMin] += dxThis;
+ vdxStretch[iiMin] -= dxThis;
+ *pdxStretchAchieved += dxThis;
+ }
+ else
+ {
+ int iiMid = (iiLim + iiMin) / 2;
+ int dxHalf1 = dx / 2;
+ int dxHalf2 = dx - dxHalf1;
+ DistributeRemainder(vdxWidths, vdxStretch, dxHalf1, iiMin, iiMid, pdxStretchAchieved);
+ DistributeRemainder(vdxWidths, vdxStretch, dxHalf2, iiMid, iiLim, pdxStretchAchieved);
+ }
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the least common multiple of the given weights. Also return
+ a std::vector of multiplicative factors for each weight.
+----------------------------------------------------------------------------------------------*/
+int GrJustifier::Lcm(std::vector<int> & vnWeights, std::vector<int> & vnMFactors)
+{
+ // The basic algorithm is to factor each weight into primes, counting how many times
+ // each prime occurs in the factorization. The LCM is the multiple of the primes
+ // with each prime raised to maximum power encountered within the factorizations.
+ // Example: weights = [2, 4, 5, 10]
+ // 2 = 2^1
+ // 4 = 2^2
+ // 5 = 5^1
+ // 10 = 2^1 * 5^1
+ // So the LCM = 2^2 * 5^1 = 20.
+
+ std::vector<int> vnPowersForLcm;
+ int inPrime;
+ for (inPrime = 0; inPrime < g_cnPrimes; inPrime++)
+ vnPowersForLcm.push_back(0);
+
+ std::vector<int> vnPowersPerPrime;
+ vnPowersPerPrime.resize(g_cnPrimes);
+ int nWtMax = 1;
+ for (int inWt = 0; inWt < (signed)vnWeights.size(); inWt++)
+ {
+ int inMax = PrimeFactors(vnWeights[inWt], vnPowersPerPrime);
+ for (inPrime = 0; inPrime <= inMax; inPrime++)
+ vnPowersForLcm[inPrime] = max(vnPowersForLcm[inPrime], vnPowersPerPrime[inPrime]);
+ nWtMax = max(nWtMax, vnWeights[inWt]);
+ }
+
+ int nLcm = 1;
+ for (inPrime = 0; inPrime < g_cnPrimes; inPrime++)
+ nLcm = nLcm * NthPower(g_rgnPrimes[inPrime], vnPowersForLcm[inPrime]);
+
+ // For each weight, calculate the multiplicative factor. This is the value by which
+ // to multiply stretch values of this weight in order to get them properly proportioned.
+ // Note that weights that are not used will have bogus factors.
+ vnMFactors.push_back(nLcm); // bogus, for weight 0
+ for (int nWt = 1; nWt <= nWtMax; nWt++)
+ {
+ vnMFactors.push_back(nLcm / nWt);
+ }
+ return nLcm;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return a std::vector indicating the prime factors of n. The values of the std::vector correspond
+ to the primes in g_rgnPrimes: [2, 3, 5, 7, ...]; they are the powers to which each
+ prime should be raised. For instance, 20 = 2^2 * 5^1, so the result would contain
+ [2, 0, 1, 0, 0, ...].
+ The returned int is index of the highest prime in the list that we found.
+----------------------------------------------------------------------------------------------*/
+int GrJustifier::PrimeFactors(int n, std::vector<int> & vnPowersPerPrime)
+{
+ // Short-cut for common cases:
+ switch (n)
+ {
+ case 0:
+ case 1:
+ vnPowersPerPrime[0] = 0;
+ return 0;
+ case 2:
+ vnPowersPerPrime[0] = 1; // 2^1
+ return 0;
+ case 3:
+ vnPowersPerPrime[0] = 0;
+ vnPowersPerPrime[1] = 1; // 3^1
+ return 1;
+ case 4:
+ vnPowersPerPrime[0] = 2; // 2^2
+ return 0;
+ case 5:
+ vnPowersPerPrime[0] = 0;
+ vnPowersPerPrime[1] = 0;
+ vnPowersPerPrime[2] = 1; // 5^1
+ return 2;
+ case 6:
+ vnPowersPerPrime[0] = 1; // 2^1
+ vnPowersPerPrime[1] = 1; // 3^1
+ return 1;
+ case 7:
+ vnPowersPerPrime[0] = 0;
+ vnPowersPerPrime[1] = 0;
+ vnPowersPerPrime[2] = 0;
+ vnPowersPerPrime[3] = 1; // 7^1
+ return 3;
+ case 8:
+ vnPowersPerPrime[0] = 3; // 2^3
+ return 0;
+ case 9:
+ vnPowersPerPrime[0] = 0;
+ vnPowersPerPrime[1] = 2; // 3^2
+ return 1;
+ case 10:
+ vnPowersPerPrime[0] = 1; // 2^1
+ vnPowersPerPrime[1] = 0;
+ vnPowersPerPrime[2] = 1; // 5^1
+ return 2;
+ default:
+ break;
+ }
+
+ // Otherwise use the general algorithm: suck out prime numbers one by one,
+ // keeping track of how many we have of each.
+
+ int inPrime;
+ for (inPrime = 0; inPrime < g_cnPrimes; inPrime++)
+ vnPowersPerPrime[inPrime] = 0;
+
+ int nRem = n;
+ for (inPrime = 0; inPrime < g_cnPrimes; inPrime++)
+ {
+ while (nRem % g_rgnPrimes[inPrime] == 0)
+ {
+ vnPowersPerPrime[inPrime] += 1;
+ nRem = nRem / g_rgnPrimes[inPrime];
+ }
+ if (nRem == 1)
+ break;
+ }
+ Assert(n > 255 || nRem == 1);
+ return inPrime;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return nX raised to the nY power.
+----------------------------------------------------------------------------------------------*/
+int GrJustifier::NthPower(int nX, int nY)
+{
+ int nRet = 1;
+ for (int i = 0; i < nY; i++)
+ nRet *= nX;
+ return nRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Determine how much shrinking is possible for low-end justification.
+----------------------------------------------------------------------------------------------*/
+//GrResult GrJustifier::suggestShrinkAndBreak(GraphiteProcess * pgje,
+// int iGlyphMin, int iGlyphLim, int dxsWidth, LgLineBreak lbPref, LgLineBreak lbMax,
+// int * pdxShrink, LgLineBreak * plbToTry)
+//{
+// *pdxShrink = 0;
+// *plbToTry = lbPref;
+// return kresOk;
+//}
+
diff --git a/Build/source/libs/graphite/test/RegressionTest/GrJustifier.h b/Build/source/libs/graphite/test/RegressionTest/GrJustifier.h
new file mode 100644
index 00000000000..ea5fc21bec9
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/GrJustifier.h
@@ -0,0 +1,82 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2003 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: GrJustifier.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ A default justification agent for Graphite.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+#pragma once
+#ifndef GRJUSTIFIER_INCLUDED
+#define GRJUSTIFIER_INCLUDED
+
+/*----------------------------------------------------------------------------------------------
+ Class: GrJustifier
+ This class provides a basic justification/layout algorithm for applications that use
+ Graphite.
+----------------------------------------------------------------------------------------------*/
+class GrJustifier : public gr::IGrJustifier
+{
+public:
+ // Constructor:
+ GrJustifier();
+ ~GrJustifier();
+
+/*
+ virtual long IncRefCount(void)
+ {
+ return InterlockedIncrement(&m_cref);
+ }
+ virtual long DecRefCount(void)
+ {
+ long cref = InterlockedDecrement(&m_cref);
+ if (cref == 0) {
+ m_cref = 1;
+ delete this;
+ }
+ return cref;
+ }
+*/
+
+ virtual gr::GrResult adjustGlyphWidths(gr::GraphiteProcess * pfgje,
+ int iGlyphMin, int iGlyphLim,
+ float dxCurrWidth, float dxDesiredWidth);
+
+ //virtual GrResult suggestShrinkAndBreak(GraphiteProcess * pfgjwe,
+ // int iGlyphMin, int iGlyphLim, int dxsWidth, LgLineBreak lbPref, LgLineBreak lbMax,
+ // int * pdxShrink, LgLineBreak * plbToTry);
+
+ // Return a Graphite-compatible justifier that can be stored in a Graphite segment.
+ // TODO: remove
+ //virtual void JustifierObject(IGrJustifier ** ppgjus)
+ //{
+ // *ppgjus = this;
+ //}
+
+ // When a segment is being destroyed, there is nothing to do, since this is a pointer
+ // to an object that is allocated elsewhere.
+ // TODO: remove
+ //virtual void DeleteJustifierPtr()
+ //{
+ //}
+
+protected:
+ long m_cref;
+
+ gr::GraphiteProcess * m_pgreng;
+
+ void DistributeRemainder(std::vector<int> & vdxWidths, std::vector<int> & vdxStretch,
+ int dx, int iiMin, int iiLim,
+ int * pdxStretchAchieved);
+ int Lcm(std::vector<int> & vnWeights, std::vector<int> & vnMFactors);
+ int PrimeFactors(int n, std::vector<int> & vnPowersPerPrime);
+ int NthPower(int nX, int nY);
+};
+
+
+#endif // !GRJUSTIFIER_INCLUDED
diff --git a/Build/source/libs/graphite/test/RegressionTest/Makefile.am b/Build/source/libs/graphite/test/RegressionTest/Makefile.am
new file mode 100644
index 00000000000..fe59b65fbaa
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/Makefile.am
@@ -0,0 +1,38 @@
+AUTOMAKE_OPTIONS = 1.6
+
+EXTRA_DIST = \
+ burmeseText.wpx \
+ romanText.wpx \
+ xlineText.wpx \
+ grtest_arabic.ttf \
+ grtest_badVersion.ttf \
+ grtest_badCmap.ttf \
+ grtest_burmese.ttf \
+ grtest_roman.ttf \
+ grtest_taiviet.ttf \
+ grtest_xline.ttf \
+ xline.gdl \
+ Makefile.vc \
+ makedebug.bat \
+ readme.txt
+
+noinst_PROGRAMS = regression-test
+
+AM_CPPFLAGS = -I$(top_srcdir)/include/graphite
+
+regression_test_LDFLAGS = -L$(top_builddir)/src -lgraphite
+
+regression_test_SOURCES = \
+ main.h \
+ stdafx.cpp stdafx.h \
+ RegressionTest.cpp \
+ TestCase.cpp TestCase.h \
+ RtTextSrc.h \
+ SimpleTextSrc.cpp SimpleTextSrc.h \
+ GrJustifier.cpp GrJustifier.h
+
+check-local: regression-test
+ $(top_builddir)/test/RegressionTest/regression-test -p $(srcdir)
+
+dist-hook:
+ rm -f grregtest.log tracelog.txt
diff --git a/Build/source/libs/graphite/test/RegressionTest/Makefile.in b/Build/source/libs/graphite/test/RegressionTest/Makefile.in
new file mode 100644
index 00000000000..547e7dfa408
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/Makefile.in
@@ -0,0 +1,478 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = regression-test$(EXEEXT)
+subdir = test/RegressionTest
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_regression_test_OBJECTS = stdafx.$(OBJEXT) RegressionTest.$(OBJEXT) \
+ TestCase.$(OBJEXT) SimpleTextSrc.$(OBJEXT) \
+ GrJustifier.$(OBJEXT)
+regression_test_OBJECTS = $(am_regression_test_OBJECTS)
+regression_test_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(regression_test_SOURCES)
+DIST_SOURCES = $(regression_test_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LSB_RELEASE = @LSB_RELEASE@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+REL_CODENAME = @REL_CODENAME@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZEOF_WCHAR_T = @SIZEOF_WCHAR_T@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+AUTOMAKE_OPTIONS = 1.6
+EXTRA_DIST = \
+ burmeseText.wpx \
+ romanText.wpx \
+ xlineText.wpx \
+ grtest_arabic.ttf \
+ grtest_badVersion.ttf \
+ grtest_badCmap.ttf \
+ grtest_burmese.ttf \
+ grtest_roman.ttf \
+ grtest_xline.ttf \
+ xline.gdl \
+ Makefile.vc \
+ makedebug.bat \
+ readme.txt
+
+AM_CPPFLAGS = -I$(top_srcdir)/include/graphite
+regression_test_LDFLAGS = -L$(top_builddir)/src -lgraphite
+regression_test_SOURCES = \
+ main.h \
+ stdafx.cpp stdafx.h \
+ RegressionTest.cpp \
+ TestCase.cpp TestCase.h \
+ RtTextSrc.h \
+ SimpleTextSrc.cpp SimpleTextSrc.h \
+ GrJustifier.cpp GrJustifier.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/RegressionTest/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/RegressionTest/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+regression-test$(EXEEXT): $(regression_test_OBJECTS) $(regression_test_DEPENDENCIES)
+ @rm -f regression-test$(EXEEXT)
+ $(CXXLINK) $(regression_test_LDFLAGS) $(regression_test_OBJECTS) $(regression_test_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GrJustifier.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RegressionTest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SimpleTextSrc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TestCase.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdafx.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-local
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \
+ clean-generic clean-libtool clean-noinstPROGRAMS ctags \
+ dist-hook distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am
+
+
+check-local: regression-test
+ $(top_builddir)/test/RegressionTest/regression-test -p $(srcdir)
+
+dist-hook:
+ rm -f grregtest.log tracelog.txt
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/libs/graphite/test/RegressionTest/Makefile.vc b/Build/source/libs/graphite/test/RegressionTest/Makefile.vc
new file mode 100644
index 00000000000..ff75d7e9e16
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/Makefile.vc
@@ -0,0 +1,121 @@
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+TARGET=RegressionTest
+REGT_SRC=.
+REGT_RES=.
+REGT_APPLIB=..\..\..\examples\applib
+
+
+!IF "$(CFG)" == ""
+CFG=DEBUG
+!ENDIF
+
+!IF "$(CFG)" == "RELEASE"
+
+OUTDIR=.\release
+INTDIR=.\release_temp
+
+all : "$(OUTDIR)\$(TARGET).exe"
+
+clean :
+ @- rd /s/q $(INTDIR)
+
+realclean : clean
+ @- rd /s/q $(OUTDIR)
+
+CPP_PROJ=/nologo /MT /W3 /GR /GX /O2 /I "." /I "../../examples/applib" /I "../../include" /I "../../include/graphite" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /c
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\$(TARGET).res" /d "NDEBUG"
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib graphite.lib /nologo /subsystem:console /incremental:no /machine:I386 /out:"$(OUTDIR)\$(TARGET).exe" /libpath:"..\..\release"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\$(TARGET).bsc"
+
+!ELSEIF "$(CFG)" == "DEBUG"
+
+OUTDIR=.\debug
+INTDIR=.\debug_temp
+
+all : "$(OUTDIR)\$(TARGET).exe" "$(OUTDIR)\$(TARGET).bsc"
+
+clean :
+ @- rd /s/q $(INTDIR)
+
+realclean : clean
+ @- rd /s/q $(OUTDIR)
+
+CPP_PROJ=/nologo /MTd /W3 /Gm /GR /GX /GZ /ZI /Od /I "." /I "../../examples/applib" /I "../../include" /I "../../include/graphite" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /FR"$(INTDIR)\\" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /c
+RSC_PROJ=/l 0x409 /fo"$(INTDIR)\$(TARGET).res" /d "_DEBUG"
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib graphite.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\$(TARGET).pdb" /debug /machine:I386 /out:"$(OUTDIR)\$(TARGET).exe" /libpath:"..\..\debug"
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\$(TARGET).bsc"
+
+!ENDIF
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+"$(INTDIR)" :
+ if not exist "$(INTDIR)/$(NULL)" mkdir "$(INTDIR)"
+
+{$(REGT_SRC)}.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(REGT_SRC)}.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(REGT_APPLIB)}.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+{$(REGT_APPLIB)}.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+
+
+CPP=cl.exe
+RSC=rc.exe
+BSC32=bscmake.exe
+LINK32=link.exe
+
+LINK32_OBJS= \
+ "$(INTDIR)\RegressionTest.obj" \
+ "$(INTDIR)\TestCase.obj" \
+ "$(INTDIR)\GrJustifier.obj" \
+ "$(INTDIR)\SimpleTextSrc.obj" \
+
+# "$(INTDIR)\RegressionTest.res"
+
+"$(OUTDIR)\$(TARGET).exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+BSC32_SBRS= \
+ "$(INTDIR)\RegressionTest.sbr" \
+ "$(INTDIR)\TestCase.sbr" \
+ "$(INTDIR)\GrJustifier.sbr" \
+ "$(INTDIR)\SimpleTextSrc.sbr" \
+#
+
+"$(OUTDIR)\$(TARGET).bsc" : "$(OUTDIR)" $(BSC32_SBRS)
+ $(BSC32) @<<
+ $(BSC32_FLAGS) $(BSC32_SBRS)
+<<
+
+"$(INTDIR)\RegressionTest.obj" "$(INTDIR)\RegressionTest.sbr" : "$(REGT_SRC)\RegressionTest.cpp" "$(INTDIR)"
+"$(INTDIR)\TestCase.obj" "$(INTDIR)\TestCase.sbr" : "$(REGT_SRC)\TestCase.cpp" "$(INTDIR)"
+"$(INTDIR)\GrJustifier.obj" "$(INTDIR)\GrJustifier.sbr" : "$(REGT_APPLIB)\GrJustifier.cpp" "$(INTDIR)"
+"$(INTDIR)\SimpleTextSrc.obj" "$(INTDIR)\SimpleTextSrc.sbr" : "$(REGT_APPLIB)\SimpleTextSrc.cpp" "$(INTDIR)"
+
+
+"$(INTDIR)\$(TARGET).res" : "$(REGT_RES)\$(TARGET).rc" "$(INTDIR)"
+ $(RSC) $(RSC_PROJ) "$(REGT_RES)\$(TARGET).rc"
+
diff --git a/Build/source/libs/graphite/test/RegressionTest/RegressionTest.cpp b/Build/source/libs/graphite/test/RegressionTest/RegressionTest.cpp
new file mode 100644
index 00000000000..1d361a4f3cd
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/RegressionTest.cpp
@@ -0,0 +1,748 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2004 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: RegressionTest.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Main file for the Graphite regression test program.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+#include "main.h"
+#include "MemoryUsage.h"
+#include <cstring>
+
+//:>********************************************************************************************
+//:> Global variables
+//:>********************************************************************************************
+std::ofstream g_strmLog; // log file output stream
+std::ofstream g_strmTrace; // debugger trace for selected tests
+std::ofstream g_strmMemUsage;
+
+int g_errorCount;
+
+// HDC g_hdc; // device-context for bogus window on which to do drawing
+
+bool g_debugMode = false;
+bool g_silentMode = false;
+
+int g_itcaseStart = 0; // adjust to skip to a certain test
+
+SegmentMemoryUsage g_smu;
+FontMemoryUsage g_fmu;
+
+std::string g_fontPath = ".";
+#ifdef _WIN32
+#define PATH_SEP "\\"
+#else
+#define PATH_SEP "/"
+#endif
+
+// Forward defintions.
+int WriteLog(int);
+void CopyWstringToUtf16(std::wstring textStr, gr::utf16 * utf16Buf, int bufSize);
+
+//:>********************************************************************************************
+//:> Functions
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Main function.
+----------------------------------------------------------------------------------------------*/
+
+int main(int argc, char* argv[])
+{
+#ifdef _WIN32
+ _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
+#endif // WIN32
+
+ int iargc = 1;
+ while (iargc < argc)
+ {
+ if ((strcmp(argv[iargc], "/d") == 0) || (strcmp(argv[iargc], "-d") == 0))
+ {
+ g_debugMode = true;
+ }
+ if ((strcmp(argv[iargc], "/s") == 0) || (strcmp(argv[iargc], "-s") == 0))
+ {
+ g_silentMode = true;
+ }
+ if ((strcmp(argv[iargc], "/p") == 0) || (strcmp(argv[iargc], "-p") == 0))
+ {
+ iargc++;
+ if (iargc < argc)
+ {
+ g_fontPath = argv[iargc];
+ }
+ }
+ iargc++;
+ }
+
+ if (!g_silentMode)
+ {
+ std::cout << "Graphite Regression Test\n";
+ std::cout << "Files path is " << g_fontPath << "\n\n";
+ if (g_debugMode)
+ std::cout << "In debug mode\n";
+ }
+
+ // Start a new log.
+ g_strmLog.open("grregtest.log");
+ if (g_strmLog.fail())
+ {
+ std::cout << "Unable to open log file.";
+ return -1;
+ }
+
+ g_errorCount = 0;
+
+// g_hdc = ::GetDC(NULL);
+
+ WriteToLog("Graphite Regression Test\n\n");
+
+ // Initialize the tracelog file.
+ g_strmTrace.open("tracelog.txt");
+ g_strmTrace.close();
+
+ TestCase * ptcaseList = NULL;
+ int numberOfTests = TestCase::SetupTests(&ptcaseList);
+
+ RunTests(numberOfTests, ptcaseList);
+
+ WriteToLog("\n==============================================\n");
+ g_strmLog << "\n\nTOTAL NUMBER OF ERRORS: " << g_errorCount << "\n";
+ if (!g_silentMode)
+ std::cout << "\n\nTOTAL NUMBER OF ERRORS: " << g_errorCount << "\n";
+
+ g_strmLog.close();
+
+ ////EngineInstance::DeleteEngines();
+ TestCase::DeleteTests();
+
+// ::ReleaseDC(NULL, g_hdc);
+
+ // Output segment memory usage information.
+ //g_strmMemUsage.open("SegMemoryUsage.log");
+ //g_smu.prettyPrint(g_strmMemUsage);
+ //g_strmMemUsage.close();
+
+ return g_errorCount;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Run the tests.
+----------------------------------------------------------------------------------------------*/
+void RunTests(int numberOfTests, TestCase * ptcaseList)
+{
+ Segment * psegPrev = NULL;
+ RtTextSrc * ptsrcPrev = NULL;
+ Segment * psegRet = NULL;
+ RtTextSrc * ptsrcRet = NULL;
+
+ for (int itcase = g_itcaseStart; itcase < numberOfTests; itcase++)
+ {
+ TestCase * ptcase = ptcaseList + itcase;
+ WriteToLog("\n----------------------------------------------\n");
+ WriteToLog("Test: ");
+
+ if (!g_silentMode)
+ std::cout << "Test " << ptcase->TestName() << "...";
+ WriteToLog(ptcase->TestName());
+ WriteToLog("\n");
+
+ RunOneTestCase(ptcase, psegPrev, &psegRet, &ptsrcRet);
+
+ delete psegPrev;
+ delete ptsrcPrev;
+ psegPrev = psegRet;
+ ptsrcPrev = ptsrcRet;
+ psegRet = NULL;
+ ptsrcRet = NULL;
+ }
+
+ delete psegPrev;
+ delete ptsrcPrev;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Run a single test case.
+----------------------------------------------------------------------------------------------*/
+int RunOneTestCase(TestCase * ptcase, Segment * psegPrev, Segment ** ppsegRet, RtTextSrc ** pptsrcRet)
+{
+ if (ptcase->Skip())
+ {
+ std::cout << "\nskipped\n";
+ g_strmLog << "skipping\n";
+ *ppsegRet = NULL;
+ return 0;
+ }
+
+#ifdef _WIN32
+ // Break into the debugger if requested.
+ if (ptcase->RunDebugger() && ::IsDebuggerPresent())
+ {
+ ::DebugBreak();
+ }
+#endif
+
+ int errorCount = 0;
+
+ gr::utf16 text[1024];
+ CopyWstringToUtf16(ptcase->Text(), text, 1024);
+
+ *ppsegRet = NULL;
+ SegmentPainter * ppainter = NULL;
+ std::pair<GlyphIterator, GlyphIterator> iterPair;
+ GlyphIterator gitBegin;
+ GlyphIterator gitEnd;
+
+ //LOGFONT lf;
+ //memset(&lf, '\0', sizeof(LOGFONT));
+ //lf.lfCharSet = DEFAULT_CHARSET;
+ //lf.lfHeight = (signed(ptcase->FontSize()) * -96) / 72; // 96 = resolution, 72 = points per inch
+ //lf.lfWeight = 400;
+ //lf.lfItalic = FALSE;
+ //wcscpy(lf.lfFaceName, ptcase->FontName().data());
+ //HDC hdc = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
+ //HFONT hfont = CreateFontIndirect(&lf);
+ //HFONT hfontOld = (HFONT)::SelectObject(hdc, hfont); // restore before destroying the DC.
+ //WinFont winfont(hdc);
+
+ FileFont font(g_fontPath + PATH_SEP + ptcase->FontFile(), float(signed(ptcase->FontSize())), 96, 96);
+
+ if (!font.isValid())
+ {
+ OutputError(ptcase, std::string("ERROR: reading font file: \"") + ptcase->FontFile() + "\" at path \"" + g_fontPath + "\"; remaining tests skipped");
+ *ppsegRet = NULL;
+ errorCount++;
+ return WriteLog(errorCount);
+ }
+
+ // Set up the text source.
+ *pptsrcRet = new RtTextSrc(&(text[0]));
+ RtTextSrc * ptsrc = *pptsrcRet;
+ (*pptsrcRet)->setFeatures(ptcase->Features());
+ (*pptsrcRet)->setRightToLeft(ptcase->Rtl());
+
+ // Generate a segment.
+ LayoutEnvironment layout;
+ layout.setDumbFallback(ptcase->DumbFallback());
+ layout.setStartOfLine(true);
+ layout.setRightToLeft(ptcase->ParaRtl());
+ if (ptcase->InitWithPrevSeg())
+ layout.setPrevSegment(psegPrev);
+
+ if (ptcase->TraceLog())
+ {
+ g_strmTrace.open("tracelog.txt", std::ios::app);
+ g_strmTrace << "Test: " << ptcase->TestName() << "\n\n";
+ layout.setLoggingStream(&g_strmTrace);
+ }
+
+ try
+ {
+ if (ptcase->AvailWidth() < 10000)
+ {
+ layout.setBestBreak(ptcase->PrefBreak());
+ layout.setWorstBreak(ptcase->WorstBreak());
+ layout.setTrailingWs(ptcase->Twsh());
+ *ppsegRet = new LineFillSegment(&font, ptsrc, &layout,
+ ptcase->FirstChar(), ptsrc->getLength(),
+ (float)ptcase->AvailWidth(),
+ ptcase->Backtrack());
+ }
+ else
+ {
+ *ppsegRet = new RangeSegment(&font, ptsrc, &layout);
+ }
+ }
+ catch (...)
+ {
+ if (!ptcase->NoSegment())
+ {
+ if (ptcase->BadFont() && !ptcase->DumbFallback())
+ // Weird situation.
+ OutputError(ptcase, "ERROR: bad font with no fallback, yet a segment was expected???");
+ else
+ OutputError(ptcase, "ERROR: generating segment; remaining tests skipped");
+ errorCount++;
+ }
+ // else segment creation failed as expected
+
+ // NB: failure to create a segment due to throwing an exception seems to result in a memory
+ // leak--the FontCache object FontFace::s_pFontCache does not get deleted.
+
+ *ppsegRet = NULL;
+ return WriteLog(errorCount);
+ }
+
+ if (ptcase->TraceLog())
+ {
+ g_strmTrace << "\n\n*********************************************************************************************************************\n\n";
+ g_strmTrace.close();
+ }
+
+ if ((*ppsegRet) && (*ppsegRet)->segmentTermination() == kestNothingFit)
+ {
+ delete *ppsegRet;
+ *ppsegRet = NULL;
+ }
+
+ if ((*ppsegRet) == NULL && !ptcase->NoSegment())
+ {
+ OutputError(ptcase, "ERROR: segment not created; remaining tests skipped");
+ errorCount++;
+ return WriteLog(errorCount);
+ }
+ else if (ptcase->NoSegment())
+ {
+ if (*ppsegRet)
+ {
+ OutputError(ptcase, "ERROR: segment created when none expected");
+ errorCount++;
+ }
+ delete *ppsegRet;
+ *ppsegRet = NULL;
+ return WriteLog(errorCount);
+ }
+
+ Segment * pseg = *ppsegRet;
+
+ pseg->calculateMemoryUsage(g_smu);
+
+ // Calculate and output font memory usage.
+ //g_fmu = Font::calculateMemoryUsage();
+ //g_strmMemUsage.open("fontMemoryUsage.log");
+ //g_fmu.prettyPrint(g_strmMemUsage);
+ //g_strmMemUsage.close();
+
+ // Test results.
+ int segMin = pseg->startCharacter();
+ int segLim = pseg->stopCharacter();
+ if ((segLim - segMin) != ptcase->CharCount())
+ {
+ OutputErrorWithValues(ptcase, "ERROR: number of characters in segment", -1,
+ (segLim - segMin), ptcase->CharCount());
+ errorCount++;
+ }
+
+ int segWidth = (int)pseg->advanceWidth();
+ if (segWidth != ptcase->SegWidth())
+ {
+ OutputErrorWithValues(ptcase, "ERROR: width of segment", -1,
+ segWidth, ptcase->SegWidth());
+ errorCount++;
+ }
+
+ iterPair = pseg->glyphs();
+ gitBegin = iterPair.first;
+ gitEnd = iterPair.second;
+ int cGlyphs = gitEnd - gitBegin;
+ if (cGlyphs != ptcase->GlyphCount())
+ {
+ OutputErrorWithValues(ptcase, "ERROR: number of glyphs", -1,
+ cGlyphs, ptcase->GlyphCount());
+ errorCount++;
+ }
+ else
+ {
+ GlyphIterator gitThis = gitBegin;
+ for (int iglyph = 0; gitThis != gitEnd; ++gitThis, iglyph++)
+ {
+ if ((*gitThis).glyphID() != ptcase->GlyphID(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: glyph id ", iglyph,
+ (*gitThis).glyphID(), ptcase->GlyphID(iglyph));
+ errorCount++;
+ }
+ if (int((*gitThis).origin()) != ptcase->XPos(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: glyph x-position ", iglyph,
+ int((*gitThis).origin()), ptcase->XPos(iglyph));
+ errorCount++;
+ }
+ if (int((*gitThis).yOffset()) != ptcase->YPos(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: glyph y-position ", iglyph,
+ int((*gitThis).yOffset()), ptcase->YPos(iglyph));
+ errorCount++;
+ }
+ if (int((*gitThis).advanceWidth()) != ptcase->AdvWidth(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: advance width ", iglyph,
+ int((*gitThis).advanceWidth()), ptcase->AdvWidth(iglyph));
+ errorCount++;
+ }
+ if (ptcase->BbTests())
+ {
+ gr::Rect rectBb = (*gitThis).bb();
+ if (int(rectBb.left) != ptcase->BbLeft(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: bb left ", iglyph,
+ int(rectBb.left), ptcase->BbLeft(iglyph));
+ errorCount++;
+ }
+ if (int(rectBb.right) != ptcase->BbRight(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: bb right ", iglyph,
+ int(rectBb.right), ptcase->BbRight(iglyph));
+ errorCount++;
+ }
+ if (int(rectBb.top) != ptcase->BbTop(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: bb top ", iglyph,
+ int(rectBb.top), ptcase->BbTop(iglyph));
+ errorCount++;
+ }
+ if (int(rectBb.bottom) != ptcase->BbBottom(iglyph))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: bb bottom ", iglyph,
+ int(rectBb.bottom), ptcase->BbBottom(iglyph));
+ errorCount++;
+ }
+ }
+ }
+ }
+
+ ppainter = new SegmentNonPainter(pseg);
+
+ if (segLim == ptcase->CharCount())
+ {
+ for (int ichar = 0; ichar < segLim; ichar++)
+ {
+ LgIpValidResult ipvr = ppainter->isValidInsertionPoint(ichar);
+ if ((ipvr == kipvrOK && !ptcase->InsPtFlag(ichar)) // TODO: handle kipvrUnknown
+ || (ipvr != kipvrOK && ptcase->InsPtFlag(ichar)))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: valid insertion point ", ichar,
+ (ipvr == kipvrOK), ptcase->InsPtFlag(ichar));
+ errorCount++;
+ }
+ }
+ }
+
+ int c2gi = 0;
+ while (c2gi < ptcase->CharToGlyphCount())
+ {
+ int ichar = ptcase->CharToGlyphItem(c2gi++);
+ int glyphCount = ptcase->CharToGlyphItem(c2gi++);
+ std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> glyphSet = pseg->charToGlyphs(ichar);
+ gr::GlyphSetIterator gitStart = glyphSet.first;
+ gr::GlyphSetIterator gitStop = glyphSet.second;
+ if ((gitStop - gitStart) != glyphCount)
+ {
+ OutputErrorWithValues(ptcase, "ERROR: number of glyphs for char ", ichar,
+ gitStop - gitStart, glyphCount);
+ errorCount++;
+ c2gi += glyphCount;
+ }
+ else
+ {
+ GlyphSetIterator glyphLp = glyphSet.first;
+ for (int ig = 0; ig < glyphCount; ig++)
+ {
+ if (static_cast<int>((*glyphLp).logicalIndex()) != ptcase->CharToGlyphItem(c2gi))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: glyph for char ", ichar,
+ (*glyphLp).logicalIndex(), ptcase->CharToGlyphItem(c2gi));
+ errorCount++;
+ }
+ c2gi++;
+ glyphLp++;
+ }
+ }
+ }
+
+ int att = 0;
+ while (att < ptcase->AttachedGlyphCount())
+ {
+ int iglyph = ptcase->AttachedGlyphItem(att++);
+ if (iglyph > cGlyphs)
+ {
+ OutputError(ptcase, "ERROR: non-existent glyph in attachment test ", iglyph);
+ errorCount++;
+ att++;
+ att += ptcase->AttachedGlyphItem(att) + 1;
+ continue;
+ }
+
+ GlyphIterator gitThis = gitBegin + iglyph;
+ GlyphIterator gitBase = gitThis->attachedClusterBase();
+ int ibase = gitBase->logicalIndex();
+ if (ibase != ptcase->AttachedGlyphItem(att))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: attachment base for glyph ", iglyph,
+ ibase, ptcase->AttachedGlyphItem(att));
+ errorCount++;
+ }
+ att++;
+ std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> glyphSet = gitThis->attachedClusterGlyphs();
+ gr::GlyphSetIterator gitStart = glyphSet.first;
+ gr::GlyphSetIterator gitStop = glyphSet.second;
+ int glyphCount = ptcase->AttachedGlyphItem(att++);
+ if ((gitStop - gitStart) != glyphCount)
+ {
+ OutputErrorWithValues(ptcase, "ERROR: number of attachments for glyph ", iglyph,
+ gitStop - gitStart, glyphCount);
+ errorCount++;
+ att += glyphCount;
+ }
+ else
+ {
+ GlyphSetIterator glyphLp = glyphSet.first;
+ for (int ig = 0; ig < glyphCount; ig++)
+ {
+ if (static_cast<int>((*glyphLp).logicalIndex()) != ptcase->AttachedGlyphItem(att))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: attachment for glyph ", iglyph,
+ (*glyphLp).logicalIndex(), ptcase->AttachedGlyphItem(att));
+ errorCount++;
+ }
+ att++;
+ glyphLp++;
+ }
+ }
+ }
+
+ for (int iclicktest = 0; iclicktest < ptcase->NumberOfClickTests(); iclicktest++)
+ {
+ gr::Point ptClick;
+ ptClick.x = static_cast<float>(ptcase->XClick(iclicktest));
+ ptClick.y = static_cast<float>(ptcase->YClick(iclicktest));
+ int charIndex;
+ bool assocPrev;
+ ppainter->pointToChar(ptClick, &charIndex, &assocPrev);
+ if (charIndex != ptcase->ClickCharIndex(iclicktest))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: char index from click ", iclicktest,
+ charIndex, ptcase->ClickCharIndex(iclicktest));
+ errorCount++;
+ continue;
+ }
+ if (assocPrev != ptcase->ClickAssocPrev(iclicktest))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: assoc-prev from click ", iclicktest,
+ assocPrev, ptcase->ClickAssocPrev(iclicktest));
+ errorCount++;
+ }
+ gr::Rect rect1, rect2;
+ ppainter->positionsOfIP(charIndex, assocPrev,
+ false, &rect1, &rect2);
+ if (ptcase->Sel1Top(iclicktest) == TestCase::kAbsent)
+ {
+ if (rect1.top != 0 || rect1.bottom != 0 || rect1.left != 0 || rect1.right != 0)
+ {
+ OutputError(ptcase, "ERROR: IP prim rect found ", iclicktest);
+ errorCount++;
+ }
+ }
+ else if (rect1.top == 0 && rect1.bottom == 0 && rect1.left == 0 && rect1.right == 0)
+ {
+ OutputError(ptcase, "ERROR: IP prim rect not found ", iclicktest);
+ errorCount++;
+ }
+ else
+ {
+ if ((int)rect1.top != ptcase->Sel1Top(iclicktest))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: IP prim rect top ", iclicktest,
+ int(rect1.top), ptcase->Sel1Top(iclicktest));
+ errorCount++;
+ }
+ if ((int)rect1.bottom != ptcase->Sel1Bottom(iclicktest))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: IP prim rect bottom ", iclicktest,
+ int(rect1.bottom), ptcase->Sel1Bottom(iclicktest));
+ errorCount++;
+ }
+ if ((int)rect1.left != ptcase->Sel1Left(iclicktest))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: IP prim rect left ", iclicktest,
+ int(rect1.left), ptcase->Sel1Left(iclicktest));
+ errorCount++;
+ }
+ }
+
+ if (ptcase->Sel2Top(iclicktest) == TestCase::kAbsent)
+ {
+ if (rect2.top != 0 || rect2.bottom != 0 || rect2.left != 0 || rect2.right != 0)
+ {
+ OutputError(ptcase, "ERROR: IP sec rect found when not expected ", iclicktest);
+ errorCount++;
+ }
+ }
+ else if (rect2.top == 0 && rect2.bottom == 0 && rect2.left == 0 && rect2.right == 0)
+ {
+ OutputError(ptcase, "ERROR: IP sec rect not found ", iclicktest);
+ errorCount++;
+ }
+ else
+ {
+ if ((int)rect2.top != ptcase->Sel2Top(iclicktest))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: IP sec rect top ", iclicktest,
+ int(rect2.top), ptcase->Sel2Top(iclicktest));
+ errorCount++;
+ }
+ if ((int)rect2.bottom != ptcase->Sel2Bottom(iclicktest))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: IP sec rect bottom ", iclicktest,
+ int(rect2.bottom), ptcase->Sel2Bottom(iclicktest));
+ errorCount++;
+ }
+ if ((int)rect2.left != ptcase->Sel2Left(iclicktest))
+ {
+ OutputErrorWithValues(ptcase, "ERROR: IP sec rect left ", iclicktest,
+ int(rect2.left), ptcase->Sel2Left(iclicktest));
+ errorCount++;
+ }
+ }
+ }
+
+ ////if (contextBlockOut != ptcase->OutputContextBlockSize())
+ ////{
+ //// OutputErrorWithValues(ptcase, "ERROR: output context block size ", -1,
+ //// (int)contextBlockOut, (int)ptcase->OutputContextBlockSize());
+ //// errorCount++;
+ ////}
+ ////else if (!ptcase->CompareContextBlock(pContextBlockOut))
+ ////{
+ //// OutputError(ptcase, "ERROR: output context block");
+ //// errorCount++;
+ ////}
+ delete ppainter;
+
+ return WriteLog(errorCount);
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Write the error count to the log.
+----------------------------------------------------------------------------------------------*/
+int WriteLog(int errorCount)
+{
+ WriteToLog("\nError count = ");
+ WriteToLog(errorCount);
+ WriteToLog("\n");
+
+ if (!g_silentMode)
+ {
+ if (errorCount == 0)
+ std::cout << "ok\n";
+ else
+ std::cout << "FAILED\n";
+ }
+
+
+ //delete pseg; // don't delete these; they are passed back to the calling method
+ //delete ptsrc;
+
+ // Delete device context
+ //DeleteObject(SelectObject(hdc, hfontOld));
+ //DeleteDC(hdc);
+
+ g_errorCount += errorCount;
+ return errorCount;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Copy a std::wstring (whose bytes can be of various sizes on different platforms)
+ to a buffer of UTF16.
+----------------------------------------------------------------------------------------------*/
+void CopyWstringToUtf16(std::wstring textStr, gr::utf16 * utf16Buf, int bufSize)
+{
+ std::fill_n(utf16Buf, bufSize, 0);
+ int cc = textStr.length();
+ for (int i = 0; i < cc; i++)
+ utf16Buf[i] = textStr[i];
+}
+
+/*----------------------------------------------------------------------------------------------
+ Output information about an error.
+----------------------------------------------------------------------------------------------*/
+void OutputError(TestCase * ptcase, std::string strErr, int i)
+{
+ OutputErrorAux(ptcase, strErr, i, false, 0, 0);
+}
+
+void OutputErrorWithValues(TestCase * ptcase, std::string strErr, int i,
+ int valueFound, int valueExpected)
+{
+ OutputErrorAux(ptcase, strErr, i, true, valueFound, valueExpected);
+}
+
+void OutputErrorAux(TestCase * ptcase, std::string strErr, int i,
+ bool showValues, int valueFound, int valueExpected)
+{
+// if (g_debugMode)
+// ::DebugBreak();
+
+ if (!g_silentMode)
+ {
+ //std::cout << ptcase->TestName() << ": ";
+ std::cout << strErr;
+ if (i > -1)
+ {
+ std::cout << "[" << i << "]";
+ }
+ std::cout << "\n ";
+ }
+
+ WriteToLog(strErr, i, showValues, valueFound, valueExpected);
+
+ WriteToLog("\n");
+}
+
+/*----------------------------------------------------------------------------------------------
+ Write some text to the log file.
+----------------------------------------------------------------------------------------------*/
+bool WriteToLog(std::string str, int i)
+{
+ if (g_strmLog.fail())
+ {
+ std::cout << "Error opening log file.";
+ return false;
+ }
+ g_strmLog << str;
+ if (i > -1)
+ g_strmLog << "[" << i << "]";
+ g_strmLog.flush();
+ return true;
+}
+
+bool WriteToLog(std::string str, int i,
+ bool showValues, int valueFound, int valueExpected)
+{
+ if (g_strmLog.fail())
+ {
+ std::cout << "Error opening log file.";
+ return false;
+ }
+ g_strmLog << str;
+ if (i > -1)
+ g_strmLog << "[" << i << "]";
+ if (showValues)
+ {
+ g_strmLog << "; found " << valueFound << " not " << valueExpected;
+ }
+ g_strmLog.flush();
+ return true;
+}
+
+
+bool WriteToLog(int n)
+{
+ if (g_strmLog.fail())
+ {
+ std::cout << "Error opening log file.";
+ return false;
+ }
+ g_strmLog << n;
+ g_strmLog.flush();
+ return true;
+}
+
diff --git a/Build/source/libs/graphite/test/RegressionTest/RtTextSrc.h b/Build/source/libs/graphite/test/RegressionTest/RtTextSrc.h
new file mode 100644
index 00000000000..cdbd51e90df
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/RtTextSrc.h
@@ -0,0 +1,74 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: RtTextSrc.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+
+-------------------------------------------------------------------------------*//*:End Ignore*/
+#pragma once
+#ifndef RTTXTSRC_INCLUDED
+#define RTTXTSRC_INCLUDED
+
+#include <cstring>
+
+/*----------------------------------------------------------------------------------------------
+ Class: RtTextSrc
+ This class extends the SimpleTextSource to allow setting of features.
+----------------------------------------------------------------------------------------------*/
+class RtTextSrc : public SimpleTextSrc
+{
+public:
+ RtTextSrc(gr::utf16 * pszText) : SimpleTextSrc(pszText)
+ {
+ m_fRtl = false;
+ memset(m_fset, 0, MAXFEAT * sizeof(FeatureSetting));
+ }
+
+ void setFeatures(FeatureSetting * fset)
+ {
+ m_cFeats = 0;
+ for (int i = 0; i < MAXFEAT; i++)
+ {
+ if (fset[i].id > 0)
+ {
+ m_fset[i].id = fset[i].id;
+ m_fset[i].value = fset[i].value;
+ m_cFeats++;
+ }
+ }
+ }
+
+ virtual size_t getFontFeatures(toffset ich, FeatureSetting * prgfset)
+ {
+ // Note: size of prgfset buffer = gr::kMaxFeatures = 64
+ std::copy(m_fset, m_fset + MAXFEAT, prgfset);
+ return m_cFeats;
+ }
+
+ virtual bool getRightToLeft(toffset ich)
+ {
+ return m_fRtl;
+ }
+ virtual unsigned int getDirectionDepth(toffset ich)
+ {
+ return ((m_fRtl == 1) ? 1 : 0);
+ }
+ void setRightToLeft(bool f)
+ {
+ m_fRtl = f;
+ }
+
+protected:
+ bool m_fRtl;
+ int m_cFeats;
+ FeatureSetting m_fset[MAXFEAT];
+};
+
+
+#endif // !RTTXTSRC_INCLUDED
diff --git a/Build/source/libs/graphite/test/RegressionTest/SimpleTextSrc.cpp b/Build/source/libs/graphite/test/RegressionTest/SimpleTextSrc.cpp
new file mode 100644
index 00000000000..c50799c96bc
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/SimpleTextSrc.cpp
@@ -0,0 +1,93 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: SimpleTextSrc.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ A simple text source that shows how to use this interface within Graphite.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+#pragma hdrstop
+// any other headers (not precompiled)
+
+#include "GrClient.h"
+#include "GrDebug.h"
+#include "ITextSource.h"
+#include "SimpleTextSrc.h"
+
+#undef THIS_FILE
+DEFINE_THIS_FILE
+
+//:>********************************************************************************************
+//:> Initialization and destruction
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Constructors.
+----------------------------------------------------------------------------------------------*/
+SimpleTextSrc::SimpleTextSrc(gr::utf16 * pszText)
+{
+ m_cref = 1; // COM-like behavior
+
+ //m_cchLength = wcslen(pszText); // don't use wcslen, it's not cross-platform
+ m_cchLength = 0;
+ for (gr::utf16 * pch = pszText; *pch != 0; pch++)
+ m_cchLength++;
+ m_prgchText = new gr::utf16[m_cchLength + 1];
+ std::copy(pszText, pszText + m_cchLength, m_prgchText);
+ m_prgchText[m_cchLength] = 0; // zero-terminate
+}
+
+/*----------------------------------------------------------------------------------------------
+ Destructor.
+----------------------------------------------------------------------------------------------*/
+SimpleTextSrc::~SimpleTextSrc()
+{
+ delete[] m_prgchText;
+}
+
+//:>********************************************************************************************
+//:> Interface methods
+//:>********************************************************************************************
+/*----------------------------------------------------------------------------------------------
+ Get the specified range of text
+----------------------------------------------------------------------------------------------*/
+size_t SimpleTextSrc::fetch(toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer)
+{
+ size_t ichRet = min(cch, size_t(m_cchLength - ichMin));
+ std::copy(m_prgchText + ichMin, m_prgchText+ichMin + ichRet, prgchwBuffer);
+ return ichRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return true if the text uses a right-to-left writing system.
+----------------------------------------------------------------------------------------------*/
+bool SimpleTextSrc::getRightToLeft(toffset ich)
+{
+ return false;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the depth of embedding of the writing system.
+----------------------------------------------------------------------------------------------*/
+unsigned int SimpleTextSrc::getDirectionDepth(toffset ich)
+{
+ return 0;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Return the vertical offset of the text. This simple implementation provides no
+ vertical offset.
+----------------------------------------------------------------------------------------------*/
+float SimpleTextSrc::getVerticalOffset(toffset ich)
+{
+ return 0;
+}
diff --git a/Build/source/libs/graphite/test/RegressionTest/SimpleTextSrc.h b/Build/source/libs/graphite/test/RegressionTest/SimpleTextSrc.h
new file mode 100644
index 00000000000..a5d191b4ac3
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/SimpleTextSrc.h
@@ -0,0 +1,113 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 1999, 2001 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: SimpleTextSrc.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ A simple text source that shows how to use this interface within Graphite.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+#pragma once
+#ifndef GRTXTSRC_INCLUDED
+#define GRTXTSRC_INCLUDED
+
+using namespace gr;
+
+/*----------------------------------------------------------------------------------------------
+ Class: SimpleTextSrc
+ This class provides a simple implementation for a text source for the Graphite engine.
+ There are no paragraph properties of interest and one set of character properties that
+ apply to the entire string.
+
+ This class is a subclass of IColorTextSource so that it can be used by the
+ WinSegmentPainter class, which expects the getColors method to be defined.
+----------------------------------------------------------------------------------------------*/
+class SimpleTextSrc : public IColorTextSource
+{
+public:
+ // Constructor:
+ SimpleTextSrc(gr::utf16 * pszText);
+ ~SimpleTextSrc();
+
+/*
+ virtual long IncRefCount(void)
+ {
+ return InterlockedIncrement(&m_cref);
+ }
+ virtual long DecRefCount(void)
+ {
+ long cref = InterlockedDecrement(&m_cref);
+ if (cref == 0) {
+ m_cref = 1;
+ delete this;
+ }
+ return cref;
+ }
+*/
+ // -------------------------------------------------------------------------------
+ // Interface methods:
+
+ virtual UtfType utfEncodingForm()
+ {
+ return kutf16;
+ }
+ virtual size_t getLength()
+ {
+ return m_cchLength;
+ }
+ virtual size_t fetch(toffset ichMin, size_t cch, utf32 * prgchBuffer)
+ {
+ throw;
+ }
+ virtual size_t fetch(toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer);
+ virtual size_t fetch(toffset ichMin, size_t cch, utf8 * prgchsBuffer)
+ {
+ throw;
+ };
+
+ virtual bool getRightToLeft(toffset ich);
+ virtual unsigned int getDirectionDepth(toffset ich);
+ virtual float getVerticalOffset(toffset ich);
+
+ virtual isocode getLanguage(toffset ich)
+ {
+ isocode ret;
+ ret.rgch[0] = 'e'; ret.rgch[1] = 'n'; ret.rgch[2] = 0; ret.rgch[3] = 0;
+ return ret;
+ }
+
+ virtual std::pair<toffset, toffset> propertyRange(toffset ich)
+ {
+ std::pair<toffset, toffset> pairRet;
+ pairRet.first = 0;
+ pairRet.second = m_cchLength;
+ return pairRet;
+ }
+
+ virtual size_t getFontFeatures(toffset ich, FeatureSetting * prgfset)
+ {
+ return 0; // no features in this simple implementation
+ }
+ virtual bool sameSegment(toffset ich1, toffset ich2)
+ {
+ return true;
+ }
+
+ virtual void getColors(toffset ich, int * pclrFore, int * pclrBack)
+ {
+ *pclrFore = kclrBlack;
+ *pclrBack = kclrTransparent;
+ }
+
+protected:
+ long m_cref;
+ gr::utf16 * m_prgchText;
+ int m_cchLength;
+};
+
+
+#endif // !GRTXTSRC_INCLUDED
diff --git a/Build/source/libs/graphite/test/RegressionTest/TestCase.cpp b/Build/source/libs/graphite/test/RegressionTest/TestCase.cpp
new file mode 100644
index 00000000000..c9696141c95
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/TestCase.cpp
@@ -0,0 +1,1974 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2004 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: TestCase.cpp
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ File to set up test cases for the Graphite regression test program.
+
+How to add a test:
+ 1. Add the name of your test method to the class declaration in TestCase.h.
+ 2. Increment the g_numberOfTests constant in this file.
+ 3. Add a call to your test method in the SetupTests method in this file.
+ 4. Copy one of the existing test methods such as SetupSimpleTest and change the name
+ and data.
+
+Things that still need testing:
+ Ligatures (there is one small test of this)
+ Justification
+ Fake italic
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+#include "main.h"
+#include <cstring>
+
+//:>********************************************************************************************
+//:> Test constants and methods
+//:>********************************************************************************************
+
+const int g_numberOfTests = 25; // *** increment as tests are added ***
+
+TestCase * g_ptcaseList; // list of test cases
+
+namespace gr { // and it was SC who got rid of the byte defn in GrPlatform.h!
+typedef unsigned char byte;
+}
+
+
+/*----------------------------------------------------------------------------------------------
+ Create the list of tests.
+----------------------------------------------------------------------------------------------*/
+int TestCase::SetupTests(TestCase ** pptcaseList)
+{
+ g_ptcaseList = new TestCase[g_numberOfTests];
+ int cptcase = 0;
+
+ // The number of methods called here should equal g_numberOfTests above.
+ g_ptcaseList[0].SetupSimpleTest(); cptcase++;
+ g_ptcaseList[1].SetupSimpleBacktrackTest(); cptcase++;
+ g_ptcaseList[2].SetupSurrogateTest(); cptcase++;
+ g_ptcaseList[3].SetupBurmese1(); cptcase++;
+ g_ptcaseList[4].SetupBurmese2(); cptcase++;
+ g_ptcaseList[5].SetupBurmese3(); cptcase++;
+ g_ptcaseList[6].SetupBurmese4(); cptcase++;
+ g_ptcaseList[7].SetupRoman(); cptcase++;
+ g_ptcaseList[8].SetupRomanFeatures(); cptcase++;
+ g_ptcaseList[9].SetupStackingAndBridging(); cptcase++;
+ g_ptcaseList[10].SetupNoWhiteSpace(); cptcase++;
+ g_ptcaseList[11].SetupNoWhiteSpaceNoSeg(); cptcase++;
+ g_ptcaseList[12].SetupOnlyWhiteSpace(); cptcase++;
+ g_ptcaseList[13].SetupCrossLine1(); cptcase++;
+ g_ptcaseList[14].SetupCrossLine2(); cptcase++;
+ g_ptcaseList[15].SetupCrossLine3(); cptcase++;
+ g_ptcaseList[16].SetupCrossLine4(); cptcase++;
+ g_ptcaseList[17].SetupArabic1(); cptcase++;
+ g_ptcaseList[18].SetupArabic2(); cptcase++;
+ g_ptcaseList[19].SetupTaiViet1(); cptcase++;
+ g_ptcaseList[20].SetupTaiViet2(); cptcase++;
+ g_ptcaseList[21].SetupDumbFallback1(); cptcase++;
+ g_ptcaseList[22].SetupDumbFallback2(); cptcase++;
+ g_ptcaseList[23].SetupBadFont(); cptcase++;
+ g_ptcaseList[24].SetupBugTest(); cptcase++;
+ // *** Add more method calls here. ***
+
+ assert(cptcase == g_numberOfTests);
+
+ *pptcaseList = g_ptcaseList;
+
+ return g_numberOfTests;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set up a simple test.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupSimpleTest()
+{
+ m_testName = "Simple";
+ //m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_roman.ttf";
+ m_text = L"This is a test."; // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+
+ // Output:
+ m_segWidth = 86; // physical width of segment
+
+ const int charCnt = 15; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true
+ };
+
+ const int glyphCnt = 15; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ gid16 glyphList[] = {55, 75, 76, 86, 3, 76, 86, 3, 68, 3, 87, 72, 86, 87, 17};
+ int xPositions[] = { 0, 9, 17, 22, 28, 33, 37, 43, 48, 55, 60, 64, 71, 77, 82};
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ int advWidths[] = { 9, 8, 4, 6, 4, 4, 6, 4, 7, 4, 4, 7, 6, 4, 4};
+
+ int bbLefts[] = { 0, 9, 18, 22, 28, 33, 38, 43, 48, 55, 60, 65, 72, 78, 83};
+ int bbRights[] = { 9, 17, 21, 27, 33, 37, 43, 48, 55, 60, 64, 71, 77, 82, 85};
+ int bbTops[] = {10, 11, 10, 7, 0, 10, 7, 0, 7, 0, 9, 7, 7, 9, 1};
+ int bbBottoms[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+ int charsToGlyphs[] = {
+ 1, 1, 1, 2, 1, 2, 3, 1, 3, 4, 1, 4, 5, 1, 5, 6, 1, 6, 7, 1, 7
+ };
+ int c2gCount = 21;
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 3;
+ int clickStuff[] = {
+ 11, 25, 1, false, 0, 24, 8, kAbsent, kAbsent, kAbsent, // below baseline
+ 42, 5, 7, true, 0, 24, 42, kAbsent, kAbsent, kAbsent, // near top of text
+ 90, 16, 15, true, 0, 24, 85, kAbsent, kAbsent, kAbsent // near baseline
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
+ SetInsPtFlags(insPtFlags);
+ SetCharsToGlyphs(charsToGlyphs, c2gCount);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set up a simple test with backtracking.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupSimpleBacktrackTest()
+{
+ m_testName = "Simple Backtrack";
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_roman.ttf";
+ m_text = L"This is a test."; // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = true;
+
+ // Output:
+ m_segWidth = 55; // physical width of segment
+
+ const int charCnt = 10; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true
+ };
+
+ const int glyphCnt = 10; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ gid16 glyphList[] = {55, 75, 76, 86, 3, 76, 86, 3, 68, 3};
+ int xPositions[] = { 0, 9, 17, 22, 28, 33, 37, 43, 48, 55};
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ int advWidths[] = { 9, 8, 4, 6, 4, 4, 6, 4, 7, 4};
+
+ const int contextBlockOutSize = 10;
+ gr::byte contextBlockOut[] = { 15, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+ SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set up a test that includes surrogates.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupSurrogateTest()
+{
+ m_testName = "Surrogates";
+ //m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_roman.ttf";
+ m_text = L"abXXcdYYe"; // text to render
+ m_text[2] = 0xD835;
+ m_text[3] = 0xDD13;
+ m_text[6] = 0xD835;
+ m_text[7] = 0xDD10;
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+
+ // Output:
+ m_segWidth = 65; // physical width of segment
+
+ const int charCnt = 9; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, false, true, true, true, false, true
+ };
+
+ const int glyphCnt = 7; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ gid16 glyphList[] = {68, 69,1227, 70, 71,1015, 72};
+ int xPositions[] = { 0, 7, 15, 27, 34, 42, 58};
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0};
+ int advWidths[] = { 7, 8, 12, 7, 8, 15, 7};
+
+ int bbLefts[] = { 0, 7, 15, 28, 35, 43, 59};
+ int bbRights[] = { 7, 14, 26, 34, 42, 57, 65};
+ int bbTops[] = { 7, 11, 10, 7, 11, 10, 7};
+ int bbBottoms[] = { 0, 0, -3, 0, 0, 0, 0};
+
+ int charsToGlyphs[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1, 2, 3, 0, 4, 1, 3, 5, 1, 4, 6, 1, 5, 7, 0,
+ 8, 1, 6,
+ };
+ int c2gCount = 25;
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 3;
+ int clickStuff[] = {
+ 17, 25, 2, false, 0, 24, 14, kAbsent, kAbsent, kAbsent, // below baseline
+ 25, 5, 4, true, 0, 24, 26, kAbsent, kAbsent, kAbsent, // near top of text
+ 55, 16, 8, true, 0, 24, 57, kAbsent, kAbsent, kAbsent // near baseline
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
+ SetInsPtFlags(insPtFlags);
+ SetCharsToGlyphs(charsToGlyphs, c2gCount);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+/*----------------------------------------------------------------------------------------------
+ A set of tests using Burmese, to test complex positioning and non-white-space
+ linebreaking.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupBurmese1()
+{
+ m_testName = "Burmese 1";
+ m_debug = false;
+ //m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Burmese";
+ m_fontFile = "grtest_burmese.ttf";
+ m_text = BurmeseText();
+ m_fontSize = 20; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 300; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_backtrack = false;
+
+ // Output:
+ m_segWidth = 281; // physical width of segment
+
+ SetupBurmeseAux(
+ 64, // character count
+ 45, // glyph count
+ 5); // number of click-tests
+
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,0, 1,1,0, 2,2,2,3,4, 3,2,0, 4,2,0, 5,5,1,6, 6,5,0, 7,7,3,8,9,10,
+ 8,7,0, 9,7,0, 10,7,0, 11,11,0, 12,12,0, 13,13,0, 14,14,0, 15,15,0,
+ 16,16,1,17, 17,16,0, 18,18,1,19, 19,18,0, 20,20,1,21, 21,20,0, 22,22,1,23,
+ 23,22,0, 24,24,0, 25,25,0
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+ SetAttachedClusters(attachments, attCount);
+
+ const int contextBlockOutSize = 11;
+ gr::byte contextBlockOut[] = { 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
+}
+
+void TestCase::SetupBurmese2()
+{
+ m_testName = "Burmese 2";
+ //m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Burmese";
+ m_fontFile = "grtest_burmese.ttf";
+
+ m_text = BurmeseText();
+ m_fontSize = 20; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 275; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_backtrack = false;
+
+ // Output:
+ m_segWidth = 215; // physical width of segment
+
+ SetupBurmeseAux(
+ 47, // character count
+ 33, // glyph count
+ 3); // number of click-tests
+
+ const int contextBlockOutSize = 11;
+ gr::byte contextBlockOut[] = { 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
+}
+
+void TestCase::SetupBurmese3()
+{
+ m_testName = "Burmese 3";
+ //m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Burmese";
+ m_fontFile = "grtest_burmese.ttf";
+
+ m_text = BurmeseText();
+ m_fontSize = 20; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 75; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_backtrack = false;
+
+ // Output:
+ m_segWidth = 73; // physical width of segment
+
+ SetupBurmeseAux(
+ 19, // character count
+ 13, // glyph count
+ 2); // number of click-tests
+
+ const int contextBlockOutSize = 11;
+ gr::byte contextBlockOut[] = { 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
+}
+
+void TestCase::SetupBurmese4()
+{
+ m_testName = "Burmese 4";
+ //m_traceLog = true;
+ //m_debug = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Burmese";
+ m_fontFile = "grtest_burmese.ttf";
+
+ m_text = BurmeseText();
+ m_fontSize = 20; // font size in points
+ m_prefBreak = klbWsBreak; // preferred break-weight
+ m_worstBreak = klbHyphenBreak; // worst-case break-weight
+ m_availWidth = 30; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_backtrack = false;
+
+ // Output:
+ m_noSegment = true;
+ m_segWidth = 0; // physical width of segment
+
+ SetupBurmeseAux(
+ 0, // character count
+ 0, // glyph count
+ 0); // number of click-tests
+}
+
+void TestCase::SetupBurmeseAux(int charCnt, int glyphCnt, int clickTestCnt)
+{
+ m_rtl = false;
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, false, false, false, true, false, false, false, false, // 0 - 9
+ true, false, false, true, false, false, false, true, true, true, // 10 - 19
+ true, false, true, true, false, false, true, false, false, false, // 20 - 29
+ false, true, false, false, true, false, false, false, true, true, // 30 - 39
+ true, true, true, true, true, true, true, true, true, false, // 40 - 49
+ true, true, true, false, false, false, true, false, false, true, // 50 - 59
+ false, false, false, true
+ };
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20 30 40
+ gid16 glyphList[] = {105,174,158,202,231,162,231,148,223,219,229,248, 3,226,162,173,216,231,177,195,115,231,170,204,243, 3,197,216,172,216, 3,233, 3,226,179,162,216,170,204,158,202,115,231,229, 3};
+ int xPositions[] = { 0, 17, 20, 22, 28, 29, 38, 40, 50, 55, 56, 57, 73, 79, 89, 99,102,109,110,111,120,129,130,131,140,143,149,167,174,191,198,205,215,222,232,234,245,252,253,262,264,271,280,278,281};
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ int advWidths[] = { 17, 2, 9, 4, 0, 10, 0, 17, 2, 0, 0, 15, 6, 10, 10, 2, 7, 0, 10, 9, 9, 0, 10, 7, 2, 6, 17, 7, 17, 7, 6, 10, 6, 10, 2, 10, 7, 10, 7, 9, 4, 9, 0, 0, 6};
+
+ int bbLefts[] = { 0, 10, 21, 23, 23, 30, 33, 41, 51, 49, 53, 58, 73, 80, 90, 96,100,103,111,109,121,123,131,132,141,143,150,165,175,189,198,206,215,223,233,235,243,253,254,263,265,272,275,275,281};
+ int bbRights[] = { 16, 19, 28, 25, 28, 39, 38, 56, 54, 55, 56, 72, 79, 88, 98,101,109,109,119,119,129,129,139,138,142,149,166,173,190,197,205,214,222,231,244,244,251,261,260,271,267,280,280,278,288};
+ int bbTops[] = { 7, 7, 7, -1, 15, 7, 15, 7, -1, 15, -2, 15, 0, 7, 7, 7, 7, 15, 7, -1, 7, 15, 7, -1, 7, 0, 7, 7, 7, 7, 0, 7, 0, 7, 16, 7, 7, 7, -1, 7, -1, 7, 15, -2, 0};
+ int bbBottoms[] = { 0, -7, -1, -7, 9, 0, 9, 0, -7, 9, -5, 0, 0, 0, 0, -7, 0, 9, -4, -7, 0, 9, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, -7, -1, -7, 0, 9, -5, 0};
+
+ // Each group = char-index, number of glyphs, glyph-indices.
+ int charsToGlyphs[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1, 1, 3, 1, 1, 4, 1, 1, 5, 1, 2, 6, 1, 3, 7, 1, 3,
+ 8, 1, 4, 9, 1, 4, 10, 1, 5, 11, 1, 6, 12, 1, 6, 13, 1, 7
+ };
+ int c2gCount = sizeof(charsToGlyphs) / sizeof(int);
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ int clickStuff[] = {
+ 10, 25, 1, true, 0, 25, 16, kAbsent, kAbsent, kAbsent,
+ 40, 5, 13, false, 0, 25, 39, kAbsent, kAbsent, kAbsent,
+ 93, 40, 19, false, 0, 25, 88, 0, 25, 77,
+ 251, 5, 52, true, 0, 25,251, kAbsent, kAbsent, kAbsent,
+ 235, 30, 48, false, -1, 27,230, 7, 19,243,
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetCharsToGlyphs(charsToGlyphs, c2gCount);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+std::wstring TestCase::BurmeseText()
+{
+ std::wstring strRet;
+ wchar_t charData[] = {
+ 0x1000, 0x1039, 0x101a, 0x1039, 0x101d, 0x1014, 0x1039, 0x101f, 0x1039, 0x200c,
+ 0x1015, 0x1039, 0x200c, 0x1010, 0x102f, 0x102d, 0x1037, 0x104f, 0x0020, 0x1015,
+ 0x1039, 0x101a, 0x1031, 0x102c, 0x1039, 0x200c, 0x101b, 0x1039, 0x101d, 0x1039,
+ 0x101f, 0x1004, 0x1039, 0x200c, 0x1019, 0x1039, 0x101f, 0x102f, 0x104a, 0x0020,
+ 0x101e, 0x102c, 0x101a, 0x102c, 0x0020, 0x1040, 0x0020, 0x1015, 0x1039, 0x101b,
+ 0x1031, 0x102c, 0x1019, 0x1039, 0x101f, 0x102f, 0x1014, 0x1039, 0x101f, 0x1004,
+ 0x1039, 0x200c, 0x1037, 0x0020, 0x1021, 0x1031, 0x102c, 0x1004, 0x1039, 0x200c,
+ 0x1019, 0x1039, 0x101b, 0x1004, 0x1039, 0x200c, 0x1019, 0x1039, 0x101f, 0x102f,
+ 0x1010, 0x102f, 0x102d, 0x1037, 0x101e, 0x100a, 0x1039, 0x200c, 0x0020, 0x1000,
+ 0x1039, 0x101a, 0x1039, 0x101d, 0x1014, 0x102f, 0x1039, 0x200c, 0x1015, 0x1039,
+ 0x200c, 0x1010, 0x102f, 0x102d, 0x1037, 0x104f, 0x0000
+ };
+ strRet.assign(charData);
+ return strRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ A set of tests using Roman script, which tests stacking diacritics, many-to-one glyphs,
+ and features.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupRoman()
+{
+ m_testName = "Roman";
+ m_traceLog = true;
+ //m_debug = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_roman.ttf";
+ m_text = RomanText(); // text to render
+ m_fontSize = 36; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+
+ // Output:
+ m_segWidth = 278; // physical width of segment
+
+ const int charCnt = 26; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true
+ };
+
+ const int glyphCnt = 24; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20
+ gid16 glyphList[] = {72,1815,1768, 83,1789, 86, 74,1943,1956,1926,1061, 68,1777,1755,805,1815, 44,1815, 80,1833,1768,1855,1838,637};
+ int xPositions[] = { 0, 23, 23, 21, 41, 45, 64, 88, 98, 112, 116,148, 171, 171,170, 188,183, 203, 199, 230, 230, 230, 230,236};
+ int yPositions[] = { 0, 0, 10, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0, 10, 20, 0};
+ int advWidths[] = {21, 0, 0, 24, 0, 18, 24, 13, 13, 4, 31, 21, 0, 0, 13, 0, 15, 0, 37, 0, 0, 0, 0, 41};
+
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,2,1,2, 1,0,0, 2,0,0, 3,3,0, 4,4,0, 5,5,0, 6,6,0, 7,7,2,8,9,
+ 8,7,0, 9,7,0, 10,10,0, 11,11,2,12,13, 12,11,0, 13,11,0, 14,14,1,15, 15,14,0,
+ 16,16,1,17, 17,16,0, 18,18,4,19,20,21,22, 19,18,0, 20,18,0, 21,18,0, 22,18,0,
+ 23,23,0
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 5;
+ int clickStuff[] = {
+ 10, 15, 2, false, 9, 21, 1, 20, 30, 18,
+ 61, 50, 6, true, 0, 72, 63, kAbsent, kAbsent, kAbsent,
+ 90, 40, 7, false, 0, 72, 87, kAbsent, kAbsent, kAbsent,
+ 260, 40, 25, true, 0, 73,263, kAbsent, kAbsent, kAbsent, // ligature
+ 267, 40, 25, false, 0, 73,263, kAbsent, kAbsent, kAbsent, // ligature
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetAttachedClusters(attachments, attCount);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+void TestCase::SetupRomanFeatures()
+{
+ m_testName = "Roman Features";
+ m_traceLog = true;
+ //m_debug = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_roman.ttf";
+ m_text = RomanText(); // text to render
+ m_fontSize = 36; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+
+ m_fset[0].id = 1024; m_fset[0].value = 2; // capital eng with tail
+ m_fset[1].id = 1026; m_fset[1].value = 1; // tone numbers
+ m_fset[2].id = 1029; m_fset[2].value = 1; // vietnamese diacritics
+ m_fset[3].id = 1032; m_fset[3].value = 1; // literacy alternates
+ m_fset[4].id = 1034; m_fset[4].value = 1; // y-hook alternate (default)
+ m_fset[5].id = 1051; m_fset[5].value = 0; // diacritic selection
+ m_fset[6].id = 0;
+
+ // Output:
+ m_segWidth = 307; // physical width of segment
+
+ const int charCnt = 26; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, false, false, true, true, true, true, true, true, true,
+ true, true, false, false, true, false, true, false, true, false,
+ false, false, false, true, true, true
+ };
+
+ const int glyphCnt = 23; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20
+ gid16 glyphList[] = {72,1815,1768, 83,1789, 86,681,1659,1667,1662,1056,274,1778, 805,1815, 44,1815, 80,1833,1768,1855,1838,637};
+ int xPositions[] = { 0, 23, 23, 21, 41, 45, 64, 87, 104, 121, 138,173, 174, 198, 217, 211, 231, 227, 258, 258, 258, 258,265};
+ int yPositions[] = { 0, 0, 10, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 10, 20, 0};
+ int advWidths[] = {21, 0, 0, 24, 0, 18, 23, 17, 17, 17, 34, 24, 24, 13, 0, 15, 0, 37, 0, 0, 0, 0, 41};
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 3;
+ int clickStuff[] = {
+ 10, 15, 3, true, 0, 72, 20, kAbsent, kAbsent, kAbsent,
+ 116, 5, 9, true, 0, 72, 120, kAbsent, kAbsent, kAbsent,
+ 90, 40, 7, false, 0, 72, 86, kAbsent, kAbsent, kAbsent
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+std::wstring TestCase::RomanText()
+{
+ std::wstring strRet;
+ wchar_t charData[] = {
+ 0x0065, 0x0303, 0x0300, 0x0070, 0x0361, 0x0073, 0x0067, 0x02e8, 0x02e5, 0x02e7,
+ 0x014a, 0x0061, 0x0302, 0x0301, 0x0069, 0x0303, 0x0049, 0x0303, 0x006d, 0x033c,
+ 0x0300, 0x0308, 0x0304, 0x0066, 0x0066, 0x0069, 0x0000
+ };
+ strRet.assign(charData);
+ return strRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ A set of tests for handling complex diacritic stacking and bridging.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupStackingAndBridging()
+{
+ m_testName = "Roman Stacking and Bridging";
+ //m_traceLog = true;
+ //m_debug = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_roman.ttf";
+ m_fontSize = 36; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+
+ // text to render
+ wchar_t charData[] = {
+ 0x0061,0x035d,0x0061,0x0020,0x0074,0x035d,0x0061,0x0020,0x0061,0x0300,
+ 0x0300,0x035d,0x0061,0x0020,0x0283,0x0300,0x0300,0x035d,0x0061,0x0020,
+ 0x0061,0x0316,0x0316,0xf176,0x0061,0x0020,0x0283,0x0300,0x0300,0xf176,
+ 0x0061,0x0020,0x0061,0x0316,0x0316,0xf176,0x0061,0x0020,0x0283,0x035d,
+ 0xf176,0x0061,0x0000
+ };
+ m_text.assign(charData);
+
+ // Output:
+ m_segWidth = 414; // physical width of segment
+
+ const int charCnt = 42; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true,
+ };
+
+ const int glyphCnt = 42; // number of glyphs in the segment
+
+ // 68 = a, 97 = t, 1305 = esh, 1768 = upper grave, 1765 = lower grave, 1802 = upper bridge,
+ // 1801 = lower bridge
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20 30 40
+ gid16 glyphList[] = {68,1802, 68, 3, 87,1802, 68, 3, 68,1768,1768,1802, 68, 3,1305,1768,1768,1802, 68, 3, 68,1765,1765,1801, 68, 3,1305,1768,1768,1801, 68, 3, 68,1765,1765,1801, 68, 3,1305,1802,1801, 68};
+ int xPositions[] = { 0, 21, 21, 42, 56, 73, 69, 91, 105, 127, 127, 126, 126,147, 161, 181, 181, 178,177,199,212, 235, 235, 234,234,255, 269, 289, 289, 286,285,307,320, 343, 343, 342,342,363, 377, 393, 393,393};
+ int yPositions[] = { 0, -7, 0, 0, 0, -1, 0, 0, 0, 0, 10, 12, 0, 0, 0, 10, 20, 23, 0, 0, 0, 0, -9, -17, 0, 0, 0, 10, 20, -6, 0, 0, 0, 0, -9, -17, 0, 0, 0, 3, -6, 0};
+ int advWidths[] = {21, 0, 21, 13, 13, 0, 21, 13, 21, 0, 0, 0, 21, 13, 16, 0, 0, 0, 21, 13, 21, 0, 0, 0, 21, 13, 16, 0, 0, 0, 21, 13, 21, 0, 0, 0, 21, 13, 16, 0, 0, 21};
+
+ int bbLefts[] = { 1, 0, 23, 42, 56, 52, 71, 91, 106, 108, 108, 105, 128,147, 159, 162, 162, 157,179,199,214, 217, 217, 213,235,255, 267, 270, 270, 265,287,307,322, 325, 325, 321,343,363, 375, 373, 373,395};
+ int bbRights[] = {21, 41, 42, 56, 69, 93, 91,105, 126, 119, 119, 146, 147,161, 178, 173, 173, 198,199,212,234, 228, 228, 254,255,269, 286, 281, 281, 306,306,320,342, 336, 336, 362,363,377, 394, 413, 414,414};
+ int bbTops [] = {22, 33, 22, 0, 28, 40, 22, 0, 22, 32, 42, 54, 22, 0, 33, 42, 53, 64, 22, 0, 22, -3, -13, -26, 22, 0, 33, 42, 53, -15, 22, 0, 22, -3, -13, -26, 22, 0, 33, 44, -15, 22};
+ int bbBottoms [] = { 0, 26, 0, 0, 0, 33, 0, 0, 0, 24, 34, 47, 0, 0, -10, 34, 44, 57, 0, 0, 0, -11, -21, -32, 0, 0, -10, 34, 44, -21, 0, 0, 0, -11, -21, -32, 0, 0, -10, 38, -21, 0};
+
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,0, 1,1,0, 2,2,0, 3,3,0, 4,4,0, 5,5,0, 6,6,0, 7,7,0,
+ 8,8,2,9,10, 9,8,0, 10,8,0, 11,11,0, 12,12,0, 13,13,0, 14,14,2,15,16,
+ 15,14,0, 16,14,0, 17,17,0, 18,18,0, 19,19,0, 20,20,2,21,22, 21,20,0,
+ 22,20,0, 23,23,0, 24,24,0, 25,25,0, 26,26,2,27,28, 27,26,0, 28,26,0,
+ 29,29,0, 30,30,0, 31,31,0, 32,32,2,33,34, 33,32,0, 34,32,0, 35,35,0,
+ 36,36,0, 37,37,0, 38,38,0, 39,39,0, 40,40,0, 41,41,0
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 6;
+ int clickStuff[] = {
+ 109, 25, 9, false, 19, 32, 105, 30, 56, 125, // first grave on 4th a
+ 178, 26, 15, true, 19, 66, 176, 9, 21, 159, // top of 1st esh, right side
+ 220, 84, 23, false, 78, 89, 210, 65, 77, 228, // first lower bridge diac
+ 271, 40, 26, false, 0, 72, 266, kAbsent, kAbsent, kAbsent, // second esh, left side
+ 271, 65, 26, false, 0, 72, 266, kAbsent, kAbsent, kAbsent, // just below second esh, left side
+ 271, 68, 29, false, 67, 78, 262, 0, 11, 280 // lower bridge diac under esh, left side
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
+ SetInsPtFlags(insPtFlags);
+ SetAttachedClusters(attachments, attCount);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+/*----------------------------------------------------------------------------------------------
+ A set of tests for handling trailing whitespace.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupNoWhiteSpace()
+{
+ m_testName = "No white space";
+ //m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_roman.ttf";
+ m_text = L"The quick brown fox."; // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 150; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_twsh = ktwshNoWs;
+ m_paraRtl = true;
+
+ // Output:
+ m_segWidth = 115; // physical width of segment
+
+ const int charCnt = 16; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true
+ };
+
+ const int glyphCnt = 16; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ gid16 glyphList[] = {55, 75, 72, 3, 3, 84, 88, 76, 70, 78, 3, 69, 85, 82, 90, 81};
+ int xPositions[] = { 0, 9, 17, 24, 29, 34, 42, 50, 54, 61, 69, 74, 82, 87, 95,107};
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ int advWidths[] = { 9, 8, 7, 4, 4, 8, 8, 4, 7, 8, 4, 8, 5, 8, 11, 8};
+
+ const int contextBlockOutSize = 10;
+ gr::byte contextBlockOut[] = { 15, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(0, NULL);
+ SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
+}
+
+void TestCase::SetupNoWhiteSpaceNoSeg()
+{
+ m_testName = "No white space - no segment";
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_roman.ttf";
+ m_text = L"The quick brown fox."; // text to render
+ m_firstChar = 15; // spaces after brown
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 2; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_twsh = ktwshNoWs;
+ m_paraRtl = true;
+
+ // Output:
+ m_noSegment = true;
+ m_segWidth = 0; // physical width of segment
+
+ const int charCnt = 0; // number of characters in the segment
+
+ const int glyphCnt = 0; // number of glyphs in the segment
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+}
+
+void TestCase::SetupOnlyWhiteSpace()
+{
+ m_testName = "Only white space";
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_roman.ttf";
+ m_text = L" fox."; // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 2; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_twsh = ktwshOnlyWs;
+ m_paraRtl = true;
+
+ // Output:
+ m_segWidth = 0; // physical width of segment - visible
+
+ const int charCnt = 3; // number of characters in the segment
+ // need charCnt elements in this array:
+ bool insPtFlags[] = { true, true, true };
+
+ const int glyphCnt = 3; // number of glyphs in the segment
+ // need glyphCnt elements in these arrays:
+ gid16 glyphList[] = { 3, 3, 3 };
+ int xPositions[] = { -4, -9,-13 };
+ int yPositions[] = { 0, 0, 0 };
+ int advWidths[] = { 4, 4, 4 };
+
+ // TODO: add click tests when the bug fix with upstream tr white space is integrated.
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 6;
+ int clickStuff[] = {
+ 2, 25, 0, false, 0, 24, -1, kAbsent, kAbsent, kAbsent,
+ -1, 5, 0, false, 0, 24, -1, kAbsent, kAbsent, kAbsent,
+ -6, -3, 1, false, 0, 24, -5, kAbsent, kAbsent, kAbsent,
+ -8, -3, 2, true, 0, 24, -10, kAbsent, kAbsent, kAbsent,
+ -13, 40, 3, true, 0, 24, -14, kAbsent, kAbsent, kAbsent,
+ -18, 0, 3, true, 0, 24, -14, kAbsent, kAbsent, kAbsent
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+/*----------------------------------------------------------------------------------------------
+ A set of tests of cross-line contextualization.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupCrossLine1()
+{
+ m_testName = "Cross-line 1";
+ //m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test CrossLine";
+ m_fontFile = "grtest_xline.ttf";
+ m_text = CrossLineText(); // "abcddddefx@ghijkmmmmn$yopppppqrsss$z@tttwwww";
+ m_fontSize = 30; // font size in points
+ m_prefBreak = klbHyphenBreak; // preferred break-weight
+ m_availWidth = 350; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+
+ // Output:
+ m_segWidth = 312; // physical width of segment
+
+ const int charCnt = 10; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true
+ };
+
+ const int glyphCnt = 13; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ gid16 glyphList[] = {30, 67, 68, 69, 70, 70, 70, 70, 71, 72, 34, 90, 32 };
+ int xPositions[] = { 0, 40, 58, 79, 97,118,139,160,180,199,213,251,272 };
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ int advWidths[] = {40, 18, 20, 18, 20, 20, 20, 20, 18, 13, 38, 20, 40 };
+
+ // TODO: add click tests
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 0;
+ int * clickStuff = NULL;
+ //int clickStuff[] = ;
+ //{
+ // 10, 25, 1, false, 0, 24, 9, kAbsent, kAbsent, kAbsent,
+ //};
+
+ const int contextBlockOutSize = 9;
+ gr::byte contextBlockOut[] = { 20, 1, 0, 2, 0, 0, 4, 0, 0, 0 };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(clickTestCnt, clickStuff);
+ SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
+}
+
+void TestCase::SetupCrossLine2()
+{
+ m_testName = "Cross-line 2";
+ //m_traceLog = true;
+ //m_debug = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test CrossLine";
+ m_fontFile = "grtest_xline.ttf";
+ m_text = CrossLineText(); // "abcddddefx@ghijkmmmmn$yopppppqrsss$z@tttwwww";
+ m_firstChar = 10;
+ m_fontSize = 30; // font size in points
+ m_prefBreak = klbHyphenBreak; // preferred break-weight
+ m_availWidth = 400; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_initWithPrev = true;
+
+ const int contextBlockInSize = 9; // output from Cross-line 1
+ gr::byte contextBlockIn[] = { 20, 1, 0, 2, 0, 0, 4, 0, 0, 0 };
+
+ // Output:
+ m_segWidth = 395; // physical width of segment
+
+ const int charCnt = 13; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ false, true, true, true, true, true, true, true, true, true, true, true, true
+ };
+
+ const int glyphCnt = 15; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ gid16 glyphList[] = {30, 34, 73, 74, 75, 76, 77, 79, 79, 79, 79, 80, 6, 91, 32 };
+ int xPositions[] = { 0, 40, 78, 99,119,131,143,163,196,228,260,293,314,334,355 };
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ int advWidths[] = {40, 38, 20, 20, 11, 11, 20, 32, 32, 32, 32, 20, 20, 20, 40 };
+
+ // TODO: add click tests
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 0;
+ int * clickStuff = NULL;
+ //int clickStuff[] = ;
+ //{
+ // 10, 25, 1, false, 0, 24, 9, kAbsent, kAbsent, kAbsent,
+ //};
+
+ const int contextBlockOutSize = 9;
+ gr::byte contextBlockOut[] = { 20, 1, 0, 3, 0, 0, 4, 0, 0, 0 };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(clickTestCnt, clickStuff);
+ SetInputContextBlock(contextBlockInSize, contextBlockIn);
+ SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
+}
+
+void TestCase::SetupCrossLine3()
+{
+ m_testName = "Cross-line 3";
+ m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test CrossLine";
+ m_fontFile = "grtest_xline.ttf";
+ m_text = CrossLineText(); // "abcddddefx@ghijkmmmmn$yopppppqrsss$z@tttwwww";
+ m_firstChar = 23;
+ m_fontSize = 30; // font size in points
+ m_prefBreak = klbHyphenBreak; // preferred break-weight
+ m_availWidth = 400; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_initWithPrev = true;
+
+ const int contextBlockInSize = 9; // output from Cross-line 2
+ gr::byte contextBlockIn[] = { 20, 1, 0, 3, 0, 0, 4, 0, 0, 0 };
+
+ // Output:
+ m_segWidth = 358; // physical width of segment
+
+ const int charCnt = 13; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true, true, false, true
+ };
+
+ const int glyphCnt = 16; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ gid16 glyphList[] = {30, 81, 6, 82, 82, 82, 82, 82, 83, 84, 85, 85, 85, 34, 8, 92 };
+ int xPositions[] = { 0, 40, 60, 81,102,123,144,164,185,206,220,236,253,269,307,339 };
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ int advWidths[] = {40, 20, 20, 20, 20, 20, 20, 20, 20, 14, 16, 16, 16, 38, 32, 18 };
+
+ // TODO: add click tests
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 0;
+ int * clickStuff = NULL;
+ //int clickStuff[] = ;
+ //{
+ // 10, 25, 1, false, 0, 24, 9, kAbsent, kAbsent, kAbsent,
+ //};
+
+ const int contextBlockOutSize = 9;
+ gr::byte contextBlockOut[] = { 20, 1, 0, 3, 0, 0, 4, 0, 0, 0 };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(clickTestCnt, clickStuff);
+ SetInputContextBlock(contextBlockInSize, contextBlockIn);
+ SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
+}
+
+void TestCase::SetupCrossLine4()
+{
+ m_testName = "Cross-line 4";
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test CrossLine";
+ m_fontFile = "grtest_xline.ttf";
+ m_text = CrossLineText(); // "abcddddefx@ghijkmmmmn$yopppppqrsss$z@tttwwww";
+ m_firstChar = 36;
+ m_fontSize = 30; // font size in points
+ m_prefBreak = klbHyphenBreak; // preferred break-weight
+ m_availWidth = 400; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_initWithPrev = true;
+
+ const int contextBlockInSize = 9; // output from Cross-line 3
+ gr::byte contextBlockIn[] = { 20, 1, 0, 3, 0, 0, 4, 0, 0, 0 };
+
+ // Output:
+ m_segWidth = 248; // physical width of segment
+
+ const int charCnt = 8; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ false, true, true, true, true, true, true, true
+ };
+
+ const int glyphCnt = 10; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ gid16 glyphList[] = { 8, 6, 86, 86, 86, 89, 89, 89, 89, 32 };
+ int xPositions[] = { 0, 32, 53, 64, 76, 87,117,147,177,208 };
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ int advWidths[] = {32, 20, 11, 11, 11, 30, 30, 30, 30, 40 };
+
+ // TODO: add click tests
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 0;
+ int * clickStuff = NULL;
+ //int clickStuff[] = ;
+ //{
+ // 10, 25, 1, false, 0, 24, 9, kAbsent, kAbsent, kAbsent,
+ //};
+
+ const int contextBlockOutSize = 0;
+ gr::byte * contextBlockOut = NULL;
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(clickTestCnt, clickStuff);
+ SetInputContextBlock(contextBlockInSize, contextBlockIn);
+ SetOutputContextBlock(contextBlockOutSize, contextBlockOut);
+}
+
+std::wstring TestCase::CrossLineText()
+{
+ // The equivalent data is in the "xlineTest.wpx" file.
+ std::wstring strRet;
+ strRet.assign(L"abcddddefx@ghijkmmmmn$yopppppqrsss$z@tttwwww");
+ return strRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ A set of tests using Arabic: RTL, bidi, and embedded direction codes.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupArabic1()
+{
+ m_testName = "Arabic 1";
+ //m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Arabic";
+ m_fontFile = "grtest_arabic.ttf";
+ m_text = ArabicText();
+ m_fontSize = 20; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 1000; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_backtrack = false;
+
+ // Output:
+ m_segWidth = 409; // physical width of segment
+
+ SetupArabicAux(
+ 61, // character count
+ 61); // glyph count
+
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,0, 1,1,1,2, 2,1,0, 3,3,4,4,5,6,7, 4,3,0, 5,3,0, 6,3,0, 7,3,0,
+ 8,8,0, 9,9,4,10,11,12,13, 10,9,0, 11,9,0, 12,9,0, 13,9,0, 14,14,0,
+ 15,15,0, 16,16,1,17, 17,16,0, 18,18,1,19, 19,18,0 // etc
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+ SetAttachedClusters(attachments, attCount);
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ int clickStuff[] = {
+ 199, 13, 37, true, 0, 35,196, kAbsent, kAbsent, kAbsent,
+ 396, 13, 3, false, 8, 26,399, 10, 17, 397,
+ 396, 8, 6, true, 3, 11,391, 9, 22, 394,
+ 222, 5, 32, true, 0, 35,225, kAbsent, kAbsent, kAbsent,
+ 217, 5, 31, false, 0, 35,215, 0, 35, 246,
+ };
+ SetClickTests(4, clickStuff);
+}
+
+void TestCase::SetupArabic2()
+{
+ m_testName = "Arabic 2";
+ m_debug = false;
+ //m_traceLog = false;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test Arabic";
+ m_fontFile = "grtest_arabic.ttf";
+ m_text = ArabicText();
+ m_fontSize = 20; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 230; // width available for segment-break after number
+ m_bold = false;
+ m_italic = false;
+ m_backtrack = false;
+
+ // Output:
+ m_segWidth = 193; // physical width of segment
+
+ SetupArabicAux(
+ 35, // character count
+ 35); // glyph count
+
+ // The x-positions are different for a shorter segment:
+ // 0 10 20 30
+ int xPositions[] = {188,183,184,177,178,178,170,169,162,150,154,154,153,155,139,132,127,127,115,118,108,102, 84, 77, 77, 72, 65, 46, 46, 37, 31, 20, 10, 0, -6};
+ SetXPositions(xPositions);
+}
+
+void TestCase::SetupArabicAux(int charCnt, int glyphCnt)
+{
+ m_rtl = true;
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true, // 0 - 9
+ true, true, true, true, true, true, true, true, true, true, // 10 - 19
+ true, true, true, true, true, true, true, true, true, true, // 20 - 29
+ true, true, true, true, true, true, true, true, true, true, // 30 - 39
+ true, true, true, true, true, true, true, true, true, true, // 40 - 49
+ true, true, true, true, true, true, true, true, true, true, // 50 - 59
+ true
+ };
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20 30 40 50 60
+ gid16 glyphList[] = {785,658,907,1182,913,907,1192,907, 3,811,914,909,911,934,592, 3,785,909,621,911, 12, 3,321, 3,236,659,731,555,925,961, 3,992,991,990, 3,821,924,712,474,882,527, 3,411,924,950, 3,236,990,991,992,993,995,236, 3,821,769,455,290,839,620,961};
+ int xPositions[] = {404,400,401, 393,394,394, 386,385,379,366,370,370,370,371,355,348,343,343,331,334,324,318,300,293,293,289,281,263,262,254,247,237,226,216,209,197,197,189,179,172,154,147,135,139,127,120,120,110, 99, 89, 79, 68, 68, 62, 50, 41, 36, 29, 19, 8, 0};
+ int yPositions[] = { 0, 0, -5, 0, 0, 4, 0, 0, 0, 0, -5, -3, -2, 4, 0, 0, 0, 1, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ int advWidths[] = { 4, 4, 0, 6, 0, 0, 6, 0, 6, 12, 0, 0, 0, 0, 11, 6, 4, 0, 11, 0, 7, 6, 17, 6, 0, 4, 7, 18, 0, 8, 6, 10, 10, 10, 6, 11, 0, 7, 9, 7, 17, 6, 11, 0, 8, 6, 0, 10, 10, 10, 10, 10, 0, 6, 11, 9, 4, 6, 9, 11, 8};
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+}
+
+std::wstring TestCase::ArabicText()
+{
+ std::wstring strRet;
+ wchar_t charData[] = {
+ 0x0628, 0x0628, 0x064e, 0x0644, 0x064e, 0x0654, 0x0627, 0x064e, 0x0020, 0x0686,
+ 0x0650, 0x0652, 0x0655, 0x06e0, 0x06a8, 0x0020, 0x0628, 0x0650, 0x06b9, 0x0652,
+ 0x0029, 0x0020, 0x0628, 0x0020, 0x200d, 0x062a, 0x06a8, 0x0633, 0x0670, 0x061b,
+ 0x0020, 0x06f1, 0x06f2, 0x06f3, 0x0020, 0x0633, 0x0670, 0x0639, 0x062f, 0x0645,
+ 0x067e, 0x0020, 0x0644, 0x0670, 0x060c, 0x0020, 0x202e, 0x06f1, 0x06f2, 0x06f3,
+ 0x06f4, 0x06f5, 0x202c, 0x0020, 0x0633, 0x0647, 0x0627, 0x0631, 0x0639, 0x0646,
+ 0x061b, 0x0000
+ };
+ strRet.assign(charData);
+ return strRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ A set of tests that uses Tai Viet script to test positioning.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupTaiViet1()
+{
+ m_testName = "Tai Viet Collisions";
+ //m_traceLog = true;
+ //m_debug = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test TaiViet";
+ m_fontFile = "grtest_taiviet.ttf";
+ m_fontSize = 36; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 2000; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_text = TaiVietText();
+
+ m_fset[0].id = 2001; m_fset[0].value = 2; // vowel position = final consonant
+ m_fset[1].id = 1051; m_fset[1].value = 0; // diacritic selection = off
+ m_fset[2].id = 2102; m_fset[2].value = 0; // collision avoidance = off
+ m_fset[3].id = 0;
+
+ // Output:
+ m_segWidth = 946; // physical width of segment
+
+ const int charCnt = 46; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, false, true, true, true, false, true, true, true,
+ false, false, true, true, false, true, true, false, false, true,
+ true, false, false, true, true, false, false, true, true, false,
+ false, true, true, false, true, true, false, false, true, true,
+ false, true, true, true, false, false
+ };
+
+ const int glyphCnt = 46; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20 30 40
+ gid16 glyphList[] = {59, 70, 71, 65, 59, 70, 71, 23, 32, 175, 70, 65, 55, 70, 73, 55, 175, 184,185, 55, 76, 184,185, 55, 77, 70, 185, 41, 77, 70, 23, 56,175, 65, 27, 93, 70,185, 53, 69, 81, 50, 27,175, 70, 23};
+ int xPositions[] = { 0, 72, 47, 72,101, 174,149,174, 206, 281, 283, 251, 283,352, 316, 352, 418, 425,386,425,493, 495,458, 495,556,559, 528, 559, 623, 623,591,623,706, 676, 706, 776,777,738, 777, 836, 816,843,880,944,946,912};
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 5, 13, 0, 0, 5, 22, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 19, 0, 0, 8, 0, 0, 0, 5, 21, 0};
+ int advWidths[] = {47, 0, 24, 29, 47, 0, 24, 32, 44, 0, 0, 29, 33, 0, 36, 33, 0, 0, 26, 33, 0, 0, 26, 33, 0, 0, 26, 32, 0, 0, 32, 52, 0, 29, 32, 0, 0, 26, 39, 0, 26, 36, 32, 0, 0, 32};
+
+ int bbLefts[] = { 5, 45, 52, 73,106, 147,154,177, 209, 254, 257, 252, 286,326, 322, 355, 391, 414,390,428,463, 484, 462,498,540,532, 532, 562, 607, 597,594,627,679, 677, 709, 744,751,742, 784, 825, 820,849,883,917,919,915};
+ int bbRights[] = {72, 72, 63, 97,174, 174,165,211, 277, 281, 283, 276, 349,352, 355, 419, 418, 422,409,491,494, 491, 481,561,553,559, 551, 621, 620, 623,628,681,706, 701, 756, 776,777,761, 835, 833, 840,882,930,944,946,949};
+ int bbTops [] = {60, 50, 25, 25, 60, 50, 25, 41, 60, 49, 66, 25, 60, 50, 40, 60, 55, 65, 36, 60, 56, 74, 36, 60, -5, 55, 36, 60, -5, 50, 41, 40, 49, 25, 55, 56, 69, 36, 55, 61, 41, 40, 55, 55, 71, 41};
+ int bbBottoms [] = { 0, 35, 0, 0, 0, 35, 0, 0, 0, 34, 50, 0, 0, 35, 0, 0, 39, 51, 0, 0, 40, 60, 0, 0,-27, 40, 0, 0, -27, 35, 0, 0, 34, 0, 0, 40, 54, 0, 0, 45, 0, 0, 0, 39, 56, 0};
+
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,0, 1,2,0, 2,2,1,1, 3,3,0, 4,4,0, 5,6,0, 6,6,1,5, 7,7,0,
+ 8,8,0, 9,11,0, 10,11,0, 11,11,2,9,10, 12,12,0, 13,14,0, 14,14,1,13,
+ 15,15,0, 16,18,0, 17,18,0, 18,18,2,16,17, 19,19,0, 20,22,0, 21,22,0,
+ 22,22,2,20,21, 23,23,0, 24,26,0, 25,26,0, 26,26,2,24,25, 27,27,0, 28,30,0,
+ 29,30,0, 30,30,2,28,29, 31,31,0, 32,33,0, 33,33,1,32, 34,34,0, 35,37,0,
+ 36,37,0, 37,37,2,35,36, 38,38,0, 39,40,0, 40,40,1,39, 41,41,0, 42,42,0,
+ 43,45,0, 44,45,0, 45,45,2,43,44
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel Top, prim sel bottom, prim sel left,
+ // sec sel Top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 4;
+ int clickStuff[] = {
+ 55, 40, 1, true, 0,100, 46, kAbsent, kAbsent, kAbsent,
+ 65, 20, 1, false, 0,100, 46, kAbsent, kAbsent, kAbsent, // adjust to the left to get a valid IP?
+ 95, 84, 4, true, 0,100, 100, kAbsent, kAbsent, kAbsent,
+ 104, 40, 4, false, 0,100, 100, kAbsent, kAbsent, kAbsent
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
+ SetInsPtFlags(insPtFlags);
+ SetAttachedClusters(attachments, attCount);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+/*----------------------------------------------------------------------------------------------
+ A set of tests that uses Tai Viet script to test positioning.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupTaiViet2()
+{
+ m_testName = "Tai Viet No Collisions";
+ //m_traceLog = true;
+ //m_debug = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"Graphite Test TaiViet";
+ m_fontFile = "grtest_taiviet.ttf";
+ m_fontSize = 36; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 2000; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_text = TaiVietText();
+
+ m_fset[0].id = 2001; m_fset[0].value = 2; // vowel position = final consonant
+ m_fset[1].id = 1051; m_fset[1].value = 1; // diacritic selection = on
+ m_fset[2].id = 2102; m_fset[2].value = 1; // collision avoidance = off
+ m_fset[3].id = 0;
+
+ // Output:
+ m_segWidth = 947; // physical width of segment
+
+ const int charCnt = 46; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true
+ };
+
+ const int glyphCnt = 46; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20 30 40
+ gid16 glyphList[] = {59, 70, 71, 65, 59, 70, 71, 23, 32, 175, 70, 65, 55, 70, 73, 55, 175, 184,185, 55, 76, 184,185, 55, 77, 70, 185, 41, 77, 70, 23, 56,175, 65, 27, 93, 70,185, 53, 69, 81, 50, 27,175, 70, 23};
+ int xPositions[] = { 0, 82, 47, 72,101, 184,149,174, 206, 281, 283, 251, 283,359, 316, 352, 418, 431,386,425,496, 508,458, 497,559,578, 530, 561, 626, 635,593,626,709, 678, 708, 778,780,740, 780, 853, 819,846,882,942,947,914};
+ int yPositions[] = { 0, -3, 0, 0, 0, -3, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 9, 0, 0, 2, 20, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, -4, 0, 0, 5, 25, 0, 0, 8, 0, 0, 0, 0, 23, 0};
+ int advWidths[] = {47, 0, 24, 29, 47, 0, 24, 32, 44, 0, 0, 29, 33, 0, 36, 33, 0, 0, 26, 33, 0, 0, 26, 33, 0, 0, 26, 32, 0, 0, 32, 52, 0, 29, 32, 0, 0, 26, 39, 0, 26, 36, 32, 0, 0, 32};
+
+ int bbLefts[] = { 5, 56, 52, 73,106, 158,154,177, 209, 254, 257, 252, 286,333, 322, 355, 391, 420,390,428,466, 497, 462,500,542,552, 534, 564, 609, 609,597,629,682, 679, 711, 747,753,744, 786, 842, 823,851,885,916,921,918};
+ int bbRights[] = {72, 82, 63, 97,174, 184,165,211, 277, 281, 283, 276, 349,359, 355, 419, 418, 427,409,491,496, 504, 481,564,555,578, 553, 624, 622, 635,630,684,709, 703, 758, 778,780,763, 837, 850, 842,885,932,942,947,951};
+ int bbTops [] = {60, 46, 25, 25, 60, 46, 25, 41, 60, 49, 73, 25, 60, 50, 40, 60, 50, 60, 36, 60, 54, 72, 36, 60, -5, 52, 36, 60, -5, 50, 41, 40, 45, 25, 55, 56, 75, 36, 55, 61, 41, 40, 55, 50, 73, 41};
+ int bbBottoms [] = { 0, 31, 0, 0, 0, 31, 0, 0, 0, 34, 57, 0, 0, 35, 0, 0, 34, 46, 0, 0, 37, 57, 0, 0,-27, 36, 0, 0, -27, 35, 0, 0, 29, 0, 0, 40, 60, 0, 0, 45, 0, 0, 0, 34, 58, 0};
+
+ // Each group = glyph-index, base, number of attached, glyphs, attached-glyph-indices
+ int attachments[] = {
+ 0,0,0, 1,2,0, 2,2,1,1, 3,3,0, 4,4,0, 5,6,0, 6,6,1,5, 7,7,0,
+ 8,8,0, 9,11,0, 10,11,0, 11,11,2,9,10, 12,12,0, 13,14,0, 14,14,1,13,
+ 15,15,0, 16,18,0, 17,18,0, 18,18,2,16,17, 19,19,0, 20,22,0, 21,22,0,
+ 22,22,2,20,21, 23,23,0, 24,26,0, 25,26,0, 26,26,2,24,25, 27,27,0, 28,30,0,
+ 29,30,0, 30,30,2,28,29, 31,31,0, 32,33,0, 33,33,1,32, 34,34,0, 35,37,0,
+ 36,37,0, 37,37,2,35,36, 38,38,0, 39,40,0, 40,40,1,39, 41,41,0, 42,42,0,
+ 43,45,0, 44,45,0, 45,45,2,43,44
+ };
+ int attCount = sizeof(attachments) / sizeof(int);
+
+ // Each line in clickStuff represents one click test with the following items:
+ // click x-coord, click y-coord, char index, assoc-prev,
+ // prim sel top, prim sel bottom, prim sel left,
+ // sec sel top, sec sel bottom, sec sel left
+ // Y-coordinates are offsets from segment top; ie, (0,0) is segment top-left.
+ const int clickTestCnt = 4;
+ int clickStuff[] = {
+ 55, 40, 2, false, 35, 65, 49, 14, 33, 82,
+ 65, 20, 1, false, 0,100, 50, kAbsent, kAbsent, kAbsent,
+ 95, 84, 4, true, 0,100, 100, kAbsent, kAbsent, kAbsent,
+ 104, 40, 4, false, 0,100, 100, kAbsent, kAbsent, kAbsent
+ };
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
+ SetInsPtFlags(insPtFlags);
+ SetAttachedClusters(attachments, attCount);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+std::wstring TestCase::TaiVietText()
+{
+ std::wstring strRet;
+ wchar_t charData[] = {
+ 0xe00f,0xe042,0xe031,0xe02b,0xe00f,0xe042,0xe031,0xe025,0xe021,0xe033,
+ 0xe042,0xe02b,0xe01c,0xe042,0xe03e,0xe01c,0xe033,0xe040,0xe009,0xe01c,
+ 0xe039,0xe040,0xe009,0xe01c,0xe035,0xe042,0xe009,0xe024,0xe035,0xe042,
+ 0xe025,0xe01b,0xe033,0xe02b,0xe00a,0xe030,0xe042,0xe009,0xe01e,0xe040,
+ 0xe03b,0xe019,0xe00a,0xe033,0xe042,0xe025,0x0000
+ };
+ strRet.assign(charData);
+ return strRet;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Set up a test where the font is bad and we revert to dumb rendering
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupDumbFallback1()
+{
+ m_testName = "Dumb Fallback 1";
+ //m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"GrErr BadVersion";
+ m_fontFile = "grtest_badVersion.ttf";
+ m_text = RomanText(); // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_dumbFallback = true;
+
+ // Output:
+ m_badFont = true;
+ m_segWidth = 196; // physical width of segment
+
+ const int charCnt = 26; // number of characters in the segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true, true, true, true, true,
+ true, true, true, true, true, true
+ };
+
+ const int glyphCnt = 26; // number of glyphs in the segment
+
+ // need glyphCnt elements in these arrays:
+ // 0 10 20
+ gid16 glyphList[] = {71, 0, 0, 82, 0, 85, 73, 0, 0, 0, 0, 67, 0, 0, 75, 0, 43, 0, 79, 0, 0, 0, 0, 72, 72, 75};
+ int xPositions[] = { 0, 7, 15, 23, 31, 39, 46, 54, 62, 70, 78, 86, 93,101,109,114,122,128,136,149,157,165,173,181,186,192};
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ int advWidths[] = { 7, 8, 8, 8, 8, 6, 8, 8, 8, 8, 8, 7, 8, 8, 4, 8, 5, 8, 12, 8, 8, 8, 8, 5, 5, 4};
+
+ const int clickTestCnt = 0;
+ int * clickStuff = NULL;
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetBBs(NULL, NULL, NULL, NULL);
+ SetInsPtFlags(insPtFlags);
+ SetClickTests(clickTestCnt, clickStuff);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Now make sure we will get a crash when we turn dumb rendering off for the same font.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupDumbFallback2()
+{
+ m_testName = "Dumb Fallback 2";
+ //m_debug = true;
+ //m_traceLog = true;
+ //m_skip = true;
+
+ // Input:
+ m_fontName = L"GrErr BadVersion";
+ m_fontFile = "grtest_badVersion.ttf";
+ m_text = L"This is a test."; // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_dumbFallback = false;
+
+ // Output:
+ m_badFont = true;
+ m_noSegment = true;
+ m_segWidth = 0; // physical width of segment
+
+ const int charCnt = 0; // number of characters in the segment
+
+ const int glyphCnt = 0; // number of glyphs in the segment
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+}
+
+/*----------------------------------------------------------------------------------------------
+ Now make sure we will get a crash when we turn dumb rendering off for the same font.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetupBadFont()
+{
+ m_testName = "Bad Font";
+ //m_debug = true;
+ //m_traceLog = true;
+ m_skip = true;
+
+ // Input:
+ // The font has been corrupted so that the size of the cmap in the directory is invalid.
+ m_fontName = L"Graphite Test Roman";
+ m_fontFile = "grtest_badCmap.ttf";
+ m_text = L"This is a test."; // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_rtl = false;
+ m_backtrack = false;
+ m_dumbFallback = true; // wants to do dumb fall-back, but can't because the font is totally invalid
+
+ // Output:
+ m_badFont = true;
+ m_noSegment = true;
+ m_segWidth = 0; // physical width of segment
+
+ const int charCnt = 0; // number of characters in the segment
+
+ const int glyphCnt = 0; // number of glyphs in the segment
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+}
+// *** Add more methods here. ***
+
+
+//:>********************************************************************************************
+//:> Utility methods.
+//:>********************************************************************************************
+
+/*----------------------------------------------------------------------------------------------
+ Delete the list of tests.
+----------------------------------------------------------------------------------------------*/
+void TestCase::DeleteTests()
+{
+ delete[] g_ptcaseList;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Constructor: initialize test case with default values.
+----------------------------------------------------------------------------------------------*/
+TestCase::TestCase()
+{
+ m_testName = "Unknown";
+ m_debug = false;
+ m_traceLog = false;
+ m_skip = false;
+
+ m_fontName.erase();
+ m_fontFile.erase();
+ m_text.erase(); // text to render
+ m_fontSize = 12; // font size in points
+ m_prefBreak = klbWordBreak; // preferred break-weight
+ m_worstBreak = klbClipBreak; // worst-case break-weight
+ m_availWidth = 500; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_backtrack = false;
+ m_twsh = ktwshAll;
+ m_paraRtl = false;
+ m_firstChar = 0;
+ m_contextBlockInSize = 0;
+ m_contextBlockIn = NULL;
+ m_initWithPrev = false;
+ memset(m_fset, 0, MAXFEAT * sizeof(FeatureSetting));
+ m_dumbFallback = true;
+
+ m_badFont = false;
+ m_noSegment = false; // yes, a segment should be generated
+ m_charCount = 0;
+ m_glyphCount = 0;
+ m_glyphArray = NULL;
+ m_xPositions = NULL;
+ m_yPositions = NULL;
+ m_advWidths = NULL;
+ m_bbLefts = NULL;
+ m_bbRights = NULL;
+ m_bbTops = NULL;
+ m_bbBottoms = NULL;
+ m_insPointFlags = NULL;
+ m_charsToGlyphs = NULL;
+ m_c2gCount = 0;
+ m_attGlyphs = NULL;
+ m_attGCount = 0;
+ m_contextBlockOutSize = 0;
+ m_contextBlockOut = NULL;
+
+ m_clickTestCount = 0;
+ m_clickTests = NULL;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Destructor.
+----------------------------------------------------------------------------------------------*/
+TestCase::~TestCase()
+{
+ delete[] m_glyphArray;
+ delete[] m_xPositions;
+ delete[] m_yPositions;
+ delete[] m_advWidths;
+ delete[] m_bbLefts;
+ delete[] m_bbRights;
+ delete[] m_bbTops;
+ delete[] m_bbBottoms;
+ delete[] m_insPointFlags;
+ delete[] m_charsToGlyphs;
+ delete[] m_attGlyphs;
+ delete[] m_clickTests;
+ delete[] m_contextBlockIn;
+ delete[] m_contextBlockOut;
+}
+
+/*----------------------------------------------------------------------------------------------
+ Setters.
+----------------------------------------------------------------------------------------------*/
+void TestCase::SetCharCount(int charCount)
+{
+ m_charCount = charCount;
+ m_insPointFlags = new bool[charCount];
+}
+
+void TestCase::SetGlyphCount(int glyphCount)
+{
+ m_glyphCount = glyphCount;
+ m_glyphArray = new gid16[glyphCount];
+ m_xPositions = new int[glyphCount];
+ m_yPositions = new int[glyphCount];
+ m_advWidths = new int[glyphCount];
+ m_bbLefts = new int[glyphCount];
+ m_bbRights = new int[glyphCount];
+ m_bbTops = new int[glyphCount];
+ m_bbBottoms = new int[glyphCount];
+}
+
+void TestCase::SetGlyphList(gid16 * glyphList)
+{
+ for (int i = 0; i < m_glyphCount; i++)
+ m_glyphArray[i] = glyphList[i];
+}
+
+void TestCase::SetXPositions(int * xPosList)
+{
+ for (int i = 0; i < m_glyphCount; i++)
+ m_xPositions[i] = xPosList[i];
+}
+
+void TestCase::SetYPositions(int * yPosList)
+{
+ for (int i = 0; i < m_glyphCount; i++)
+ m_yPositions[i] = yPosList[i];
+}
+
+void TestCase::SetAdvWidths(int * advWidths)
+{
+ for (int i = 0; i < m_glyphCount; i++)
+ m_advWidths[i] = advWidths[i];
+}
+
+void TestCase::SetBBs(int * bbLefts, int * bbRights, int * bbTops, int * bbBottoms)
+{
+ if (bbLefts == NULL) // no bb tests
+ {
+ delete[] m_bbLefts;
+ delete[] m_bbRights;
+ delete[] m_bbTops;
+ delete[] m_bbBottoms;
+ m_bbLefts = NULL;
+ m_bbRights = NULL;
+ m_bbTops = NULL;
+ m_bbBottoms = NULL;
+ return;
+ }
+
+ for (int i = 0; i < m_glyphCount; i++)
+ {
+ m_bbLefts[i] = bbLefts[i];
+ m_bbRights[i] = bbRights[i];
+ m_bbTops[i] = bbTops[i];
+ m_bbBottoms[i] = bbBottoms[i];
+ }
+}
+
+void TestCase::SetInsPtFlags(bool * flags)
+{
+ for (int i = 0; i < m_charCount; i++)
+ m_insPointFlags[i] = flags[i];
+}
+
+void TestCase::SetCharsToGlyphs(int * stuff, int count)
+{
+ m_c2gCount = count;
+ m_charsToGlyphs = new int[count];
+ for (int i = 0; i < count; i++)
+ m_charsToGlyphs[i] = stuff[i];
+}
+
+void TestCase::SetAttachedClusters(int * stuff, int count)
+{
+ m_attGCount = count;
+ m_attGlyphs = new int[count];
+ for (int i = 0; i < count; i++)
+ m_attGlyphs[i] = stuff[i];
+}
+
+void TestCase::SetClickTests(int clickTestCount, int * clickStuff)
+{
+ const int fc = ClickTest::fieldCnt;
+
+ m_clickTestCount = clickTestCount;
+ m_clickTests = new ClickTest[clickTestCount];
+ for (int i = 0; i < clickTestCount; i++)
+ {
+ m_clickTests[i].xClick = clickStuff[(i * fc) + 0];
+ m_clickTests[i].yClick = clickStuff[(i * fc) + 1];
+ m_clickTests[i].charIndex = clickStuff[(i * fc) + 2];
+ m_clickTests[i].assocPrev = clickStuff[(i * fc) + 3];
+ m_clickTests[i].sel1Top = clickStuff[(i * fc) + 4];
+ m_clickTests[i].sel1Bottom = clickStuff[(i * fc) + 5];
+ m_clickTests[i].sel1Left = clickStuff[(i * fc) + 6];
+ m_clickTests[i].sel2Top = clickStuff[(i * fc) + 7];
+ m_clickTests[i].sel2Bottom = clickStuff[(i * fc) + 8];
+ m_clickTests[i].sel2Left = clickStuff[(i * fc) + 9];
+ }
+}
+
+void TestCase::SetInputContextBlock(int contextBlockInSize, gr::byte * pContextBlockIn)
+{
+ m_contextBlockInSize = contextBlockInSize;
+ if (contextBlockInSize == 0)
+ {
+ m_contextBlockIn = NULL;
+ }
+ else
+ {
+ m_contextBlockIn = new gr::byte[contextBlockInSize];
+ std::copy(pContextBlockIn, pContextBlockIn + contextBlockInSize, m_contextBlockIn);
+ }
+}
+
+void TestCase::SetOutputContextBlock(int contextBlockOutSize, gr::byte * pContextBlockOut)
+{
+ m_contextBlockOutSize = contextBlockOutSize;
+ m_contextBlockOut = new gr::byte[contextBlockOutSize];
+ std::copy(pContextBlockOut, pContextBlockOut + contextBlockOutSize, m_contextBlockOut);
+}
+
+
+
+
+void TestCase::SetupBugTest()
+{
+ m_testName = "Bug Test";
+ m_traceLog = true;
+ m_debug = true;
+ m_skip = true;
+
+ // Input:
+ m_fontName = L"Padauk";
+ m_fontFile = "grtest_infinity.ttf";
+
+ wchar_t charData[] = { 0x101e, 0x1032, 0x1015, 0x103c, 0x103d, 0x103e, 0x102d, 0x1038, 0x0000 };
+ m_text.assign(charData);
+ int charCnt = 8;
+
+ m_fontSize = 20; // font size in points
+ m_prefBreak = klbWsBreak; // preferred break-weight
+ m_worstBreak = klbHyphenBreak; // worst-case break-weight
+ m_availWidth = 1000; // width available for segment
+ m_bold = false;
+ m_italic = false;
+ m_backtrack = false;
+ m_rtl = false;
+
+ // Output:
+ m_noSegment = false;
+ m_segWidth = 52; // physical width of segment
+
+ // need charCnt elements in this array:
+ bool insPtFlags[] = {
+ true, false, true, true, false, false, false, true
+ };
+
+ int glyphCnt = 7;
+ // need glyphCnt elements in these arrays:
+ gid16 glyphList[] = {105,174,158,202,231,162,231};
+ int xPositions[] = { 0, 17, 20, 22, 28, 29, 38};
+ int yPositions[] = { 0, 0, 0, 0, 0, 0, 0};
+ int advWidths[] = { 17, 2, 9, 4, 0, 10, 0};
+
+ int bbLefts[] = { 0, 10, 21, 23, 23, 30, 33};
+ int bbRights[] = { 16, 19, 28, 25, 28, 39, 38};
+ int bbTops[] = { 7, 7, 7, -1, 15, 7, 15};
+ int bbBottoms[] = { 0, -7, -1, -7, 9, 0, 9};
+
+ // Each group = char-index, number of glyphs, glyph-indices.
+ int charsToGlyphs[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1, 3, 3, 1, 2, 4, 1, 4, 5, 0, 6, 1, 5, 7, 1, 6
+ };
+ int c2gCount = sizeof(charsToGlyphs) / sizeof(int);
+
+ // Finish setting up test case.
+ SetCharCount(charCnt);
+ SetGlyphCount(glyphCnt);
+ SetGlyphList(glyphList);
+ SetXPositions(xPositions);
+ SetYPositions(yPositions);
+ SetAdvWidths(advWidths);
+ SetCharsToGlyphs(charsToGlyphs, c2gCount);
+ SetBBs(bbLefts, bbRights, bbTops, bbBottoms);
+ SetInsPtFlags(insPtFlags);
+}
diff --git a/Build/source/libs/graphite/test/RegressionTest/TestCase.h b/Build/source/libs/graphite/test/RegressionTest/TestCase.h
new file mode 100644
index 00000000000..68258929a1f
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/TestCase.h
@@ -0,0 +1,245 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2004 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: TestCase.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Definition of TestCase class for Graphite regression test program.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef TESTCASE_H
+#define TESTCASE_H 1
+
+#define NO_EXCEPTIONS 1
+
+class TestCase
+{
+public:
+ // Methods to set up test cases.
+ void SetupSimpleTest();
+ void SetupSimpleBacktrackTest();
+ void SetupSurrogateTest(); // TODO: add a test for UTF-8
+ void SetupBurmese1();
+ void SetupBurmese2();
+ void SetupBurmese3();
+ void SetupBurmese4();
+ void SetupRoman();
+ void SetupRomanFeatures();
+ void SetupStackingAndBridging();
+ void SetupNoWhiteSpace();
+ void SetupNoWhiteSpaceNoSeg();
+ void SetupOnlyWhiteSpace();
+ void SetupCrossLine1();
+ void SetupCrossLine2();
+ void SetupCrossLine3();
+ void SetupCrossLine4();
+ void SetupArabic1();
+ void SetupArabic2();
+ void SetupTaiViet1();
+ void SetupTaiViet2();
+ void SetupDumbFallback1();
+ void SetupDumbFallback2();
+ void SetupBadFont();
+ void SetupBugTest();
+ // *** Add more methods here. ***
+
+protected:
+ // Auxiliary functions to set up test cases.
+ void SetupBurmeseAux(int charCount, int glyphCount, int clickTestCount);
+ void SetupArabicAux(int charCount, int glyphCount);
+ std::wstring BurmeseText();
+ std::wstring RomanText();
+ std::wstring CrossLineText();
+ std::wstring ArabicText();
+ std::wstring TaiVietText();
+
+public:
+ const static int kAbsent = -100; // not present in data
+
+public:
+ // constructor:
+ TestCase();
+ // destructor:
+ ~TestCase();
+
+ static int SetupTests(TestCase **);
+ static void DeleteTests();
+
+ // Getters:
+ std::string TestName() { return m_testName; }
+ bool RunDebugger() { return m_debug; }
+ bool TraceLog() { return m_traceLog; }
+ bool Skip() { return m_skip; }
+
+ std::wstring Text() { return m_text; }
+ std::wstring FontName() { return m_fontName; }
+ std::string FontFile() { return m_fontFile; }
+ size_t FontSize() { return m_fontSize; }
+ LineBrk PrefBreak() { return m_prefBreak; }
+ LineBrk WorstBreak() { return m_worstBreak; }
+ int FeatureID(int i) { return m_fset[i].id; }
+ int FeatureValue(int i) { return m_fset[i].value; }
+ FeatureSetting * Features() { return m_fset; }
+ int AvailWidth() { return m_availWidth; }
+ bool Backtrack() { return m_backtrack; }
+ TrWsHandling Twsh() { return m_twsh; }
+ bool Rtl() { return m_rtl; }
+ bool ParaRtl() { return m_paraRtl; }
+ size_t FirstChar() { return m_firstChar; }
+ bool DumbFallback() { return m_dumbFallback; }
+ size_t InputContextBlock(gr::byte ** ppContextBlock)
+ {
+ *ppContextBlock = m_contextBlockIn;
+ return m_contextBlockInSize;
+ }
+
+ bool InitWithPrevSeg() { return m_initWithPrev; }
+ bool BadFont() { return m_badFont; }
+ bool NoSegment() { return m_noSegment; }
+ int SegWidth() { return m_segWidth; }
+ int CharCount() { return m_charCount; }
+ int GlyphCount() { return m_glyphCount; }
+
+ int GlyphID(int i) { return m_glyphArray[i]; }
+ int XPos(int i) { return m_xPositions[i]; }
+ int YPos(int i) { return m_yPositions[i]; }
+ int AdvWidth(int i) { return m_advWidths[i]; }
+ int BbLeft(int i) { return m_bbLefts[i]; }
+ int BbRight(int i) { return m_bbRights[i]; }
+ int BbTop(int i) { return m_bbTops[i]; }
+ int BbBottom(int i) { return m_bbBottoms[i]; }
+ bool BbTests() { return (m_bbLefts != NULL); }
+
+ int InsPtFlag(int i) { return m_insPointFlags[i]; }
+
+ int CharToGlyphCount() { return m_c2gCount; }
+ int CharToGlyphItem(int i) { return m_charsToGlyphs[i]; }
+ int AttachedGlyphCount() { return m_attGCount; } // that is, the lenght of the data
+ int AttachedGlyphItem(int i) { return m_attGlyphs[i]; }
+
+ int NumberOfClickTests() { return m_clickTestCount; }
+ int XClick(int i) { return m_clickTests[i].xClick; }
+ int YClick(int i) { return m_clickTests[i].yClick; }
+ int ClickCharIndex(int i) { return m_clickTests[i].charIndex; }
+ bool ClickAssocPrev(int i) { return (bool)m_clickTests[i].assocPrev; }
+ int Sel1Top(int i) { return m_clickTests[i].sel1Top; }
+ int Sel1Bottom(int i) { return m_clickTests[i].sel1Bottom; }
+ int Sel1Left(int i) { return m_clickTests[i].sel1Left; }
+ int Sel2Top(int i) { return m_clickTests[i].sel2Top; }
+ int Sel2Bottom(int i) { return m_clickTests[i].sel2Bottom; }
+ int Sel2Left(int i) { return m_clickTests[i].sel2Left; }
+ size_t OutputContextBlockSize() { return m_contextBlockOutSize; }
+ bool CompareContextBlock(gr::byte * pResult)
+ {
+ for (size_t i = 0; i < m_contextBlockOutSize; i++)
+ {
+ if (m_contextBlockOut[i] != pResult[i])
+ return false;
+ }
+ return true;
+ }
+
+ struct ClickTest
+ {
+ int xClick;
+ int yClick;
+ int charIndex;
+ int assocPrev; // boolean: 0 or 1
+ int sel1Top;
+ int sel1Bottom;
+ int sel1Left; // we only need left or right, not both
+ int sel2Top;
+ int sel2Bottom;
+ int sel2Left;
+
+ const static int fieldCnt = 10;
+ };
+
+protected:
+ std::string m_testName;
+ bool m_debug; // break into the debugger when running this test
+ bool m_traceLog; // generate a logging file (tracelog.txt) for this test; if this is turned on for
+ // more than one test, the tests will be appended
+ bool m_skip;
+
+#define MAXFEAT 10
+
+ // Input parameters:
+ std::wstring m_text; // default: none
+ std::wstring m_fontName; // default: empty
+ std::string m_fontFile; // default: empty
+ size_t m_fontSize; // default: 12
+ LineBrk m_prefBreak; // default: word-break
+ LineBrk m_worstBreak; // default: clip-break
+ FeatureSetting m_fset[MAXFEAT]; // default: none
+ int m_availWidth; // default: 100
+ bool m_bold; // default: false
+ bool m_italic; // default: false
+ bool m_rtl; // default: false
+ bool m_backtrack; // default: false
+ TrWsHandling m_twsh; // default: ktwshAll
+ bool m_paraRtl; // default: false
+ size_t m_firstChar; // default: 0
+ size_t m_contextBlockInSize; // default: 0
+ gr::byte * m_contextBlockIn; // default: NULL -- DELETE
+ bool m_initWithPrev; // default: false
+ bool m_dumbFallback; // default: true
+ // start of line flag
+ // resolution
+ // justification
+
+ // Output:
+ bool m_badFont; // default: false
+ bool m_noSegment; // no segment should be generated
+ int m_segWidth;
+ int m_charCount;
+ int m_glyphCount;
+ gid16 * m_glyphArray;
+ int * m_xPositions;
+ int * m_yPositions;
+ int * m_advWidths;
+ int * m_bbLefts;
+ int * m_bbRights;
+ int * m_bbTops;
+ int * m_bbBottoms;
+ bool * m_insPointFlags;
+ int * m_charsToGlyphs; // char-to-glyph mappings
+ int m_c2gCount;
+ int * m_attGlyphs; // attachment clusters
+ int m_attGCount;
+ int m_clickTestCount;
+ ClickTest * m_clickTests;
+ size_t m_contextBlockOutSize;
+ gr::byte * m_contextBlockOut;
+ // glyphs-to-chars
+ // pdichwContext
+ // arrow key behavior
+ // etc.
+
+ // Setters:
+ void SetCharCount(int charCount);
+ void SetGlyphCount(int glyphCount);
+ void SetGlyphList(gid16 * glyphList);
+ void SetXPositions(int * posList);
+ void SetYPositions(int * posList);
+ void SetAdvWidths(int * advWidths);
+ void SetBBs(int * bbLefts, int * bbRights, int * bbTops, int * bbBottoms);
+ void SetInsPtFlags(bool * flags);
+ void SetCharsToGlyphs(int * stuff, int count);
+ void SetAttachedClusters(int * stuff, int count);
+ void SetClickTests(int clickTestCount, int * clickStuff);
+ void SetInputContextBlock(int contextBlockInSize, gr::byte * contextBlockIn);
+ void SetOutputContextBlock(int contextBlockOutSize, gr::byte * contextBlockIn);
+};
+
+
+#endif // !TESTCASE_H
+
diff --git a/Build/source/libs/graphite/test/RegressionTest/arabicText.wpx b/Build/source/libs/graphite/test/RegressionTest/arabicText.wpx
new file mode 100644
index 00000000000..62fee81be5b
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/arabicText.wpx
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE WpDoc SYSTEM "WorldPad.dtd">
+<WpDoc wpxVersion="2.0">
+
+<Languages>
+ <LgWritingSystem id="arb" language="arb" type="ISO-639-2">
+ <Name24>
+ <AUni ws="en">Arabic, Standard</AUni>
+ </Name24>
+ <Abbr24>
+ <AUni ws="en">Ara</AUni>
+ </Abbr24>
+ <Locale24><Integer val="1033"/></Locale24>
+ <RightToLeft24><Boolean val="true"/></RightToLeft24>
+ <DefaultSerif24><Uni>Scheherazade Graphite Alpha</Uni></DefaultSerif24>
+ <DefaultSansSerif24><Uni>Scheherazade Graphite Alpha</Uni></DefaultSansSerif24>
+ <DefaultBodyFont24><Uni>Charis SIL</Uni></DefaultBodyFont24>
+ <DefaultMonospace24><Uni>Courier</Uni></DefaultMonospace24>
+ <ICULocale24><Uni>arb</Uni></ICULocale24>
+ <KeyboardType24><Uni>standard</Uni></KeyboardType24>
+ <KeymanKeyboard24><Uni>Arabic Demo</Uni></KeymanKeyboard24>
+ <Collations24>
+ <LgCollation>
+ <Name30>
+ <AUni ws="en">DefaultCollation</AUni>
+ </Name30>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CI_AI</Uni></WinCollation30>
+ </LgCollation>
+ </Collations24>
+ </LgWritingSystem>
+</Languages>
+
+<Styles>
+ <StStyle>
+ <Name17><Uni>Normal</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni></Uni></BasedOn17>
+ <Next17><Uni>Normal</Uni></Next17>
+ <Rules17>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Bulleted List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Bulleted List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="101" bulNumStartAt="1"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 1</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 1</Uni></Next17>
+ <Rules17>
+ <Prop bold="invert" fontsize="14000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 2</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 2</Uni></Next17>
+ <Rules17>
+ <Prop italic="invert" fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 3</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 3</Uni></Next17>
+ <Rules17>
+ <Prop fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Numbered List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Numbered List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="10"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>External Link</Uni></Name17>
+ <Type17><Integer val="1"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>External Link</Uni></Next17>
+ <Rules17>
+ <Prop underline="single" forecolor="7f007f" undercolor="7f007f"/>
+ </Rules17>
+ </StStyle>
+</Styles>
+
+<Body docRightToLeft="false">
+ <StTxtPara>
+ <StyleRules15>
+ <Prop spaceBefore="12000" spaceAfter="12000" rightToLeft="1" namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="arb" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Arabic" fontVariations="1051=1,1030=0">ببَلَٔاَ Ú†Ùْٕ۠ڨ بÙÚ¹Ù’) ب â€ØªÚ¨Ø³Ù°Ø› Û±Û²Û³ سٰعدمپ لٰ، ‮۱۲۳۴۵‬ سهارعن؛</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+</Body>
+
+<PageSetup>
+ <PageInfo>
+ <TopMargin9999><Integer val="72000"/></TopMargin9999>
+ <BottomMargin9999><Integer val="72000"/></BottomMargin9999>
+ <LeftMargin9999><Integer val="90000"/></LeftMargin9999>
+ <RightMargin9999><Integer val="90000"/></RightMargin9999>
+ <HeaderMargin9999><Integer val="36000"/></HeaderMargin9999>
+ <FooterMargin9999><Integer val="36000"/></FooterMargin9999>
+ <PageSize9999><Integer val="0"/></PageSize9999>
+ <PageHeight9999><Integer val="792000"/></PageHeight9999>
+ <PageWidth9999><Integer val="612000"/></PageWidth9999>
+ <PageOrientation9999><Integer val="0"/></PageOrientation9999>
+ <Header9999>
+ <Str>
+ <Run ws="en">arabicText.wpx</Run>
+ </Str>
+ </Header9999>
+ <Footer9999>
+ <Str>
+ <Run ws="en">&amp;[page],&amp;[date]</Run>
+ </Str>
+ </Footer9999>
+ </PageInfo>
+</PageSetup>
+
+</WpDoc>
diff --git a/Build/source/libs/graphite/test/RegressionTest/bridgingStackingText.wpx b/Build/source/libs/graphite/test/RegressionTest/bridgingStackingText.wpx
new file mode 100644
index 00000000000..d91ecea8262
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/bridgingStackingText.wpx
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE WpDoc SYSTEM "WorldPad.dtd">
+<WpDoc wpxVersion="2.0">
+
+<Languages>
+ <LgWritingSystem id="en" language="en" type="ISO-639-1">
+ <Name24>
+ <AUni ws="en">English</AUni>
+ </Name24>
+ <Abbr24>
+ <AUni ws="en">Eng</AUni>
+ </Abbr24>
+ <Description24>
+ <AStr ws="en">
+ <Run ws="en">The standard alphabetic representation of English (United States style).</Run>
+ </AStr>
+ </Description24>
+ <Locale24><Integer val="1033"/></Locale24>
+ <RightToLeft24><Boolean val="false"/></RightToLeft24>
+ <DefaultSerif24><Uni>Times New Roman</Uni></DefaultSerif24>
+ <DefaultSansSerif24><Uni>Arial</Uni></DefaultSansSerif24>
+ <DefaultBodyFont24><Uni>Charis SIL</Uni></DefaultBodyFont24>
+ <DefaultMonospace24><Uni>Courier New</Uni></DefaultMonospace24>
+ <ICULocale24><Uni>en</Uni></ICULocale24>
+ <KeyboardType24><Uni>standard</Uni></KeyboardType24>
+ <Collations24>
+ <LgCollation>
+ <Name30>
+ <AUni ws="en">Default Collation</AUni>
+ </Name30>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CI_AI</Uni></WinCollation30>
+ </LgCollation>
+ <LgCollation>
+ <Name30>
+ <AUni ws="en">Case Sensitive</AUni>
+ </Name30>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CS_AI</Uni></WinCollation30>
+ </LgCollation>
+ </Collations24>
+ </LgWritingSystem>
+</Languages>
+
+<Styles>
+ <StStyle>
+ <Name17><Uni>Normal</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni></Uni></BasedOn17>
+ <Next17><Uni>Normal</Uni></Next17>
+ <Rules17>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Bulleted List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Bulleted List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="101" bulNumStartAt="1"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 1</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 1</Uni></Next17>
+ <Rules17>
+ <Prop bold="invert" fontsize="14000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 2</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 2</Uni></Next17>
+ <Rules17>
+ <Prop italic="invert" fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 3</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 3</Uni></Next17>
+ <Rules17>
+ <Prop fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Numbered List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Numbered List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="10"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>External Link</Uni></Name17>
+ <Type17><Integer val="1"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>External Link</Uni></Next17>
+ <Rules17>
+ <Prop underline="single" forecolor="7f007f" undercolor="7f007f"/>
+ </Rules17>
+ </StStyle>
+</Styles>
+
+<Body docRightToLeft="false">
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="48000" fontsizeUnit="mpt" fontFamily="Doulos SIL"></Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman">aÍa tÍa à̀Ía ʃ̀̀Ía aÌ–Ì–ï…¶a ʃ̀̀a aÌ–Ì–ï…¶a ʃÍï…¶a</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+</Body>
+
+<PageSetup>
+ <PageInfo>
+ <TopMargin9999><Integer val="72000"/></TopMargin9999>
+ <BottomMargin9999><Integer val="72000"/></BottomMargin9999>
+ <LeftMargin9999><Integer val="90000"/></LeftMargin9999>
+ <RightMargin9999><Integer val="90000"/></RightMargin9999>
+ <HeaderMargin9999><Integer val="36000"/></HeaderMargin9999>
+ <FooterMargin9999><Integer val="36000"/></FooterMargin9999>
+ <PageSize9999><Integer val="0"/></PageSize9999>
+ <PageHeight9999><Integer val="792000"/></PageHeight9999>
+ <PageWidth9999><Integer val="612000"/></PageWidth9999>
+ <PageOrientation9999><Integer val="0"/></PageOrientation9999>
+ <Header9999>
+ <Str>
+ <Run ws="en">bridgingDiacTest.wpx</Run>
+ </Str>
+ </Header9999>
+ <Footer9999>
+ <Str>
+ <Run ws="en">&amp;[page],&amp;[date]</Run>
+ </Str>
+ </Footer9999>
+ </PageInfo>
+</PageSetup>
+
+</WpDoc>
diff --git a/Build/source/libs/graphite/test/RegressionTest/burmeseText.wpx b/Build/source/libs/graphite/test/RegressionTest/burmeseText.wpx
new file mode 100644
index 00000000000..94d699a2a1c
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/burmeseText.wpx
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE WpDoc SYSTEM "WorldPad.dtd">
+<WpDoc wpxVersion="2.0">
+
+<Languages>
+ <LgWritingSystem id="my" language="my" type="ISO-639-1">
+ <Name24>
+ <AUni ws="en">Burmese</AUni>
+ </Name24>
+ <Description24>
+ <AStr ws="en">
+ <Run></Run>
+ </AStr>
+ </Description24>
+ <Locale24><Integer val="1109"/></Locale24>
+ <RightToLeft24><Boolean val="false"/></RightToLeft24>
+ <DefaultSerif24><Uni>Padauk</Uni></DefaultSerif24>
+ <DefaultSansSerif24><Uni>Arial</Uni></DefaultSansSerif24>
+ <DefaultMonospace24><Uni>Courier</Uni></DefaultMonospace24>
+ <ICULocale24><Uni>my</Uni></ICULocale24>
+ <KeyboardType24><Uni>keyman</Uni></KeyboardType24>
+ <KeymanKeyboard24><Uni>Burmese Unicode 0.03</Uni></KeymanKeyboard24>
+ <Collations24>
+ <LgCollation>
+ <Name30>
+ <AUni ws="en">DefaultCollation</AUni>
+ </Name30>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CI_AI</Uni></WinCollation30>
+ </LgCollation>
+ </Collations24>
+ </LgWritingSystem>
+</Languages>
+
+<Styles>
+ <StStyle>
+ <Name17><Uni>Normal</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni></Uni></BasedOn17>
+ <Next17><Uni>Normal</Uni></Next17>
+ <Rules17>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Bulleted List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Bulleted List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="101" bulNumStartAt="1"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 1</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 1</Uni></Next17>
+ <Rules17>
+ <Prop bold="invert" fontsize="14000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 2</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 2</Uni></Next17>
+ <Rules17>
+ <Prop italic="invert" fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 3</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 3</Uni></Next17>
+ <Rules17>
+ <Prop fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Numbered List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Numbered List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="10"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>External Link</Uni></Name17>
+ <Type17><Integer val="1"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>External Link</Uni></Next17>
+ <Rules17>
+ <Prop underline="single" forecolor="7f007f" undercolor="7f007f"/>
+ </Rules17>
+ </StStyle>
+</Styles>
+
+<Body docRightToLeft="false">
+ <StTxtPara>
+ <StyleRules15>
+ <Prop rightToLeft="0" namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="my" fontsize="20000" fontsizeUnit="mpt" fontFamily="Graphite Test Burmese">က္ယ္á€á€”္ဟ္‌ပ္‌á€á€¯á€­á€·á ပ္ယော္‌ရ္á€á€¹á€Ÿá€„္‌မ္ဟုአ</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+</Body>
+
+<PageSetup>
+ <PageInfo>
+ <TopMargin9999><Integer val="72000"/></TopMargin9999>
+ <BottomMargin9999><Integer val="72000"/></BottomMargin9999>
+ <LeftMargin9999><Integer val="90000"/></LeftMargin9999>
+ <RightMargin9999><Integer val="90000"/></RightMargin9999>
+ <HeaderMargin9999><Integer val="36000"/></HeaderMargin9999>
+ <FooterMargin9999><Integer val="36000"/></FooterMargin9999>
+ <PageSize9999><Integer val="0"/></PageSize9999>
+ <PageHeight9999><Integer val="792000"/></PageHeight9999>
+ <PageWidth9999><Integer val="612000"/></PageWidth9999>
+ <PageOrientation9999><Integer val="0"/></PageOrientation9999>
+ <Header9999>
+ <Str>
+ <Run ws="en">brumeseText.wpx</Run>
+ </Str>
+ </Header9999>
+ <Footer9999>
+ <Str>
+ <Run ws="en">&amp;[page],&amp;[date]</Run>
+ </Str>
+ </Footer9999>
+ </PageInfo>
+</PageSetup>
+
+</WpDoc>
diff --git a/Build/source/libs/graphite/test/RegressionTest/grtest_arabic.ttf b/Build/source/libs/graphite/test/RegressionTest/grtest_arabic.ttf
new file mode 100644
index 00000000000..df25e54b3f3
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/grtest_arabic.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/RegressionTest/grtest_badCmap.ttf b/Build/source/libs/graphite/test/RegressionTest/grtest_badCmap.ttf
new file mode 100644
index 00000000000..d66c725f12e
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/grtest_badCmap.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/RegressionTest/grtest_badVersion.ttf b/Build/source/libs/graphite/test/RegressionTest/grtest_badVersion.ttf
new file mode 100644
index 00000000000..babe42e5352
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/grtest_badVersion.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/RegressionTest/grtest_burmese.ttf b/Build/source/libs/graphite/test/RegressionTest/grtest_burmese.ttf
new file mode 100644
index 00000000000..ab253fbbfd6
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/grtest_burmese.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/RegressionTest/grtest_roman.ttf b/Build/source/libs/graphite/test/RegressionTest/grtest_roman.ttf
new file mode 100644
index 00000000000..2001ff6b5ac
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/grtest_roman.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/RegressionTest/grtest_taiviet.ttf b/Build/source/libs/graphite/test/RegressionTest/grtest_taiviet.ttf
new file mode 100644
index 00000000000..3bf4a662b11
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/grtest_taiviet.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/RegressionTest/grtest_xline.ttf b/Build/source/libs/graphite/test/RegressionTest/grtest_xline.ttf
new file mode 100644
index 00000000000..537a4b9532a
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/grtest_xline.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/RegressionTest/main.h b/Build/source/libs/graphite/test/RegressionTest/main.h
new file mode 100644
index 00000000000..1fcdacf6293
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/main.h
@@ -0,0 +1,89 @@
+/*--------------------------------------------------------------------*//*:Ignore this sentence.
+Copyright (C) 2004 SIL International. All rights reserved.
+
+Distributable under the terms of either the Common Public License or the
+GNU Lesser General Public License, as specified in the LICENSING.txt file.
+
+File: Main.h
+Responsibility: Sharon Correll
+Last reviewed: Not yet.
+
+Description:
+ Header files to include in the Graphite regression test program.
+-------------------------------------------------------------------------------*//*:End Ignore*/
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+#ifndef GRCOMPILER_H
+#define GRCOMPILER_H 1
+
+#define NO_EXCEPTIONS 1
+
+// To allow call to IsDebuggerPresent:
+#define _WIN32_WINNT WINVER
+
+//:>********************************************************************************************
+//:> Include files
+//:>********************************************************************************************
+// #include "windows.h"
+#include "stdafx.h"
+////#include "resource.h"
+// #include <hash_map>
+#include <fstream>
+#include <iostream>
+#include <vector>
+////#include <algorithm>
+#include <string>
+#ifdef _WIN32
+#include <crtdbg.h>
+#endif // _WIN32
+#include <assert.h>
+
+////using std::max;
+////using std::min;
+
+#include "GrCommon.h"
+#include "GrPlatform.h"
+
+////////#include "LgCharPropsStub.h"
+
+#include "GrConstants.h"
+///#include "TtfUtil.h"
+///#include "Tt.h"
+
+#include "GrClient.h"
+#include "ITextSource.h"
+#include "SimpleTextSrc.h"
+#include "IGrEngine.h"
+#include "IGrJustifier.h"
+#include "GrJustifier.h"
+#include "SegmentAux.h"
+#include "Font.h"
+// #include "WinFont.h"
+#include "FileFont.h"
+#include "Segment.h"
+#include "SegmentPainter.h"
+// #include "WinSegmentPainter.h"
+
+#include "TestCase.h"
+#include "RtTextSrc.h"
+
+
+//:>********************************************************************************************
+//:> Functions
+//:>********************************************************************************************
+void RunTests(int numberOfTests, TestCase * ptcaseList);
+int RunOneTestCase(TestCase * ptcase, Segment * psegPrev, Segment ** ppsegRet, RtTextSrc ** pptsrcRet);
+void OutputError(TestCase * ptcase, std::string strErr, int i = -1);
+void OutputErrorWithValues(TestCase * ptcase, std::string strErr, int i,
+ int valueFound, int valueExpected);
+void OutputErrorAux(TestCase * ptcase, std::string strErr, int i,
+ bool showValues, int valueFound, int valueExpected);
+bool WriteToLog(std::string str, int i = -1);
+bool WriteToLog(std::string str, int i,
+ bool showValues, int valueFound, int valueExpected);
+bool WriteToLog(int n);
+
+#endif //!WRCOMPILER_H
+
diff --git a/Build/source/libs/graphite/test/RegressionTest/makedebug.bat b/Build/source/libs/graphite/test/RegressionTest/makedebug.bat
new file mode 100644
index 00000000000..94d09eb720a
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/makedebug.bat
@@ -0,0 +1,2 @@
+cls
+nmake CFG=DEBUG -f makefile.vc \ No newline at end of file
diff --git a/Build/source/libs/graphite/test/RegressionTest/readme.txt b/Build/source/libs/graphite/test/RegressionTest/readme.txt
new file mode 100644
index 00000000000..e9f7facad20
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/readme.txt
@@ -0,0 +1,19 @@
+Graphite Regression Test
+
+COMPILING
+Use makedebug.bat to build a debug version. Creating a release version is not supported.
+
+RUNNING
+Extract the fonts from the fonts.zip file and install them.
+
+Options:
+/d - breaks into the debugger (if any) when an error occurs
+/s - silent mode; does not write to the standard output but only to the log file
+
+The program generates a file called grregtest.log with a list of errors.
+
+A file called tracelog.txt will be output for the tests for which tracing is turned on.
+
+ADDING TESTS
+See TestCase.cpp.
+
diff --git a/Build/source/libs/graphite/test/RegressionTest/romanText.wpx b/Build/source/libs/graphite/test/RegressionTest/romanText.wpx
new file mode 100644
index 00000000000..594cc886a0f
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/romanText.wpx
@@ -0,0 +1,206 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE WpDoc SYSTEM "WorldPad.dtd">
+<WpDoc wpxVersion="2.0">
+
+<Languages>
+ <LgWritingSystem id="en" language="en" type="ISO-639-1">
+ <Name24>
+ <AUni ws="en">English</AUni>
+ </Name24>
+ <Abbr24>
+ <AUni ws="en">Eng</AUni>
+ </Abbr24>
+ <Description24>
+ <AStr ws="en">
+ <Run ws="en">The standard alphabetic representation of English (United States style).</Run>
+ </AStr>
+ </Description24>
+ <Locale24><Integer val="1033"/></Locale24>
+ <RightToLeft24><Boolean val="false"/></RightToLeft24>
+ <DefaultSerif24><Uni>Times New Roman</Uni></DefaultSerif24>
+ <DefaultSansSerif24><Uni>Arial</Uni></DefaultSansSerif24>
+ <DefaultBodyFont24><Uni>Charis SIL</Uni></DefaultBodyFont24>
+ <DefaultMonospace24><Uni>Courier New</Uni></DefaultMonospace24>
+ <ICULocale24><Uni>en</Uni></ICULocale24>
+ <KeyboardType24><Uni>standard</Uni></KeyboardType24>
+ <Collations24>
+ <LgCollation>
+ <Name30>
+ <AUni ws="en">Default Collation</AUni>
+ </Name30>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CI_AI</Uni></WinCollation30>
+ </LgCollation>
+ <LgCollation>
+ <Name30>
+ <AUni ws="en">Case Sensitive</AUni>
+ </Name30>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CS_AI</Uni></WinCollation30>
+ </LgCollation>
+ </Collations24>
+ </LgWritingSystem>
+</Languages>
+
+<Styles>
+ <StStyle>
+ <Name17><Uni>Normal</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni></Uni></BasedOn17>
+ <Next17><Uni>Normal</Uni></Next17>
+ <Rules17>
+ <Prop italic="off" bold="off" superscript="off" underline="none" fontsize="10000" fontsizeUnit="mpt" offset="0" offsetUnit="mpt" forecolor="black" backcolor="white" undercolor="black" align="leading" firstIndent="0" leadingIndent="0" trailingIndent="0" spaceBefore="0" spaceAfter="0" lineHeight="10000" lineHeightUnit="mpt" lineHeightType="atLeast" rightToLeft="0" borderTop="0" borderBottom="0" borderLeading="0" borderTrailing="0" borderColor="black" bulNumScheme="0" bulNumStartAt="1" fontFamily="&lt;default serif&gt;">
+ <BulNumFontInfo backcolor="white" bold="off" fontsize="10000mpt" forecolor="black" italic="off" offset="0mpt" superscript="off" undercolor="black" underline="none" fontFamily="Times New Roman"/>
+ </Prop>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Bulleted List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Bulleted List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="101" bulNumStartAt="1"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 1</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 1</Uni></Next17>
+ <Rules17>
+ <Prop bold="invert" fontsize="14000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 2</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 2</Uni></Next17>
+ <Rules17>
+ <Prop italic="invert" fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 3</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 3</Uni></Next17>
+ <Rules17>
+ <Prop fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Numbered List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Numbered List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="10"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>External Link</Uni></Name17>
+ <Type17><Integer val="1"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>External Link</Uni></Next17>
+ <Rules17>
+ <Prop underline="single" forecolor="7f007f" undercolor="7f007f"/>
+ </Rules17>
+ </StStyle>
+</Styles>
+
+<Body docRightToLeft="false">
+ <StTxtPara>
+ <StyleRules15>
+ <Prop rightToLeft="0" namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman">ẽ̀p͡sg˨˥˧ŊấĩĨm̼̀̈̄ffi</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop rightToLeft="0" namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="20000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman">with features:</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop rightToLeft="0" namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman" fontVariations="1026=1,1029=1,1032=1,1024=2,1051=0">ẽ̀p͡sg˨˥˧ŊấĩĨm̼̀̈̄ffi</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop rightToLeft="0" namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman"></Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop rightToLeft="0" namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="20000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman">stacking and bridging:</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop rightToLeft="0" namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman">aÍa tÍa à̀Ía </Run>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" forecolor="ff6000" fontFamily="Graphite Test Roman">ʃ̀̀Ía</Run>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman"> aÌ–Ì–ï…¶a </Run>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" forecolor="blue" fontFamily="Graphite Test Roman">ʃ̀̀a</Run>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" fontFamily="Graphite Test Roman"> </Run>
+ <Run ws="en" fontsize="36000" fontsizeUnit="mpt" forecolor="yellow" fontFamily="Graphite Test Roman">aÌ–Ì–ï…¶a</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+</Body>
+
+<PageSetup>
+ <PageInfo>
+ <TopMargin9999><Integer val="72000"/></TopMargin9999>
+ <BottomMargin9999><Integer val="72000"/></BottomMargin9999>
+ <LeftMargin9999><Integer val="90000"/></LeftMargin9999>
+ <RightMargin9999><Integer val="90000"/></RightMargin9999>
+ <HeaderMargin9999><Integer val="36000"/></HeaderMargin9999>
+ <FooterMargin9999><Integer val="36000"/></FooterMargin9999>
+ <PageSize9999><Integer val="0"/></PageSize9999>
+ <PageHeight9999><Integer val="792000"/></PageHeight9999>
+ <PageWidth9999><Integer val="612000"/></PageWidth9999>
+ <PageOrientation9999><Integer val="0"/></PageOrientation9999>
+ <Header9999>
+ <Str>
+ <Run ws="en">romanText.wpx</Run>
+ </Str>
+ </Header9999>
+ <Footer9999>
+ <Str>
+ <Run ws="en">&amp;[page],&amp;[date]</Run>
+ </Str>
+ </Footer9999>
+ </PageInfo>
+</PageSetup>
+
+</WpDoc>
diff --git a/Build/source/libs/graphite/test/RegressionTest/stdafx.cpp b/Build/source/libs/graphite/test/RegressionTest/stdafx.cpp
new file mode 100644
index 00000000000..7f699d258e2
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/stdafx.cpp
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes
+// RegressionTest.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/Build/source/libs/graphite/test/RegressionTest/stdafx.h b/Build/source/libs/graphite/test/RegressionTest/stdafx.h
new file mode 100644
index 00000000000..c5e242de5cb
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/stdafx.h
@@ -0,0 +1,12 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+// #include <tchar.h>
+
+// TODO: reference additional headers your program requires here
diff --git a/Build/source/libs/graphite/test/RegressionTest/taivietText.wpx b/Build/source/libs/graphite/test/RegressionTest/taivietText.wpx
new file mode 100644
index 00000000000..964c4968611
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/taivietText.wpx
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE WpDoc SYSTEM "WorldPad.dtd">
+<WpDoc wpxVersion="2.0">
+
+<Languages>
+ <LgWritingSystem id="blt_TV" language="blt" type="ISO-639-2">
+ <Name24>
+ <AUni ws="en">Tai Dam</AUni>
+ </Name24>
+ <Locale24><Integer val="1033"/></Locale24>
+ <RightToLeft24><Boolean val="false"/></RightToLeft24>
+ <FontVariation24><Uni>2001=0,2005=0,2101=1,1051=1,2102=1</Uni></FontVariation24>
+ <DefaultSerif24><Uni>Tai Heritage Graphite</Uni></DefaultSerif24>
+ <DefaultSansSerif24><Uni>Arial</Uni></DefaultSansSerif24>
+ <DefaultBodyFont24><Uni>Charis SIL</Uni></DefaultBodyFont24>
+ <DefaultMonospace24><Uni>Courier</Uni></DefaultMonospace24>
+ <ICULocale24><Uni>blt_TV</Uni></ICULocale24>
+ <KeyboardType24><Uni>standard</Uni></KeyboardType24>
+ <Collations24>
+ <LgCollation>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CI_AI</Uni></WinCollation30>
+ </LgCollation>
+ </Collations24>
+ </LgWritingSystem>
+</Languages>
+
+<Styles>
+ <StStyle>
+ <Name17><Uni>Normal</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni></Uni></BasedOn17>
+ <Next17><Uni>Normal</Uni></Next17>
+ <Rules17>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Bulleted List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Bulleted List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="101" bulNumStartAt="1"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 1</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 1</Uni></Next17>
+ <Rules17>
+ <Prop bold="invert" fontsize="14000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 2</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 2</Uni></Next17>
+ <Rules17>
+ <Prop italic="invert" fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 3</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 3</Uni></Next17>
+ <Rules17>
+ <Prop fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Numbered List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Numbered List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="10"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>External Link</Uni></Name17>
+ <Type17><Integer val="1"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>External Link</Uni></Next17>
+ <Rules17>
+ <Prop underline="single" forecolor="7f007f" undercolor="7f007f"/>
+ </Rules17>
+ </StStyle>
+</Styles>
+
+<Body docRightToLeft="false">
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run></Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="blt_TV" fontsize="36000" fontsizeUnit="mpt" forecolor="transparent" fontFamily="Graphite Test TaiViet" fontVariations="2001=2,1051=0,2102=0">î€î‚î€î‚î‚î‚î€î€‰î€œî€¹î€î€‰î€œî€µî‚î‚î‚î€î€»î€™î€Šî€³î‚</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="blt_TV" fontsize="36000" fontsizeUnit="mpt" forecolor="transparent" fontFamily="Graphite Test TaiViet" fontVariations="2001=2,2102=0"></Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="blt_TV" fontsize="36000" fontsizeUnit="mpt" forecolor="transparent" fontFamily="Graphite Test TaiViet" fontVariations="2001=2,2102=1">î€î‚î€î‚î‚î‚î€î€‰î€œî€¹î€î€‰î€œî€µî‚î‚î‚î€î€»î€™</Run>
+ <Run ws="blt_TV" fontsize="36000" fontsizeUnit="mpt" forecolor="transparent" fontFamily="Graphite Test TaiViet" fontVariations="2001=2">î‚</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+</Body>
+
+<PageSetup>
+ <PageInfo>
+ <TopMargin9999><Integer val="72000"/></TopMargin9999>
+ <BottomMargin9999><Integer val="72000"/></BottomMargin9999>
+ <LeftMargin9999><Integer val="90000"/></LeftMargin9999>
+ <RightMargin9999><Integer val="90000"/></RightMargin9999>
+ <HeaderMargin9999><Integer val="36000"/></HeaderMargin9999>
+ <FooterMargin9999><Integer val="36000"/></FooterMargin9999>
+ <PageSize9999><Integer val="0"/></PageSize9999>
+ <PageHeight9999><Integer val="792000"/></PageHeight9999>
+ <PageWidth9999><Integer val="612000"/></PageWidth9999>
+ <PageOrientation9999><Integer val="0"/></PageOrientation9999>
+ <Header9999>
+ <Str>
+ <Run ws="en">collision_examples.wpx</Run>
+ </Str>
+ </Header9999>
+ <Footer9999>
+ <Str>
+ <Run ws="en">&amp;[page],&amp;[date]</Run>
+ </Str>
+ </Footer9999>
+ </PageInfo>
+</PageSetup>
+
+</WpDoc>
diff --git a/Build/source/libs/graphite/test/RegressionTest/xline.gdl b/Build/source/libs/graphite/test/RegressionTest/xline.gdl
new file mode 100644
index 00000000000..70bfa15902a
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/xline.gdl
@@ -0,0 +1,146 @@
+
+/*********************************************************************************
+ File: xline.gdl
+
+ For testing cross-line contextualization.
+
+ Compile with stddr.ttf
+
+ To test, type something like these examples:
+ abc$x
+ abcx@
+ abc$x@
+ and force a line break after the x.
+*********************************************************************************/
+
+#include "stddef.gdh"
+
+Bidi = false;
+
+#define duplicated user1
+
+
+table(glyph) {MUnits = 1000 }
+
+ g_A = codepoint("A");
+ g_B = codepoint("B");
+ g_C = codepoint("C");
+ g_D = codepoint("D");
+ g_E = codepoint("E");
+ g_F = codepoint("F");
+ g_G = codepoint("G");
+
+ g_a = codepoint("a");
+ g_b = codepoint("b");
+ g_c = codepoint("c");
+ g_d = codepoint("d");
+ g_e = codepoint("e");
+ g_f = codepoint("f");
+ g_g = codepoint("g");
+
+ g_x = codepoint("x");
+ g_y = codepoint("y");
+ g_z = codepoint("z");
+
+ g_asterisk = codepoint("*") { ptCenter = point(bb.width/2, bb.height/2) };
+ g_dollar = codepoint("$") { xWid = aw };
+ g_hash = codepoint("#");
+ g_at = codepoint("@") { xWid = aw };
+ g_amp = codepoint("&") {xWid = aw };
+ g_percent = codepoint("%");
+
+ g_leftArrow = codepoint("<") { xWid = aw };
+ g_rightArrow = codepoint(">") { xWid = aw };
+
+ clsUpper = codepoint("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+ { ptCenter = point(bb.width/2, ascent/2) };
+ clsLower = codepoint("abcdefghijklmnopqrstuvwxyz");
+
+ clsMyAny = glyphid(2..216) { justify.stretch = 700m };
+
+ g_m = codepoint("m");
+ g_Mlig = codepoint("M") {
+ component.one = box(0,0, bb.width/2, ascent);
+ component.two = box(bb.width/2,0, bb.width,ascent) };
+
+ gSpace = U+0020 { justify.stretch = 3000m };
+
+ clsXYZ = (g_x g_y g_z);
+
+endtable; // glyph
+
+
+table(lb)
+
+ // Allow non-optimal linebreaks after x, y, or z.
+ clsXYZ {break = BREAK_INTRA};
+
+endtable; // lb
+
+
+table(sub)
+
+pass(1)
+
+ // Switch the $ and @ if they are both there, and insert & after the one on the first
+ // line and before the one on the second line. Note that these rules supercede the rule
+ // to insert the left- and right-arrows.
+ g_dollar _ _ g_at > @7 g_amp:7 g_amp:1 @1
+ / _ _ ANY? # {break == BREAK_INTRA} ANY? _ _ ;
+
+ g_dollar
+ clsXYZ {measure.endofline = g_at.aw - g_dollar.aw + g_amp.aw}
+ ANY {measure.startofline = g_dollar.aw - g_at.aw + g_amp.aw}
+ g_at;
+ g_dollar
+ clsXYZ {measure.endofline = g_at.aw - g_dollar.aw + g_amp.aw}
+ g_at {measure.startofline = g_dollar.aw - g_at.aw + g_amp.aw};
+
+
+ // Just copy the $ to the following segment.
+ g_dollar _ > @1 {duplicated = true} g_dollar:1
+ / _ {duplicated == false} ANY? ^ # {break == BREAK_INTRA} ANY? _ ;
+
+ g_dollar
+ clsXYZ {measure.endofline = g_rightArrow.aw}
+ ANY {measure.startofline = g_dollar.aw + g_leftArrow.aw};
+
+
+ // Just copy the @ to the previous segment.
+ _ g_at > g_at:5 @5 {duplicated = true}
+ / _ ANY? ^ # {break == BREAK_INTRA} ANY? _ {duplicated == false};
+
+ clsXYZ {measure.endofline = g_at.aw + g_rightArrow.aw}
+ ANY {measure.startofline = g_leftArrow.aw}
+ g_at;
+
+ clsXYZ {measure.endofline = g_at.aw + g_rightArrow.aw}
+ g_at {measure.startofline = g_leftArrow.aw};
+
+
+ // Insert a '<' at the beginning of the line and a '>' at the end.
+ _ > g_leftArrow / # _;
+ _ > g_rightArrow / clsMyAny _ # ^ ;
+
+ clsMyAny {measure {startofline = g_leftArrow.aw; endofline = g_rightArrow.aw}};
+
+endpass;
+
+pass(2)
+
+ // Don't stretch trailing white space.
+ gSpace {justify.stretch = 0} / _ [gSpace [gSpace [gSpace gSpace?]? ]? ]? # ;
+ // In fact, don't stretch any line-boundary glyph.
+ clsMyAny {justify.stretch = 0} / _ #;
+
+
+endpass;
+
+endtable; // sub
+
+
+table(pos)
+
+ clsMyAny {adv.x += justify.width};
+
+endtable; // pos
diff --git a/Build/source/libs/graphite/test/RegressionTest/xlineText.wpx b/Build/source/libs/graphite/test/RegressionTest/xlineText.wpx
new file mode 100644
index 00000000000..a8d51fefda7
--- /dev/null
+++ b/Build/source/libs/graphite/test/RegressionTest/xlineText.wpx
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE WpDoc SYSTEM "WorldPad.dtd">
+<WpDoc wpxVersion="2.0">
+
+<Languages>
+ <LgWritingSystem id="en" language="en" type="ISO-639-1">
+ <Name24>
+ <AUni ws="en">English</AUni>
+ </Name24>
+ <Locale24><Integer val="1033"/></Locale24>
+ <RightToLeft24><Boolean val="false"/></RightToLeft24>
+ <DefaultSerif24><Uni>Times New Roman</Uni></DefaultSerif24>
+ <DefaultSansSerif24><Uni>Arial</Uni></DefaultSansSerif24>
+ <DefaultMonospace24><Uni>Courier New</Uni></DefaultMonospace24>
+ <ICULocale24><Uni>en</Uni></ICULocale24>
+ <KeyboardType24><Uni>standard</Uni></KeyboardType24>
+ <Collations24>
+ <LgCollation>
+ <Name30>
+ <AUni ws="en">DefaultCollation</AUni>
+ </Name30>
+ <WinLCID30><Integer val="1033"/></WinLCID30>
+ <WinCollation30><Uni>Latin1_General_CI_AI</Uni></WinCollation30>
+ </LgCollation>
+ </Collations24>
+ </LgWritingSystem>
+</Languages>
+
+<Styles>
+ <StStyle>
+ <Name17><Uni>Normal</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni></Uni></BasedOn17>
+ <Next17><Uni>Normal</Uni></Next17>
+ <Rules17>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Bulleted List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Bulleted List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="101" bulNumStartAt="1"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 1</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 1</Uni></Next17>
+ <Rules17>
+ <Prop bold="invert" fontsize="14000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 2</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 2</Uni></Next17>
+ <Rules17>
+ <Prop italic="invert" fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Heading 3</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Heading 3</Uni></Next17>
+ <Rules17>
+ <Prop fontsize="12000" fontsizeUnit="mpt" spaceBefore="12000" spaceAfter="3000"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>Numbered List</Uni></Name17>
+ <Type17><Integer val="0"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>Numbered List</Uni></Next17>
+ <Rules17>
+ <Prop firstIndent="-18000" bulNumScheme="10"/>
+ </Rules17>
+ </StStyle>
+ <StStyle>
+ <Name17><Uni>External Link</Uni></Name17>
+ <Type17><Integer val="1"/></Type17>
+ <BasedOn17><Uni>Normal</Uni></BasedOn17>
+ <Next17><Uni>External Link</Uni></Next17>
+ <Rules17>
+ <Prop underline="single" forecolor="7f007f" undercolor="7f007f"/>
+ </Rules17>
+ </StStyle>
+</Styles>
+
+<Body docRightToLeft="false">
+ <StTxtPara>
+ <StyleRules15>
+ <Prop namedStyle="Normal"/>
+ </StyleRules15>
+ <Contents16>
+ <Str>
+ <Run ws="en" fontsize="28000" fontsizeUnit="mpt" fontFamily="Graphite Test CrossLine">abcddddefx@ghijkmmmmn$yopppppqrsss$z@tttwwww</Run>
+ </Str>
+ </Contents16>
+ </StTxtPara>
+</Body>
+
+<PageSetup>
+ <PageInfo>
+ <TopMargin9999><Integer val="72000"/></TopMargin9999>
+ <BottomMargin9999><Integer val="72000"/></BottomMargin9999>
+ <LeftMargin9999><Integer val="90000"/></LeftMargin9999>
+ <RightMargin9999><Integer val="90000"/></RightMargin9999>
+ <HeaderMargin9999><Integer val="36000"/></HeaderMargin9999>
+ <FooterMargin9999><Integer val="36000"/></FooterMargin9999>
+ <PageSize9999><Integer val="0"/></PageSize9999>
+ <PageHeight9999><Integer val="792000"/></PageHeight9999>
+ <PageWidth9999><Integer val="612000"/></PageWidth9999>
+ <PageOrientation9999><Integer val="0"/></PageOrientation9999>
+ <Header9999>
+ <Str>
+ <Run ws="en">xline_test.wpx</Run>
+ </Str>
+ </Header9999>
+ <Footer9999>
+ <Str>
+ <Run ws="en">&amp;[page],&amp;[date]</Run>
+ </Str>
+ </Footer9999>
+ </PageInfo>
+</PageSetup>
+
+</WpDoc>
diff --git a/Build/source/libs/graphite/test/examples/burmese/Padauk.ttf b/Build/source/libs/graphite/test/examples/burmese/Padauk.ttf
new file mode 100644
index 00000000000..16a2ed864d9
--- /dev/null
+++ b/Build/source/libs/graphite/test/examples/burmese/Padauk.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/examples/burmese/bh1.utx b/Build/source/libs/graphite/test/examples/burmese/bh1.utx
new file mode 100644
index 00000000000..9dcaa5c3459
--- /dev/null
+++ b/Build/source/libs/graphite/test/examples/burmese/bh1.utx
@@ -0,0 +1,4 @@
+ကျွနှ်ပ်á€á€­á€¯á€·á ပျော်ရွှင်မှုአသာယာ ဠပြောမှုနှင့် အောင်မြင်မှုá€á€­á€¯á€·á€žá€Šá€º ကျွနု်ပ်á€á€­á€¯á€·á ကျန်းမာá€á€¼á€„်းအပေါ်á€á€½á€„် အများကြီး မှီá€á€­á€¯á€”ေပါသည်ዠပညာá€á€á€ºá€›á€”်አကြွယ်á€á€á€»á€™á€ºá€¸á€žá€¬á€›á€”်နှင့် ကြိုးပမ်း လုပ်ဆောင်မှုအားလုံး အောင်မြင်စေရန်အá€á€½á€€á€º ကျန်းမာရေးသည် အထူးပင် အရေးကြီးပါသည်ዠကျန်းမာရေးမပြည့်စုံလျှင် ကျွနု်ပ်á€á€­á€¯á€·á ပညာရေးአစီးပွားရေး မြှင့်á€á€„်မှုလုပ်ငန်းများ လုပ်နိုင်လိမ့်မည် မဟုá€á€ºá€•á€«á‹ သို့ဖြစ်á အစဥ်သဖြင့် ကျန်းမာနေရန် ကျွနု်ပ်á€á€­á€¯á€· ကြိုးစားကြရပါမည်á‹
+ကျွန်းမာရေးနှင့် ပြည့်စုံရန်အá€á€½á€€á€º ဆောင်ရွက်ရန် နည်းလမ်းများကို သိရှိလိုက်နာရပါမည်ዠအစားအသောက်አအအိပ်အနေአလေ့ကျင့်á€á€”်းနှင့် သန့်ရှင်းမှုá€á€­á€¯á€·á€žá€Šá€º ကျန်းမာရေးအá€á€½á€€á€º လိုအပ်á€á€»á€€á€ºá€™á€»á€¬á€¸ ဖြစ်ပါသည်ዠအစားအစာသည် အသက်ရှင်မှုအá€á€½á€€á€º အထူးလိုအပ်á€á€»á€€á€º ဖြစ်ပါသည်ዠကျွနု်ပ်á€á€­á€¯á€·á€žá€Šá€º အသက် ရှင်နေနိုင်ရန် အစာစားရá€á€¼á€„်းဖြစ်ပြီး စားသောက်ရန် အသက်ရှင်နေá€á€¼á€„်း မဟုá€á€ºá€ºá€•á€«á‹ ကျန်းမာမှုအá€á€½á€€á€º သင့်á€á€±á€¬á€ºá€žá€Šá€ºá€· ပရိုá€á€­á€”်းአသá€á€¹á€á€¯á€“ာá€á€ºá€™á€»á€¬á€¸á€”ှင့် ဗီá€á€¬á€™á€„်များ များစွာပါá€á€„်သည့် အစာများကို ရယူစားသုံးရန် လိုအပ်ပါသည်ዠကျွနု်ပ်á€á€­á€¯á€·á€”ှင့် လျှော်ကန်သင့် မြá€á€ºá€™á€Šá€ºá€· အိပ်စက်အနားယူမှုမှာလည်း အရေးကြီးပါသည်ዠကျွနု်ပ်á€á€­á€¯á€·á á€á€”္ဓာကိုယ်မှ ကြွက်သားများနှင့် အသားမျှင်များအား ထိန်းသိမ်းပြုပြင်မှုအá€á€½á€€á€º အိပ်စက်á€á€¼á€„်းနှင့် နားနေá€á€¼á€„်းá€á€­á€¯á€· အညီအမျှ လိုအပ်ပါသည်ዠထို့ကြောင့် လုံလောက်စွာ အိပ်စက်နားနေရပါမည်á‹
+ကိုယ်ကာယလေ့ကျင့်á€á€”်းများနှင့် သန့်ရှင်းမှုá€á€­á€¯á€·á€œá€Šá€ºá€¸ အရေးကြီး လိုအပ်ပါသည်ዠလမ်းလျှောက်á€á€¼á€„်းနှင့် အိမ်á€á€½á€„်း လေ့ကျင့်á€á€”်းများသည် အစားအသောက်စားလိုစိá€á€ºá€”ှင့် စိá€á€ºá€›á€½á€¾á€„်လန်းမှုá€á€­á€¯á€·á€€á€­á€¯ á€á€­á€¯á€¸á€•á€½á€¬á€¸á€…ေပါသည်ዠá€á€…်ကိုယ်ရေသန့်ရှင်းရေးက ကျန်းမာမှုကို အထောက်အကူပြုပါသည်ዠနေ့စဥ် ရေá€á€»á€­á€¯á€¸á€á€¼á€„်းአအစာမစားမီနှင့် စားပြီးá€á€­á€¯á€„်း လက်များကို စနစ်á€á€€á€»á€†á€±á€¸á€€á€¼á€±á€¬ ရပါမည်á‹
+အထက်ပါ ကျန်းမာရေး နည်းလမ်းများကို လိုက်နာဆောင်ရွက်ပါက ကျွနု်ပ်á€á€­á€¯á€· á€á€…်သက်á€á€¬á€¡á€á€½á€€á€º ကျန်းမာရေးနှင့်ပြည့်စုံနေမည်မှာ သေá€á€»á€¬á€•á€«á€žá€Šá€ºá‹ ကျွနု်ပ်á€á€­á€¯á€· ကျန်းမာနေလျှင် စီးပွားဥစ္စာပြည့်စုံá€á€¼á€„်းአပညာရေးပြည့်စုံá€á€¼á€„်းနှင့် အá€á€¼á€¬á€¸á€¡á€±á€¬á€„်မြင်မှုများကို စွမ်းဆောင်နိုင်ပါမည်ዠသို့ပါá ကျန်းမာá€á€¼á€„်းသည် á€á€»á€™á€ºá€¸á€žá€¬á€á€¼á€„်းဖြစ်ကြောင်းနှင့် ကျန်းမာá€á€¼á€„်းသည် á€á€»á€™á€ºá€¸á€žá€¬á€á€¼á€„်းထက် ပိုမိုကောင်းမွန်သည်ဟု ဆိုရမည် ဖြစ်ပါသည်á‹
diff --git a/Build/source/libs/graphite/test/examples/khmer/cloudsku2.txt b/Build/source/libs/graphite/test/examples/khmer/cloudsku2.txt
new file mode 100755
index 00000000000..6026347f841
--- /dev/null
+++ b/Build/source/libs/graphite/test/examples/khmer/cloudsku2.txt
@@ -0,0 +1,29 @@
+ពពក
+១-ពពកនៅលើមáŸážƒáž‚ឺ​ជា​ážáŸ†ážŽáž€áŸ‹áž‘ឹក​ážáž¼áž…ៗ​ជា​ច្រើន​ ។
+២-ពពកមើលទៅឃើញស្អាហ​ហើយ​មាន​ប្រយោជនáŸâ€‹áž…ំញáŸáŸ‡áž˜áž“ុស្សដែរ​​ ។​
+៣-ពពកគឺជាប្រភពនៃទឹកភ្លៀង ដែលរុក្ážáž‡áž¶ážáž·â€‹ នឹង​សážáŸ’វទាំងឡាយážáŸ’រូវការ​ ។​
+៤-ទឹកភ្លៀង​បង្អុរពីលើ "ពពក" ទៅក្នុង​ទន្លáŸâ€‹ážŠáŸ‚ល​ជា​ទី​កន្លែង​សំរាប់យើងរកážáŸ’រី​ ​។​
+៥-ទឹក​អ​ណ្ដូង​របស់​យើង​កáŸáž˜áž€â€‹áž–ី​ទឹក​ភ្លៀង​ដែរ​ ។​
+៦-យើងប្រើទឹកសំរាប់ហូប​ សំរាប់ដាំស្ល​ និងសំ​រាប់​ងូážâ€‹áž‘ឹក​សំរាប់បោកគក់​ ។​
+៧-នៅពáŸáž›ážáŸ’ងៃ​ ពពកផ្ដល់ម្លប់អោយ​យើង​ពី​កំ​ដៅ​ព្រះអាទិážáŸ’យ​​ ។
+៨-ប្រសិនបើមានពពកនៅពáŸáž›áž™áž”់​ នោះ​នឹង​​ អាច​​ការពារកំដៅពីចំហាយផែនដី ។​ áž áŸážáž»â€‹ážŠáž¼áž…្នáŸáŸ‡â€‹áž áž¾áž™â€‹áž‘ើប​ធ្វើអោយយើងមានអារម្មណáŸáž€áž€áŸ‹áž€áŸ’ដៅ​នៅ​ពáŸáž›â€‹áž™áž”់​ដែលមានពពកច្រើន​​ ។
+៩-áž–áŸáž›ážáŸ’លះពពកធ្វើអោយមានភ្លៀងធ្លាក់យ៉ាង​ážáŸ’លាំង​ និងធ្វើអោយមានទឹកជំនន់​ទឹក​ទន្លáŸâ€‹áž‡áž“់​ឡើងយ៉ាងážáŸ’លាំង​ហើយផ្ទះសំបែង​ជា​ច្រើន​បាន​ážáŸ’រូវ​លិចលង់ ​។​
+១០-ទឹកជំនន់បំផ្លិចបំផ្លាញផលដំណាំជាច្រើន​​ ។
+១១-សážáŸ’វជាច្រើនបានលង់ទឹកស្លាប់​​​ ។
+១២-មានផ្ទាំងដីធ្លាក់បាក់ចុះមកជាច្រើន​ ។​
+១៣-ប៉ុន្ដែនៅទីណាដែលគ្មានពពកច្រើន​ ទីកន្លែង​នោះ​ážáŸ’វះ​ážáž¶ážáž‘ឹក ​ ​និង​ក្លាយទៅជាវាល​រហោ​ស្ážáž¶áž“​ ។ អážáŸ‹â€‹áž˜áž¶áž“​ដើម​ឈើ​រុក្ážáž‡áž¶ážáž·â€‹ážšážŸáŸ‹ ស្វážâ€‹áž“ិង​មនុស្ស​កáŸâ€‹áž˜áž·áž“​អាច​រស់​នៅ​ទី​នោះ​បាន​ដែរ​ ។​​ ​
+
+CLOUDS
+1 The clouds in the sky are made up of little drops of water.
+2 Clouds are pretty to look at as well as useful to man.
+3 Clouds are the source of rain, which is needed by both plants and animals.
+4 Rain from the clouds fills the rivers where we get fish.
+5 Our wells are also filled by the rain that falls from the clouds.
+6 We use water for drinking, for cooking and for washing.
+7 During the day, the clouds provide shade from the heat of the sun.
+8 If there are clouds at night, they prevent the heat from the surface of the earth from rising. So that is why we feel warm on a cloudy night.
+9 Sometimes clouds bring heavy rains and floods. Rivers overflow and houses get flooded.
+10 The floods destroy crops.
+11 Animals are drowned.
+12 There are landslides.
+13 But in places where there are not many clouds, there is less water and the place becomes a desert in which no plants grow and no animals and people live.
diff --git a/Build/source/libs/graphite/test/examples/khmer/mond40gr6.ttf b/Build/source/libs/graphite/test/examples/khmer/mond40gr6.ttf
new file mode 100755
index 00000000000..a4a784c9026
--- /dev/null
+++ b/Build/source/libs/graphite/test/examples/khmer/mond40gr6.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errBadGloc.ttf b/Build/source/libs/graphite/test/fonterrors/errBadGloc.ttf
new file mode 100644
index 00000000000..6cce2701493
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errBadGloc.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errBadGloc2.ttf b/Build/source/libs/graphite/test/fonterrors/errBadGloc2.ttf
new file mode 100644
index 00000000000..89c54507f58
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errBadGloc2.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errBadPass.ttf b/Build/source/libs/graphite/test/fonterrors/errBadPass.ttf
new file mode 100644
index 00000000000..82ae6b66c7a
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errBadPass.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errBadStackMachine.ttf b/Build/source/libs/graphite/test/fonterrors/errBadStackMachine.ttf
new file mode 100644
index 00000000000..27350bef70c
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errBadStackMachine.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errBadSubs.ttf b/Build/source/libs/graphite/test/fonterrors/errBadSubs.ttf
new file mode 100644
index 00000000000..8027c72b79a
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errBadSubs.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errBadVersion.ttf b/Build/source/libs/graphite/test/fonterrors/errBadVersion.ttf
new file mode 100644
index 00000000000..babe42e5352
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errBadVersion.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errGarbageFsm.ttf b/Build/source/libs/graphite/test/fonterrors/errGarbageFsm.ttf
new file mode 100644
index 00000000000..7909e115949
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errGarbageFsm.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errGarbageGlat.ttf b/Build/source/libs/graphite/test/fonterrors/errGarbageGlat.ttf
new file mode 100644
index 00000000000..012e6b5d5b2
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errGarbageGlat.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errGarbageSilf.ttf b/Build/source/libs/graphite/test/fonterrors/errGarbageSilf.ttf
new file mode 100644
index 00000000000..b540a0d4dd5
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errGarbageSilf.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errSilfVerMismatch.ttf b/Build/source/libs/graphite/test/fonterrors/errSilfVerMismatch.ttf
new file mode 100644
index 00000000000..9088e11ea9a
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errSilfVerMismatch.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errSubsUnderflow.ttf b/Build/source/libs/graphite/test/fonterrors/errSubsUnderflow.ttf
new file mode 100644
index 00000000000..a7b04a1e146
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errSubsUnderflow.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/errTooManyClasses.ttf b/Build/source/libs/graphite/test/fonterrors/errTooManyClasses.ttf
new file mode 100644
index 00000000000..9c73c9a38a1
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/errTooManyClasses.ttf
Binary files differ
diff --git a/Build/source/libs/graphite/test/fonterrors/fonterrors.gdl b/Build/source/libs/graphite/test/fonterrors/fonterrors.gdl
new file mode 100644
index 00000000000..862284a2440
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/fonterrors.gdl
@@ -0,0 +1,43 @@
+
+/*********************************************************************************
+ File: fonterrors.gdl
+
+ For seeing some basic Graphite behavior. This version is used to generate
+ fonts that can be deliberately corrupted to test error handling in the
+ engine.
+
+ Compile with Std SILDoulos (stddr.ttf).
+*********************************************************************************/
+
+#include "stddef.gdh"
+
+Bidi = false;
+
+
+table(glyph)
+
+ clsUpperVowel = codepoint("AEIOU");
+ clsLowerVowel = codepoint("aeiou");
+
+ clsUpperCons = codepoint("BCDFGHJKLMNPQRSTVWXYZ");
+ clsLowerCons = codepoint("bcdfghjklmnpqrstvwxyz");
+
+ clsDigit = codepoint("0123456789") {tSuper = 400m};
+
+endtable; // glyph
+
+
+table(sub)
+
+ clsUpperVowel > clsLowerVowel;
+ clsLowerCons > clsUpperCons;
+
+endtable;
+
+
+table(pos)
+
+ clsDigit {shift.y += tSuper};
+
+endtable;
+
diff --git a/Build/source/libs/graphite/test/fonterrors/readme.txt b/Build/source/libs/graphite/test/fonterrors/readme.txt
new file mode 100644
index 00000000000..943b2853cf6
--- /dev/null
+++ b/Build/source/libs/graphite/test/fonterrors/readme.txt
@@ -0,0 +1,43 @@
+FONTS FOR TESTING ERROR HANDLING
+
+This directory constains a set of fonts that have been deliberately corrupted in order to test Graphite's error recovery capabilities.
+
+The "correct" behavior of the font is that vowels are rendered as lowercase, consonants as uppercase, and digits are raised vertically. For some of the fonts, recovery will be adequate to show some smart behaviors; for others the engine will revert to pure dumb rendering.
+
+
+* GrErr BadGloc - errBadGloc.ttf
+ The stated number of attributes exceeds actual number. This actually should not cause any real error, since the attributes are never read.
+
+* GrErr BadGloc2 - errBadGloc2.ttf
+ The stated number of attributes is less than actual number. This causes attributes greater than the number specified to have the value zero.
+
+* GrErr BadPass - errBadPass.ttf
+ One of the offsets to the pass information points off to somewhere nonsensical.
+
+* GrErr BadStackMachine - errStackMachine.ttf
+ Extra bytes have been inserted into the stack machine commands for both of the substitution rules. The engine manages to recover and handle the rule correctly in this case. (Reproduce using lowercase consonants or uppercase vowels.)
+
+* GrErr BadSubs - errSubs.ttf
+ A PutSubs command references a non-existent replacement class. This causes the glyph to appear as a square box. (Reproduce using lowercase consonants or uppercase vowels.)
+
+* GrErr BadVersion - errBadVersion.ttf
+ Bad version numbers are recorded in the Silf, Gloc, Glat, and Feat tables. Reading the Silf table will trigger an error being thrown, and the font will fall back to dumb rendering.
+
+* GrErr GarbageFsm - errGarbageFsm.ttf
+ The state table portions of the FSMs have been overwritten with garbage. Font will fall back to dumb rendering when any rules are fired.
+
+* GrErr GarbageGlat - errGarbageGlat.ttf
+ A section of Glat is overwritten with garbage. The "normal" behavior of the font is to raise the digits by 400m. But the lower digits (1 and 2) have been corrupted so they should simply not show that behavior.
+
+* GrErr GarbageSilf - errGarbageSilf.ttf
+ A section of Silf table is overwritten with garbage. Font will fall back to dumb rendering.
+
+* GrErr SilfVersionMismatch - errSilfVerMismatch.ttf
+ The Silf table claims to be version 1.0, but is actually version 2.0. Font will fall back to dumb rendering.
+
+* GrErr SubsUnderflow - errSubsUnderflow.ttf
+ A bogus command is inserted into the stack machine commands for both the substitution rules, causing an underflow when running the rules. The engine manages to recover and handle the rule correctly in this case. (Reproduce using lowercase consonants or uppercase vowels.)
+
+* GrErr TooManyClasses - errTooManyClasses.ttf
+ Very large number of classes in the list of replacement classes, larger than are actually there.
+
diff --git a/Build/source/libs/graphite/uninstalled-top.pc.in b/Build/source/libs/graphite/uninstalled-top.pc.in
new file mode 100644
index 00000000000..e6dff4bb12e
--- /dev/null
+++ b/Build/source/libs/graphite/uninstalled-top.pc.in
@@ -0,0 +1,6 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+priv_includedir=@abs_srcdir@/src
+includedir=@abs_srcdir@/include
+libdir=@abs_builddir@/src/.libs
+version=@VERSION@
diff --git a/Build/source/libs/graphite/withenable.ac b/Build/source/libs/graphite/withenable.ac
new file mode 100644
index 00000000000..83db7006d82
--- /dev/null
+++ b/Build/source/libs/graphite/withenable.ac
@@ -0,0 +1,4 @@
+# we don't currently support use of an installed graphite lib
+
+AC_ARG_WITH([graphite],
+ [ --without-graphite build xetex without graphite support])
diff --git a/Build/source/libs/libpng/ac/libpng.ac b/Build/source/libs/libpng/ac/libpng.ac
new file mode 100644
index 00000000000..009eb29cd33
--- /dev/null
+++ b/Build/source/libs/libpng/ac/libpng.ac
@@ -0,0 +1,3 @@
+## libs/libpng/ac/libpng.ac
+## define required functions and headers from system libpng
+KPSE_CHECK_LIB([libpng], [png_set_read_fn], [png.h])
diff --git a/Build/source/libs/libpng/ac/withenable.ac b/Build/source/libs/libpng/ac/withenable.ac
new file mode 100644
index 00000000000..37489800b6c
--- /dev/null
+++ b/Build/source/libs/libpng/ac/withenable.ac
@@ -0,0 +1,3 @@
+## libs/libpng/kpse/withenable.ac
+## configure options and TL libraries required for libpng
+KPSE_WITH_LIB([libpng], [zlib])
diff --git a/Build/source/libs/obsdcompat/ac/withenable.ac b/Build/source/libs/obsdcompat/ac/withenable.ac
new file mode 100644
index 00000000000..6e52d310e91
--- /dev/null
+++ b/Build/source/libs/obsdcompat/ac/withenable.ac
@@ -0,0 +1,3 @@
+## libs/obsdcompat/ac/withenable.ac
+## configure options and TL libraries required for obsdcompat
+KPSE_WITH_LIB([obsdcompat], , [tree])
diff --git a/Build/source/libs/t1lib/ac/t1lib.ac b/Build/source/libs/t1lib/ac/t1lib.ac
new file mode 100644
index 00000000000..1e8d0bcdc66
--- /dev/null
+++ b/Build/source/libs/t1lib/ac/t1lib.ac
@@ -0,0 +1,4 @@
+## libs/t1lib/ac/t1lib.ac
+## define required functions and headers from system t1lib
+KPSE_CHECK_LIB([t1lib], [T1_AddFont T1_CheckForInit],
+ [t1lib.h])
diff --git a/Build/source/libs/t1lib/ac/withenable.ac b/Build/source/libs/t1lib/ac/withenable.ac
new file mode 100644
index 00000000000..c67aca06b4c
--- /dev/null
+++ b/Build/source/libs/t1lib/ac/withenable.ac
@@ -0,0 +1,3 @@
+## libs/t1lib/ac/withenable.ac
+## configure options and TL libraries required for t1lib
+KPSE_WITH_LIB([t1lib])
diff --git a/Build/source/libs/teckit/Makefile.am.orig b/Build/source/libs/teckit/Makefile.am.orig
new file mode 100644
index 00000000000..fef026304ce
--- /dev/null
+++ b/Build/source/libs/teckit/Makefile.am.orig
@@ -0,0 +1,7 @@
+AUTOMAKE_OPTIONS = 1.6
+
+SUBDIRS = lib bin docs test
+
+EXTRA_DIST = license/License_CPLv05.txt
+EXTRA_DIST += license/License_LGPLv21.txt
+EXTRA_DIST += license/LICENSING.txt
diff --git a/Build/source/libs/teckit/ac/teckit.ac b/Build/source/libs/teckit/ac/teckit.ac
new file mode 100644
index 00000000000..490becdb5a2
--- /dev/null
+++ b/Build/source/libs/teckit/ac/teckit.ac
@@ -0,0 +1,3 @@
+## libs/teckit/ac/teckit.ac
+## define required functions and headers from system teckit
+KPSE_CHECK_LIB([teckit], [TECkit_CreateConverter], [TECkit_Engine.h])
diff --git a/Build/source/libs/teckit/ac/withenable.ac b/Build/source/libs/teckit/ac/withenable.ac
new file mode 100644
index 00000000000..536220e52ce
--- /dev/null
+++ b/Build/source/libs/teckit/ac/withenable.ac
@@ -0,0 +1,3 @@
+## libs/teckit/ac/withenable.ac
+## configure options and TL libraries required for teckit
+KPSE_WITH_LIB([teckit], [zlib])
diff --git a/Build/source/libs/xpdf/ac/withenable.ac b/Build/source/libs/xpdf/ac/withenable.ac
new file mode 100644
index 00000000000..84f89f7d835
--- /dev/null
+++ b/Build/source/libs/xpdf/ac/withenable.ac
@@ -0,0 +1,3 @@
+## libs/xpdf/ac/withenable.ac
+## configure options and TL libraries required for xpdf
+KPSE_WITH_LIB([xpdf], , [tree])
diff --git a/Build/source/libs/zlib/ac/withenable.ac b/Build/source/libs/zlib/ac/withenable.ac
new file mode 100644
index 00000000000..0e61eac2e51
--- /dev/null
+++ b/Build/source/libs/zlib/ac/withenable.ac
@@ -0,0 +1,3 @@
+## libs/zlib/ac/withenable.ac
+## configure options and TL libraries required for zlib
+KPSE_WITH_LIB([zlib])
diff --git a/Build/source/libs/zlib/ac/zlib.ac b/Build/source/libs/zlib/ac/zlib.ac
new file mode 100644
index 00000000000..aea063a2250
--- /dev/null
+++ b/Build/source/libs/zlib/ac/zlib.ac
@@ -0,0 +1,3 @@
+## libs/zlib/ac/zlib.ac
+## define required functions and headers from system zlib
+KPSE_CHECK_LIB([zlib], [inflate], [zlib.h])
diff --git a/Build/source/m4/README b/Build/source/m4/README
new file mode 100644
index 00000000000..d8e5db91e06
--- /dev/null
+++ b/Build/source/m4/README
@@ -0,0 +1,28 @@
+This directory is the central repository for Autoconf macros needed to build
+the teTeX / TeX live (TL) tree.
+
+(1) `Public' macros such as libtool.m4 used to build the libraries and
+programs in the TL subdirectories libs/*/, utils/*/, and texk/*/ that are
+owned by the TL tree (i.e., either not maintained independently or with a
+proxy Makefile.am using an unmodified source tree and bypassing the original
+build system).
+
+Note: the files libtool.m4 and ../build-aux/ltmain.sh must match.
+
+(2) `Private' macros for the TL infrastructure, used in directories owned
+by the TL tree.
+
+kpse-pkgs.m4: defines lists of subdirectories libs/LIB/, utils/PROG/, and
+ tex/PROG/ with libraries and programs that can be built as part of
+ the TL tree.
+kpse-setup.m4: macros that recurse through these lists to provide configure
+ options. They depend on configure fragments */*/ac/withenable.ac
+ defining the dependencies between these libraries and programs.
+
+(3) `Public' macros for the TL libraries in the subdirectories libs/*/ and
+texk/kpathsea/, used to configure programs and other libraries requiring
+these TL libraries. The macros are designed with the aim that programs
+maintained independently can be built as part of the TL tree or without TL
+(using installed versions of the required libraries), ideally using the same
+unmodified sources.
+
diff --git a/Build/source/m4/kpse-asm.m4 b/Build/source/m4/kpse-asm.m4
new file mode 100644
index 00000000000..4b5add4c4bc
--- /dev/null
+++ b/Build/source/m4/kpse-asm.m4
@@ -0,0 +1,41 @@
+# Private macro for the teTeX / TeX live (TL) tree.
+# by Peter Breitenlohner, April 15, 1996.
+# Copyright (C) 1996 - 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# KPSE_ASM_UNDERSCORE
+# -------------------
+# Check if gcc asm for i386 needs external symbols with an underscore.
+AC_DEFUN([KPSE_ASM_UNDERSCORE],
+[AC_CACHE_CHECK([whether gcc asm needs underscore],
+ [pb_cv_asm_underscore],
+ [
+# Some versions of GCC asm for i386 need an underscore prepended to
+# external symbols. Figure out if this is so.
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+extern char val ;
+extern void sub () ;
+#if defined (__i386__) && defined (__GNUC__)
+asm(" .align 4\n"
+".globl sub\n"
+"sub:\n"
+" movb \$][1,val\n"
+" ret\n");
+#else
+void sub () { val = 1; }
+#endif /* assembler */
+char val ;]],
+ [[sub (); return 0;]])],
+ [pb_cv_asm_underscore=no],
+ [pb_cv_asm_underscore=yes])])
+if test "x$pb_cv_asm_underscore" = xyes; then
+ AC_DEFINE([ASM_NEEDS_UNDERSCORE], 1,
+ [web2c: Define if gcc asm needs _ on external symbols.])
+fi
+]) # KPSE_ASM_UNDERSCORE
+
diff --git a/Build/source/m4/kpse-common.m4 b/Build/source/m4/kpse-common.m4
new file mode 100644
index 00000000000..920a909e253
--- /dev/null
+++ b/Build/source/m4/kpse-common.m4
@@ -0,0 +1,235 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 1995 - 2009 Karl Berry <tex-live@tug.org>
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_LIBS_PREPARE
+# -----------------
+# Enforce inclusion of this file.
+AC_DEFUN([KPSE_LIBS_PREPARE], [])
+
+# _KPSE_INIT()
+# ------------
+# Initialize infrastructure for libraries and programs in the TL tree.
+# If in the TL tree, define kpse_TL as relative path to the TL root.
+AC_DEFUN([_KPSE_INIT],
+[## $0: Initialize TL infrastructure
+m4_syscmd([test -f ../../texk/kpathsea/doc/kpathsea.texi])[]dnl
+m4_if(m4_sysval, [0], [m4_define([kpse_TL], [../../])])[]dnl
+m4_ifdef([kpse_TL],
+[kpse_BLD=`(cd "./kpse_TL()." && pwd)`
+kpse_SRC=`(cd "$srcdir/kpse_TL()." && pwd)`
+])[]dnl
+]) # _KPSE_INIT
+
+# KPSE_INIT()
+# -----------
+# Initialize, if not automatically done so via KPSE_*_FLAGS
+AC_DEFUN([KPSE_INIT],
+[AC_REQUIRE([_KPSE_INIT])])
+
+# _KPSE_USE_LIBTOOL()
+# ------------------
+AC_DEFUN([_KPSE_USE_LIBTOOL],
+[## $0: Generate a libtool script for use in configure tests
+AC_PROVIDE_IFELSE([LT_INIT], ,
+ [m4_fatal([$0: requires libtool])])[]dnl
+LT_OUTPUT
+m4_append([AC_LANG(C)],
+[ac_link="./libtool --mode=link --tag=CC $ac_link"
+])[]dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+[m4_append([AC_LANG(C++)],
+[ac_link="./libtool --mode=link --tag=CXX $ac_link"
+])])[]dnl
+AC_LANG(_AC_LANG)[]dnl
+]) # _KPSE_USE_LIBTOOL
+
+# _KPSE_LIB_FLAGS(LIBDIR, LIBNAME,
+# [SHELL-CODE=DEFAULT-SHELL-CODE],
+# INCLUDES, LIBS, OPTIONS,
+# [REBUILD-SRC-DEPENDENCIES],
+# [REBUILD-BLD-DEPENDENCIES])
+# ------------------------------------------------
+# Provide the configure options '--with-system-LIBDIR' (if in the TL tree),
+# '--with-LIBDIR-includes', and '--with-LIBDIR-libdir'.
+#
+# Set the make variables LIBDIR_INCLUDES and LIBDIR_LIBS to the CPPFLAGS and
+# LIBS required for the library in the directory libs/LIBDIR/ of the TL tree.
+#
+# If an installed (system) version of the library has been selected or is
+# implied, then execute SHELL-CODE to set the two variables.
+# In most cases DEFAULT-SHELL-CODE will do the right thing, based on the
+# values of with_LIBDIR_includes and with_LIBDIR_libdir.
+#
+# Otherwise, set LIBDIR_INCLUDES based on the value of INCLUDES and
+# LIBDIR_LIBS based on the value of LIBS. If OPTIONS specifies a libtool
+# library, then arrange that future configure test use libtool.
+# Furthermore, set LIBDIR_DEPEND and LIBDIR_RULE to values suitable as
+# dependency and rule to rebuild the library (assuming that
+# '${top_srcdir}/../../' and '${top_builddir}/../../' point to the root of
+# the TL tree).
+AC_DEFUN([_KPSE_LIB_FLAGS],
+[AC_REQUIRE([_KPSE_INIT])[]dnl
+## $0: Setup $1 (-l$2) flags
+m4_ifdef([kpse_TL],
+ [_KPSE_LIB_FLAGS_TL($@)],
+ [_KPSE_LIB_FLAGS_STANDALONE($@)])[]dnl
+AC_SUBST(AS_TR_CPP($1)[_INCLUDES])[]dnl
+AC_SUBST(AS_TR_CPP($1)[_LIBS])[]dnl
+AC_SUBST(AS_TR_CPP($1)[_DEPEND])[]dnl
+AC_SUBST(AS_TR_CPP($1)[_RULE])[]dnl
+m4_provide_if([AM_INIT_AUTOMAKE], [_AM_SUBST_NOTMAKE(AS_TR_CPP($1)[_RULE])])[]dnl
+]) # _KPSE_LIB_FLAGS
+
+# _KPSE_LIB_FLAGS_TL(LIBDIR, LIBNAME,
+# [SHELL-CODE=DEFAULT-SHELL-CODE],
+# INCLUDES, LIBS, OPTIONS,
+# [REBUILD-SRC-DEPENDENCIES],
+# [REBUILD-BLD-DEPENDENCIES])
+# ---------------------------------------------------
+# Internal subroutine for use of _KPSE_LIB_FLAGS inside the TL tree.
+m4_define([_KPSE_LIB_FLAGS_TL],
+[m4_if(m4_index([ $6 ], [ lt ]), [-1], ,
+ [AC_REQUIRE([_KPSE_USE_LIBTOOL])])[]dnl m4_if
+m4_if(m4_index([ $6 ], [ tree ]), [-1],
+ [AC_ARG_WITH([system-$1],
+ [AS_HELP_STRING([--with-system-$1],
+ [use installed $1 headers and library])])[]dnl
+_KPSE_LIB_FLAGS_WITH([$1])[]dnl
+if test "x$with_system_[]AS_TR_SH($1)" = xyes; then
+ m4_ifval([$3], [$3], AS_TR_CPP([kpse-$1-system-flags]))[]dnl
+else
+])[]dnl m4_if
+ AS_TR_CPP($1)[_INCLUDES=`echo '$4' | sed \
+ -e "s,SRC/,$kpse_SRC/,g" \
+ -e "s,BLD/,$kpse_BLD/,g"`]
+ AS_TR_CPP($1)[_LIBS=`echo '$5' | sed \
+ -e "s,BLD/,$kpse_BLD/,g"`]
+ m4_if([$1], [kpathsea],
+ [AS_TR_CPP($1)[_DEPEND=`echo '$5' | sed \
+ -e 's,BLD/texk/,${top_builddir}/../,g'`]
+ AS_TR_CPP($1)[_RULE='# Rebuild lib$2
+$(]AS_TR_CPP($1)[_DEPEND):]m4_ifval([$7],
+ [[ $7]])m4_ifval([$8], [[ $8
+ cd ${top_builddir}/../$1 && $(MAKE) $(AM_MAKEFLAGS)
+$8:]])[
+ cd ${top_builddir}/../$1 && $(MAKE) $(AM_MAKEFLAGS)']],
+ [AS_TR_CPP($1)[_DEPEND=`echo '$5' | sed \
+ -e 's,BLD/,${top_builddir}/../../,g'`]
+ AS_TR_CPP($1)[_RULE='# Rebuild lib$2
+$(]AS_TR_CPP($1)[_DEPEND):]m4_ifval([$7],
+ [[ $7]])m4_ifval([$8], [[ $8
+ cd ${top_builddir}/../../libs/$1 && $(MAKE) $(AM_MAKEFLAGS)
+$8:]])[
+ cd ${top_builddir}/../../libs/$1 && $(MAKE) $(AM_MAKEFLAGS)']])
+m4_if(m4_index([ $6 ], [ tree ]), [-1],
+ [fi
+])[]dnl m4_if
+]) # _KPSE_LIB_FLAGS_TL
+
+# _KPSE_LIB_FLAGS_STANDALONE(LIBDIR, LIBNAME,
+# [SHELL-CODE=DEFAULT-SHELL-CODE],
+# INCLUDES, LIBS, OPTIONS)
+# ------------------------------------------------
+# Internal subroutine for standalone use of_KPSE_LIB_FLAGS.
+m4_define([_KPSE_LIB_FLAGS_STANDALONE],
+[m4_if(m4_index([ $6 ], [ tree ]), [-1], ,
+[m4_fatal([$0: not in TL tree])])[]dnl m4_if
+_KPSE_LIB_FLAGS_WITH([$1])[]dnl
+m4_ifval([$3], [$3], [_KPSE_LIB_FLAGS_SYSTEM([$1], [$2])])[]dnl
+]) # _KPSE_LIB_FLAGS_STANDALONE
+
+# _KPSE_LIB_FLAGS_WITH(LIBDIR)
+# ----------------------------
+# Internal subroutine for of_KPSE_LIB_FLAGS: configure options.
+m4_define([_KPSE_LIB_FLAGS_WITH],
+[AC_ARG_WITH([$1-includes],
+ [AS_HELP_STRING([--with-$1-includes=DIR],
+ [$1 headers installed in DIR])])[]dnl
+AC_ARG_WITH([$1-libdir],
+ [AS_HELP_STRING([--with-$1-libdir=DIR],
+ [$1 library installed in DIR])])[]dnl
+]) # _KPSE_LIB_FLAGS_WITH
+
+# _KPSE_LIB_FLAGS_SYSTEM(LIBDIR, LIBNAME)
+# ---------------------------------------
+# Internal subroutine for of_KPSE_LIB_FLAGS: default flags for system library.
+m4_define([_KPSE_LIB_FLAGS_SYSTEM],
+[if test "x$with_[]AS_TR_SH($1)_includes" != x && test "x$with_[]AS_TR_SH($1)_includes" != xyes; then
+ AS_TR_CPP($1)_INCLUDES="-I$with_[]AS_TR_SH($1)_includes"
+fi
+AS_TR_CPP($1)_LIBS="-l$2"
+if test "x$with_[]AS_TR_SH($1)_libdir" != x && test "x$with_[]AS_TR_SH($1)_libdir" != xyes; then
+ AS_TR_CPP($1)_LIBS="-L$with_[]AS_TR_SH($1)_libdir $AS_TR_CPP($1)_LIBS"
+fi
+]) # _KPSE_LIB_FLAGS_SYSTEM
+
+# KPSE_COMMON(PACKAGE-NAME, [MORE-AUTOMAKE-OPTIONS])
+# --------------------------------------------------
+# Common Autoconf code for all programs using libkpathsea.
+# Originally written by Karl Berry as texk/kpathsea/common.ac.
+#
+# Initializtion of Automake and Libtool, some common tests.
+AC_DEFUN([KPSE_COMMON],
+[dnl Remember PACKAGE-NAME as Kpse_Package (for future messages)
+m4_define([Kpse_Package], [$1])
+dnl
+AM_INIT_AUTOMAKE([foreign dist-bzip2]m4_ifval([$2], [ $2]))
+AM_MAINTAINER_MODE
+dnl
+LT_PREREQ([2.2.6])
+LT_INIT
+dnl
+AC_SYS_LARGEFILE
+AC_FUNC_FSEEKO
+dnl
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_FUNC_CLOSEDIR_VOID
+AC_CHECK_HEADERS([assert.h float.h limits.h memory.h pwd.h stdlib.h \
+ string.h strings.h sys/param.h unistd.h])
+dnl
+dnl Replacement functions that may be required on ancient broken system.
+AC_CHECK_FUNCS([putenv strcasecmp strtol strstr])
+dnl
+dnl More common functions
+AC_CHECK_FUNCS([bcmp bcopy bzero getcwd getwd index memcmp memcpy rindex strchr strrchr])
+dnl
+AC_C_CONST
+AC_C_INLINE
+dnl
+dnl Check whether struct stat provides high-res time.
+AC_CHECK_MEMBERS([struct stat.st_mtim])
+dnl
+dnl Check whether prototypes work.
+AC_CACHE_CHECK([whether the compiler accepts prototypes],
+ [kb_cv_c_prototypes],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]],
+ [[extern void foo(int i,...);]])],
+ [kb_cv_c_prototypes=yes],
+ [kb_cv_c_prototypes=no])])
+if test "$kb_cv_c_prototypes" = yes; then
+ AC_DEFINE([HAVE_PROTOTYPES], 1,
+ [Define to 1 if your compiler understands prototypes.])
+fi
+dnl
+dnl This is a GNU libc invention.
+AC_CACHE_CHECK([whether program_invocation_name is predefined],
+ [kb_cv_var_program_inv_name],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
+ [[extern char *program_invocation_name;
+ program_invocation_name = "love";]])],
+ [kb_cv_var_program_inv_name=yes],
+ [kb_cv_var_program_inv_name=no])])
+if test "$kb_cv_var_program_inv_name" = yes; then
+ AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], 1,
+ [Define to 1 if you are using GNU libc or otherwise have global variables
+ `program_invocation_name' and `program_invocation_short_name'.])
+fi
+]) # KPSE_COMMON
diff --git a/Build/source/m4/kpse-cross.m4 b/Build/source/m4/kpse-cross.m4
new file mode 100644
index 00000000000..3f020060297
--- /dev/null
+++ b/Build/source/m4/kpse-cross.m4
@@ -0,0 +1,50 @@
+# Private macros for the kpathsea library.
+# Copyright (C) 1995 - 2009 Karl Berry <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# KPSE_CROSS_PATH_PROG(RESULT, CROSS_PROG, NORMAL_PROG)
+# -----------------------------------------------------
+# Find a program when cross-compiling, or use a default when not.
+# RESULT = variable which records the outcome
+# CROSS_PROG = program to look for when cross-compiling
+# NORMAL_PROG = program to use when not cross-compiling
+# Example: KPSE_CROSS_PATH_PROG([TANGLE], [tangle], [./tangle]) sets
+# 'TANGLE' to the program 'tangle' found in PATH when cross-compiling,
+# and to './tangle' if not.
+AC_DEFUN([KPSE_CROSS_PATH_PROG],
+ [if test "x$cross_compiling" = xyes; then
+AC_PATH_PROG([$1], [$2])
+if test -z "${$1}"; then
+ AC_MSG_ERROR([$2 was not found but is required when cross-compiling.
+ Install $2 or set \$$1 to the full pathname.])
+fi
+else
+ $1=$3
+fi
+]) # KPSE_CROSS_PATH_PROG
+
+# KPSE_CROSS_BUILD_VAR(STEM, PROG)
+# --------------------------------
+# Set BUILD$1 to $2 when cross-compiling, to $($1) if not.
+# Example: KPSE_CROSS_BUILD_VAR([CC], [cc]) sets 'BUILDCC' to 'cc'
+# if cross-compiling, and to '$(CC)' if not.
+AC_DEFUN([KPSE_CROSS_BUILD_VAR],
+ [if test "x$cross_compiling" = xyes; then
+ if test -z "${BUILD$1}"; then
+ BUILD$1='$2'
+ fi
+ AC_MSG_RESULT([setting \$BUILD$1 to ${BUILD$1}])
+else
+ if test -n "${BUILD$1}"; then
+ AC_MSG_WARN([\$BUILD$1 set but not cross-compiling.])
+ fi
+ BUILD$1='$($1)'
+fi
+AC_SUBST([BUILD$1])
+]) # KPSE_CROSS_BUILD_VAR
+
diff --git a/Build/source/m4/kpse-freetype-flags.m4 b/Build/source/m4/kpse-freetype-flags.m4
new file mode 100644
index 00000000000..09ff051fa68
--- /dev/null
+++ b/Build/source/m4/kpse-freetype-flags.m4
@@ -0,0 +1,29 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_FREETYPE_FLAGS([SHELL-CODE=DEFAULT-SHELL-CODE])
+# ----------------------------------------------------
+# Provide the configure options '--with-system-freetype' (if in the TL tree),
+# '--with-freetype-includes', and '--with-freetype-libdir'.
+#
+# Set the make variables FREETYPE_INCLUDES and FREETYPE_LIBS to the CPPFLAGS and
+# LIBS required for the `-lttf' library in libs/freetype/ of the TL tree.
+AC_DEFUN([KPSE_FREETYPE_FLAGS],
+[_KPSE_LIB_FLAGS([freetype], [ttf],
+ [$1],
+ [-IBLD/libs/freetype/freetype],
+ [BLD/libs/freetype/libttf.a], [],
+ [], [${top_builddir}/../../libs/freetype/freetype/freetype.h])[]dnl
+]) # KPSE_FREETYPE_FLAGS
+
+# KPSE_FREETYPE_SYSTEM_FLAGS
+# --------------------------
+AC_DEFUN([KPSE_FREETYPE_SYSTEM_FLAGS],
+[_KPSE_LIB_FLAGS_SYSTEM([freetype], [ttf])[]dnl
+]) # KPSE_FREETYPE_SYSTEM_FLAGS
diff --git a/Build/source/m4/kpse-freetype2-flags.m4 b/Build/source/m4/kpse-freetype2-flags.m4
new file mode 100644
index 00000000000..91171a854ab
--- /dev/null
+++ b/Build/source/m4/kpse-freetype2-flags.m4
@@ -0,0 +1,36 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_FREETYPE2_FLAGS([SHELL-CODE=DEFAULT-SHELL-CODE])
+# -----------------------------------------------------
+# Provide the configure options '--with-system-freetype2' (if in the TL tree),
+# '--with-freetype2-includes', and '--with-freetype2-libdir'.
+#
+# Set the make variables FREETYPE2_INCLUDES and FREETYPE2_LIBS to the CPPFLAGS and
+# LIBS required for the `-lfreetype' library in libs/freetype2/ of the TL tree.
+AC_DEFUN([KPSE_FREETYPE2_FLAGS],
+[AC_REQUIRE([KPSE_ZLIB_FLAGS])[]dnl
+_KPSE_LIB_FLAGS([freetype2], [freetype],
+ [$1],
+ [-IBLD/libs/freetype2/freetype2 -IBLD/libs/freetype2],
+ [BLD/libs/freetype2/libfreetype.a], [],
+ [], [${top_builddir}/../../libs/freetype2/ft2build.h])[]dnl
+]) # KPSE_FREETYPE2_FLAGS
+
+# KPSE_FREETYPE2_SYSTEM_FLAGS
+# ---------------------------
+AC_DEFUN([KPSE_FREETYPE2_SYSTEM_FLAGS],
+[if test "x$with_freetype2_includes" != x && test "x$with_freetype2_includes" != xyes; then
+ FREETYPE2_INCLUDES="-I$with_freetype2_includes/freetype2 -I$with_freetype2_includes"
+fi
+FREETYPE2_LIBS="-lfreetype"
+if test "x$with_freetype2_libdir" != x && test "x$with_freetype2_libdir" != xyes; then
+ FREETYPE2_LIBS="-L$with_freetype2_libdir $FREETYPE2_LIBS"
+fi
+]) # KPSE_FREETYPE2_SYSTEM_FLAGS
diff --git a/Build/source/m4/kpse-gd-flags.m4 b/Build/source/m4/kpse-gd-flags.m4
new file mode 100644
index 00000000000..81b19b82e68
--- /dev/null
+++ b/Build/source/m4/kpse-gd-flags.m4
@@ -0,0 +1,29 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_GD_FLAGS([SHELL-CODE=DEFAULT-SHELL-CODE])
+# ----------------------------------------------
+# Provide the configure options '--with-system-gd' (if in the TL tree),
+# '--with-gd-includes', and '--with-gd-libdir'.
+#
+# Set the make variables GD_INCLUDES and GD_LIBS to the CPPFLAGS and
+# LIBS required for the `-lgd' library in libs/gd/ of the TL tree.
+AC_DEFUN([KPSE_GD_FLAGS],
+[AC_REQUIRE([KPSE_LIBPNG_FLAGS])[]dnl
+_KPSE_LIB_FLAGS([gd], [gd],
+ [$1],
+ [-IBLD/libs/gd], [BLD/libs/gd/libgd.a], [],
+ [], [${top_builddir}/../../libs/libpng/gd.h])[]dnl
+]) # KPSE_GD_FLAGS
+
+# KPSE_GD_SYSTEM_FLAGS
+# --------------------
+AC_DEFUN([KPSE_GD_SYSTEM_FLAGS],
+[_KPSE_LIB_FLAGS_SYSTEM([gd], [gd])[]dnl
+]) # KPSE_GD_SYSTEM_FLAGS
diff --git a/Build/source/m4/kpse-graphite-flags.m4 b/Build/source/m4/kpse-graphite-flags.m4
new file mode 100644
index 00000000000..73f60f2ef52
--- /dev/null
+++ b/Build/source/m4/kpse-graphite-flags.m4
@@ -0,0 +1,30 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_GRAPHITE_FLAGS([SHELL-CODE=DEFAULT-SHELL-CODE])
+# ----------------------------------------------------
+# Provide the configure options '--with-system-graphite' (if in the TL tree),
+# '--with-graphite-includes', and '--with-graphite-libdir'.
+#
+# Set the make variables GRAPHITE_INCLUDES and GRAPHITE_LIBS to the CPPFLAGS
+# and LIBS required for the `-lgraphite' library in libs/graphite/ of the TL tree.
+AC_DEFUN([KPSE_GRAPHITE_FLAGS],
+[AC_REQUIRE([KPSE_ZLIB_FLAGS])[]dnl
+_KPSE_LIB_FLAGS([graphite], [graphite],
+ [$1],
+ [-ISRC/libs/graphite/include],
+ [BLD/libs/graphite/libgraphite.a], [],
+ [], [])[]dnl
+]) # KPSE_GRAPHITE_FLAGS
+
+# KPSE_GRAPHITE_SYSTEM_FLAGS
+# --------------------------
+AC_DEFUN([KPSE_GRAPHITE_SYSTEM_FLAGS],
+[_KPSE_LIB_FLAGS_SYSTEM([graphite], [graphite])[]dnl
+]) # KPSE_GRAPHITE_SYSTEM_FLAGS
diff --git a/Build/source/m4/kpse-kpathsea-flags.m4 b/Build/source/m4/kpse-kpathsea-flags.m4
new file mode 100644
index 00000000000..495f565b6cf
--- /dev/null
+++ b/Build/source/m4/kpse-kpathsea-flags.m4
@@ -0,0 +1,30 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_KPATHSEA_FLAGS([SHELL-CODE=DEFAULT-SHELL-CODE])
+# ----------------------------------------------------
+# Provide the configure options '--with-system-kpathsea' (if in the TL tree),
+# '--with-kpathsea-includes', and '--with-kpathsea-libdir'.
+#
+# Set the make variables KPATHSEA_INCLUDES and KPATHSEA_LIBS to the CPPFLAGS and
+# LIBS required for the `-lkpathsea' library in texk/kpathsea/ of the TL tree.
+AC_DEFUN([KPSE_KPATHSEA_FLAGS],
+[_KPSE_LIB_FLAGS([kpathsea], [kpathsea],
+ [$1],
+ [-IBLD/texk -ISRC/texk],
+ [BLD/texk/kpathsea/libkpathsea.la], [lt],
+ [${top_srcdir}/../kpathsea/*.[ch]],
+ [${top_builddir}/../kpathsea/paths.h])[]dnl
+]) # KPSE_KPATHSEA_FLAGS
+
+# KPSE_KPATHSEA_SYSTEM_FLAGS
+# --------------------------
+AC_DEFUN([KPSE_KPATHSEA_SYSTEM_FLAGS],
+[_KPSE_LIB_FLAGS_SYSTEM([kpathsea], [kpathsea])[]dnl
+]) # KPSE__SYSTEM_FLAGS
diff --git a/Build/source/m4/kpse-lex.m4 b/Build/source/m4/kpse-lex.m4
new file mode 100644
index 00000000000..ed77e6a8b24
--- /dev/null
+++ b/Build/source/m4/kpse-lex.m4
@@ -0,0 +1,23 @@
+# Private macros for the kpathsea library.
+# Copyright (C) 2003 - 2009 Karl Berry <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# KPSE_PROG_LEX()
+# ---------------
+# Like AC_PROG_LEX, with the flag '-l' for flex.
+AC_DEFUN([KPSE_PROG_LEX],
+[AC_PROG_LEX
+# Work around a problem with Flex Version 2.5.31 which needs -l flag.
+# Since all recent versions of flex support -l, don't check for the
+# specific version, but check that at least "--version" is supported.
+# We also want to catch LEX=/some/where/flex, so:
+case $LEX in
+ *flex) $LEX --version >/dev/null 2>&1 && LEX="$LEX -l" ;;
+esac
+]) # KPSE_PROG_LEX
+
diff --git a/Build/source/m4/kpse-libpng-flags.m4 b/Build/source/m4/kpse-libpng-flags.m4
new file mode 100644
index 00000000000..fa283ca3f36
--- /dev/null
+++ b/Build/source/m4/kpse-libpng-flags.m4
@@ -0,0 +1,29 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_LIBPNG_FLAGS([SHELL-CODE=DEFAULT-SHELL-CODE])
+# --------------------------------------------------
+# Provide the configure options '--with-system-libpng' (if in the TL tree),
+# '--with-libpng-includes', and '--with-libpng-libdir'.
+#
+# Set the make variables LIBPNG_INCLUDES and LIBPNG_LIBS to the CPPFLAGS and
+# LIBS required for the `-lpng' library in libs/libpng/ of the TL tree.
+AC_DEFUN([KPSE_LIBPNG_FLAGS],
+[AC_REQUIRE([KPSE_ZLIB_FLAGS])[]dnl
+_KPSE_LIB_FLAGS([libpng], [png],
+ [$1],
+ [-IBLD/libs/libpng], [BLD/libs/libpng/libpng.a], [],
+ [], [${top_builddir}/../../libs/libpng/png.h ${top_builddir}/../../libs/libpng/pngconf.h])[]dnl
+]) # KPSE_LIBPNG_FLAGS
+
+# KPSE_LIBPNG_SYSTEM_FLAGS
+# ------------------------
+AC_DEFUN([KPSE_LIBPNG_SYSTEM_FLAGS],
+[_KPSE_LIB_FLAGS_SYSTEM([libpng], [png])[]dnl
+]) # KPSE_LIBPNG_SYSTEM_FLAGS
diff --git a/Build/source/m4/kpse-macos-framework.m4 b/Build/source/m4/kpse-macos-framework.m4
new file mode 100644
index 00000000000..a2778839437
--- /dev/null
+++ b/Build/source/m4/kpse-macos-framework.m4
@@ -0,0 +1,23 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2005 - 2008 Jonathan Kew <...@...>
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_CHECK_FRAMEWORK(FRAMEWORK, BODY)
+# -------------------------------------
+AC_DEFUN([KPSE_CHECK_FRAMEWORK],
+[AC_CACHE_CHECK([for Mac OS X $1 framework],
+ [kpse_cv_have_$1],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$1/$1.h>]],
+ [[$2]])],
+ [kpse_cv_have_$1=yes],
+ [kpse_cv_have_$1=no])])
+AS_IF([test "x$kpse_cv_have_$1" = xyes],
+ [AC_DEFINE([HAVE_]AS_TR_CPP([$1]), 1,
+ [Define to 1 if you have the Mac OS X $1 framework.])])[]dnl
+]) # KPSE_CHECK_FRAMEWORK
diff --git a/Build/source/m4/kpse-obsdcompat-flags.m4 b/Build/source/m4/kpse-obsdcompat-flags.m4
new file mode 100644
index 00000000000..7a9b4b176fb
--- /dev/null
+++ b/Build/source/m4/kpse-obsdcompat-flags.m4
@@ -0,0 +1,21 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_OBSDCOMPAT_FLAGS()
+# -----------------------
+# Set the make variables OBSDCOMPAT_INCLUDES and OBSDCOMPAT_LIBS to
+# the CPPFLAGS and LIBS required for the `-lobsdcompat' library in
+# libs/obsdcompat/ of the TL tree.
+AC_DEFUN([KPSE_OBSDCOMPAT_FLAGS],
+[_KPSE_LIB_FLAGS([obsdcompat], [openbsd-compat], [],
+ [-IBLD/libs/obsdcompat -ISRC/libs/obsdcompat],
+ [BLD/libs/obsdcompat/libopenbsd-compat.a],
+ [tree],
+ [${top_srcdir}/../../libs/obsdcompat/*.[ch]])[]dnl
+]) # KPSE_OBSDCOMPAT_FLAGS
diff --git a/Build/source/m4/kpse-pkgs.m4 b/Build/source/m4/kpse-pkgs.m4
new file mode 100644
index 00000000000..82fa60c4e16
--- /dev/null
+++ b/Build/source/m4/kpse-pkgs.m4
@@ -0,0 +1,120 @@
+# Private macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+## ------------------------------ ##
+## Define lists of sub-packages. ##
+## ------------------------------ ##
+
+# Hopefully these lists are defined here and nowhere else.
+# Note: directories in these lists need not exist.
+
+# KPSE_LIBS_PKGS()
+# ----------------
+# Define the list of library sub-packages, i.e., subdirs 'libs/*'.
+# Each library must precede required other libraries (if any).
+AC_DEFUN([KPSE_LIBS_PKGS],
+[m4_define([kpse_libs_pkgs], [
+teckit
+graphite
+xpdf
+gd
+freetype2
+freetype
+t1lib
+obsdcompat
+libpng
+zlib
+])]) # KPSE_LIBS_PKGS
+
+# KPSE_ALL_SYSTEM_FLAGS()
+# -----------------------
+# Generate flags for all potential system libraries available,
+# only used at top-level.
+AC_DEFUN([KPSE_ALL_SYSTEM_FLAGS],
+[AC_REQUIRE([KPSE_LIBS_PREPARE])[]dnl
+AC_REQUIRE([KPSE_ZLIB_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_LIBPNG_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_T1LIB_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_FREETYPE_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_FREETYPE2_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_GD_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_GRAPHITE_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_TECKIT_SYSTEM_FLAGS])[]dnl
+AC_REQUIRE([KPSE_KPATHSEA_SYSTEM_FLAGS])[]dnl
+]) # KPSE_ALL_SYSTEM_FLAGS
+
+# KPSE_UTILS_PKGS()
+# -----------------
+# Define the list of utility sub-packages, i.e., subdirs 'utils/*'.
+AC_DEFUN([KPSE_UTILS_PKGS],
+[m4_define([kpse_utils_pkgs], [
+dialog
+pdfopen
+ps2eps
+psutils
+t1utils
+tpic2pdftex
+vlna
+])]) # KPSE_UTILS_PKGS
+
+# KPSE_TEXK_PKGS()
+# ----------------
+# Define the list of TeXk sub-packages, i.e., subdirs 'texk/*',
+# excluding 'texk/kpathsea'.
+AC_DEFUN([KPSE_TEXK_PKGS],
+[m4_define([kpse_texk_pkgs], [
+web2c
+one
+afm2pl
+bibtex8
+cjkutils
+detex
+devnag
+dtl
+dvi2tty
+dvidvi
+dviljk
+dvipdfm
+dvipdfmx
+dvipos
+dvipsk
+gsftopk
+lacheck
+lcdf-typetools
+makeindexk
+musixflx
+ps2pkm
+seetexk
+tex4htk
+ttf2pk
+ttfdump
+xdv2pdf
+xdvipdfmx
+tetex
+])]) # KPSE_TEXK_PKGS
+
+
+
+## ------------------------------- ##
+## Loop over one of these lists. ##
+## ------------------------------- ##
+
+# KPSE_FOR_PKGS(LIST, ACTION)
+# ---------------------------
+# Run the shell code ACTION for each element Kpse_Pkg in kpse_LIST_pkgs,
+# with Kpse_pkg a sanitized version of Kpse_Pkg for shell variables and
+# Kpse_PKG a sanitized (upper case) version for make variables.
+AC_DEFUN([KPSE_FOR_PKGS],
+[AC_REQUIRE([KPSE_LIBS_PKGS])AC_REQUIRE([KPSE_UTILS_PKGS])AC_REQUIRE([KPSE_TEXK_PKGS])[]dnl
+AC_FOREACH([Kpse_Pkg], kpse_$1_pkgs,
+[m4_pushdef([Kpse_pkg], AS_TR_SH(Kpse_Pkg))[]dnl
+m4_pushdef([Kpse_PKG], AS_TR_CPP(Kpse_Pkg))[]dnl
+$2
+m4_popdef([Kpse_pkg])m4_popdef([Kpse_PKG])[]dnl
+])]) # KPSE_FOR_PKGS
diff --git a/Build/source/m4/kpse-setup.m4 b/Build/source/m4/kpse-setup.m4
new file mode 100644
index 00000000000..369c694ad60
--- /dev/null
+++ b/Build/source/m4/kpse-setup.m4
@@ -0,0 +1,140 @@
+# Private macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_SETUP(TOP-LEVEL)
+# ---------------------
+# Initialize path prefix kpse_TL to top-level teTeX / TeX live (TL) directory.
+# Sinclude all withenable.ac files providing:
+# configure options --with-system-LIB, --with-LIB-includes, and --with-LIB-libdir
+# for libraries
+# configure option --without-PKG for programs
+# library dependencies for programs and libraries
+AC_DEFUN([KPSE_SETUP],
+[m4_define([kpse_TL], [$1])
+KPSE_WEB2C_PREPARE
+m4_sinclude(kpse_TL[ac/withenable.ac])
+m4_sinclude(kpse_TL[utils/ac/withenable.ac])
+KPSE_FOR_PKGS([utils], [m4_sinclude(kpse_TL[utils/]Kpse_Pkg[/ac/withenable.ac])])
+m4_sinclude(kpse_TL[texk/ac/withenable.ac])
+KPSE_FOR_PKGS([texk], [m4_sinclude(kpse_TL[texk/]Kpse_Pkg[/ac/withenable.ac])])
+m4_sinclude(kpse_TL[texk/kpathsea/ac/withenable.ac])
+m4_sinclude(kpse_TL[libs/ac/withenable.ac])
+KPSE_FOR_PKGS([libs], [m4_sinclude(kpse_TL[libs/]Kpse_Pkg[/ac/withenable.ac])])
+]) # KPSE_SETUP
+
+# KPSE_WITH_PROG(PROG, REQUIRED-LIBS, OPTIONS, [COMMENT])
+# -------------------------------------------------------
+# Provide the configure option --enable-PROG if the option `without' is
+# specified, or -disable-PROG otherwise.
+# Define the list of libraries required from the TL tree (if any).
+# Options:
+# without - do not build by default
+AC_DEFUN([KPSE_WITH_PROG],
+[m4_pushdef([Kpse_with], m4_if(m4_index([ $3 ], [ without ]), [-1], [yes], [no]))[]dnl
+AC_ARG_ENABLE([$1],
+ AS_HELP_STRING([[--]m4_if(Kpse_with, [yes], [dis], [en])[able-$1]],
+ m4_if(Kpse_with, [yes],
+ [do not ])[build the $1 ]m4_ifval([$4],
+ [($4) ])[package]))[]dnl
+case $enable_[]AS_TR_SH($1) in #(
+ yes|no);; #(
+ *) AC_MSG_NOTICE([Assuming `--]m4_if(Kpse_with, [no], [dis], [en])[able-$1'])
+ enable_[]AS_TR_SH($1)=Kpse_with
+ ac_configure_args="$ac_configure_args '--[]m4_if(Kpse_with, [no], [dis], [en])able-$1'";;
+esac
+m4_popdef([Kpse_with])[]dnl
+m4_ifval([$2], [
+test "x$enable_[]AS_TR_SH($1)" = xno || {
+AC_FOREACH([Kpse_Lib], [$2], [ need_[]AS_TR_SH(Kpse_Lib)=yes
+])}
+])[]dnl m4_ifval
+]) # KPSE_WITH_PROG
+
+# KPSE_WITH_LIB(LIB, REQUIRED-LIBS, OPTIONS, [COMMENT-SYS],
+ [COMMENT-INC], [COMMENT-LIB])
+# ---------------------------------------------------------
+# Unless the option `tree' is specified, provide the configure options
+# --with-system-LIB, --with-LIB-includes, and --with-LIB-libdir.
+# Define the list of libraries required from the TL tree (if any).
+# Options:
+# tree - only use library from the TL tree
+# The last three arguments are optional additions to the help texts.
+#
+# At the top-level we build a (reversed) list of potential system libraries.
+AC_DEFUN([KPSE_WITH_LIB],
+[m4_if(m4_index([ $3 ], [ tree ]), [-1],
+[AC_ARG_WITH([system-$1],
+ [AS_HELP_STRING([--with-system-$1],
+ [use installed $1 headers and library]m4_ifval([$4], [ ($4)]))])[]dnl
+AC_ARG_WITH([$1-includes],
+ [AS_HELP_STRING([--with-$1-includes=DIR],
+ [$1 headers installed in DIR]m4_ifval([$5], [ ($5)]))])[]dnl
+AC_ARG_WITH([$1-libdir],
+ [AS_HELP_STRING([--with-$1-libdir=DIR],
+ [$1 library installed in DIR]m4_ifval([$6], [ ($6)]))])[]dnl
+if test "x$with_system_[]AS_TR_SH($1)" = x; then
+ if test -f $srcdir/kpse_TL[]m4_if([$1], [kpathsea], [texk], [libs])/$1/configure; then
+ AC_MSG_NOTICE([Assuming `$1' headers and library from TL tree])
+ with_system_[]AS_TR_SH($1)=no
+ else
+ AC_MSG_NOTICE([Assuming installed `$1' headers and library])
+ with_system_[]AS_TR_SH($1)=yes
+ fi
+ ac_configure_args="$ac_configure_args '--with-system-$1=$with_system_[]AS_TR_SH($1)'"
+m4_ifset([kpse_TL], [], dnl top level only
+[elif test "x$with_system_[]AS_TR_SH($1)" = xyes; then
+ AC_MSG_NOTICE([Using installed `$1' headers and library])
+else
+ AC_MSG_NOTICE([Using `$1' headers and library from TL tree])
+ if test "x$with_system_[]AS_TR_SH($1)" != xno; then
+ with_system_[]AS_TR_SH($1)=no
+ ac_configure_args="$ac_configure_args '--without-system-$1'"
+ fi
+m4_define([kpse_syslib_pkgs], [$1]m4_ifval([kpse_syslib_pkgs],
+ [ _m4_defn([kpse_syslib_pkgs])]))[]dnl
+])[]dnl m4_ifset
+fi
+m4_ifval([$2],
+[if test "x$with_system_[]AS_TR_SH($1)" = xyes; then
+AC_FOREACH([Kpse_Lib], [$2],
+[ if test "x$with_system_[]AS_TR_SH(Kpse_Lib)" = x; then
+ AC_MSG_NOTICE([ -> installed `AS_TR_SH(Kpse_Lib)' headers and library])
+ with_system_[]AS_TR_SH(Kpse_Lib)=yes
+ ac_configure_args="$ac_configure_args '--with-system-Kpse_Lib'"
+ elif test "x$with_system_[]AS_TR_SH(Kpse_Lib)" != xyes; then
+ AC_MSG_ERROR([Sorry, `--with-system-$1' requires `--with-system-Kpse_Lib'])
+ fi
+])fi
+])[]dnl m4_ifval
+])[]dnl m4_if
+m4_ifval([$2], [
+test "x$need_[]AS_TR_SH($1)" = xyes && {
+AC_FOREACH([Kpse_Lib], [$2], [ need_[]AS_TR_SH(Kpse_Lib)=yes
+])}
+])[]dnl m4_ifval
+]) # KPSE_WITH_LIB
+
+# Initialize the list of potential system libraries.
+m4_define([kpse_syslib_pkgs], [])
+
+# KPSE_CHECK_LIB(LIB, REQUIRED-FUNCTION..., REQUIRED-HEADER...)
+# -------------------------------------------------------------
+# When the user requests to use an installed version of a required library,
+# check that the flags derived from --with-LIB-includes and --with-LIB-libdir
+# provide the required functions and headers.
+AC_DEFUN([KPSE_CHECK_LIB],
+[if test "x$need_[]AS_TR_SH($1):$with_system_[]AS_TR_SH($1)" = 'xyes:yes'; then
+ AC_MSG_NOTICE([checking requested system `$1' library...])
+ CPPFLAGS="$AS_TR_CPP($1)_INCLUDES $CPPFLAGS"
+ LIBS="$AS_TR_CPP($1)_LIBS $LIBS"
+ AC_CHECK_FUNCS([$2], , [syslib_status=no])
+ AC_CHECK_HEADERS([$3], , [syslib_status=no])
+fi
+]) # KPSE_CHECK_LIB
+
diff --git a/Build/source/m4/kpse-t1lib-flags.m4 b/Build/source/m4/kpse-t1lib-flags.m4
new file mode 100644
index 00000000000..0400715df98
--- /dev/null
+++ b/Build/source/m4/kpse-t1lib-flags.m4
@@ -0,0 +1,28 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_T1LIB_FLAGS([SHELL-CODE=DEFAULT-SHELL-CODE])
+# -------------------------------------------------
+# Provide the configure options '--with-system-t1lib' (if in the TL tree),
+# '--with-t1lib-includes', and '--with-t1lib-libdir'.
+#
+# Set the make variables T1LIB_INCLUDES and T1LIB_LIBS to the CPPFLAGS and
+# LIBS required for the `-lt1' library in libs/t1lib/ of the TL tree.
+AC_DEFUN([KPSE_T1LIB_FLAGS],
+[_KPSE_LIB_FLAGS([t1lib], [t1],
+ [$1],
+ [-IBLD/libs/t1lib], [BLD/libs/t1lib/libt1.a], [],
+ [], [${top_builddir}/../../libs/t1lib/t1lib.h])[]dnl
+]) # KPSE_T1LIB_FLAGS
+
+# KPSE_T1LIB_SYSTEM_FLAGS
+# -----------------------
+AC_DEFUN([KPSE_T1LIB_SYSTEM_FLAGS],
+[_KPSE_LIB_FLAGS_SYSTEM([t1lib], [t1])[]dnl
+]) # KPSE_T1LIB_SYSTEM_FLAGS
diff --git a/Build/source/m4/kpse-teckit-flags.m4 b/Build/source/m4/kpse-teckit-flags.m4
new file mode 100644
index 00000000000..e970dc2f66b
--- /dev/null
+++ b/Build/source/m4/kpse-teckit-flags.m4
@@ -0,0 +1,30 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_TECKIT_FLAGS([SHELL-CODE=DEFAULT-SHELL-CODE])
+# --------------------------------------------------
+# Provide the configure options '--with-system-teckit' (if in the TL tree),
+# '--with-teckit-includes', and '--with-teckit-libdir'.
+#
+# Set the make variables TECKIT_INCLUDES and TECKIT_LIBS to the CPPFLAGS and
+# LIBS required for the `-lTECkit' library in libs/teckit/ of the TL tree.
+AC_DEFUN([KPSE_TECKIT_FLAGS],
+[AC_REQUIRE([KPSE_ZLIB_FLAGS])[]dnl
+_KPSE_LIB_FLAGS([teckit], [TECkit],
+ [$1],
+ [-ISRC/libs/teckit/source/Public-headers],
+ [BLD/libs/teckit/libTECkit.a], [],
+ [], [])[]dnl
+]) # KPSE_TECKIT_FLAGS
+
+# KPSE_TECKIT_SYSTEM_FLAGS
+# ------------------------
+AC_DEFUN([KPSE_TECKIT_SYSTEM_FLAGS],
+[_KPSE_LIB_FLAGS_SYSTEM([teckit], [TECkit])[]dnl
+]) # KPSE_TECKIT_SYSTEM_FLAGS
diff --git a/Build/source/m4/kpse-web2c.m4 b/Build/source/m4/kpse-web2c.m4
new file mode 100644
index 00000000000..ebddb7374fe
--- /dev/null
+++ b/Build/source/m4/kpse-web2c.m4
@@ -0,0 +1,82 @@
+# Private macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_WEB2C_PREPARE
+# ------------------
+# AC_DEFUN'ed so it can enforce inclusion of this file.
+AC_DEFUN([KPSE_WEB2C_PREPARE], [])
+
+# KPSE_WITH_MKTEX(PROG, YES-OR-NO, TEXT, STEM)
+# --------------------------------------------
+# Provide configure options --enable-mktex*-default and normalize result.
+m4_define([KPSE_WITH_MKTEX],
+[AC_ARG_ENABLE([$1-default],
+ AS_HELP_STRING([--]m4_if($2, [yes], [dis], [en])[able-$1-default],
+ m4_if($2, [yes],
+ [do not ])[run $1 if $3 missing],
+ [30]))[]dnl
+AS_CASE([$enable_$1_default], [yes|no], ,
+ [enable_$1_default=$2])[]dnl
+]) # KPSE_WITH_MKTEX
+
+# KPSE_MKTEX_DEFINE(PROG, YES-OR-NO, TEXT, STEM)
+# ----------------------------------------------
+# Defines for enable-mktex*-default
+m4_define([KPSE_MKTEX_DEFINE],
+[AS_IF([test "x$enable_$1_default" = xyes],
+ [AC_DEFINE([MAKE_$4_BY_DEFAULT], 1,
+ [Define to 1 if you want to run $1 if $3 is missing,
+ and to 0 if you don't])],
+ [AC_DEFINE([MAKE_$4_BY_DEFAULT], 0)])[]dnl
+]) # KPSE_MKTEX_DEFINE
+
+# KPSE_WITH_XTEX(PROG, BUILD-OR-NO, SYNC-OR-NO, TEXT, REQUIRED-LIBS)
+# ------------------------------------------------------------------
+# Provide configure options --enable-*tex and normalize result.
+m4_define([KPSE_WITH_XTEX],
+[AC_ARG_ENABLE([$1],
+ AS_HELP_STRING([--]m4_if($2, [yes], [dis], [en])[able-$1],
+ m4_if($2, [yes],
+ [do not ])[compile and install $4],
+ [30]))[]dnl
+AS_CASE([$enable_$1], [yes|no], ,
+ [enable_$1=$2])[]dnl
+m4_ifval([$5], [
+test "x$enable_$1" = xno || {
+AC_FOREACH([Kpse_Lib], [$5], [ need_[]AS_TR_SH(Kpse_Lib)=yes
+])}
+])[]dnl m4_ifval
+]) # KPSE_WITH_XTEX
+
+# KPSE_XTEX_COND(PROG, BUILD-OR-NO, SYNC-OR-NO, TEXT, REQUIRED-LIBS)
+# ------------------------------------------------------------------
+# Conditionals for --with-*tex
+m4_define([KPSE_XTEX_COND],
+[AM_CONDITIONAL(AS_TR_CPP($1), [test "x$enable_$1" = xyes])[]dnl
+AM_CONDITIONAL(AS_TR_CPP($1)[_SYNCTEX], m4_if([$3], [yes], [true], [false]))[]dnl
+]) # KPSE_XTEX_COND
+
+# KPSE_WITH_MFWIN(WINDOW, DEFINE, TEXT)
+# -------------------------------------
+# Provide configure options --enable-*win.
+m4_define([KPSE_WITH_MFWIN],
+[AC_ARG_ENABLE([$1win],
+ AS_HELP_STRING([--enable-$1win],
+ [include $3 window support],
+ [30]))[]dnl
+]) # KPSE_WITH_MFWIN
+
+# KPSE_MFWIN_DEFINE(WINDOW, DEFINE, TEXT)
+# ---------------------------------------
+# Defines for enable-*win
+m4_define([KPSE_MFWIN_DEFINE],
+[AS_IF([test "x$enable_$1win" = xyes],
+ [AC_DEFINE([$2WIN], ,
+ [metafont: Define to include $3 window support.])])[]dnl
+]) # KPSE_MFWIN_DEFINE
diff --git a/Build/source/m4/kpse-win32.m4 b/Build/source/m4/kpse-win32.m4
new file mode 100644
index 00000000000..4eba4d185f5
--- /dev/null
+++ b/Build/source/m4/kpse-win32.m4
@@ -0,0 +1,25 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holders
+# give unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_CHECK_WIN32
+# ----------------
+# Check for WIN32 and distinguish between MINGW32 and native.
+AC_DEFUN([KPSE_CHECK_WIN32],
+[AC_CACHE_CHECK([for native WIN32 or MINGW32],
+ [kpse_cv_have_win32],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifndef WIN32
+ choke me
+#endif]], [[]])],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifndef __MINGW32__
+ choke me
+#endif]], [[]])],
+ [kpse_cv_have_win32=mingw32],
+ [kpse_cv_have_win32=native])],
+ [kpse_cv_have_win32=no])])
+]) # KPSE_CHECK_WIN32
diff --git a/Build/source/m4/kpse-xpdf-flags.m4 b/Build/source/m4/kpse-xpdf-flags.m4
new file mode 100644
index 00000000000..7c3f97afc42
--- /dev/null
+++ b/Build/source/m4/kpse-xpdf-flags.m4
@@ -0,0 +1,30 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_XPDF_FLAGS()
+# -----------------
+# Set the make variables XPDF_INCLUDES and XPDF_LIBS to the CPPFLAGS and
+# LIBS required for the `-lxpdf' library in libs/xpdf/ of the TL tree.
+AC_DEFUN([KPSE_XPDF_FLAGS],
+[_KPSE_LIB_FLAGS([xpdf], [xpdf], [],
+ _Kpse_Xpdf_Flags[ -IBLD/libs/xpdf -IBLD/libs/xpdf/goo -IBLD/libs/xpdf/fofi -IBLD/libs/xpdf/xpdf],
+ [BLD/libs/xpdf/libxpdf.a],
+ [tree],
+ [], [${top_builddir}/../../libs/xpdf/xpdf/Stream.h])[]dnl
+]) # KPSE_XPDF_FLAGS
+
+# KPSE_XPDF_SELF_FLAGS()
+# ----------------------
+# Flags for building and using libxpdf.
+AC_DEFUN([KPSE_XPDF_SELF_FLAGS],
+[XPDF_SELF_FLAGS=_Kpse_Xpdf_Flags
+AC_SUBST([XPDF_SELF_FLAGS])[]dnl
+]) # KPSE_XPDF_SELF_FLAGS
+
+m4_define([_Kpse_Xpdf_Flags], [-DPDF_PARSER_ONLY])
diff --git a/Build/source/m4/kpse-zlib-flags.m4 b/Build/source/m4/kpse-zlib-flags.m4
new file mode 100644
index 00000000000..782b0cd7a56
--- /dev/null
+++ b/Build/source/m4/kpse-zlib-flags.m4
@@ -0,0 +1,28 @@
+# Public macros for the teTeX / TeX live (TL) tree.
+# Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 0
+
+# KPSE_ZLIB_FLAGS([SHELL-CODE=DEFAULT-SHELL-CODE])
+# ------------------------------------------------
+# Provide the configure options '--with-system-zlib' (if in the TL tree),
+# '--with-zlib-includes', and '--with-zlib-libdir'.
+#
+# Set the make variables ZLIB_INCLUDES and ZLIB_LIBS to the CPPFLAGS and
+# LIBS required for the `-lz' library in libs/zlib/ of the TL tree.
+AC_DEFUN([KPSE_ZLIB_FLAGS],
+[_KPSE_LIB_FLAGS([zlib], [z],
+ [$1],
+ [-IBLD/libs/zlib], [BLD/libs/zlib/libz.a], [],
+ [], [${top_builddir}/../../libs/zlib/zlib.h ${top_builddir}/../../libs/zlib/zconf.h])[]dnl
+]) # KPSE_ZLIB_FLAGS
+
+# KPSE_ZLIB_SYSTEM_FLAGS
+# ----------------------
+AC_DEFUN([KPSE_ZLIB_SYSTEM_FLAGS],
+[_KPSE_LIB_FLAGS_SYSTEM([zlib], [z])[]dnl
+]) # KPSE_ZLIB_SYSTEM_FLAGS
diff --git a/Build/source/m4/libtool.m4 b/Build/source/m4/libtool.m4
new file mode 100644
index 00000000000..39ba996cb96
--- /dev/null
+++ b/Build/source/m4/libtool.m4
@@ -0,0 +1,7357 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 56 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+ lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+ ;;
+esac
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+if test "$no_create" != yes; then
+ lt_cl_success=:
+ test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+ exec AS_MESSAGE_LOG_FD>/dev/null
+ $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+ exec AS_MESSAGE_LOG_FD>>config.log
+ $lt_cl_success || AS_EXIT(1)
+fi
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ _LT_PROG_XSI_SHELLFNS
+
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_SHELL_INIT
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<_LT_EOF
+[$]*
+_LT_EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
+
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
+ fi
+ fi
+ fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+ [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC*)
+ # IBM XL 8.0 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(int foo(void) {},
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ )
+ LDFLAGS="$save_LDFLAGS"
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+ [[If ld is used when linking, flag to hardcode $libdir into a binary
+ during linking. This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+ [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report which library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+m4_defun([_LT_PROG_CXX],
+[
+pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+AC_PROG_CXX
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_CXX
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_CXX], [])
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[AC_REQUIRE([_LT_PROG_CXX])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 will use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ xl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=echo
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_F77],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+AC_PROG_F77
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_F77
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_F77], [])
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_REQUIRE([_LT_PROG_F77])dnl
+AC_LANG_PUSH(Fortran 77)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${F77-"f77"}
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_FC],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+AC_PROG_FC
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_FC
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_FC], [])
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
+ lt_save_GCC=$GCC
+ CC=${FC-"f95"}
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# 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 ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# 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 ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# 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_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# 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 ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -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 file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# 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 "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$[@]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$[1]+=\$[2]"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+ ;;
+ esac
+])
diff --git a/Build/source/m4/ltoptions.m4 b/Build/source/m4/ltoptions.m4
new file mode 100644
index 00000000000..34151a3ba62
--- /dev/null
+++ b/Build/source/m4/ltoptions.m4
@@ -0,0 +1,368 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/Build/source/m4/ltsugar.m4 b/Build/source/m4/ltsugar.m4
new file mode 100644
index 00000000000..9000a057d31
--- /dev/null
+++ b/Build/source/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/Build/source/m4/ltversion.m4 b/Build/source/m4/ltversion.m4
new file mode 100644
index 00000000000..b8e154fe6e1
--- /dev/null
+++ b/Build/source/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3012 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6])
+m4_define([LT_PACKAGE_REVISION], [1.3012])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6'
+macro_revision='1.3012'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/Build/source/m4/lt~obsolete.m4 b/Build/source/m4/lt~obsolete.m4
new file mode 100644
index 00000000000..637bb2066c4
--- /dev/null
+++ b/Build/source/m4/lt~obsolete.m4
@@ -0,0 +1,92 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
diff --git a/Build/source/texk/Makefile.in.orig b/Build/source/texk/Makefile.in.orig
new file mode 100644
index 00000000000..48bff423245
--- /dev/null
+++ b/Build/source/texk/Makefile.in.orig
@@ -0,0 +1,91 @@
+# @configure_input@
+# Top-level Makefile for kpathsea-using programs.
+
+# Package subdirectories, the library, and all subdirectories.
+ESUBDIRS=@ESUBDIRS@
+
+programs = web2c $(ESUBDIRS)
+kpathsea_dir = kpathsea
+all_dirs = $(programs) $(kpathsea_dir)
+
+kpse_include make/paths.mk
+kpse_include make/makevars.mk
+
+# It's too bad we have to pass all these down, but I see no alternative,
+# if we are to propagate changes at the top level.
+# XMAKEARGS is for the user to override.
+makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' $(makevars) $(XMAKEARGS)
+installargs = $(makeargs)
+
+# Not everything from common.mk is relevant to this top-level
+# Makefile, but most of it is, and it doesn't seem worth separating the
+# compilation-specific stuff.
+kpse_include make/common.mk
+
+# Get more of the default setup.
+kpse_include make/programs.mk
+
+# kpathsea is not a sibling, it's a child.
+kpathsea_parent = .
+
+# Make the library before the programs.
+# Always make all, rather than $@, because automake-generated Makefiles,
+# among others, do not have a default target.
+# Use if ... rather than || or && because Ultrix sh exits for
+# no good reason with the latter.
+default all: do-kpathsea
+ for d in $(programs); do if test -f $$d/Makefile; then \
+ (cd $$d && $(MAKE) $(makeargs) all) || exit 1; else true; fi; done
+
+install install-data install-exec:
+ for d in kpathsea $(programs); do if test -f $$d/Makefile; then \
+ (cd $$d && $(MAKE) $(installargs) $@) || exit 1; else true; fi; done
+
+# Other standard targets for everything.
+uninstall uninstall-exec uninstall-data \
+mostlyclean clean realclean extraclean configclean \
+info dvi check depend::
+ for d in $(all_dirs); do if test -f $$d/Makefile; then \
+ (cd $$d && $(MAKE) $(makeargs) $@) || exit 1; else true; fi; done
+
+distclean::
+ rm -rf conftest*
+
+distclean::
+ for d in $(all_dirs); do if test -f $$d/Makefile; then \
+ (cd $$d && $(MAKE) $(makeargs) $@) || exit 1; else true; fi; done
+
+distclean realclean::
+ rm -f Makefile Makefile.aux config.status config.cache config.log libtool
+
+# Unconditionally remake the library, since we don't want to write out
+# the dependencies here.
+do-kpathsea:
+ cd $(kpathsea_dir) && $(MAKE) $(makeargs)
+
+# Targets that only apply to web2c.
+triptrap trip trap mptrap \
+formats fmts bases mems \
+install-formats install-fmts install-bases install-mems \
+install-links c-sources: do-kpathsea
+ cd web2c && $(MAKE) $(makeargs) $@
+
+@MAINT@ac_dir = $(srcdir)/etc/autoconf
+@MAINT@autoconf = $(ac_dir)/acspecific.m4 $(ac_dir)/acgeneral.m4 $(ac_dir)/acsite.m4
+@MAINT@configure_in = $(srcdir)/configure.in
+@MAINT@$(srcdir)/configure: $(configure_in) $(srcdir)/withenable.ac $(autoconf)
+@MAINT@ cd $(srcdir) && $(srcdir)/autoconf2.13 -m $(ac_dir)
+@MAINT@
+@MAINT@# And make sure that --enable-maintainer-mode is used if configure is
+@MAINT@# called from the makefiles. We do not try to do this through the
+@MAINT@# cache, lest the option sneaks into a global cache file.
+@MAINT@enablemaintflag = --enable-maintainer-mode
+
+config.status: $(srcdir)/configure
+ $(SHELL) $(srcdir)/configure --no-create --verbose $(enablemaintflag)
+
+Makefile: $(srcdir)/Makefile.in config.status
+ $(SHELL) config.status
+
+TAGS:
+ find $(srcdir) \( -name '*.[cCfFhilsy]' -o -name '*.el' \) | etags -
diff --git a/Build/source/texk/README.orig b/Build/source/texk/README.orig
new file mode 100644
index 00000000000..16a9f34c35f
--- /dev/null
+++ b/Build/source/texk/README.orig
@@ -0,0 +1,103 @@
+$Id$
+Copyright 2006, 2007, 2008, 2009 TeX Users Group.
+You may freely use, modify and/or distribute this file.
+
+This TeX Live directory contains the programs that use the kpathsea
+library for configuration and path searching, and the library itself.
+
+Some programs can be built on their own, but others, including kpathsea
+itself, cannot. Instead, try configure --enable-tetex-build in ../, or
+using the Build script there. In general, for TeX Live we only test
+configuring the whole tree.
+
+Upstream sources and last-checked versions follow. If a url is given,
+that is the upstream, although this does not mean the program is
+actively maintained. Programs marked with a "?" are not (knowingly)
+maintained here, but the upstream is unknown. If a program is knowingly
+maintained here in the TL repo, that is explicitly stated.
+
+Anyone -- please research and update any of this information.
+
+
+afm2pl 0.7.03 - ok 28apr08
+ http://tex.aanhet.net/afm2pl/
+
+bibtex8 - ?
+
+chktex - ?
+
+cjkutils - Werner Lemberg
+
+detex - ?
+
+devnag - from devnag package installed in texmf-dist.
+
+djgpp - ?
+
+dtl - ?
+
+dvi2tty 5.3.1 - needs update 18may07
+ http://www.mesa.nl/pub/dvi2tty/
+
+dvidvi - ?
+
+dviljk - maintained here, by Joachim Schrod
+
+dvipdfm 0.13.2d - ok 5jun08
+ http://gaspra.kettering.edu/dvipdfm/dvipdfm-0.13.2d.tar.gz
+ until dvipdfmx is a 100% replacement we cannot drop it.
+
+dvipdfmx 20080607 - ok 9jun08
+ http://project.ktug.or.kr/dvipdfmx/snapshot/latest/
+ dvipdfmx@project.ktug.or.kr (ChoF, Hirata, Matthias)
+
+dvipng 1.11 - ok 15may08
+ http://www.ctan.org/tex-archive/dviware/dvipng/
+
+dvipos - ?
+
+dvipsk - maintained here by Tom Rokicki, Karl Berry, Akira Kakuto, ...
+
+etc - random additional files
+
+gsftopk - from Paul Vojta's xdvi?
+
+kpathsea - maintained here by Karl Berry, Akira Kakuto, ...
+
+lacheck - ?
+
+lcdf-typetools 2.69 - ok 6may08
+ http://www.lcdf.org/type/
+
+m4 - maintained here, part of our build
+
+make - maintained here, part of our build
+
+makeindexk - maintained here (but should it be?)
+
+musixflx - ?
+
+ps2pkm - ?
+
+seetexk - ?
+
+tex4htk
+ http://www.cse.ohio-state.edu/~gurari/TeX4ht/
+
+texlive - maintained here, scripts
+
+ttf2pk -
+ http://ctan.org/fonts/utilities/ttf2pk
+
+ttfdump - ?
+
+web2c - maintained here by Karl Berry et al. - core web2c, plain tex, omega.
+ The TeX variant dirs (pdftexdir, xetexdir, etc.)
+ updated here by their respective maintainers.
+
+xdv2pdf - Jonathan Kew
+
+xdvik 22.84.14 - ok 01jul08
+ ftp://tug.org/tex/
+
+xdvipdfmx - Jonathan Kew
diff --git a/Build/source/texk/ac/withenable.ac b/Build/source/texk/ac/withenable.ac
new file mode 100644
index 00000000000..e1f03b94b67
--- /dev/null
+++ b/Build/source/texk/ac/withenable.ac
@@ -0,0 +1 @@
+## texk/ac/withenable.ac
diff --git a/Build/source/texk/afm2pl/Makefile.in.orig b/Build/source/texk/afm2pl/Makefile.in.orig
new file mode 100644
index 00000000000..d22379fbd5a
--- /dev/null
+++ b/Build/source/texk/afm2pl/Makefile.in.orig
@@ -0,0 +1,43 @@
+# @configure_input@
+# Makefile for afm2pl. Thomas Esser. public domain.
+
+program = afm2pl
+default all: $(program) $(program).1
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+
+# See INSTALL for compilation options.
+# DEFS = @DEFS@ $(XDEFS) -DKPATHSEA -I$(srcdir)/../dvipsk
+DEFS = @DEFS@ $(XDEFS) -DKPATHSEA
+
+objects = $(program).o
+
+$(program): $(kpathsea) $(objects)
+ $(kpathsea_link) $(objects) $(LOADLIBES)
+
+kpse_include ../make/tkpathsea.mk
+
+install: install-exec install-data
+uninstall: uninstall-exec uninstall-data
+
+install-exec: $(program)
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ $(INSTALL_LIBTOOL_PROG) $(program) $(bindir)
+uninstall-exec:
+ rm -f $(bindir)/$(program)
+
+install-data: $(program).1
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir)
+ $(INSTALL_DATA) $(srcdir)/$(program).1 $(man1dir)/$(program).$(manext)
+uninstall-data:
+ rm -f $(man1dir)/$(program).$(manext)
+
+kpse_include ../make/clean.mk
+kpse_include ../make/config.mk
+
+info dvi check:
+
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/afm2pl/ac/withenable.ac b/Build/source/texk/afm2pl/ac/withenable.ac
new file mode 100644
index 00000000000..95940e87ebd
--- /dev/null
+++ b/Build/source/texk/afm2pl/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/afm2pl/ac/withenable.ac
+## configure options and TL libraries required for afm2pl
+KPSE_WITH_PROG([afm2pl], [kpathsea])
diff --git a/Build/source/texk/afm2pl/configure.in.orig b/Build/source/texk/afm2pl/configure.in.orig
new file mode 100644
index 00000000000..4678c90e576
--- /dev/null
+++ b/Build/source/texk/afm2pl/configure.in.orig
@@ -0,0 +1,25 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(afm2pl.c)
+
+AC_CONFIG_HEADERS(c-auto.h:c-auto.in)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+
+# If libm is present, use it.
+AC_CHECK_LIB(m, main,LIBS="$LIBS -lm")
+
+sinclude(../kpathsea/withenable.ac)
+
+dnl These tests prevent reliable cross-compilation. Sigh.
+dnl Some special hacks are used to make cross-compilation
+dnl succeed in one special case.
+
+AC_UNSET_CC
+AC_RESET_CC
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
+date >stamp-auto
diff --git a/Build/source/texk/am/man.am b/Build/source/texk/am/man.am
new file mode 100644
index 00000000000..8e2ad41d04d
--- /dev/null
+++ b/Build/source/texk/am/man.am
@@ -0,0 +1,50 @@
+## texk/am/man.am: Makefile fragment for kpathsea and web2c manual pages.
+## requires $(man_sources), $(EXTRA_DIST), and $(DISTCLEANFILES)
+## requires $(KPATHSEA_PATHS_H) giving the directory of kpathsea/paths.h
+
+SUFFIXES = .1 .man .ps .dvi
+
+.man.1:
+ sed -f sedscript $< >$@
+man_files = $(man_sources:.man=.1)
+$(man_files): sedscript
+
+nodist_man1_MANS = $(man_files)
+
+# At present, all but VERSION should be unused.
+sedscript: $(KPATHSEA_PATHS_H)/kpathsea/paths.h
+ cp /dev/null sedscript
+ sed -n -e '/^#define/s/#define[ ][ ]*\([A-Z_a-z][A-Z_a-z]*\)[ ][ ]*\(.*\)/s%@\1@%\2%/p' \
+ $< \
+ | sed -e 's/"//g' -e 's/[ ]*\/\*[^*]*\*\///g' >>sedscript
+ echo 's%@VER''SION@%$(VERSION)%' >>sedscript
+ echo 's%@BINDIR@%$(bindir)%' >>sedscript
+ echo 's%@INFODIR@%$(infodir)%' >>sedscript
+ echo 's%@TEXINPUTDIR@%$(texinputdir)%' >>sedscript
+ echo 's%@MFINPUTDIR@%$(mfinputdir)%' >>sedscript
+ echo 's%@MPINPUTDIR@%$(mpinputdir)%' >>sedscript
+ echo 's%@FONTDIR@%$(fontdir)%' >>sedscript
+ echo 's%@FMTDIR@%$(fmtdir)%' >>sedscript
+ echo 's%@BASEDIR@%$(basedir)%' >>sedscript
+ echo 's%@MEMDIR@%$(memdir)%' >>sedscript
+ echo 's%@TEXPOOLDIR@%$(texpooldir)%' >>sedscript
+ echo 's%@MFPOOLDIR@%$(mfpooldir)%' >>sedscript
+ echo 's%@MPPOOLDIR@%$(mppooldir)%' >>sedscript
+ echo 's%@FONTMAPDIR@%$(dvipsdir)%' >>sedscript
+ echo 's%@LOCALMODES@%$(localmodes)%' >>sedscript
+
+DITROFF = groff
+
+.1.dvi:
+ $(DITROFF) -Tdvi -man $< >$@
+DVIS = $(man_files:.1=.dvi)
+
+.1.ps:
+ $(DITROFF) -Tps -man $< >$@
+PSS = $(man_files:.1=.ps)
+
+EXTRA_DIST += $(man_sources)
+
+DISTCLEANFILES += sedscript $(man_files) $(DVIS) $(PSS)
+
+## end of texk/am/man.am
diff --git a/Build/source/texk/bibtex8/Makefile.in.orig b/Build/source/texk/bibtex8/Makefile.in.orig
new file mode 100644
index 00000000000..55ee9a6724a
--- /dev/null
+++ b/Build/source/texk/bibtex8/Makefile.in.orig
@@ -0,0 +1,50 @@
+# @configure_input@
+# Makefile for bibtex8. Public domain.
+
+version = 3.71
+# Beware : default char type is unsigned
+XCPPFLAGS = -DSUPPORT_8BIT -DKPATHSEA -DUNIX -funsigned-char
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+kpse_include ../make/texi.mk
+
+#
+# Object files
+#
+OBJS = bibtex-1.o bibtex-2.o bibtex-3.o \
+ bibtex-4.o bibtex.o utils.o
+
+
+programs = bibtex8
+#
+# Main target
+#
+default: all
+
+all: $(programs)
+
+
+bibtex8: $(OBJS) $(kpathsea)
+ $(kpathsea_link) $(OBJS) $(LOADLIBES)
+
+install: all install-data install-doc
+ -$(top_srcdir)/../mkinstalldirs $(bindir)
+ -$(INSTALL_LIBTOOL_PROG) bibtex8 $(bindir)/bibtex8
+
+install-data:
+ -$(top_srcdir)/../mkinstalldirs $(texmf)/bibtex/csf
+ -$(INSTALL) -m 644 $(srcdir)/csf/*.csf $(texmf)/bibtex/csf
+
+install-doc:
+ -$(top_srcdir)/../mkinstalldirs $(texmf)/doc/bibtex8
+ for i in 00readme.txt HISTORY csfile.txt file_id.diz ; \
+ do $(INSTALL) -m 644 $(srcdir)/$$i $(texmf)/doc/bibtex8; \
+ done
+
+kpse_include ../make/tkpathsea.mk
+kpse_include ../make/clean.mk
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
+
diff --git a/Build/source/texk/bibtex8/ac/withenable.ac b/Build/source/texk/bibtex8/ac/withenable.ac
new file mode 100644
index 00000000000..b65ab681b70
--- /dev/null
+++ b/Build/source/texk/bibtex8/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/bibtex8/ac/withenable.ac
+## configure options and TL libraries required for bibtex8
+KPSE_WITH_PROG([bibtex8], [kpathsea])
diff --git a/Build/source/texk/bibtex8/configure.in.orig b/Build/source/texk/bibtex8/configure.in.orig
new file mode 100644
index 00000000000..2284eb40f89
--- /dev/null
+++ b/Build/source/texk/bibtex8/configure.in.orig
@@ -0,0 +1,13 @@
+dnl Public domain.
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(bibtex-1.c)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+
+sinclude(../kpathsea/withenable.ac)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/cjkutils/Makefile.in.orig b/Build/source/texk/cjkutils/Makefile.in.orig
new file mode 100644
index 00000000000..bf6c3b3108b
--- /dev/null
+++ b/Build/source/texk/cjkutils/Makefile.in.orig
@@ -0,0 +1,14 @@
+# @configure_input@
+
+RM = @RM@
+
+all_subdirs = conv scripts hbf2gf
+
+all check clean configclean default depend dvi extraclean \
+info install install-data install-exec mostlyclean realclean uninstall \
+uninstall-data uninstall-exec:
+ for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
+
+distclean::
+ for d in $(all_subdirs); do (test -f $$d/Makefile && { cd $$d && $(MAKE) $@; } || true); done
+ $(RM) -f config.cache config.log stamp-auto config.status Makefile
diff --git a/Build/source/texk/cjkutils/ac/withenable.ac b/Build/source/texk/cjkutils/ac/withenable.ac
new file mode 100644
index 00000000000..9bbe9162d29
--- /dev/null
+++ b/Build/source/texk/cjkutils/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/cjkutils/ac/withenable.ac
+## configure options and TL libraries required for cjkutils
+KPSE_WITH_PROG([cjkutils], [kpathsea])
diff --git a/Build/source/texk/cjkutils/configure.in.orig b/Build/source/texk/cjkutils/configure.in.orig
new file mode 100644
index 00000000000..9e190434224
--- /dev/null
+++ b/Build/source/texk/cjkutils/configure.in.orig
@@ -0,0 +1,58 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(hbf2gf/hbf.h)
+
+AC_CONFIG_HEADERS([hbf2gf/c-auto.h:hbf2gf/c-auto.in])
+
+dnl check host
+AC_CANONICAL_SYSTEM
+AC_PROG_MAKE_SET
+
+
+dnl Checks for programs.
+AC_PROG_CC
+
+
+dnl Checks for header files.
+AC_HEADER_STDC
+
+
+dnl get Compiler flags right.
+if test "x$CC" = xgcc; then
+ XX_CFLAGS="-Wall"
+else
+ case "$host" in
+ alpha-dec-osf*)
+ XX_CFLAGS="-std1 -O2 -g3"
+ ;;
+ *)
+ XX_CFLAGS=
+ ;;
+ esac
+fi
+AC_SUBST(XX_CFLAGS)
+
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_STRUCT_TM
+
+
+dnl Checks for library functions.
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(strdup strstr strtol strtoul)
+
+dnl we need this for hbf.c
+if test "x$ac_cv_func_strdup" = xno; then
+ no_strdup=-DNO_STRDUP
+fi
+AC_SUBST(no_strdup)
+
+AC_CHECK_PROG(RM, rm, rm)
+AC_PROG_INSTALL
+
+sinclude(../kpathsea/withenable.ac)
+
+AC_CONFIG_FILES([Makefile])
+KPSE_CONFIG_FILES([conv/Makefile hbf2gf/Makefile scripts/Makefile])
+AC_OUTPUT
+date >stamp-auto
diff --git a/Build/source/texk/configure.in.orig b/Build/source/texk/configure.in.orig
new file mode 100644
index 00000000000..8c7cf884b9e
--- /dev/null
+++ b/Build/source/texk/configure.in.orig
@@ -0,0 +1,57 @@
+dnl Public domain. Originally written many years ago by Karl Berry and
+dnl Thomas Esser, and others.
+dnl
+dnl Top-level configure for kpathsea-using programs.
+dnl Our job is to run configure in the relevant subdirectories.
+dnl
+dnl Assumption: each program will create a c-auto.h that defines
+dnl everything kpathsea needs. We arrange this by including (at
+dnl autoconf time) kpathsea/common.ac.
+dnl
+dnl Consequence: we don't need to run configure in the kpathsea directory
+dnl itself; we can just copy from a program directory. We'll use the
+dnl first one.
+dnl
+AC_INIT(kpathsea/kpathsea.texi)
+
+dnl These configure scripts won't work with anything else.
+AC_PREREQ(2.59)
+
+AC_PROG_MAKE_SET
+
+dnl Because we include make/common.make.
+AC_PROG_CC
+AC_ISC_POSIX
+AC_PROG_LN_S
+
+dnl If we guessed the prefix in the subdirectories, it might guess
+dnl differently than the prefix here, and that would cause confusion.
+AC_PREFIX_PROGRAM(tex)
+
+dnl Pass this down from the top level so that when the subprograms
+dnl install kpathsea a command line value is propagated.
+AC_PROG_INSTALL
+
+dnl If the other programs ever acquire their own --with or --enable
+dnl options, they must be added, so configure --help at the top level
+dnl will show all the options.
+sinclude(libtool.m4)
+sinclude(withenable.ac)
+sinclude(kpathsea/withenable.ac)
+sinclude(web2c/withenable.ac)
+sinclude(xdvik/withenable.ac)
+
+AC_PROG_LIBTOOL
+
+if test "x$with_x" = xno; then
+ with_xdvik=no
+fi
+
+dnl required subdirs
+AC_CONFIG_SUBDIRS([kpathsea web2c])
+
+dnl optional subdirs => ESUBDIRS
+KPSE_CONFIG_SUBDIRS(kpse_texk_pkglist)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/detex/ac/withenable.ac b/Build/source/texk/detex/ac/withenable.ac
new file mode 100644
index 00000000000..5b309bf5c99
--- /dev/null
+++ b/Build/source/texk/detex/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/detex/ac/withenable.ac
+## configure options and TL libraries required for detex
+KPSE_WITH_PROG([detex], [kpathsea])
diff --git a/Build/source/texk/devnag/ac/withenable.ac b/Build/source/texk/devnag/ac/withenable.ac
new file mode 100644
index 00000000000..1391d6e9e70
--- /dev/null
+++ b/Build/source/texk/devnag/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/devnag/ac/withenable.ac
+## configure options and TL libraries required for devnag
+KPSE_WITH_PROG([devnag])
diff --git a/Build/source/texk/dtl/ac/withenable.ac b/Build/source/texk/dtl/ac/withenable.ac
new file mode 100644
index 00000000000..532a2ac77bc
--- /dev/null
+++ b/Build/source/texk/dtl/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/dtl/ac/withenable.ac
+## configure options and TL libraries required for dtl
+KPSE_WITH_PROG([dtl], [kpathsea])
diff --git a/Build/source/texk/dummy/Makefile.am b/Build/source/texk/dummy/Makefile.am
new file mode 100644
index 00000000000..7ab40d9192e
--- /dev/null
+++ b/Build/source/texk/dummy/Makefile.am
@@ -0,0 +1,10 @@
+##
+noinst_DATA = ../subtexkdir-configure
+
+DISTCLEANFILES = $(noinst_DATA)
+
+all-local: $(noinst_DATA)
+
+../subtexkdir-configure:
+ echo "${srcdir}/configure" | sed 's,dummy/,SUBTEXKDIR/,' >$@
+
diff --git a/Build/source/texk/dummy/Makefile.in b/Build/source/texk/dummy/Makefile.in
new file mode 100644
index 00000000000..563d532f413
--- /dev/null
+++ b/Build/source/texk/dummy/Makefile.in
@@ -0,0 +1,420 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = .
+DIST_COMMON = $(am__configure_deps) \
+ $(srcdir)/../../build-aux/install-sh \
+ $(srcdir)/../../build-aux/missing $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/configure \
+ ../../build-aux/config.guess ../../build-aux/config.sub \
+ ../../build-aux/depcomp ../../build-aux/install-sh \
+ ../../build-aux/ltmain.sh ../../build-aux/missing \
+ ../../build-aux/texinfo.tex ../../build-aux/ylwrap
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DATA = $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+noinst_DATA = ../subtexkdir-configure
+DISTCLEANFILES = $(noinst_DATA)
+all: all-am
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d $(distdir) || mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA) all-local
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am all-local am--refresh check check-am clean \
+ clean-generic dist dist-all dist-bzip2 dist-gzip dist-lzma \
+ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-generic distcleancheck distdir distuninstallcheck \
+ dvi dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am uninstall uninstall-am
+
+
+all-local: $(noinst_DATA)
+
+../subtexkdir-configure:
+ echo "${srcdir}/configure" | sed 's,dummy/,SUBTEXKDIR/,' >$@
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/texk/dummy/aclocal.m4 b/Build/source/texk/dummy/aclocal.m4
new file mode 100644
index 00000000000..a249a8e6d87
--- /dev/null
+++ b/Build/source/texk/dummy/aclocal.m4
@@ -0,0 +1,618 @@
+# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10.2], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 13
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/Build/source/texk/dummy/configure b/Build/source/texk/dummy/configure
new file mode 100755
index 00000000000..1a4943f3765
--- /dev/null
+++ b/Build/source/texk/dummy/configure
@@ -0,0 +1,3403 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for TeX live texk dummy 2009.
+#
+# Report bugs to <tex-k@tug.org>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ case $as_dir in
+ /*)
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell bug-autoconf@gnu.org about your system,
+ echo including any error possibly output before this message.
+ echo This can help us improve future autoconf versions.
+ echo Configuration will now proceed without shell functions.
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='TeX live texk dummy'
+PACKAGE_TARNAME='tex-live-texk-dummy'
+PACKAGE_VERSION='2009'
+PACKAGE_STRING='TeX live texk dummy 2009'
+PACKAGE_BUGREPORT='tex-k@tug.org'
+
+ac_unique_file="../../build-aux/missing"
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+ { (exit 1); exit 1; }; } ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { $as_echo "$as_me: error: working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures TeX live texk dummy 2009 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root
+ [DATAROOTDIR/doc/tex-live-texk-dummy]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of TeX live texk dummy 2009:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+
+Report bugs to <tex-k@tug.org>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+TeX live texk dummy configure 2009
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by TeX live texk dummy $as_me 2009, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test -r "$ac_site_file"; then
+ { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_aux_dir=
+for ac_dir in ../../build-aux "$srcdir"/../../build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../build-aux \"$srcdir\"/../../build-aux" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in ../../build-aux \"$srcdir\"/../../build-aux" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+am__api_version='1.10'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+done
+IFS=$as_save_IFS
+
+fi
+
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ test -d ./--version && rmdir ./--version
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='tex-live-texk-dummy'
+ VERSION='2009'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+echo "$ac_configure_args" | sed 's,/dummy,/SUBTEXKDIR,g' >../subtexkdir-conf.args
+
+ac_config_files="$ac_config_files Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by TeX live texk dummy $as_me 2009, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+TeX live texk dummy config.status 2009
+configured by $0, generated by GNU Autoconf 2.63,
+ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} ||
+{
+ $as_echo "$as_me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=' '
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+ { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X " :F $CONFIG_FILES "
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ ac_file_inputs="$ac_file_inputs '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+
+
+
+ esac
+
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/Build/source/texk/dummy/configure.ac b/Build/source/texk/dummy/configure.ac
new file mode 100644
index 00000000000..ea8d39437ec
--- /dev/null
+++ b/Build/source/texk/dummy/configure.ac
@@ -0,0 +1,21 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+dnl
+dnl This file is free software; the copyright holder
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+AC_INIT([TeX live texk dummy], [2009], [tex-k@tug.org])
+AC_PREREQ([2.63])
+AC_CONFIG_SRCDIR([../../build-aux/missing])
+AC_CONFIG_AUX_DIR([../../build-aux])
+
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+echo "$ac_configure_args" | sed 's,/dummy,/SUBTEXKDIR,g' >../subtexkdir-conf.args
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/Build/source/texk/dvi2tty/ac/withenable.ac b/Build/source/texk/dvi2tty/ac/withenable.ac
new file mode 100644
index 00000000000..a68df38b816
--- /dev/null
+++ b/Build/source/texk/dvi2tty/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/dvi2tty/ac/withenable.ac
+## configure options and TL libraries required for dvi2tty
+KPSE_WITH_PROG([dvi2tty], [kpathsea])
diff --git a/Build/source/texk/dvidvi/ac/withenable.ac b/Build/source/texk/dvidvi/ac/withenable.ac
new file mode 100644
index 00000000000..9beeb86107a
--- /dev/null
+++ b/Build/source/texk/dvidvi/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/dvidvi/ac/withenable.ac
+## configure options and TL libraries required for dvidvi
+KPSE_WITH_PROG([dvidvi], [kpathsea])
diff --git a/Build/source/texk/dviljk/Makefile.in.orig b/Build/source/texk/dviljk/Makefile.in.orig
new file mode 100644
index 00000000000..2b5ea365d1e
--- /dev/null
+++ b/Build/source/texk/dviljk/Makefile.in.orig
@@ -0,0 +1,112 @@
+# @configure_input@
+# Makefile for dviljk -- kb@mail.tug.org. Public domain.
+version = 2.6
+
+.NOTPARALLEL:
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+
+prog_cflags = -DKPATHSEA
+
+common_objects = tfm.o
+
+program = dvilj
+objects = dvilj.o $(common_objects)
+objects2p = dvilj2p.o $(common_objects)
+program2p = dvilj2p
+objects4 = dvilj4.o $(common_objects)
+program4 = dvilj4
+objects4l = dvilj4l.o $(common_objects)
+program4l = dvilj4l
+program6 = dvilj6
+
+programs = $(program) $(program2p) $(program4) $(program4l)
+
+default: $(program4)
+all: $(programs)
+
+$(program): $(objects) $(kpathsea)
+ $(kpathsea_link) $(objects) $(LOADLIBES)
+$(program2p): $(objects2p) $(kpathsea)
+ $(kpathsea_link) $(objects2p) $(LOADLIBES)
+$(program4): $(objects4) $(kpathsea)
+ $(kpathsea_link) $(objects4) $(LOADLIBES)
+$(program4l): $(objects4l) $(kpathsea)
+ $(kpathsea_link) $(objects4l) $(LOADLIBES)
+
+dvilj.o:
+ $(compile) -c -DLJ $(srcdir)/dvi2xx.c -o $@
+dvilj2p.o:
+ $(compile) -c -DLJ2P $(srcdir)/dvi2xx.c -o $@
+dvilj4.o:
+ $(compile) -c -DLJ4 $(srcdir)/dvi2xx.c -o $@
+dvilj4l.o:
+ $(compile) -c -DLJ4 -DLJ4L $(srcdir)/dvi2xx.c -o $@
+
+dvilj.o dvilj2p.o dvilj4.o dvilj4l.o: dvi2xx.c
+
+VERSION = `grep 'define VERSION' dvi2xx.c | sed -e 's/^.*version //' -e 's/).*//'`
+dvilj.man: dvilj.pod dvi2xx.c
+ pod2man --center="TeX-Live" --release="Version $(VERSION)" $< >$@
+dvilj.ps: dvilj.man
+ man -t -l $< >$@
+
+kpse_include ../make/tkpathsea.mk
+
+install: install-exec install-data
+uninstall: uninstall-exec uninstall-data
+
+install-exec:
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ test ! -f $(program) \
+ || $(INSTALL_LIBTOOL_PROG) $(program) $(bindir)
+ test ! -f $(program2p) \
+ || $(INSTALL_LIBTOOL_PROG) $(program2p) $(bindir)
+ test ! -f $(program4) \
+ || $(INSTALL_LIBTOOL_PROG) $(program4) $(bindir)
+ test ! -f $(program4l) \
+ || $(INSTALL_LIBTOOL_PROG) $(program4l) $(bindir)
+ $(INSTALL_SCRIPT) $(srcdir)/dvihp $(scriptdir)/dvihp
+ cd $(bindir) && (rm -f $(program6); $(LN) $(program4) $(program6))
+uninstall-exec:
+ cd $(bindir); rm -f $(programs)
+
+install-data:
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir)
+ $(INSTALL_DATA) $(srcdir)/dvilj.man $(man1dir)/dvilj.$(manext)
+ for p in dvilj2p dvilj4 dvilj4l dvilj6; do \
+ rm -f $(man1dir)/$$p.$(manext); \
+ ln -s dvilj.$(manext) $(man1dir)/$$p.$(manext); \
+ done
+ $(INSTALL_DATA) $(srcdir)/dvihp.man $(man1dir)/dvihp.$(manext)
+
+# It seems simplest to keep this separate. Use find and cpio instead of
+# just cp -r in case the source hierarchy is cvs- or rcs-ified.
+# Use "" to quote wildcards because backslash is a directory separator
+# on MS-DOS and MS-Windows.
+install-fonts:
+ find fonts -name \( "*.tfm" -o -name "*.vf" \) -print | cpio -pld $(texmf)
+
+uninstall-data:
+ rm -f $(man1dir)/dvilj.$(manext)
+
+
+distname = dviljk
+program_files = dvihp dvilj.man README.fonts
+version_files = dvi2xx.c dvihp
+
+pre-dist-$(distname):
+post-dist-$(distname):
+ ln -s `pwd`/fonts `pwd`/tex `pwd`/src.fonts $(distdir)
+
+kpse_include ../make/dist.mk
+kpse_include ../make/config.mk
+
+info dvi check:
+
+kpse_include ../make/clean.mk
+
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/dviljk/ac/withenable.ac b/Build/source/texk/dviljk/ac/withenable.ac
new file mode 100644
index 00000000000..3f25facbd84
--- /dev/null
+++ b/Build/source/texk/dviljk/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/dviljk/ac/withenable.ac
+## configure options and TL libraries required for dviljk
+KPSE_WITH_PROG([dviljk], [kpathsea])
diff --git a/Build/source/texk/dviljk/configure.in.orig b/Build/source/texk/dviljk/configure.in.orig
new file mode 100644
index 00000000000..32c3066d897
--- /dev/null
+++ b/Build/source/texk/dviljk/configure.in.orig
@@ -0,0 +1,20 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(dvi2xx.c)
+
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+
+sinclude(../kpathsea/withenable.ac)
+
+dnl These tests prevent reliable cross-compilation. Sigh.
+AC_C_CHAR_UNSIGNED
+AC_CHECK_SIZEOF(long)
+
+AC_CHECK_FUNCS(rmdir unlink mkdtemp mktemp)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/dvipdfm/Makefile.in.orig b/Build/source/texk/dvipdfm/Makefile.in.orig
new file mode 100644
index 00000000000..a75ca83d585
--- /dev/null
+++ b/Build/source/texk/dvipdfm/Makefile.in.orig
@@ -0,0 +1,81 @@
+# @configure_input@
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+
+ZLIBDIR=../../libs/zlib
+ZLIBSRCDIR=$(srcdir)/$(ZLIBDIR)
+ZLIBDEP = @ZLIBDEP@
+LDZLIB = @LDZLIB@
+
+LIBPNGDIR=../../libs/libpng
+LIBPNGSRCDIR=$(srcdir)/$(LIBPNGDIR)
+LIBPNGDEP = @LIBPNGDEP@
+LDLIBPNG = @LDLIBPNG@
+
+LD_ALL_LIBS = $(LDLIBPNG) $(LDZLIB)
+ALL_LIBS_DEP = $(ZLIBDEP) $(LIBPNGDEP)
+
+program = dvipdfm
+programs = $(program) ebb
+default all: $(programs)
+
+prog_cflags = @LIBPNGCPPFLAGS@ @ZLIBCPPFLAGS@
+
+objects=pdfdev.o pdfdoc.o dvi.o mfileio.o mem.o jpeg.o numbers.o pdfobj.o \
+ pdfparse.o pdfspecial.o tfm.o type1.o dvipdfm.o epdf.o vf.o \
+ t1crypt.o pkfont.o tpic.o thumbnail.o pngimage.o htex.o \
+ mpost.o psimage.o psspecial.o colorsp.o encodings.o @TTF_OPT@ ttf.o
+eobjects=ebb.o jpeg.o pdfobj.o mem.o mfileio.o numbers.o pdfparse.o \
+ pngimage.o
+
+$(program): $(objects) $(kpathsea) $(ALL_LIBS_DEP)
+ $(kpathsea_link) $(objects) $(LD_ALL_LIBS) $(LOADLIBES)
+
+ebb: $(eobjects) $(kpathsea) $(ALL_LIBS_DEP)
+ $(kpathsea_link) $(eobjects) $(LD_ALL_LIBS) $(LOADLIBES)
+
+$(LIBPNGDIR)/libpng.a:
+ cd $(LIBPNGDIR); $(MAKE)
+
+$(ZLIBDIR)/libz.a:
+ cd $(ZLIBDIR); $(MAKE)
+
+kpse_include ../make/tkpathsea.mk
+
+install: install-exec install-data
+uninstall: uninstall-exec uninstall-data
+
+distclean::
+ $(RM) config.h
+
+install-exec:
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ $(INSTALL_LIBTOOL_PROG) $(program) $(bindir)
+# don't install ebb; we use the compatible version in dvipdfmx.
+# but i guess we may as well keep building it for now. --karl, 23may08.
+# $(INSTALL_LIBTOOL_PROG) ebb $(bindir)
+ $(INSTALL_SCRIPT) $(srcdir)/dvipdft $(bindir)
+
+uninstall-exec:
+ cd $(bindir); rm -f $(programs)
+
+install-data:
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir)
+ $(INSTALL_DATA) $(srcdir)/$(program).1 $(man1dir)/$(program).$(manext)
+ $(INSTALL_DATA) $(srcdir)/dvipdft.1 $(man1dir)/dvipdft.$(manext)
+ $(INSTALL_DATA) $(srcdir)/ebb.1 $(man1dir)/ebb.$(manext)
+
+uninstall-data:
+ rm -f $(man1dir)/dvilj.$(manext)
+ rm -f $(man1dir)/dvipdft.$(manext)
+ rm -f $(man1dir)/ebb.$(manext)
+
+kpse_include ../make/config.mk
+
+info dvi check:
+
+kpse_include ../make/clean.mk
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/dvipdfm/ac/withenable.ac b/Build/source/texk/dvipdfm/ac/withenable.ac
new file mode 100644
index 00000000000..ecfa3e417c5
--- /dev/null
+++ b/Build/source/texk/dvipdfm/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/dvipdfm/ac/withenable.ac
+## configure options and TL libraries required for dvipdfm
+KPSE_WITH_PROG([dvipdfm], [kpathsea libpng])
diff --git a/Build/source/texk/dvipdfm/acinclude.m4.orig b/Build/source/texk/dvipdfm/acinclude.m4.orig
new file mode 100644
index 00000000000..879c18301f2
--- /dev/null
+++ b/Build/source/texk/dvipdfm/acinclude.m4.orig
@@ -0,0 +1,105 @@
+#
+# Local tests written by MAW
+#
+AC_DEFUN([AC_EXT_TIMEZONE],
+[AC_MSG_CHECKING([whether time.h defines timezone as an external variable])
+AC_TRY_LINK([#include <time.h>], [ -timezone; ],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_TIMEZONE], 1, [define if <time.h> has timezone as an external variable])],
+ [AC_MSG_RESULT(no)])])
+AC_DEFUN([AC_HAVE_BASENAME],
+ [AC_MSG_CHECKING([whether basename is in either libgen.h or string.h])
+ AC_TRY_COMPILE([#include <libgen.h>
+#include <string.h>], [extern char basename(void)],
+ [AC_MSG_RESULT(no)], [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_BASENAME)])])
+AC_DEFUN([AC_TZ_HAS_TM_GMTOFF],
+[AC_MSG_CHECKING([whether struct tz has tm_gmtoff as a member])
+AC_TRY_COMPILE([#include <time.h>], [struct tm *tp; tp->tm_gmtoff],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_TM_GMTOFF], 1, [define if struct tm has tm_gmtoff as a member])],
+ [AC_MSG_RESULT(no)])])
+#
+AC_DEFUN([AC_HAS_KPSE_FORMATS],
+ [AC_MSG_CHECKING([whether you have kpathsea headers and they whether they know about the required file formats])
+ AC_TRY_COMPILE([#include <stdio.h>
+#include <kpathsea/tex-file.h>],
+ [kpse_tex_ps_header_format;
+ kpse_type1_format;kpse_vf_format],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_KPSE_FORMATS], 1, [define if kpathsea supports type1 and vf formats])],
+ [AC_MSG_RESULT(no);
+AC_MSG_ERROR([PS_HEADER and/or VF formats not found in Kpathsea header files.
+
+This version of dvipdfm requires that kpathsea and its headers be installed.
+If you are sure they are installed and in a standard place, maybe you need a
+newer version of kpathsea? You also might try setting the environment
+variable CPPFLAGS (or CFLAGS) with -I pointing to the directory containing
+the file "tex-file.h"
+
+])])])
+#
+AC_DEFUN([AC_HAS_OMEGA_FORMATS],
+ [AC_MSG_CHECKING([whether your kpathsea supports Omega OFM file formats])
+ AC_TRY_COMPILE([#include <stdio.h>
+#include <kpathsea/tex-file.h>],
+ [kpse_ofm_format],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_OMEGA_FORMATS], 1, [Define if kpathsea understands Omega (OFM/OVF) formats])],
+ [AC_MSG_RESULT(no)])])
+AC_DEFUN([AC_HAS_TTF_FORMATS],
+ [AC_MSG_CHECKING([whether your kpathsea supports Truetype (TTF) file formats])
+ AC_TRY_COMPILE([#include <stdio.h>
+#include <kpathsea/tex-file.h>],
+ [kpse_truetype_format],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_TTF_FORMATS], 1 ,[define if kpathsea understands TrueType (TTF) formats])
+ TTF_OPT=''],
+ [AC_MSG_RESULT(no)])])
+#
+# Check for zlib
+#
+AC_DEFUN([AC_HAS_ZLIB],
+[_cppflags=$CPPFLAGS
+ _ldflags=$LDFLAGS
+AC_ARG_WITH(zlib,
+[ --with-zlib=DIR use zlib include/library files from DIR],[
+ if test -d "$withval"; then
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ fi
+])
+AC_MSG_CHECKING([for zlib header files])
+AC_TRY_COMPILE([#include <zlib.h>], [z_stream p;],
+[AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(z, compress,
+[AC_DEFINE([HAVE_ZLIB], 1, [define if you have zlib and its headers])
+ LIBS="$LIBS -lz"
+ AC_CHECK_LIB(z, compress2,
+[AC_DEFINE([HAVE_ZLIB_COMPRESS2], 1, [define if your zlib has the compress2 function])])])],
+[CPPFLAGS=$_cppflags
+ LDDFLAGS=$_ldflags
+ AC_MSG_RESULT(no)])])
+#
+# Check for libpng
+#
+AC_DEFUN([AC_HAS_LIBPNG],
+[_cppflags=$CPPFLAGS
+_ldflags=$LDFLAGS
+AC_ARG_WITH(png,
+[ --with-png=DIR use png include/library files from DIR],[
+ if test -d "$withval"; then
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ fi
+])
+AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow, LIBS="$LIBS -lm"))
+AC_MSG_CHECKING([for png header files])
+AC_TRY_COMPILE([#include <png.h>], [png_infop p;], [
+ AC_MSG_RESULT(yes)
+ AC_CHECK_LIB(png, png_get_image_width, [
+ AC_DEFINE([HAVE_LIBPNG], 1, [define if you have libpng])
+ LIBS="$LIBS -lpng"], , -lz)], [
+ AC_MSG_RESULT(no)])])
+#
+# End of local tests
+#
diff --git a/Build/source/texk/dvipdfm/configure.in.orig b/Build/source/texk/dvipdfm/configure.in.orig
new file mode 100644
index 00000000000..26fef88d265
--- /dev/null
+++ b/Build/source/texk/dvipdfm/configure.in.orig
@@ -0,0 +1,58 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(dvipdfm.c)
+
+define([_version_],"0.13.2d")
+
+VERSION=_version_
+AC_SUBST(VERSION)
+AC_DEFINE(VERSION, _version_, [package version])
+AC_DEFINE(PACKAGE, "dvipdfm", [package name])
+
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+sinclude(../kpathsea/withenable.ac)
+sinclude(../../libs/zlib/withenable.ac)
+sinclude(../../libs/libpng/withenable.ac)
+sinclude(../../libs/zlib/zlib.ac)
+sinclude(../../libs/libpng/libpng.ac)
+
+AC_DEFINE([HAVE_KPATHSEA], 1, [define if you have kpathsea])
+AC_DEFINE([HAVE_XBASENAME], 1, [define if you have xbasename() in your libkpathsea instead of basename()])
+AC_DEFINE([HAVE_ZLIB], 1, [define if you have zlib and its headers])
+AC_DEFINE([HAVE_ZLIB_COMPRESS2], 1, [define if your zlib has the compress2 function])
+AC_DEFINE([HAVE_KPSE_FORMATS], 1, [define if kpathsea supports type1 and vf formats])
+AC_DEFINE([HAVE_OMEGA_FORMATS], 1, [Define if kpathsea understands Omega (OFM/OVF) formats])
+AC_DEFINE([HAVE_TTF_FORMATS], 1, [define if kpathsea understands TrueType (TTF) formats])
+AC_DEFINE([HAVE_LIBPNG], 1, [define if you have libpng])
+TTF_OPT=''
+AC_SUBST(TTF_OPT)
+
+# TEXMF='${datadir}/texmf'
+# AC_SUBST(TEXMF)
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_EXT_TIMEZONE
+AC_TZ_HAS_TM_GMTOFF
+
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+
+dnl Checks for library functions.
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS(strspn system)
+AC_CHECK_LIB(m, main)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/dvipdfm/m4/maw-time.m4 b/Build/source/texk/dvipdfm/m4/maw-time.m4
new file mode 100644
index 00000000000..91a6c005ddd
--- /dev/null
+++ b/Build/source/texk/dvipdfm/m4/maw-time.m4
@@ -0,0 +1,34 @@
+# maw-time.m4 - timezone tests
+# Copyright (C) 1998 - 2009 Mark A. Wicks <mwicks@kettering.edu>
+# Kettering University
+#
+# This file is free software; the copyright holder
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# MAW_EXT_TIMEZONE
+# ----------------
+AC_DEFUN([MAW_EXT_TIMEZONE],
+[AC_MSG_CHECKING([whether time.h defines timezone as an external variable])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],
+ [[-timezone;]])],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_TIMEZONE], 1,
+ [Define if <time.h> has timezone as an external variable.])],
+ [AC_MSG_RESULT([no])])
+])# MAW_EXT_TIMEZONE
+
+# MAW_TM_HAS_TM_GMTOFF
+# --------------------
+AC_DEFUN([MAW_TM_HAS_TM_GMTOFF],
+[AC_MSG_CHECKING([whether struct tm has tm_gmtoff as a member])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]],
+ [[struct tm *tp; tp->tm_gmtoff;]])],
+ [AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_TM_GMTOFF], 1,
+ [Define if struct tm has tm_gmtoff as a member.])],
+ [AC_MSG_RESULT([no])])
+])# MAW_TM_HAS_TM_GMTOFF
+
diff --git a/Build/source/texk/dvipdfmx/Makefile.in.orig b/Build/source/texk/dvipdfmx/Makefile.in.orig
new file mode 100644
index 00000000000..effbfe0fbf7
--- /dev/null
+++ b/Build/source/texk/dvipdfmx/Makefile.in.orig
@@ -0,0 +1,616 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
+ TODO compile depcomp install-sh missing mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/cho-kpse.m4 \
+ $(top_srcdir)/m4/cho-libs.m4 $(top_srcdir)/m4/maw-time.m4 \
+ $(top_srcdir)/../../libs/zlib/withenable.ac \
+ $(top_srcdir)/../../libs/zlib/zlib.ac \
+ $(top_srcdir)/../../libs/libpng/withenable.ac \
+ $(top_srcdir)/../../libs/libpng/libpng.ac \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LDLIBPNG = @LDLIBPNG@
+LDZLIB = @LDZLIB@
+LIBOBJS = @LIBOBJS@
+LIBPNGCPPFLAGS = @LIBPNGCPPFLAGS@
+LIBPNGDEP = @LIBPNGDEP@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ZLIBCPPFLAGS = @ZLIBCPPFLAGS@
+ZLIBDEP = @ZLIBDEP@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+dvipdfmx_LDFLAGS = @dvipdfmx_LDFLAGS@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = data src
+ACLOCAL_AMFLAGS = -I m4
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+ cd $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d $(distdir) || mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-generic \
+ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+ dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-generic distclean-hdr distclean-tags distcleancheck \
+ distdir distuninstallcheck dvi dvi-am html html-am info \
+ info-am install install-am install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# to regenerate autofiles, run
+# aclocal -I m4 && autoconf && autoheader && automake
+# tested with autoconf 2.62 and automake 1.10.1. --karl, 21apr08.
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/texk/dvipdfmx/ac/withenable.ac b/Build/source/texk/dvipdfmx/ac/withenable.ac
new file mode 100644
index 00000000000..201550211fa
--- /dev/null
+++ b/Build/source/texk/dvipdfmx/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/dvipdfmx/ac/withenable.ac
+## configure options and TL libraries required for dvipdfmx
+KPSE_WITH_PROG([dvipdfmx], [kpathsea libpng])
diff --git a/Build/source/texk/dvipdfmx/configure.in.orig b/Build/source/texk/dvipdfmx/configure.in.orig
new file mode 100644
index 00000000000..b7d3b21514f
--- /dev/null
+++ b/Build/source/texk/dvipdfmx/configure.in.orig
@@ -0,0 +1,149 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(src/dvipdfmx.c)
+AM_INIT_AUTOMAKE(dvipdfmx, 20080607)
+AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE
+
+dnl Checks for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+AC_SYS_LARGEFILE
+AC_FUNC_FSEEKO
+
+# Building inside teTeX or TeX Live?
+AC_ARG_ENABLE(tetex-build, [ --enable-tetex-build build as part of a teTeX installation])
+
+
+dnl Check for kpathsea library. (required)
+if test "x$enable_tetex_build" = xyes; then
+ # In teTeX and TeX Live, LDFLAGS is passed by texk/Makefile and
+ # reserved for the user. Therefore we need another variable for the
+ # loader flags to find the local kpathsea. We use dvipdfmx_LDFLAGS
+ # since Automake already sets that up in the link command.
+ dvipdfmx_LDFLAGS=
+ AC_SUBST(dvipdfmx_LDFLAGS)
+
+ if test ! -d $srcdir/../../texk/kpathsea; then
+ AC_MSG_ERROR([
+=========================================
+
+You specified --enable-tetex-build, but I can't find the kpathsea
+directory. I expected it to be in $srcdir/../../texk/kpathsea.
+
+=========================================])
+ fi
+ CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/../../texk -I\$(top_srcdir)/../../texk"
+ dvipdfmx_LDFLAGS="-L\$(top_builddir)/../../texk/kpathsea/.libs"
+
+ AM_CONDITIONAL(TDS_VERSION_11, true)
+ AC_DEFINE([__TDS_VERSION__], 0x200406L)
+else
+ dnl Don't bother going further if we don't have kpse installed.
+ AC_ARG_WITH(kpathsea,
+ [ --with-kpathsea=DIR use kpathsea include/library files from DIR], [
+ if test -d "$withval"; then
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ fi
+ ], [
+ if test -d "$prefix"; then
+ CPPFLAGS="$CPPFLAGS -I$prefix/include"
+ LDFLAGS="$LDFLAGS -L$prefix/lib"
+ else
+ CPPFLAGS="$CPPFLAGS -I$ac_default_prefix/include"
+ LDFLAGS="$LDFLAGS -L$ac_default_prefix/lib"
+ fi
+ ])
+
+ AC_CHECK_LIB(kpathsea, kpse_find_file, [LIBS="-lkpathsea $LIBS"],
+ AC_MSG_ERROR([kpathsea library not found
+This version of dvipdfmx requires the kpathsea library and its headers. If
+you know where it is you might try setting the LDFLAGS environment variable
+with -L pointing to the directory containing libkpathsea.a.
+ ])
+ )
+
+ dnl Check kpathsea support for required formats and funcs.
+ CHO_CHECK_KPSE_SUPPORT([dvipdfmx])
+
+ dnl Check for TDS version kpathsea library supports.
+ CHO_CHECK_KPSE_TDS_VERSION
+fi
+
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h)
+AC_CHECK_HEADERS(stdint.h inttypes.h sys/types.h)
+
+dnl Checks for library functions.
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS(open close system getenv mkstemp basename)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+MAW_EXT_TIMEZONE
+MAW_TZ_HAS_TM_GMTOFF
+
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+AC_STRUCT_TIMEZONE
+AC_C_BIGENDIAN
+
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+
+
+dnl Check for additional libraries.
+if test "x$enable_tetex_build" = xyes; then
+ # Get these common libraries from the sources, too.
+ # Seems like it would be simpler to treat kpathsea this way too, but
+ # we're just starting from what lcdf-typetools did.
+ sinclude(../../libs/zlib/withenable.ac)
+ sinclude(../../libs/zlib/zlib.ac)
+
+ sinclude(../../libs/libpng/withenable.ac)
+ sinclude(../../libs/libpng/libpng.ac)
+
+ # yes, we have zlib and png.
+ AC_DEFINE(HAVE_ZLIB)
+ AC_DEFINE(HAVE_LIBPNG)
+
+ # You must define HAVE_ZLIB_COMPRESS2 to enable '-z' option for controlling
+ # zlib compression level, but zlib.ac included above does not do this test.
+ # We assume zlib always has compress2() here although that's not always true.
+ AC_DEFINE([HAVE_ZLIB_COMPRESS2], 1)
+
+ # tetex/tex live build; this always has kpathsea, xbasename, etc.,
+ # as we're building from current sources. Do this stuff at the end so
+ # other configure tests don't try to link with kpathsea (which doesn't
+ # exist at configure time).
+ LIBS="-lkpathsea -lm $LIBS"
+ AC_MSG_NOTICE([tetex build enabled, LIBS now: $LIBS])
+else
+ CHO_HAS_LIBPAPER
+ CHO_HAS_ZLIB
+ CHO_HAS_LIBPNG
+
+dnl these variables are defined in the tetex case and used in src/Makefile.am.
+dnl just let them be empty.
+ AC_SUBST(LIBPNGCPPFLAGS)
+ AC_SUBST(LDLIBPNG)
+ AC_SUBST(LIBPNGDEP)
+ AC_SUBST(ZLIBCPPFLAGS)
+ AC_SUBST(LDZLIB)
+ AC_SUBST(ZLIBDEP)
+ AC_SUBST(dvipdfmx_LDFLAGS)
+fi
+
+AC_CONFIG_FILES([Makefile data/Makefile src/Makefile])
+AC_OUTPUT
+
diff --git a/Build/source/texk/dvipos/ac/withenable.ac b/Build/source/texk/dvipos/ac/withenable.ac
new file mode 100644
index 00000000000..6419f1fef39
--- /dev/null
+++ b/Build/source/texk/dvipos/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/dvipos/ac/withenable.ac
+## configure options and TL libraries required for dvipos
+KPSE_WITH_PROG([dvipos], [kpathsea])
diff --git a/Build/source/texk/dvipsk/Makefile.in.orig b/Build/source/texk/dvipsk/Makefile.in.orig
new file mode 100644
index 00000000000..2c5c34d297b
--- /dev/null
+++ b/Build/source/texk/dvipsk/Makefile.in.orig
@@ -0,0 +1,164 @@
+# @configure_input@
+# Makefile for dvipsk -- kb@mail.tug.org. Public domain.
+version = 5.96dev
+
+# Add -DDEFRES=dpi to DEFS to change the default resolution from 600.
+# Add -DSECURE if you will install dvips with special privileges.
+# Add -DNO_DEBUG to omit debugging support.
+# Add -DNO_EMTEX to omit EMTEX specials.
+# Add -DNO_HPS to omit hypertex support.
+# Add -DNO_TPIC to omit tpic support.
+#
+# For VM/CMS or (perhaps) VMS or DOS compilation, need the corresponding
+# subdirectory from the original dvips distribution. (Maybe dvipsk
+# won't work at all on such systems; if you have info one way or the
+# other, please let kb@cs.umb.edu know.)
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+kpse_include ../make/cross.mk
+kpse_include ../make/texi.mk
+prog_cflags = -DUNIX -DKPATHSEA -DNeedFunctionPrototypes -DSHIFTLOWCHARS
+
+# The `t[mp]-' business is so that we don't create an empty .pro file,
+# if running squeeze fails for some reason. A dependency on squeeze
+# fails here, so we include it below.
+.SUFFIXES: .pro .lpro
+.lpro.pro:
+ ./squeeze <$< >t-$@
+ mv t-$@ $@
+prologues = tex.pro texps.pro texc.pro special.pro finclude.pro \
+ color.pro crop.pro hps.pro
+
+objects = dospecial.o dviinput.o emspecial.o fontdef.o loadfont.o \
+dvips.o tfmload.o download.o prescan.o scanpage.o skippage.o output.o \
+scalewidth.o dosection.o dopage.o resident.o search.o unpack.o drawPS.o \
+header.o repack.o virtualfont.o dpicheck.o finclude.o writet1.o \
+pprescan.o papersiz.o color.o bbox.o hps.o t1part.o
+
+program = dvips
+programs = afm2tfm $(program)
+
+
+default all: $(programs) $(prologues) dvips.info
+
+$(program): $(kpathsea) $(objects)
+ $(kpathsea_link) $(objects) $(LOADLIBES)
+afm2tfm: $(kpathsea) afm2tfm.o
+ $(kpathsea_link) afm2tfm.o $(LOADLIBES)
+# Omit LOADLIBES since no need to dynamically link with kpathsea.
+squeeze.o: squeeze.c
+ $(build_compile) -c $<
+squeeze: squeeze.o
+ $(build_link_command) squeeze.o
+
+@MAINT@## # Temporarily disabled -- 2008-02-28 peb
+@MAINT@## # The new version includes ptexlib.h.
+@MAINT@## # Can't do this without adjusting CPPFLAGS!
+@MAINT@## $(srcdir)/writet1.c: $(srcdir)/../web2c/pdftexdir/writet1.c
+@MAINT@## cp -f $(srcdir)/../web2c/pdftexdir/writet1.c $@
+
+@MAINT@## $(srcdir)/ptexmac.h: $(srcdir)/../web2c/pdftexdir/ptexmac.h
+@MAINT@## cp -f $(srcdir)/../web2c/pdftexdir/ptexmac.h $@
+
+$(prologues): squeeze
+texc.lpro: texc.script tex.lpro
+ $(SHELL) $(srcdir)/texc.script $(srcdir)/tex.lpro $@
+
+kpse_include ../make/tkpathsea.mk
+
+# The environment for running check.
+# No need to specify TEXMF, as ../kpathsea/texmf.cnf should contain
+# suitable absolute paths at this point. Those are converted to
+# SELFAUTO* paths on installation.
+checkenv = TEXMFCNF=../kpathsea \
+ TFMFONTS=$(srcdir)/testdata: VFFONTS=$(srcdir)/testdata: \
+ TEXPSHEADERS=$(srcdir)/testdata: TEXCONFIG=$(srcdir)/testdata:
+
+check: all
+ rm -f mtest.ps
+ -($(checkenv) ./dvips -D 300 $(srcdir)/testdata/dvipstst.xdv -o dvipstst.ps)
+ mv dvipstst.ps mtest.ps
+ -($(checkenv) ./dvips -D 300 $(srcdir)/testdata/dvipstst.xdv -o)
+ -diff $(srcdir)/testdata/dvipstst.xps dvipstst.ps
+
+install: install-exec install-data
+ $(POST_INSTALL)
+# @echo "Create $(psheaderdir)/base/config.ps if necessary (see ./INSTALL)."
+uninstall: uninstall-exec uninstall-data
+
+install-exec: all
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
+ rm -f $(bindir)/o$(program)
+ ln -s $(program) $(bindir)/o$(program)
+uninstall-exec:
+ for p in $(programs); do rm -f $(bindir)/$$p; done
+ rm -f $(bindir)/o$(program)
+
+# config.ps, encoding files, etc., are not installed here, since they
+# need to go through the usual package mechanism.
+install-data: $(program).info
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir) $(infodir) $(psheaderdir)/base
+# PostScript prologues and encodings.
+ for h in $(prologues); do $(INSTALL_DATA) $$h $(psheaderdir)/base/$$h; done
+# Info files.
+ $(INSTALL_DATA) $(srcdir)/$(program).i* $(infodir)/
+# Man pages.
+ $(INSTALL_DATA) $(srcdir)/$(program).1 $(man1dir)/$(program).$(manext)
+ rm -f $(man1dir)/o$(program).$(manext)
+ ln -s $(program).$(manext) $(man1dir)/o$(program).$(manext)
+ $(INSTALL_DATA) $(srcdir)/afm2tfm.1 $(man1dir)/afm2tfm.$(manext)
+# Post.
+ $(POST_INSTALL)
+ if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ install-info --info-dir=$(infodir) $(infodir)/$(program).info; \
+ else true; fi
+
+uninstall-data:
+ $(PRE_UNINSTALL)
+ if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ install-info --delete --info-dir=$(infodir) $(infodir)/$(program).info; \
+ else true; fi
+ $(NORMAL_UNINSTALL)
+ rm -f $(infodir)/dvips.i*
+ rm -f $(man1dir)/dvips.$(manext) $(man1dir)/afm2tfm.$(manext)
+
+distname = dvipsk
+program_files = *.texi *.info* *.lpro psfonts.map *.1 texc.script \
+ dvips.help $(program).aux $(program).cps dvipstst.dvi
+version_files = dvips.h afm2tfm.c dvips.c
+
+pre-dist-$(distname): INSTALL $(program).info $(program).dvi
+post-dist-$(distname):
+ ln -s `pwd`/contrib `pwd`/tex $(distdir)
+ mkdir $(distdir)/reencode; ln -s $(fontname)/*.enc $(distdir)/reencode
+ ln -s `pwd`/README.reencode $(distdir)/reencode/README
+ rm -f $(distdir)/texc.lpro
+
+kpse_include ../make/dist.mk
+kpse_include ../make/config.mk
+
+info: $(program).info
+dvi: $(program).dvi
+
+@MAINT@INSTALL: $(program).texi
+@MAINT@ $(MAKEINFO) -D INSTALLONLY --no-headers --no-split --no-validate \
+@MAINT@ $(MAKEINFO_FLAGS) $< -o $@
+@MAINT@ $(top_srcdir)/../add-info-toc $@
+@MAINT@$(program).info: dvips.help
+@MAINT@dvips.help: dvips.c
+@MAINT@ ./dvips --help >$@
+@MAINT@doc: info INSTALL
+
+kpse_include ../make/clean.mk
+
+distclean::
+ rm -f *.pro texc.lpro
+
+clean::
+ rm -f mtest.ps dvipstst.ps
+
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/dvipsk/ac/withenable.ac b/Build/source/texk/dvipsk/ac/withenable.ac
new file mode 100644
index 00000000000..251dfa955fc
--- /dev/null
+++ b/Build/source/texk/dvipsk/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/dvipsk/ac/withenable.ac
+## configure options and TL libraries required for dvipsk
+KPSE_WITH_PROG([dvipsk], [kpathsea])
diff --git a/Build/source/texk/dvipsk/configure.in.orig b/Build/source/texk/dvipsk/configure.in.orig
new file mode 100644
index 00000000000..92acfc45309
--- /dev/null
+++ b/Build/source/texk/dvipsk/configure.in.orig
@@ -0,0 +1,34 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(dvips.c)
+
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+
+# If libm is present, use it.
+AC_CHECK_LIB(m, main,LIBS="$LIBS -lm")
+
+
+sinclude(../kpathsea/withenable.ac)
+
+dnl These tests prevent reliable cross-compilation. Sigh.
+dnl Some special hacks are used to make cross-compilation
+dnl succeed in one special case.
+
+AC_UNSET_CC
+AC_CHECK_SIZEOF(int)
+AC_RESET_CC
+
+# If you're cross-compiling, these macros set up the variables in
+# ../make/cross.mk: BUILDCC, BUILDCFLAGS, BUILDCCLD etc.
+KPSE_CROSS_BUILD_VAR(CC, cc)
+KPSE_CROSS_BUILD_VAR(CFLAGS, $(BUILDXCFLAGS))
+KPSE_CROSS_BUILD_VAR(CPPFLAGS, $(BUILDXCPPFLAGS))
+KPSE_CROSS_BUILD_VAR(LDFLAGS, $(BUILDXLDFLAGS))
+KPSE_CROSS_BUILD_VAR(CCLD, $(BUILDCC))
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/gsftopk/Makefile.in.orig b/Build/source/texk/gsftopk/Makefile.in.orig
new file mode 100644
index 00000000000..ca7916ed1dd
--- /dev/null
+++ b/Build/source/texk/gsftopk/Makefile.in.orig
@@ -0,0 +1,64 @@
+# @configure_input@
+# Makefile for gsftopkk --kb@cs.umb.edu. Modified Yves.Arrouye@imag.fr
+version = 1.19
+
+program = gsftopk
+default all: $(program) gsftopk.1
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+
+gsftopkpsheaderdir = $(psheaderdir)/gsftopk
+
+# (Optional) The fully-qualified path of Ghostscript.
+# GSPATH=-DGS=\"/usr/local/gnu/bin/gs\"
+
+# See INSTALL for compilation options.
+DEFS = @DEFS@ $(XDEFS) $(GSPATH) -DKPATHSEA
+
+objects = gsftopk.o
+
+
+$(program): $(kpathsea) $(objects)
+ $(kpathsea_link) $(objects) $(LOADLIBES)
+
+kpse_include ../make/tkpathsea.mk
+
+gsftopk.1: gsftopk1.sed sedscript
+ sed -f sedscript <$(srcdir)/gsftopk1.sed >$@
+
+sedscript: mksedscript Makefile
+ $(SHELL) $(srcdir)/mksedscript $(DEFS) >$@
+
+install: install-exec install-data
+uninstall: uninstall-exec uninstall-data
+
+install-exec: $(program)
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ $(INSTALL_LIBTOOL_PROG) $(program) $(bindir)
+uninstall-exec:
+ rm -f $(bindir)/$(program)
+
+install-data: gsftopk.1
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir) $(gsftopkpsheaderdir)
+ $(INSTALL_DATA) gsftopk.1 $(man1dir)/gsftopk.$(manext)
+ $(INSTALL_DATA) $(srcdir)/render.ps $(gsftopkpsheaderdir)/render.ps
+uninstall-data:
+ rm -f $(man1dir)/gsftopk.$(manext)
+ rm -f $(gsftopkpsheaderdir)/render.ps
+
+kpse_include ../make/clean.mk
+
+clean::
+ rm -f sedscript
+
+distclean::
+ rm -f gsftopk.1
+
+kpse_include ../make/config.mk
+
+info dvi check:
+
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/gsftopk/ac/withenable.ac b/Build/source/texk/gsftopk/ac/withenable.ac
new file mode 100644
index 00000000000..94468941099
--- /dev/null
+++ b/Build/source/texk/gsftopk/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/gsftopk/ac/withenable.ac
+## configure options and TL libraries required for gsftopk
+KPSE_WITH_PROG([gsftopk], [kpathsea])
diff --git a/Build/source/texk/gsftopk/configure.in.orig b/Build/source/texk/gsftopk/configure.in.orig
new file mode 100644
index 00000000000..e81367859fa
--- /dev/null
+++ b/Build/source/texk/gsftopk/configure.in.orig
@@ -0,0 +1,28 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(gsftopk.c)
+
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+
+sinclude(../kpathsea/withenable.ac)
+
+dnl Checks for header files.
+AC_HEADER_SYS_WAIT
+AC_HEADER_TIME
+AC_CHECK_HEADERS([poll.h sys/time.h])
+
+dnl Checks for library functions.
+AC_FUNC_VFORK
+AC_TYPE_SIGNAL
+AC_CHECK_FUNCS([poll sigaction])
+
+if test "$ac_cv_header_poll_h" = no || test "$ac_cv_func_poll" = no; then
+ AC_CHECK_HEADERS([sys/select.h select.h])
+fi
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/kpathsea/Makefile.in.orig b/Build/source/texk/kpathsea/Makefile.in.orig
new file mode 100644
index 00000000000..3fb569e9f1c
--- /dev/null
+++ b/Build/source/texk/kpathsea/Makefile.in.orig
@@ -0,0 +1,258 @@
+# $Id$
+# @configure_input@
+# Makefile for kpathsea. Public domain.
+version = @KPSEVERSION@
+
+# Add -DNO_DEBUG to disable debugging, for vanishingly better performance.
+
+kpse_include ../make/paths.mk
+kpse_include ../make/makevars.mk
+kpse_include ../make/common.mk
+kpse_include ../make/library.mk
+kpse_include ../make/programs.mk
+kpse_include ../make/texi.mk
+
+@MAINT@warn_more = -Wmissing-prototypes -Wwrite-strings -Wshadow
+@MAINT@MAKEINFO_FLAGS := $(MAKEINFO_FLAGS) --no-split
+
+# Install these header files (except acconfig.h).
+install_headers = *.h $(srcdir)/*.h
+
+# Put tex-file.o first, because it's what depends on the paths, and may
+# reduce frustration if the paths are wrong by doing it first.
+
+objects = tex-file.lo absolute.lo atou.lo cnf.lo concat.lo concat3.lo \
+concatn.lo db.lo debug.lo dir.lo elt-dirs.lo expand.lo extend-fname.lo \
+file-p.lo find-suffix.lo fn.lo fontmap.lo getopt.lo getopt1.lo hash.lo \
+kdefault.lo kpathsea.lo line.lo magstep.lo make-suffix.lo mingw32.lo path-elt.lo \
+pathsearch.lo proginit.lo progname.lo readable.lo rm-suffix.lo \
+str-list.lo str-llist.lo tex-glyph.lo tex-hush.lo tex-make.lo \
+tilde.lo truncate.lo uppercasify.lo variable.lo version.lo xbasename.lo \
+xcalloc.lo xdirname.lo xfopen.lo xfseek.lo xfseeko.lo xftell.lo xftello.lo xgetcwd.lo xmalloc.lo \
+xopendir.lo xputenv.lo xrealloc.lo xstat.lo xstrdup.lo $(liblobjs) $(malloc)
+liblobjs = @LTLIBOBJS@
+
+library = kpathsea
+
+# We want to compile almost everything with libtool ...
+KPATHSEA_CC = $(LIBTOOL) --mode=compile $(CC)
+.SUFFIXES: .lo
+.c.lo:
+ $(KPATHSEA_CC) $(ALL_CFLAGS) -DMAKE_KPSE_DLL -c $<
+
+default all: kpsewhich kpsestat kpseaccess kpsereadlink $(library).info manfiles
+
+kpsewhich: $(kpathsea) kpsewhich.o
+ $(kpathsea_link) kpsewhich.o $(LOADLIBES)
+
+kpsestat: kpsestat.o
+ $(link_command) kpsestat.o
+
+kpseaccess: access.o
+ $(link_command) access.o
+
+kpsereadlink: readlink.o
+ $(link_command) readlink.o
+
+$(kpathsea): $(objects)
+ $(kpathsea_link) -rpath $(libdir) -version-info @KPSE_LT_VERS@ $(objects)
+
+# First null out comments and leading/trailing whitespace, then remove
+# lines that define invalid C identifiers, then remove blank lines and
+# lines that define lowercase values (those are never path values). Each
+# line remaining looks like
+# <name> = <value>
+# (but = and surrounding spaces are optional, hence can't remove all spaces).
+# Change this to #ifndef DEFAULT_name@#define DEFAULT_name "value"@#endif,
+# then change the @'s to newlines (sed isn't good at multiline replacements).
+#
+# No backslash-newline escapes in the long sed replacement because that
+# will turn into a space in the output.
+#
+# We replace the $TEXMF* references with nonexisting directories. These
+# are the compile-time defaults and are not useful in the native TL
+# builds; we rely completely on the self-location. (Previously, the
+# random build-time paths would get included in the binaries, to
+# consequent confusion.)
+#
+# We preserve the $SELFAUTO* references, since the selfauto-using
+# compile-time path for cnf files is how texmf.cnf gets found, which
+# determines everything else.
+#
+# The definition of DEFAULT_TEXMF (and other variables)
+# that winds up in the final paths.h will not be used.
+#
+# We don't want to rewrite paths.h when we have only changed comments
+# in texmf.cnf that have no effect on paths.h, since that would cause
+# almost everything to be rebuilt.
+#
+# We also replace all semicolons with colons in the paths.
+# The path-splitting code should be changed to understand both.
+#
+$(kpathsea_dir)/paths.h: stamp-paths
+stamp-paths: $(srcdir)/texmf.cnf
+ echo "/* paths.h: Generated from texmf.cnf. */" >paths.tmp
+ sed -e 's/%.*//' -e 's/^[ ]*//' -e 's/[ ]*$$//' $(srcdir)/texmf.cnf \
+ | grep '^[ ]*[A-Z0-9_]*[ =]' \
+ | sed '/^$$/d' \
+ | sed 's/^\([^ =]*\)[ ]*=*[ ]*\(.*\)/#ifndef DEFAULT_\1%#define DEFAULT_\1 "\2"%#endif/' \
+ | tr '%' '\012' \
+ | sed -e 's%\$$TEXMFCONFIG%/nonesuch/texmfconfig%g' \
+ -e 's%\$$TEXMFDIST%/nonesuch/texmfdist%g' \
+ -e 's%\$$TEXMFDOCDIR%/nonesuch/texmfdocdir%g' \
+ -e 's%\$$TEXMFLOCAL%/nonesuch/texmflocal%g' \
+ -e 's%\$$TEXMFMAIN%/nonesuch/texmfmain%g' \
+ -e 's%\$$TEXMFSYSCONFIG%/nonesuch/texmfsysconfig%g' \
+ -e 's%\$$TEXMFSYSVAR%/nonesuch/texmfsysvar%g' \
+ -e 's%\$$TEXMFVAR%/nonesuch/texmfvar%g' \
+ -e 's%\$$TEXMF%/nonesuch/texmf%g' \
+ -e 's%\$$VARTEXFONTS%/nonesuch/vartexfonts%g' \
+ | sed -e 's%;%:%g' \
+ >>paths.tmp
+ @if cmp -s paths.h paths.tmp 2>/dev/null; then \
+ echo "paths.h is unchanged"; \
+ else \
+ echo "cp paths.tmp paths.h"; \
+ cp paths.tmp paths.h; \
+ fi
+ rm -f paths.tmp
+ date >stamp-paths
+
+# Need an extra definition for this. Dependencies included below.
+tex-file.o:
+ $(KPATHSEA_CC) -DDEFAULT_FONT_SIZES='\"$(default_texsizes)\"' $(srcdir)/tex-file.c
+
+check: kpsewhich
+ ./kpsewhich -expand-var '$$TEXMF'
+
+install: install-exec install-data
+uninstall: uninstall-exec uninstall-data
+
+install-exec: kpsewhich
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir) $(scriptdir) \
+ $(libdir) $(web2cdir)
+ if grep 'original mktexpk --' $(scriptdir)/mktexpk >/dev/null 2>&1\
+ || test ! -r $(scriptdir)/mktexpk; then \
+ $(INSTALL_SCRIPT) $(srcdir)/mktexpk $(scriptdir)/mktexpk; \
+ else true; fi
+ if grep 'original mktexmf --' $(scriptdir)/mktexmf >/dev/null 2>&1\
+ || test ! -r $(scriptdir)/mktexmf; then \
+ $(INSTALL_SCRIPT) $(srcdir)/mktexmf $(scriptdir)/mktexmf; \
+ else true; fi
+ if grep 'original mktextfm --' $(scriptdir)/mktextfm >/dev/null 2>&1\
+ || test ! -r $(scriptdir)/mktextfm; then \
+ $(INSTALL_SCRIPT) $(srcdir)/mktextfm $(scriptdir)/mktextfm; \
+ else true; fi
+ if grep 'original mktexlsr --' $(scriptdir)/mktexlsr >/dev/null 2>&1\
+ || test ! -r $(scriptdir)/mktexlsr; then \
+ $(INSTALL_SCRIPT) $(srcdir)/mktexlsr $(scriptdir)/mktexlsr; \
+ else true; fi
+ $(INSTALL_DATA) $(srcdir)/mktex.opt $(web2cdir)/mktex.opt
+ $(INSTALL_SCRIPT) $(srcdir)/mktexdir $(web2cdir)/mktexdir
+ $(INSTALL_DATA) $(srcdir)/mktexdir.opt $(web2cdir)/mktexdir.opt
+ $(INSTALL_SCRIPT) $(srcdir)/mktexnam $(web2cdir)/mktexnam
+ $(INSTALL_DATA) $(srcdir)/mktexnam.opt $(web2cdir)/mktexnam.opt
+ $(INSTALL_SCRIPT) $(srcdir)/mktexupd $(web2cdir)/mktexupd
+ $(INSTALL_LIBTOOL_LIBS) lib$(library).la $(libdir)
+ $(INSTALL_LIBTOOL_PROG) kpsewhich $(bindir)
+ $(INSTALL_PROGRAM) kpsestat $(bindir)
+ $(INSTALL_PROGRAM) kpseaccess $(bindir)
+ $(INSTALL_PROGRAM) kpsereadlink $(bindir)
+uninstall-exec:
+ $(UNINSTALL_LIBTOOL_LIBS) $(libdir)/lib$(library).la
+ $(UNINSTALL_LIBTOOL_PROG) $(bindir)/kpsewhich
+ $(UNINSTALL_PROGRAM) $(bindir)/kpsestat
+ $(UNINSTALL_PROGRAM) $(bindir)/kpseaccess
+ $(UNINSTALL_PROGRAM) $(bindir)/kpsereadlink
+
+install-data: $(srcdir)/texmf.cnf kpathsea.info install-man
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(texmf) $(infodir) $(web2cdir)
+ if grep 'original texmf.cnf --' $(web2cdir)/texmf.cnf >/dev/null 2>&1 \
+ || test ! -r $(web2cdir)/texmf.cnf; then \
+ $(INSTALL_DATA) $(srcdir)/texmf.cnf $(web2cdir)/texmf.cnf; \
+ else true; fi
+# Info files.
+ $(INSTALL_DATA) $(srcdir)/kpathsea.i* $(infodir)/
+# Should we install the headers? They are not just system-dependent,
+# which is bad enough, but even compiler-dependent.
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(includedir)/kpathsea
+ for f in $(install_headers); do \
+ $(INSTALL_DATA) $$f $(includedir)/kpathsea/; done
+ rm -f $(includedir)/kpathsea/acconfig.h
+# Post.
+ $(POST_INSTALL)
+ if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ install-info --info-dir=$(infodir) $(infodir)/kpathsea.info; \
+ else true; fi
+
+uninstall-data:
+ $(PRE_UNINSTALL)
+ if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ install-info --delete --info-dir=$(infodir) $(infodir)/kpathsea.info; \
+ else true; fi
+ $(NORMAL_UNINSTALL)
+ rm -f $(infodir)/kpathsea.i*
+# for f in $(install_headers); do rm -f $(includedir)/`basename $$f`; done
+
+# distdir is used by other distributions; they define $(distdir).
+distdir: doc $(library).dvi $(library).h
+ rm -rf $(distdir)
+ mkdir -p $(distdir)
+ ln $(ln_files) $(distdir)
+ touch *.info*
+ ln mktex* *.info* *.texi *.ftp $(library).aux $(library).cps $(distdir)
+ rm -f $(distdir)/*.1 $(distdir)/*.man
+ ln *.man $(distdir)
+ ln BUGS README.CONFIGURE HIER PROJECTS *.ac $(distdir)
+ touch kpathsea.h # to avoid .cps.h rule on Solaris
+ cd $(distdir) && rm -f paths.h
+
+# I don't use this, but other programmers want it. acconfig.h is an
+# autoheader input file, not an includable C header. Bad name.
+$(library).h: always
+ rm -f $@
+ echo '/* This is a generated file */' >$@
+ echo '/* collecting all kpathsea headers. */' >>$@
+ echo '#include <kpathsea/config.h>' >>$@
+ ls -1 *.h \
+ | grep -v '\(acconfig\|config\|kpathsea\|win32lib\)\.h' \
+ | sed -e 's,^,#include <kpathsea/,' -e s',$$,>,' >>$@
+ touch -r `ls -1t *.h | tail +2 | head -1` $@
+always:
+.PHONY: always
+
+kpse_include ../make/config.mk
+
+info: $(library).info
+dvi: $(library).dvi
+
+$(library).info: bugs.texi hier.texi install.texi unixtex.texi
+
+@MAINT@INSTALL: install.texi
+@MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
+@MAINT@ $(top_srcdir)/../add-info-toc $@
+@MAINT@BUGS: bugs.texi
+@MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
+@MAINT@ $(top_srcdir)/../add-info-toc $@
+@MAINT@HIER: hier.texi
+@MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
+@MAINT@unixtex.ftp: unixtex.texi
+@MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
+@MAINT@doc: info HIER BUGS INSTALL unixtex.ftp
+
+kpse_include ../make/clean.mk
+
+mostlyclean::
+ rm -f kpsewhich kpsestat kpseaccess kpsereadlink *.lo
+ $(LIBTOOL) --mode=clean $(RM) lib$(library).la
+distclean::
+ rm -f paths.h stamp-paths
+
+# The manual pages
+manfiles = kpseaccess.1 kpsestat.1 kpsewhich.1 kpsereadlink.1 \
+ mktexlsr.1 mktexmf.1 mktextfm.1 mktexpk.1
+
+kpse_include ../make/man.mk
+
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/kpathsea/common.ac.orig b/Build/source/texk/kpathsea/common.ac.orig
new file mode 100644
index 00000000000..79d0789f750
--- /dev/null
+++ b/Build/source/texk/kpathsea/common.ac.orig
@@ -0,0 +1,117 @@
+dnl Public domain.
+dnl Originally written by Karl Berry
+dnl
+dnl Common Autoconf sinclude file for kpathsea-using programs. (Have to
+dnl use the m4 `sinclude' builtin instead of `include', since Autoconf
+dnl disables `include'.)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+sinclude(../libtool.m4)
+
+AC_PROG_LIBTOOL
+
+AC_SYS_LARGEFILE
+AC_FUNC_FSEEKO
+
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_FUNC_CLOSEDIR_VOID
+AC_CHECK_HEADERS([assert.h float.h limits.h memory.h pwd.h stdlib.h \
+ string.h strings.h sys/param.h unistd.h])
+AC_CHECK_DECLS([putenv, strstr])
+
+dnl Libtool supporting objects that may be required on ancient broken system.
+AC_CHECK_FUNCS(putenv,, LTLIBOBJS="$LTLIBOBJS putenv.lo")
+AC_CHECK_FUNCS(strcasecmp,, LTLIBOBJS="$LTLIBOBJS strcasecmp.lo")
+AC_CHECK_FUNCS(strtol,, LTLIBOBJS="$LTLIBOBJS strtol.lo")
+AC_CHECK_FUNCS(strstr,, LTLIBOBJS="$LTLIBOBJS strstr.lo")
+AC_SUBST(LTLIBOBJS)
+
+AC_CHECK_FUNCS(bcmp bcopy bzero getcwd getwd index memcmp memcpy rindex strchr strrchr)
+
+AC_C_CONST
+
+# Check whether struct stat provides high-res time.
+AC_CHECK_MEMBERS([struct stat.st_mtim])
+
+# Check whether prototypes work.
+AC_MSG_CHECKING(whether the compiler accepts prototypes)
+AC_CACHE_VAL(kb_cv_c_prototypes,
+[AC_TRY_COMPILE([#include <stdarg.h>], [extern void foo(int i,...);],
+ kb_cv_c_prototypes=yes, kb_cv_c_prototypes=no)])dnl
+AC_MSG_RESULT($kb_cv_c_prototypes)
+if test "$kb_cv_c_prototypes" = yes; then
+ AC_DEFINE([HAVE_PROTOTYPES], 1,
+ [Define to 1 if your compiler understands prototypes.])
+fi
+
+# This is a GNU libc invention.
+AC_MSG_CHECKING([whether program_invocation_name is predefined])
+AC_CACHE_VAL([kb_cv_var_program_inv_name],
+[AC_TRY_LINK(,
+ [extern char *program_invocation_name; program_invocation_name = "love";],
+ [kb_cv_var_program_inv_name=yes], [kb_cv_var_program_inv_name=no])])dnl
+AC_MSG_RESULT([$kb_cv_var_program_inv_name])
+if test "$kb_cv_var_program_inv_name" = yes; then
+ AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], 1,
+ [Define to 1 if you are using GNU libc or otherwise have global
+ variables `program_invocation_name' and `program_invocation_short_name'.])
+fi
+
+if test $ac_cv_func_getcwd = yes; then
+# We only need to run this if we have getcwd.
+AC_MSG_CHECKING([whether getcwd uses fork or vfork])
+AC_CACHE_VAL([kb_cv_func_getcwd_forks],
+[AC_TRY_RUN([
+int fork() { exit(1); }
+int vfork() { exit(1); }
+extern char *getcwd();
+char path[100];
+int main() {
+getcwd(path,100);
+return 0;
+}], [kb_cv_func_getcwd_forks=no], [kb_cv_func_getcwd_forks=yes],
+ [kb_cv_func_getcwd_forks=no])])dnl
+AC_MSG_RESULT([$kb_cv_func_getcwd_forks])
+if test $kb_cv_func_getcwd_forks = yes; then
+ AC_DEFINE([GETCWD_FORKS], 1,
+ [Define to 1 if getcwd is implemented using fork or vfork. Let me know
+ if you have to add this by hand because configure failed to detect it.])
+fi
+fi
+
+# Common --with and --enable options.
+sinclude(../../texk/kpathsea/withenable.ac)
+
+# Implementation of those options.
+AC_DEFUN([_KPSE_DEFINE_MAKE_BY_DEFAULT],
+[if test "x$with_$1_default" = xyes; then
+ AC_DEFINE([MAKE_$2_BY_DEFAULT], 1,
+ [Define to 1 if you want to run $1 if $3 missing, and to 0 if you don't.])
+else
+ AC_DEFINE([MAKE_$2_BY_DEFAULT], 0)
+fi
+])# _KPSE_DEFINE_MAKE_BY_DEFAULT
+
+_KPSE_DEFINE_MAKE_BY_DEFAULT([mktexmf], [TEX_MF], [MF source])
+_KPSE_DEFINE_MAKE_BY_DEFAULT([mktexpk], [TEX_PK], [PK font])
+_KPSE_DEFINE_MAKE_BY_DEFAULT([mktextex], [TEX_TEX], [TeX source])
+_KPSE_DEFINE_MAKE_BY_DEFAULT([mktexfmt], [TEX_FMT], [format file])
+_KPSE_DEFINE_MAKE_BY_DEFAULT([mktextfm], [TEX_TFM], [TFM file])
+_KPSE_DEFINE_MAKE_BY_DEFAULT([mkocp], [OMEGA_OCP], [OCP file])
+_KPSE_DEFINE_MAKE_BY_DEFAULT([mkofm], [OMEGA_OFM], [OFM file])
+
+# Is libm present. FIXME: do we need it at all?
+AC_CHECK_LIB(m, main)
+
+# If you're cross-compiling, these macros set up the variables in
+# ../make/cross.mk: BUILDCC, BUILDCFLAGS, BUILDCCLD etc.
+KPSE_CROSS_BUILD_VAR(CC, cc)
+KPSE_CROSS_BUILD_VAR(CFLAGS, $(BUILDXCFLAGS))
+KPSE_CROSS_BUILD_VAR(CPPFLAGS, $(BUILDXCPPFLAGS))
+KPSE_CROSS_BUILD_VAR(LDFLAGS, $(BUILDXLDFLAGS))
+KPSE_CROSS_BUILD_VAR(CCLD, $(BUILDCC))
diff --git a/Build/source/texk/kpathsea/configure.in.orig b/Build/source/texk/kpathsea/configure.in.orig
new file mode 100644
index 00000000000..67c9b4b9bb2
--- /dev/null
+++ b/Build/source/texk/kpathsea/configure.in.orig
@@ -0,0 +1,73 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl Kpathsea package version:
+dnl Starting development:
+dnl kpse_devel_version = dev;
+dnl Making releases:
+dnl kpse_micro_version += 1;
+dnl kpse_devel_version = ;
+dnl
+dnl Kpathsea shared library version:
+dnl Only bug fixes:
+dnl kpse_lib_micro += 1;
+dnl Adding new interfaces (backwards compatible)
+dnl kpse_lib_minor += 1;
+dnl kpse_lib_micro = 0;
+dnl Modifying or revoking interfaces (not backwards compatible)
+dnl kpse_lib_major += 1;
+dnl kpse_lib_minor = 0;
+dnl kpse_lib_micro = 0;
+dnl
+m4_define([kpse_major_version], [3])[]dnl
+m4_define([kpse_minor_version], [5])[]dnl
+m4_define([kpse_micro_version], [7])[]dnl
+m4_define([kpse_devel_version], [dev])[]dnl
+m4_define([kpse_version], [kpse_major_version.kpse_minor_version.kpse_micro_version[]kpse_devel_version])[]dnl
+
+m4_define([kpse_lib_major], [5])[]dnl
+m4_define([kpse_lib_minor], [0])[]dnl
+m4_define([kpse_lib_micro], [0])[]dnl
+m4_define([kpse_lt_version],[m4_eval(kpse_lib_major + kpse_lib_minor):kpse_lib_micro:kpse_lib_minor])[]dnl
+
+AC_INIT([kpathsea], [kpse_version], [tex-k@mail.tug.org])
+AC_CONFIG_SRCDIR([pathsearch.c])
+
+AC_SUBST([KPSEVERSION], [kpse_version])
+AC_DEFINE([KPSEVERSION], ["kpathsea version kpse_version"])
+AC_SUBST([KPSE_LT_VERS], [kpse_lt_version])
+
+dnl Write output here, instead of putting a zillion -D's on the command line.
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in],
+ [sed 's/^#define PACKAGE_/#define KPSE_PACKAGE_/' c-auto.h >c-auto.tmp && mv -f c-auto.tmp c-auto.h
+ date >stamp-auto])
+
+sinclude(common.ac)
+
+AH_TOP([/* c-auto.h: defines for kpathsea, as determined by configure.
+
+ Copyright 1994-97, 2008 Karl Berry.
+ Copyright 1997-99, 2002, 2005 Olaf Weber.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, see <http://www.gnu.org/licenses/>. */
+
+/* Guard against double inclusion. */
+#ifndef KPATHSEA_C_AUTO_H
+#define KPATHSEA_C_AUTO_H
+
+/* kpathsea: the version string. */
+#define KPSEVERSION "REPLACE-WITH-KPSEVERSION"])
+AH_BOTTOM([#endif /* !KPATHSEA_C_AUTO_H */])
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/lacheck/ac/withenable.ac b/Build/source/texk/lacheck/ac/withenable.ac
new file mode 100644
index 00000000000..b1e20cd2fae
--- /dev/null
+++ b/Build/source/texk/lacheck/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/lacheck/ac/withenable.ac
+## configure options and TL libraries required for lacheck
+KPSE_WITH_PROG([lacheck], [kpathsea])
diff --git a/Build/source/texk/makeindexk/Makefile.in.orig b/Build/source/texk/makeindexk/Makefile.in.orig
new file mode 100644
index 00000000000..d3c5f49aaa2
--- /dev/null
+++ b/Build/source/texk/makeindexk/Makefile.in.orig
@@ -0,0 +1,54 @@
+# @configure_input@
+# Makefile for makeindexk --te@dbs.uni-hannover.de. Public domain.
+version = 2.13
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+
+objects = genind.o mkind.o qsort.o scanid.o scanst.o sortid.o
+program = makeindex
+programs = $(program)
+
+default all: $(programs)
+
+$(program): $(kpathsea) $(objects)
+ $(kpathsea_link) $(objects) $(LOADLIBES)
+kpse_include ../make/tkpathsea.mk
+
+install: install-exec install-data
+uninstall: uninstall-exec uninstall-data
+
+install-exec: $(programs)
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ $(INSTALL_LIBTOOL_PROG) $(program) $(bindir)
+ $(INSTALL_SCRIPT) $(srcdir)/mkindex $(scriptdir)/mkindex
+uninstall-exec:
+ cd $(bindir) && rm -f $(program)
+ cd $(scriptdir) && rm -f mkindex
+
+install-data: makeindex.1
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir)
+ $(INSTALL_DATA) $(srcdir)/makeindex.1 $(man1dir)/makeindex.$(manext)
+ $(INSTALL_DATA) $(srcdir)/mkindex.1 $(man1dir)/mkindex.$(manext)
+
+uninstall-data:
+
+distname = makeindex
+program_files =
+version_files =
+
+pre-dist-$(distname):
+post-dist-$(distname):
+
+kpse_include ../make/dist.mk
+kpse_include ../make/config.mk
+
+info dvi check:
+
+kpse_include ../make/clean.mk
+
+distclean::
+
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/makeindexk/ac/withenable.ac b/Build/source/texk/makeindexk/ac/withenable.ac
new file mode 100644
index 00000000000..ca58bc1bbe5
--- /dev/null
+++ b/Build/source/texk/makeindexk/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/makeindexk/ac/withenable.ac
+## configure options and TL libraries required for makeindexk
+KPSE_WITH_PROG([makeindexk], [kpathsea])
diff --git a/Build/source/texk/makeindexk/configure.in.orig b/Build/source/texk/makeindexk/configure.in.orig
new file mode 100644
index 00000000000..434e56f1008
--- /dev/null
+++ b/Build/source/texk/makeindexk/configure.in.orig
@@ -0,0 +1,18 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(mkind.c)
+
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+
+sinclude(../kpathsea/withenable.ac)
+
+AC_ARG_PROGRAM
+AC_HAVE_HEADERS(ctype.h types.h locale.h)
+AC_CHECK_FUNCS(strchr strrchr setlocale)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/musixflx/Makefile.in.orig b/Build/source/texk/musixflx/Makefile.in.orig
new file mode 100644
index 00000000000..52beb1f7037
--- /dev/null
+++ b/Build/source/texk/musixflx/Makefile.in.orig
@@ -0,0 +1,42 @@
+# @configure_input@
+# Makefile for musixflx. Public domain.
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+
+prog_cflags = -DUNIX -DKPATHSEA -DNeedFunctionPrototypes
+
+program = musixflx
+objects = musixflx.o
+
+programs = $(program)
+
+default: $(program)
+all: $(program)
+
+$(program): $(objects)
+ $(kpathsea_link) $(objects)
+
+install: install-exec
+
+uninstall: uninstall-exec
+
+install-exec: all
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
+uninstall-exec:
+ for p in $(programs); do rm -f $(bindir)/$$p; done
+
+install-data:
+
+uninstall-data:
+
+kpse_include ../make/dist.mk
+kpse_include ../make/config.mk
+
+info dvi check:
+
+kpse_include ../make/clean.mk
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
+
diff --git a/Build/source/texk/musixflx/ac/withenable.ac b/Build/source/texk/musixflx/ac/withenable.ac
new file mode 100644
index 00000000000..520e1ed0b12
--- /dev/null
+++ b/Build/source/texk/musixflx/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/musixflx/ac/withenable.ac
+## configure options and TL libraries required for musixflx
+KPSE_WITH_PROG([musixflx])
diff --git a/Build/source/texk/musixflx/configure.in.orig b/Build/source/texk/musixflx/configure.in.orig
new file mode 100644
index 00000000000..ee2b36b9d30
--- /dev/null
+++ b/Build/source/texk/musixflx/configure.in.orig
@@ -0,0 +1,14 @@
+dnl Public domain.
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(musixflx.c)
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
+
+sinclude(../kpathsea/common.ac)
+
+dnl These tests prevent reliable cross-compilation. Sigh.
+AC_C_CHAR_UNSIGNED
+AC_CHECK_SIZEOF(long)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/one/Makefile.am b/Build/source/texk/one/Makefile.am
new file mode 100644
index 00000000000..68deed99684
--- /dev/null
+++ b/Build/source/texk/one/Makefile.am
@@ -0,0 +1,24 @@
+##
+ACLOCAL_AMFLAGS = -I ../../m4
+
+INCLUDES = $(XPDF_INCLUDES) $(FREETYPE2_INCLUDES) $(LIBPNG_INCLUDES)
+INCLUDES += $(OBSDCOMPAT_INCLUDES) $(MD5_INCLUDES) $(ZLIB_INCLUDES)
+LIBS = $(XPDF_LIBS) $(FREETYPE2_LIBS) $(LIBPNG_LIBS)
+LIBS += $(OBSDCOMPAT_LIBS) $(MD5_LIBS) $(ZLIB_LIBS)
+
+bin_PROGRAMS = progone
+
+progone_SOURCES = one.c
+
+@ZLIB_RULE@
+@OBSDCOMPAT_RULE@
+@LIBPNG_RULE@
+@T1LIB_RULE@
+@FREETYPE2_RULE@
+@GD_RULE@
+@XPDF_RULE@
+@GRAPHITE_RULE@
+@TECKIT_RULE@
+
+TESTS = progone
+
diff --git a/Build/source/texk/one/Makefile.in b/Build/source/texk/one/Makefile.in
new file mode 100644
index 00000000000..5a7c6dce781
--- /dev/null
+++ b/Build/source/texk/one/Makefile.in
@@ -0,0 +1,764 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = progone$(EXEEXT)
+TESTS = progone$(EXEEXT)
+subdir = .
+DIST_COMMON = $(am__configure_deps) \
+ $(srcdir)/../../build-aux/config.guess \
+ $(srcdir)/../../build-aux/config.sub \
+ $(srcdir)/../../build-aux/depcomp \
+ $(srcdir)/../../build-aux/install-sh \
+ $(srcdir)/../../build-aux/ltmain.sh \
+ $(srcdir)/../../build-aux/missing $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(top_srcdir)/configure ../../build-aux/config.guess \
+ ../../build-aux/config.sub ../../build-aux/depcomp \
+ ../../build-aux/install-sh ../../build-aux/ltmain.sh \
+ ../../build-aux/missing ../../build-aux/texinfo.tex \
+ ../../build-aux/ylwrap
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-common.m4 \
+ $(top_srcdir)/../../m4/kpse-freetype2-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-gd-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-graphite-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-libpng-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-obsdcompat-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-t1lib-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-teckit-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-xpdf-flags.m4 \
+ $(top_srcdir)/../../m4/kpse-zlib-flags.m4 \
+ $(top_srcdir)/../../m4/libtool.m4 \
+ $(top_srcdir)/../../m4/ltoptions.m4 \
+ $(top_srcdir)/../../m4/ltsugar.m4 \
+ $(top_srcdir)/../../m4/ltversion.m4 \
+ $(top_srcdir)/../../m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_progone_OBJECTS = one.$(OBJEXT)
+progone_OBJECTS = $(am_progone_OBJECTS)
+progone_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/../../build-aux/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(progone_SOURCES)
+DIST_SOURCES = $(progone_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FREETYPE2_DEPEND = @FREETYPE2_DEPEND@
+FREETYPE2_INCLUDES = @FREETYPE2_INCLUDES@
+FREETYPE2_LIBS = @FREETYPE2_LIBS@
+GD_DEPEND = @GD_DEPEND@
+GD_INCLUDES = @GD_INCLUDES@
+GD_LIBS = @GD_LIBS@
+GRAPHITE_DEPEND = @GRAPHITE_DEPEND@
+GRAPHITE_INCLUDES = @GRAPHITE_INCLUDES@
+GRAPHITE_LIBS = @GRAPHITE_LIBS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_DEPEND = @LIBPNG_DEPEND@
+LIBPNG_INCLUDES = @LIBPNG_INCLUDES@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = $(XPDF_LIBS) $(FREETYPE2_LIBS) $(LIBPNG_LIBS) \
+ $(OBSDCOMPAT_LIBS) $(MD5_LIBS) $(ZLIB_LIBS)
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OBSDCOMPAT_DEPEND = @OBSDCOMPAT_DEPEND@
+OBSDCOMPAT_INCLUDES = @OBSDCOMPAT_INCLUDES@
+OBSDCOMPAT_LIBS = @OBSDCOMPAT_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+T1LIB_DEPEND = @T1LIB_DEPEND@
+T1LIB_INCLUDES = @T1LIB_INCLUDES@
+T1LIB_LIBS = @T1LIB_LIBS@
+TECKIT_DEPEND = @TECKIT_DEPEND@
+TECKIT_INCLUDES = @TECKIT_INCLUDES@
+TECKIT_LIBS = @TECKIT_LIBS@
+VERSION = @VERSION@
+XPDF_DEPEND = @XPDF_DEPEND@
+XPDF_INCLUDES = @XPDF_INCLUDES@
+XPDF_LIBS = @XPDF_LIBS@
+ZLIB_DEPEND = @ZLIB_DEPEND@
+ZLIB_INCLUDES = @ZLIB_INCLUDES@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ACLOCAL_AMFLAGS = -I ../../m4
+INCLUDES = $(XPDF_INCLUDES) $(FREETYPE2_INCLUDES) $(LIBPNG_INCLUDES) \
+ $(OBSDCOMPAT_INCLUDES) $(MD5_INCLUDES) $(ZLIB_INCLUDES)
+progone_SOURCES = one.c
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+progone$(EXEEXT): $(progone_OBJECTS) $(progone_DEPENDENCIES)
+ @rm -f progone$(EXEEXT)
+ $(LINK) $(progone_OBJECTS) $(progone_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/one.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d $(distdir) || mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(PROGRAMS) config.h
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \
+ clean clean-binPROGRAMS clean-generic clean-libtool ctags dist \
+ dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \
+ dist-zip distcheck distclean distclean-compile \
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-binPROGRAMS
+
+
+@ZLIB_RULE@
+@OBSDCOMPAT_RULE@
+@LIBPNG_RULE@
+@T1LIB_RULE@
+@FREETYPE2_RULE@
+@GD_RULE@
+@XPDF_RULE@
+@GRAPHITE_RULE@
+@TECKIT_RULE@
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/texk/one/ac/withenable.ac b/Build/source/texk/one/ac/withenable.ac
new file mode 100644
index 00000000000..a9e5e93e922
--- /dev/null
+++ b/Build/source/texk/one/ac/withenable.ac
@@ -0,0 +1,4 @@
+## texk/one/ac/withenable.ac
+## configure options and TL libraries required for one
+dnl KPSE_WITH_PROG([one], [freetype2 gd], , [testing])
+KPSE_WITH_PROG([one], [freetype2 t1lib gd teckit graphite], [without], [testing])
diff --git a/Build/source/texk/one/aclocal.m4 b/Build/source/texk/one/aclocal.m4
new file mode 100644
index 00000000000..b7fa6ec471b
--- /dev/null
+++ b/Build/source/texk/one/aclocal.m4
@@ -0,0 +1,921 @@
+# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10.2], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 4
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[# Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file. Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*) set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 13
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([../../m4/kpse-common.m4])
+m4_include([../../m4/kpse-freetype2-flags.m4])
+m4_include([../../m4/kpse-gd-flags.m4])
+m4_include([../../m4/kpse-graphite-flags.m4])
+m4_include([../../m4/kpse-libpng-flags.m4])
+m4_include([../../m4/kpse-obsdcompat-flags.m4])
+m4_include([../../m4/kpse-t1lib-flags.m4])
+m4_include([../../m4/kpse-teckit-flags.m4])
+m4_include([../../m4/kpse-xpdf-flags.m4])
+m4_include([../../m4/kpse-zlib-flags.m4])
+m4_include([../../m4/libtool.m4])
+m4_include([../../m4/ltoptions.m4])
+m4_include([../../m4/ltsugar.m4])
+m4_include([../../m4/ltversion.m4])
+m4_include([../../m4/lt~obsolete.m4])
diff --git a/Build/source/texk/one/config.h.in b/Build/source/texk/one/config.h.in
new file mode 100644
index 00000000000..bcc3ed319e5
--- /dev/null
+++ b/Build/source/texk/one/config.h.in
@@ -0,0 +1,59 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/Build/source/texk/one/configure b/Build/source/texk/one/configure
new file mode 100755
index 00000000000..57757c6ca4f
--- /dev/null
+++ b/Build/source/texk/one/configure
@@ -0,0 +1,13781 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for bld-test-texk-one 1.1.
+#
+# Report bugs to <peb@mppmu.mpg.de>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ case $as_dir in
+ /*)
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell bug-autoconf@gnu.org about your system,
+ echo including any error possibly output before this message.
+ echo This can help us improve future autoconf versions.
+ echo Configuration will now proceed without shell functions.
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $ECHO works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<_LT_EOF
+$*
+_LT_EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+ if test "X${echo_test_string+set}" != Xset; then
+ # find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+ { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+ then
+ break
+ fi
+ done
+ fi
+
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+ else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$ECHO" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ ECHO='print -r'
+ elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ ECHO='printf %s\n'
+ if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ ECHO="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ ECHO="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ ECHO=echo
+ fi
+ fi
+ fi
+ fi
+ fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='bld-test-texk-one'
+PACKAGE_TARNAME='bld-test-texk-one'
+PACKAGE_VERSION='1.1'
+PACKAGE_STRING='bld-test-texk-one 1.1'
+PACKAGE_BUGREPORT='peb@mppmu.mpg.de'
+
+ac_unique_file="one.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+TECKIT_RULE
+TECKIT_DEPEND
+TECKIT_LIBS
+TECKIT_INCLUDES
+GRAPHITE_RULE
+GRAPHITE_DEPEND
+GRAPHITE_LIBS
+GRAPHITE_INCLUDES
+XPDF_RULE
+XPDF_DEPEND
+XPDF_LIBS
+XPDF_INCLUDES
+GD_RULE
+GD_DEPEND
+GD_LIBS
+GD_INCLUDES
+FREETYPE2_RULE
+FREETYPE2_DEPEND
+FREETYPE2_LIBS
+FREETYPE2_INCLUDES
+T1LIB_RULE
+T1LIB_DEPEND
+T1LIB_LIBS
+T1LIB_INCLUDES
+LIBPNG_RULE
+LIBPNG_DEPEND
+LIBPNG_LIBS
+LIBPNG_INCLUDES
+OBSDCOMPAT_RULE
+OBSDCOMPAT_DEPEND
+OBSDCOMPAT_LIBS
+OBSDCOMPAT_INCLUDES
+ZLIB_RULE
+ZLIB_DEPEND
+ZLIB_LIBS
+ZLIB_INCLUDES
+CPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+lt_ECHO
+RANLIB
+AR
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+LIBTOOL
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+enable_dependency_tracking
+with_gnu_ld
+enable_libtool_lock
+with_system_zlib
+with_zlib_includes
+with_zlib_libdir
+with_system_libpng
+with_libpng_includes
+with_libpng_libdir
+with_system_t1lib
+with_t1lib_includes
+with_t1lib_libdir
+with_system_freetype2
+with_freetype2_includes
+with_freetype2_libdir
+with_system_gd
+with_gd_includes
+with_gd_libdir
+with_system_graphite
+with_graphite_includes
+with_graphite_libdir
+with_system_teckit
+with_teckit_includes
+with_teckit_libdir
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+ { (exit 1); exit 1; }; } ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { $as_echo "$as_me: error: working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures bld-test-texk-one 1.1 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root
+ [DATAROOTDIR/doc/bld-test-texk-one]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of bld-test-texk-one 1.1:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-static[=PKGS] build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --disable-libtool-lock avoid locking (might break parallel builds)
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-system-zlib use installed zlib headers and library
+ --with-zlib-includes=DIR
+ zlib headers installed in DIR
+ --with-zlib-libdir=DIR zlib library installed in DIR
+ --with-system-libpng use installed libpng headers and library
+ --with-libpng-includes=DIR
+ libpng headers installed in DIR
+ --with-libpng-libdir=DIR
+ libpng library installed in DIR
+ --with-system-t1lib use installed t1lib headers and library
+ --with-t1lib-includes=DIR
+ t1lib headers installed in DIR
+ --with-t1lib-libdir=DIR t1lib library installed in DIR
+ --with-system-freetype2 use installed freetype2 headers and library
+ --with-freetype2-includes=DIR
+ freetype2 headers installed in DIR
+ --with-freetype2-libdir=DIR
+ freetype2 library installed in DIR
+ --with-system-gd use installed gd headers and library
+ --with-gd-includes=DIR gd headers installed in DIR
+ --with-gd-libdir=DIR gd library installed in DIR
+ --with-system-graphite use installed graphite headers and library
+ --with-graphite-includes=DIR
+ graphite headers installed in DIR
+ --with-graphite-libdir=DIR
+ graphite library installed in DIR
+ --with-system-teckit use installed teckit headers and library
+ --with-teckit-includes=DIR
+ teckit headers installed in DIR
+ --with-teckit-libdir=DIR
+ teckit library installed in DIR
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <peb@mppmu.mpg.de>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+bld-test-texk-one configure 1.1
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by bld-test-texk-one $as_me 1.1, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test -r "$ac_site_file"; then
+ { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_aux_dir=
+for ac_dir in ../../build-aux "$srcdir"/../../build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../build-aux \"$srcdir\"/../../build-aux" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in ../../build-aux \"$srcdir\"/../../build-aux" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+
+am__api_version='1.10'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+done
+IFS=$as_save_IFS
+
+fi
+
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ test -d ./--version && rmdir ./--version
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='bld-test-texk-one'
+ VERSION='1.1'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.2.6'
+macro_revision='1.3012'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_compiler_gnu=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c89=$ac_arg
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ $as_unset ac_script || ac_script=
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:4436: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:4439: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:4442: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+ = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_AR="ar"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 5648 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ lt_cv_cc_needs_belf=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ lt_cv_cc_needs_belf=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+ { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ lt_cv_ld_exported_symbols_list=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ lt_cv_ld_exported_symbols_list=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ if test "x$as_val" = x""yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+# Set options
+
+
+
+ enable_dlopen=no
+
+
+ enable_win32_dll=no
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+ # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+ withval=$with_pic; pic_mode="$withval"
+else
+ pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:$LINENO: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:7505: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:7509: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl*)
+ # IBM XL C 8.0/Fortran 10.1 on PPC
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:7844: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:7848: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:7949: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:7953: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:8004: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:8008: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test "$hard_links" = no; then
+ { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ xlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='${wl}-f,'
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ export_dynamic_flag_spec='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec=''
+ link_all_deplibs=yes
+ allow_undefined_flag="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=echo
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat >conftest.$ac_ext <<_ACEOF
+int foo(void) {}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='${wl}'
+ archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc=no
+ else
+ archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+$as_echo "$archive_cmds_need_lc" >&6; }
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix[3-9]*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # Some binutils ld are patched to set DT_RUNPATH
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+ shlibpath_overrides_runpath=yes
+fi
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+ test "$inherit_rpath" = yes; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
+$as_echo_n "checking for shl_load... " >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_shl_load || defined __stub___shl_load
+choke me
+#endif
+
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_func_shl_load=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+$as_echo "$ac_cv_func_shl_load" >&6; }
+if test "x$ac_cv_func_shl_load" = x""yes; then
+ lt_cv_dlopen="shl_load"
+else
+ { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dld_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+ { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_dlopen || defined __stub___dlopen
+choke me
+#endif
+
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_func_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_func_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
+if test "x$ac_cv_func_dlopen" = x""yes; then
+ lt_cv_dlopen="dlopen"
+else
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_svld_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_test_x conftest$ac_exeext
+ }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_dld_dld_link=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line 10804 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line 10900 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report which library types will actually be built
+ { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test "$can_build_shared" = "no" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test "$enable_shared" = yes || enable_static=yes
+ { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+## _KPSE_INIT: Initialize TL infrastructure
+kpse_BLD=`(cd "./../../." && pwd)`
+kpse_SRC=`(cd "$srcdir/../../." && pwd)`
+
+## _KPSE_LIB_FLAGS: Setup zlib (-lz) flags
+
+# Check whether --with-system-zlib was given.
+if test "${with_system_zlib+set}" = set; then
+ withval=$with_system_zlib;
+fi
+
+# Check whether --with-zlib-includes was given.
+if test "${with_zlib_includes+set}" = set; then
+ withval=$with_zlib_includes;
+fi
+
+# Check whether --with-zlib-libdir was given.
+if test "${with_zlib_libdir+set}" = set; then
+ withval=$with_zlib_libdir;
+fi
+if test "x$with_system_zlib" = xyes; then
+ if test "x$with_zlib_includes" != x && test "x$with_zlib_includes" != xyes; then
+ ZLIB_INCLUDES="-I$with_zlib_includes"
+fi
+ZLIB_LIBS="-lz"
+if test "x$with_zlib_libdir" != x && test "x$with_zlib_libdir" != xyes; then
+ ZLIB_LIBS="-L$with_zlib_libdir $ZLIB_LIBS"
+fi
+else
+ ZLIB_INCLUDES=`echo '-IBLD/libs/zlib' | sed \
+ -e "s,SRC/,$kpse_SRC/,g" \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ ZLIB_LIBS=`echo 'BLD/libs/zlib/libz.a' | sed \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ ZLIB_DEPEND=`echo 'BLD/libs/zlib/libz.a' | sed \
+ -e 's,BLD/,${top_builddir}/../../,g'`
+ ZLIB_RULE='# Rebuild libz
+$(ZLIB_DEPEND): ${top_builddir}/../../libs/zlib/zlib.h ${top_builddir}/../../libs/zlib/zconf.h
+ cd ${top_builddir}/../../libs/zlib && $(MAKE) $(AM_MAKEFLAGS)
+${top_builddir}/../../libs/zlib/zlib.h ${top_builddir}/../../libs/zlib/zconf.h:
+ cd ${top_builddir}/../../libs/zlib && $(MAKE) $(AM_MAKEFLAGS)'
+fi
+
+## _KPSE_LIB_FLAGS: Setup obsdcompat (-lopenbsd-compat) flags
+ OBSDCOMPAT_INCLUDES=`echo '-IBLD/libs/obsdcompat -ISRC/libs/obsdcompat' | sed \
+ -e "s,SRC/,$kpse_SRC/,g" \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ OBSDCOMPAT_LIBS=`echo 'BLD/libs/obsdcompat/libopenbsd-compat.a' | sed \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ OBSDCOMPAT_DEPEND=`echo 'BLD/libs/obsdcompat/libopenbsd-compat.a' | sed \
+ -e 's,BLD/,${top_builddir}/../../,g'`
+ OBSDCOMPAT_RULE='# Rebuild libopenbsd-compat
+$(OBSDCOMPAT_DEPEND): ${top_srcdir}/../../libs/obsdcompat/*.[ch]
+ cd ${top_builddir}/../../libs/obsdcompat && $(MAKE) $(AM_MAKEFLAGS)'
+
+## _KPSE_LIB_FLAGS: Setup libpng (-lpng) flags
+
+# Check whether --with-system-libpng was given.
+if test "${with_system_libpng+set}" = set; then
+ withval=$with_system_libpng;
+fi
+
+# Check whether --with-libpng-includes was given.
+if test "${with_libpng_includes+set}" = set; then
+ withval=$with_libpng_includes;
+fi
+
+# Check whether --with-libpng-libdir was given.
+if test "${with_libpng_libdir+set}" = set; then
+ withval=$with_libpng_libdir;
+fi
+if test "x$with_system_libpng" = xyes; then
+ if test "x$with_libpng_includes" != x && test "x$with_libpng_includes" != xyes; then
+ LIBPNG_INCLUDES="-I$with_libpng_includes"
+fi
+LIBPNG_LIBS="-lpng"
+if test "x$with_libpng_libdir" != x && test "x$with_libpng_libdir" != xyes; then
+ LIBPNG_LIBS="-L$with_libpng_libdir $LIBPNG_LIBS"
+fi
+else
+ LIBPNG_INCLUDES=`echo '-IBLD/libs/libpng' | sed \
+ -e "s,SRC/,$kpse_SRC/,g" \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ LIBPNG_LIBS=`echo 'BLD/libs/libpng/libpng.a' | sed \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ LIBPNG_DEPEND=`echo 'BLD/libs/libpng/libpng.a' | sed \
+ -e 's,BLD/,${top_builddir}/../../,g'`
+ LIBPNG_RULE='# Rebuild libpng
+$(LIBPNG_DEPEND): ${top_builddir}/../../libs/libpng/png.h ${top_builddir}/../../libs/libpng/pngconf.h
+ cd ${top_builddir}/../../libs/libpng && $(MAKE) $(AM_MAKEFLAGS)
+${top_builddir}/../../libs/libpng/png.h ${top_builddir}/../../libs/libpng/pngconf.h:
+ cd ${top_builddir}/../../libs/libpng && $(MAKE) $(AM_MAKEFLAGS)'
+fi
+
+## _KPSE_LIB_FLAGS: Setup t1lib (-lt1) flags
+
+# Check whether --with-system-t1lib was given.
+if test "${with_system_t1lib+set}" = set; then
+ withval=$with_system_t1lib;
+fi
+
+# Check whether --with-t1lib-includes was given.
+if test "${with_t1lib_includes+set}" = set; then
+ withval=$with_t1lib_includes;
+fi
+
+# Check whether --with-t1lib-libdir was given.
+if test "${with_t1lib_libdir+set}" = set; then
+ withval=$with_t1lib_libdir;
+fi
+if test "x$with_system_t1lib" = xyes; then
+ if test "x$with_t1lib_includes" != x && test "x$with_t1lib_includes" != xyes; then
+ T1LIB_INCLUDES="-I$with_t1lib_includes"
+fi
+T1LIB_LIBS="-lt1"
+if test "x$with_t1lib_libdir" != x && test "x$with_t1lib_libdir" != xyes; then
+ T1LIB_LIBS="-L$with_t1lib_libdir $T1LIB_LIBS"
+fi
+else
+ T1LIB_INCLUDES=`echo '-IBLD/libs/t1lib' | sed \
+ -e "s,SRC/,$kpse_SRC/,g" \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ T1LIB_LIBS=`echo 'BLD/libs/t1lib/libt1.a' | sed \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ T1LIB_DEPEND=`echo 'BLD/libs/t1lib/libt1.a' | sed \
+ -e 's,BLD/,${top_builddir}/../../,g'`
+ T1LIB_RULE='# Rebuild libt1
+$(T1LIB_DEPEND): ${top_builddir}/../../libs/t1lib/t1lib.h
+ cd ${top_builddir}/../../libs/t1lib && $(MAKE) $(AM_MAKEFLAGS)
+${top_builddir}/../../libs/t1lib/t1lib.h:
+ cd ${top_builddir}/../../libs/t1lib && $(MAKE) $(AM_MAKEFLAGS)'
+fi
+
+## _KPSE_LIB_FLAGS: Setup freetype2 (-lfreetype) flags
+
+# Check whether --with-system-freetype2 was given.
+if test "${with_system_freetype2+set}" = set; then
+ withval=$with_system_freetype2;
+fi
+
+# Check whether --with-freetype2-includes was given.
+if test "${with_freetype2_includes+set}" = set; then
+ withval=$with_freetype2_includes;
+fi
+
+# Check whether --with-freetype2-libdir was given.
+if test "${with_freetype2_libdir+set}" = set; then
+ withval=$with_freetype2_libdir;
+fi
+if test "x$with_system_freetype2" = xyes; then
+ if test "x$with_freetype2_includes" != x && test "x$with_freetype2_includes" != xyes; then
+ FREETYPE2_INCLUDES="-I$with_freetype2_includes/freetype2 -I$with_freetype2_includes"
+fi
+FREETYPE2_LIBS="-lfreetype"
+if test "x$with_freetype2_libdir" != x && test "x$with_freetype2_libdir" != xyes; then
+ FREETYPE2_LIBS="-L$with_freetype2_libdir $FREETYPE2_LIBS"
+fi
+else
+ FREETYPE2_INCLUDES=`echo '-IBLD/libs/freetype2/freetype2 -IBLD/libs/freetype2' | sed \
+ -e "s,SRC/,$kpse_SRC/,g" \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ FREETYPE2_LIBS=`echo 'BLD/libs/freetype2/libfreetype.a' | sed \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ FREETYPE2_DEPEND=`echo 'BLD/libs/freetype2/libfreetype.a' | sed \
+ -e 's,BLD/,${top_builddir}/../../,g'`
+ FREETYPE2_RULE='# Rebuild libfreetype
+$(FREETYPE2_DEPEND): ${top_builddir}/../../libs/freetype2/ft2build.h
+ cd ${top_builddir}/../../libs/freetype2 && $(MAKE) $(AM_MAKEFLAGS)
+${top_builddir}/../../libs/freetype2/ft2build.h:
+ cd ${top_builddir}/../../libs/freetype2 && $(MAKE) $(AM_MAKEFLAGS)'
+fi
+
+## _KPSE_LIB_FLAGS: Setup gd (-lgd) flags
+
+# Check whether --with-system-gd was given.
+if test "${with_system_gd+set}" = set; then
+ withval=$with_system_gd;
+fi
+
+# Check whether --with-gd-includes was given.
+if test "${with_gd_includes+set}" = set; then
+ withval=$with_gd_includes;
+fi
+
+# Check whether --with-gd-libdir was given.
+if test "${with_gd_libdir+set}" = set; then
+ withval=$with_gd_libdir;
+fi
+if test "x$with_system_gd" = xyes; then
+ if test "x$with_gd_includes" != x && test "x$with_gd_includes" != xyes; then
+ GD_INCLUDES="-I$with_gd_includes"
+fi
+GD_LIBS="-lgd"
+if test "x$with_gd_libdir" != x && test "x$with_gd_libdir" != xyes; then
+ GD_LIBS="-L$with_gd_libdir $GD_LIBS"
+fi
+else
+ GD_INCLUDES=`echo '-IBLD/libs/gd' | sed \
+ -e "s,SRC/,$kpse_SRC/,g" \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ GD_LIBS=`echo 'BLD/libs/gd/libgd.a' | sed \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ GD_DEPEND=`echo 'BLD/libs/gd/libgd.a' | sed \
+ -e 's,BLD/,${top_builddir}/../../,g'`
+ GD_RULE='# Rebuild libgd
+$(GD_DEPEND): ${top_builddir}/../../libs/libpng/gd.h
+ cd ${top_builddir}/../../libs/gd && $(MAKE) $(AM_MAKEFLAGS)
+${top_builddir}/../../libs/libpng/gd.h:
+ cd ${top_builddir}/../../libs/gd && $(MAKE) $(AM_MAKEFLAGS)'
+fi
+
+## _KPSE_LIB_FLAGS: Setup xpdf (-lxpdf) flags
+ XPDF_INCLUDES=`echo '-DPDF_PARSER_ONLY -IBLD/libs/xpdf -IBLD/libs/xpdf/goo -IBLD/libs/xpdf/fofi -IBLD/libs/xpdf/xpdf' | sed \
+ -e "s,SRC/,$kpse_SRC/,g" \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ XPDF_LIBS=`echo 'BLD/libs/xpdf/libxpdf.a' | sed \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ XPDF_DEPEND=`echo 'BLD/libs/xpdf/libxpdf.a' | sed \
+ -e 's,BLD/,${top_builddir}/../../,g'`
+ XPDF_RULE='# Rebuild libxpdf
+$(XPDF_DEPEND): ${top_builddir}/../../libs/xpdf/xpdf/Stream.h
+ cd ${top_builddir}/../../libs/xpdf && $(MAKE) $(AM_MAKEFLAGS)
+${top_builddir}/../../libs/xpdf/xpdf/Stream.h:
+ cd ${top_builddir}/../../libs/xpdf && $(MAKE) $(AM_MAKEFLAGS)'
+
+## _KPSE_LIB_FLAGS: Setup graphite (-lgraphite) flags
+
+# Check whether --with-system-graphite was given.
+if test "${with_system_graphite+set}" = set; then
+ withval=$with_system_graphite;
+fi
+
+# Check whether --with-graphite-includes was given.
+if test "${with_graphite_includes+set}" = set; then
+ withval=$with_graphite_includes;
+fi
+
+# Check whether --with-graphite-libdir was given.
+if test "${with_graphite_libdir+set}" = set; then
+ withval=$with_graphite_libdir;
+fi
+if test "x$with_system_graphite" = xyes; then
+ if test "x$with_graphite_includes" != x && test "x$with_graphite_includes" != xyes; then
+ GRAPHITE_INCLUDES="-I$with_graphite_includes"
+fi
+GRAPHITE_LIBS="-lgraphite"
+if test "x$with_graphite_libdir" != x && test "x$with_graphite_libdir" != xyes; then
+ GRAPHITE_LIBS="-L$with_graphite_libdir $GRAPHITE_LIBS"
+fi
+else
+ GRAPHITE_INCLUDES=`echo '-ISRC/libs/graphite/include' | sed \
+ -e "s,SRC/,$kpse_SRC/,g" \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ GRAPHITE_LIBS=`echo 'BLD/libs/graphite/libgraphite.a' | sed \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ GRAPHITE_DEPEND=`echo 'BLD/libs/graphite/libgraphite.a' | sed \
+ -e 's,BLD/,${top_builddir}/../../,g'`
+ GRAPHITE_RULE='# Rebuild libgraphite
+$(GRAPHITE_DEPEND):
+ cd ${top_builddir}/../../libs/graphite && $(MAKE) $(AM_MAKEFLAGS)'
+fi
+
+## _KPSE_LIB_FLAGS: Setup teckit (-lTECkit) flags
+
+# Check whether --with-system-teckit was given.
+if test "${with_system_teckit+set}" = set; then
+ withval=$with_system_teckit;
+fi
+
+# Check whether --with-teckit-includes was given.
+if test "${with_teckit_includes+set}" = set; then
+ withval=$with_teckit_includes;
+fi
+
+# Check whether --with-teckit-libdir was given.
+if test "${with_teckit_libdir+set}" = set; then
+ withval=$with_teckit_libdir;
+fi
+if test "x$with_system_teckit" = xyes; then
+ if test "x$with_teckit_includes" != x && test "x$with_teckit_includes" != xyes; then
+ TECKIT_INCLUDES="-I$with_teckit_includes"
+fi
+TECKIT_LIBS="-lTECkit"
+if test "x$with_teckit_libdir" != x && test "x$with_teckit_libdir" != xyes; then
+ TECKIT_LIBS="-L$with_teckit_libdir $TECKIT_LIBS"
+fi
+else
+ TECKIT_INCLUDES=`echo '-ISRC/libs/teckit/source/Public-headers' | sed \
+ -e "s,SRC/,$kpse_SRC/,g" \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ TECKIT_LIBS=`echo 'BLD/libs/teckit/libTECkit.a' | sed \
+ -e "s,BLD/,$kpse_BLD/,g"`
+ TECKIT_DEPEND=`echo 'BLD/libs/teckit/libTECkit.a' | sed \
+ -e 's,BLD/,${top_builddir}/../../,g'`
+ TECKIT_RULE='# Rebuild libTECkit
+$(TECKIT_DEPEND):
+ cd ${top_builddir}/../../libs/teckit && $(MAKE) $(AM_MAKEFLAGS)'
+fi
+
+
+ac_config_files="$ac_config_files Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by bld-test-texk-one $as_me 1.1, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+bld-test-texk-one config.status 1.1
+configured by $0, generated by GNU Autoconf 2.63,
+ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
+enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
+host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
+host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
+host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
+build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
+build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
+build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
+SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
+Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
+GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
+EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
+FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
+LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
+NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
+LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
+exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
+AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
+GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
+SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
+ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
+need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
+LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
+libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
+version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
+striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+SHELL \
+ECHO \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+finish_eval \
+old_striplib \
+striplib; do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+ case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
+ ;;
+esac
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} ||
+{
+ $as_echo "$as_me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=' '
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+ { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_t"; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+ { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ ac_file_inputs="$ac_file_inputs '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+ } >"$tmp/config.h" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$tmp/config.h" "$ac_file" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file. Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*) set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir=$dirpart/$fdir
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options which allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that does not interpret backslashes.
+ECHO=$lt_ECHO
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking. This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ case $xsi_shell in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# 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 ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+}
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result="${1##*/}"
+}
+
+# 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 ()
+{
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"
+}
+
+# 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_stripname ()
+{
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=${1%%=*}
+ func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=${#1}
+}
+
+_LT_EOF
+ ;;
+ *) # Bourne compatible functions.
+ cat << \_LT_EOF >> "$cfgfile"
+
+# 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 ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "X${1}" | $Xsed -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 file
+func_basename ()
+{
+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+
+# 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 "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "X${3}" \
+ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+ esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+ yes)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1+=\$2"
+}
+_LT_EOF
+ ;;
+ *)
+ cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+ ;;
+ esac
+
+
+ sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+ ;;
+
+ esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/Build/source/texk/one/configure.ac b/Build/source/texk/one/configure.ac
new file mode 100644
index 00000000000..434259c4003
--- /dev/null
+++ b/Build/source/texk/one/configure.ac
@@ -0,0 +1,28 @@
+dnl
+AC_INIT([bld-test-texk-one], [1.1], [peb@mppmu.mpg.de])
+AC_PREREQ([2.63])
+AC_CONFIG_SRCDIR([one.c])
+AC_CONFIG_AUX_DIR([../../build-aux])
+AC_CONFIG_MACRO_DIR([../../m4])
+
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+LT_PREREQ([2.2.6])
+LT_INIT
+
+AC_CONFIG_HEADERS([config.h])
+
+KPSE_ZLIB_FLAGS
+KPSE_OBSDCOMPAT_FLAGS
+KPSE_LIBPNG_FLAGS
+KPSE_T1LIB_FLAGS
+KPSE_FREETYPE2_FLAGS
+KPSE_GD_FLAGS
+KPSE_XPDF_FLAGS
+KPSE_GRAPHITE_FLAGS
+KPSE_TECKIT_FLAGS
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/Build/source/texk/one/one.c b/Build/source/texk/one/one.c
new file mode 100644
index 00000000000..49c3b6cb364
--- /dev/null
+++ b/Build/source/texk/one/one.c
@@ -0,0 +1,16 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <zlib.h>
+#include <png.h>
+
+int
+main (int argc, char **argv)
+{
+ printf ("Hello, this is progone,"
+ " using libpng %d (" PNG_LIBPNG_VER_STRING ") and zlib %s (" ZLIB_VERSION ")\n",
+ png_access_version_number (), zlibVersion ());
+ return 0;
+}
diff --git a/Build/source/texk/ps2pkm/Makefile.in.orig b/Build/source/texk/ps2pkm/Makefile.in.orig
new file mode 100644
index 00000000000..0a55b49752f
--- /dev/null
+++ b/Build/source/texk/ps2pkm/Makefile.in.orig
@@ -0,0 +1,64 @@
+# @configure_input@
+# Makefile for ps2pkm --te@dbs.uni-hannover.de. Public domain.
+version = 1.5m
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+prog_cflags = -DUNIX -DKPATHSEA
+
+libobj = arith.o curves.o fontfcn.o hints.o lines.o objects.o paths.o \
+ regions.o scanfont.o spaces.o t1funcs.o t1info.o t1io.o \
+ t1snap.o t1stub.o token.o type1.o util.o bstring.o basics.o
+common_objects = pkout.o filenames.o
+ps2pkobjs = $(libobj) ps2pk.o encoding.o pkout.o filenames.o
+pk2bmobjs = pk2bm.o pkin.o
+pfb2pfaobjs = pfb2pfa.o filenames.o basics.o
+magobjs = mag.o basics.o
+
+program = ps2pk
+programs = pfb2pfa mag pk2bm $(program)
+
+default all: $(programs)
+
+$(program): $(kpathsea) $(ps2pkobjs)
+ $(kpathsea_link) $(ps2pkobjs) $(LOADLIBES)
+pk2bm: $(kpathsea) $(pk2bmobjs)
+ $(kpathsea_link) $(pk2bmobjs) $(LOADLIBES)
+pfb2pfa: $(kpathsea) $(pfb2pfaobjs)
+ $(kpathsea_link) $(pfb2pfaobjs) $(LOADLIBES)
+mag: $(kpathsea) $(magobjs)
+ $(kpathsea_link) $(magobjs) $(LOADLIBES)
+
+kpse_include ../make/tkpathsea.mk
+
+install: install-exec install-data
+uninstall: uninstall-exec uninstall-data
+
+install-exec: $(programs)
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
+uninstall-exec:
+ for p in $(programs); do rm -f $(bindir)/$$p; done
+
+install-data: mag.1 pfb2pfa.1 pk2bm.1 ps2pk.1
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir)
+ $(INSTALL_DATA) $(srcdir)/mag.1 $(man1dir)/mag.$(manext)
+ $(INSTALL_DATA) $(srcdir)/pfb2pfa.1 $(man1dir)/pfb2pfa.$(manext)
+ $(INSTALL_DATA) $(srcdir)/pk2bm.1 $(man1dir)/pk2bm.$(manext)
+ $(INSTALL_DATA) $(srcdir)/ps2pk.1 $(man1dir)/ps2pk.$(manext)
+uninstall-data:
+ rm -f $(man1dir)/ps2pk.$(manext) $(man1dir)/pk2bm.$(manext) \
+ $(man1dir)/pfb2pfa.$(manext) $(man1dir)/mag.$(manext)
+
+pre-dist-$(distname):
+post-dist-$(distname):
+
+kpse_include ../make/dist.mk
+kpse_include ../make/config.mk
+
+info dvi check:
+
+kpse_include ../make/clean.mk
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/ps2pkm/ac/withenable.ac b/Build/source/texk/ps2pkm/ac/withenable.ac
new file mode 100644
index 00000000000..72351528f8d
--- /dev/null
+++ b/Build/source/texk/ps2pkm/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/ps2pkm/ac/withenable.ac
+## configure options and TL libraries required for ps2pkm
+KPSE_WITH_PROG([ps2pkm], [kpathsea])
diff --git a/Build/source/texk/ps2pkm/configure.in.orig b/Build/source/texk/ps2pkm/configure.in.orig
new file mode 100644
index 00000000000..4f750585481
--- /dev/null
+++ b/Build/source/texk/ps2pkm/configure.in.orig
@@ -0,0 +1,23 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(arith.c)
+
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+
+sinclude(../kpathsea/withenable.ac)
+AC_CHECK_LIB(m, main)
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(fcntl.h)
+
+dnl Checks for library functions.
+AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(memset)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/seetexk/ac/withenable.ac b/Build/source/texk/seetexk/ac/withenable.ac
new file mode 100644
index 00000000000..75c55e50ffc
--- /dev/null
+++ b/Build/source/texk/seetexk/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/seetexk/ac/withenable.ac
+## configure options and TL libraries required for seetexk
+KPSE_WITH_PROG([seetexk], [kpathsea])
diff --git a/Build/source/texk/tetex/Makefile.in.orig b/Build/source/texk/tetex/Makefile.in.orig
new file mode 100644
index 00000000000..012005bf879
--- /dev/null
+++ b/Build/source/texk/tetex/Makefile.in.orig
@@ -0,0 +1,113 @@
+# $Id$
+# @configure_input@
+# Makefile for teTeX's extra scripts - te@dbs.uni-hannover.de.
+# Public domain.
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+
+man5dir = $(mandir)/man5
+
+SCRIPTS = \
+ allcm allneeded dvi2fax dvired fmtutil fmtutil-sys fontinst \
+ kpsetool kpsewhere ps2frag ps4pdf pslatex rubibtex rumakeindex \
+ texconfig texconfig-dialog texconfig-sys \
+ texlinks updmap updmap-sys
+
+contextmanpgs = \
+ ctxtools makempy mptopdf pstopdf texfind texmfstart \
+ pdftools texexec texfont textools texutil
+
+# The man pages for script packages such as thumbpdf and mkjobtexmf are
+# copied here by hand; ctan2tl doesn't know how to handle this case. Help.
+manpgs = \
+ allcm allec allneeded dvi2fax dvired e2pall epstopdf fontinst \
+ kpsetool kpsewhere mkjobtexmf mkocp mkofm ofm2opl opl2ofm otp2ocp outocp \
+ ovf2ovp ovp2ovf ps2frag pslatex rubibtex rumakeindex texconfig \
+ texdoctk thumbpdf ttf2afm updmap
+
+all: $(SCRIPTS)
+default: all
+
+install: install-data install-exec
+
+# Auxiliary files.
+install-data::
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir) $(man5dir) $(texpooldir) $(texmf)/doc/tetex
+ for p in $(manpgs); do \
+ $(INSTALL_DATA) $(srcdir)/$$p.man $(man1dir)/$$p.$(manext); \
+ done
+ for p in $(contextmanpgs); do \
+ $(INSTALL_DATA) $(srcdir)/context/$$p.man $(man1dir)/$$p.$(manext); \
+ done
+ $(INSTALL_DATA) $(srcdir)/fmtutil.man $(man1dir)/fmtutil.1
+ $(INSTALL_DATA) $(srcdir)/texlinks.man $(man1dir)/texlinks.1
+ $(INSTALL_DATA) $(srcdir)/fmtutil.cnf.5 $(man5dir)/fmtutil.cnf.5
+ $(INSTALL_DATA) $(srcdir)/updmap.cfg.5 $(man5dir)/updmap.cfg.5
+ cd $(man1dir); rm -f allec.$(manext) texhash.$(manext) \
+ lambda.$(manext) pdflatex.$(manext) kpsepath.$(manext) \
+ kpsexpand.$(manext) mf-nowin.$(manext) ctangle.$(manext) \
+ cweave.$(manext) odvicopy.$(manext) \
+ odvitype.$(manext) texconfig-sys.$(manext) \
+ updmap-sys.$(manext) mktexfmt.$(manext) fmtutil-sys.$(manext)
+ ln -s allcm.$(manext) $(man1dir)/allec.$(manext)
+ ln -s mktexlsr.$(manext) $(man1dir)/texhash.$(manext)
+ ln -s omega.$(manext) $(man1dir)/lambda.$(manext)
+ ln -s pdftex.$(manext) $(man1dir)/pdflatex.$(manext)
+ ln -s kpsetool.$(manext) $(man1dir)/kpsepath.$(manext)
+ ln -s kpsetool.$(manext) $(man1dir)/kpsexpand.$(manext)
+ ln -s mf.$(manext) $(man1dir)/mf-nowin.$(manext)
+ ln -s cweb.$(manext) $(man1dir)/ctangle.$(manext)
+ ln -s cweb.$(manext) $(man1dir)/cweave.$(manext)
+ ln -s dvicopy.$(manext) $(man1dir)/odvicopy.$(manext)
+ ln -s dvitype.$(manext) $(man1dir)/odvitype.$(manext)
+ ln -s texconfig.$(manext) $(man1dir)/texconfig-sys.$(manext)
+ ln -s updmap.$(manext) $(man1dir)/updmap-sys.$(manext)
+ ln -s fmtutil.$(manext) $(man1dir)/mktexfmt.$(manext)
+ ln -s fmtutil.$(manext) $(man1dir)/fmtutil-sys.$(manext)
+ for p in TETEXDOC.pdf TETEXDOC.ps TETEXDOC.dvi teTeX-FAQ; do \
+ $(INSTALL_DATA) $(srcdir)/doc/$$p $(texmf)/doc/tetex; \
+ done
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(texmf)/texconfig $(texmf)/texconfig/g $(texmf)/texconfig/v $(texmf)/texconfig/x
+ $(INSTALL_DATA) $(srcdir)/texmf/texconfig/g/generic $(texmf)/texconfig/g
+ $(INSTALL_DATA) $(srcdir)/texmf/texconfig/v/vt100 $(texmf)/texconfig/v
+ $(INSTALL_DATA) $(srcdir)/texmf/texconfig/x/xterm $(texmf)/texconfig/x
+ $(INSTALL_DATA) $(srcdir)/texmf/texconfig/README $(texmf)/texconfig
+ $(INSTALL_DATA) $(srcdir)/texmf/texconfig/generic $(texmf)/texconfig
+ $(INSTALL_SCRIPT) $(srcdir)/tcfmgr $(texmf)/texconfig/tcfmgr
+ $(INSTALL_DATA) $(srcdir)/tcfmgr.map $(texmf)/texconfig/tcfmgr.map
+ $(INSTALL_DATA) $(srcdir)/fmtutil.cnf $(texmf)/web2c/fmtutil.cnf
+
+install-exec:
+ -$(SHELL) $(srcdir)/../mkinstalldirs $(scriptdir)
+ for s in $(SCRIPTS); do \
+ $(INSTALL_SCRIPT) $(srcdir)/$$s $(scriptdir)/$$s; \
+ done
+ cd $(scriptdir) && rm -f allec kpsepath kpsexpand texhash; \
+ ln -s allcm allec; \
+ ln -s kpsetool kpsepath; \
+ ln -s kpsetool kpsexpand; \
+ ln -s mktexlsr texhash
+ cd $(scriptdir) && rm -f mktexfmt; ln -s fmtutil mktexfmt
+
+#
+# This target is invoked by the top-level make,
+# to create the per-format engine symlinks in $(bindir),
+# after everything else is installed. We explicitly specify the
+# fmtutil.cnf file to use for the sake of distro builds. Also, that way
+# we don't have to run mktexlsr also.
+run_texlinks = $(bindir)/texlinks -f $(web2cdir)/fmtutil.cnf
+run-texlinks:
+ PATH="$(bindir):$(PATH)"; export PATH; $(run_texlinks)
+
+kpse_include ../make/clean.mk
+
+config.status: $(srcdir)/configure
+ $(SHELL) $(srcdir)/configure --no-create --verbose
+
+Makefile: $(srcdir)/Makefile.in config.status
+ $(SHELL) config.status
+
+depend:
+check:
diff --git a/Build/source/texk/tetex/configure.in.orig b/Build/source/texk/tetex/configure.in.orig
new file mode 100644
index 00000000000..fcaf2e14755
--- /dev/null
+++ b/Build/source/texk/tetex/configure.in.orig
@@ -0,0 +1,12 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(texconfig)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+sinclude(../kpathsea/withenable.ac)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/tex4htk/Makefile.in.orig b/Build/source/texk/tex4htk/Makefile.in.orig
new file mode 100644
index 00000000000..d7859d85fda
--- /dev/null
+++ b/Build/source/texk/tex4htk/Makefile.in.orig
@@ -0,0 +1,79 @@
+# @configure_input@
+# Makefile for tex4ht in TeX Live. Public domain.
+# Originally written by S. Rahtz.
+version = 1.0
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+kpse_include ../make/texi.mk
+prog_cflags = -DUNIX -DKPATHSEA -DNeedFunctionPrototypes
+
+objects = tex4ht.o t4ht.o
+
+programs = tex4ht t4ht
+shell_scripts = htcontext htlatex htmex httex httexi htxelatex htxetex ht
+perl_scripts = mk4ht
+
+default all: $(programs)
+
+t4ht: $(kpathsea) t4ht.o
+ $(kpathsea_link) t4ht.o $(LOADLIBES)
+
+tex4ht: $(kpathsea) tex4ht.o
+ $(kpathsea_link) tex4ht.o $(LOADLIBES)
+
+kpse_include ../make/tkpathsea.mk
+
+install: install-exec install-data
+
+uninstall: uninstall-exec uninstall-data
+
+install-exec: all
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
+ $(INSTALL) -d "$(prefix)/texmf-dist/scripts/tex4ht"
+ for p in $(shell_scripts); do $(INSTALL_SCRIPT) $(srcdir)/$$p "$(prefix)/texmf-dist/scripts/tex4ht/$$p.sh"; done
+ for p in $(perl_scripts); do $(INSTALL_SCRIPT) $(srcdir)/$$p "$(prefix)/texmf-dist/scripts/tex4ht/$$p.pl"; done
+ if test -d "$(bindir)/../../texmf-dist/scripts/tex4ht"; then \
+ d=../../texmf-dist/scripts/tex4ht; \
+ elif test -d "$(bindir)/../texmf-dist/scripts/tex4ht"; then \
+ d=../texmf-dist/scripts/tex4ht; \
+ else \
+ echo "Error: texmf-dist/scripts/tex4ht directory not found" >&2; \
+ exit 1; \
+ fi; \
+ for p in $(shell_scripts); do rm -f $(bindir)/$$p; ln -s $$d/$$p.sh $(bindir)/$$p; done; \
+ for p in $(perl_scripts); do rm -f $(bindir)/$$p; ln -s $$d/$$p.pl $(bindir)/$$p; done
+
+uninstall-exec:
+ for p in $(programs) $(scripts); do rm -f $(bindir)/$$p; done
+
+install-data:
+
+uninstall-data:
+
+distname = tex4ht
+
+kpse_include ../make/dist.mk
+kpse_include ../make/config.mk
+kpse_include ../make/clean.mk
+distclean::
+ -rm v*.tex *.txt i*.tex *.gif *.toc *.otc *.lg *.xref *.html *.idv *.log *.aux tmp.* tex4ht.env
+
+dvi info check:
+
+maybecheck:
+ TEXINPUTS=$(srcdir): $(SHELL) $(srcdir)/ht latex test
+
+
+tex4ht.env: tex4ht.in
+ sed -e "s;@texmf@;$(texmf);" < $(srcdir)/tex4ht.in \
+ | sed -e "s;@prefix@;$(prefix);g" \
+ | sed -e "s;@imbindir@.;;g" \
+ | sed -e "s/Mmove/Mmv/" \
+ | sed -e "s/Ccopy/Ccp/" \
+ > tex4ht.env
+
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/tex4htk/ac/withenable.ac b/Build/source/texk/tex4htk/ac/withenable.ac
new file mode 100644
index 00000000000..d2396d98304
--- /dev/null
+++ b/Build/source/texk/tex4htk/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/tex4htk/ac/withenable.ac
+## configure options and TL libraries required for tex4htk
+KPSE_WITH_PROG([tex4htk], [kpathsea])
diff --git a/Build/source/texk/tex4htk/configure.in.orig b/Build/source/texk/tex4htk/configure.in.orig
new file mode 100644
index 00000000000..4a988f8dab2
--- /dev/null
+++ b/Build/source/texk/tex4htk/configure.in.orig
@@ -0,0 +1,11 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(tex4ht.c)
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
+
+sinclude(../kpathsea/common.ac)
+
+AC_CHECK_SIZEOF(int)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/ttf2pk/Makefile.in.orig b/Build/source/texk/ttf2pk/Makefile.in.orig
new file mode 100644
index 00000000000..64669ac3189
--- /dev/null
+++ b/Build/source/texk/ttf2pk/Makefile.in.orig
@@ -0,0 +1,64 @@
+# @configure_input@
+# Makefile for ttf2pk --te@dbs.uni-hannover.de. Public domain.
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+
+LDFREETYPE=@LDFREETYPE@
+FREETYPECPPFLAGS=@FREETYPECPPFLAGS@
+FREETYPEDEP=@FREETYPEDEP@
+FREETYPEDIR = ../../libs/freetype
+FREETYPESRCDIR = $(srcdir)/$(FREETYPEDIR)
+
+prog_cflags = -DHAVE_LIBKPATHSEA $(FREETYPECPPFLAGS)
+prog_ldflags = $(LDFREETYPE)
+
+ttf2pkobjs = errormsg.o filesrch.o ligkern.o newobj.o parse.o pklib.o \
+ subfont.o texenc.o ttf2pk.o ttfenc.o ttflib.o
+
+ttf2tfmobjs = case.o errormsg.o filesrch.o ligkern.o newobj.o parse.o \
+ subfont.o texenc.o tfmaux.o ttf2tfm.o ttfaux.o ttfenc.o vplaux.o
+
+programs = ttf2pk ttf2tfm
+
+default all: $(programs)
+
+ttf2pk: $(kpathsea) $(ttf2pkobjs) $(FREETYPEDEP)
+ $(kpathsea_link) $(ttf2pkobjs) $(prog_ldflags) $(LOADLIBES)
+
+ttf2tfm: $(kpathsea) $(ttf2tfmobjs) $(FREETYPEDEP)
+ $(kpathsea_link) $(ttf2tfmobjs) $(prog_ldflags) $(LOADLIBES)
+
+$(FREETYPEDIR)/lib/.libs/libttf.a:
+ cd $(FREETYPEDIR); $(MAKE) $(makeargs)
+
+kpse_include ../make/tkpathsea.mk
+
+install: install-exec install-data
+uninstall: uninstall-exec uninstall-data
+
+install-exec: $(programs)
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
+uninstall-exec:
+ for p in $(programs); do rm -f $(bindir)/$$p; done
+
+install-data: ttf2pk.1 ttf2tfm.1
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir)
+ $(INSTALL_DATA) $(srcdir)/ttf2pk.1 $(man1dir)/ttf2pk.$(manext)
+ $(INSTALL_DATA) $(srcdir)/ttf2tfm.1 $(man1dir)/ttf2tfm.$(manext)
+uninstall-data:
+ rm -f $(man1dir)/ttf2pk.$(manext) $(man1dir)/ttf2tfm.$(manext)
+
+pre-dist-$(distname):
+post-dist-$(distname):
+
+kpse_include ../make/dist.mk
+kpse_include ../make/config.mk
+
+info dvi check:
+
+kpse_include ../make/clean.mk
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/ttf2pk/ac/withenable.ac b/Build/source/texk/ttf2pk/ac/withenable.ac
new file mode 100644
index 00000000000..1e64469d4de
--- /dev/null
+++ b/Build/source/texk/ttf2pk/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/ttf2pk/ac/withenable.ac
+## configure options and TL libraries required for ttf2pk
+KPSE_WITH_PROG([ttf2pk], [kpathsea freetype])
diff --git a/Build/source/texk/ttf2pk/configure.in.orig b/Build/source/texk/ttf2pk/configure.in.orig
new file mode 100644
index 00000000000..c8a32886130
--- /dev/null
+++ b/Build/source/texk/ttf2pk/configure.in.orig
@@ -0,0 +1,19 @@
+dnl Public domain.
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(ttf2pk.c)
+
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+AC_PROG_LN_S
+
+sinclude(../kpathsea/withenable.ac)
+sinclude(../../libs/freetype/withenable.ac)
+sinclude(../../libs/freetype/freetype.ac)
+
+AC_CHECK_LIB(m, main)
+
+KPSE_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/ttfdump/Makefile.in.orig b/Build/source/texk/ttfdump/Makefile.in.orig
new file mode 100644
index 00000000000..d01b644dd81
--- /dev/null
+++ b/Build/source/texk/ttfdump/Makefile.in.orig
@@ -0,0 +1,148 @@
+# Makefile.in for Autoconf.
+# @configure_input@
+# Copyright (C) 1992, 1993, 1994 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# @configure_input@
+
+SHELL = /bin/sh
+
+#### Start of system configuration section. ####
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+# If you use gcc, you should either run the fixincludes script that
+# comes with it or else use gcc with the -traditional option. Otherwise
+# ioctl calls will be compiled incorrectly on some systems.
+CC = @CC@
+AR = ar
+
+# set make command
+@SET_MAKE@
+
+# Set RANLIB = echo if your system doesn't have or need ranlib.
+RANLIB = @RANLIB@
+
+# Use cp if you don't have install.
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+DEFS = @DEFS@
+LIBS = @LIBS@
+
+INCLUDES = -I@top_srcdir@/include
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+
+MAKEINFO = makeinfo
+TEXI2DVI = texi2dvi
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+# Where to install the executables.
+bindir = $(exec_prefix)/bin
+
+# Where to put the include header
+includedir = $(prefix)/include
+
+# Where to put the Info files
+infodir = $(prefix)/info
+
+# Where to put the library file
+libdir = $(prefix)/lib
+
+# Where to put the manual pages.
+mandir = $(prefix)/man
+
+#### End of system configuration section. ####
+
+SUBDIRS = libttf src
+
+# Set default target.
+all:
+
+.PHONY: all install uninstall
+all check install uninstall: config.h Makefile all-local
+ @for subdir in $(SUBDIRS); do \
+ echo "making $@ in $$subdir"; \
+ ( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
+ done
+
+.PHONY: all-local
+all-local:
+
+.PHONY: clean
+clean: clean-local
+ @for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done
+
+.PHONY: distclean
+distclean: distclean-local
+ @for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done
+ rm -f config.status
+
+.PHONY: realclean
+realclean: realclean-local
+ @for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir && $(MAKE) $(FLAGS_TO_PASS) $@ || exit 1; cd ..; done
+ rm -f config.status
+
+.PHONY: mostlyclean-local
+mostlyclean-local:
+ rm -f *~
+
+.PHONY: clean-local
+clean-local: mostlyclean-local
+
+.PHONY: distclean-local
+distclean-local: clean-local
+ rm -f Makefile config.cache config.h config.log stamp-h
+ rm -f tags TAGS
+
+.PHONY: realclean-local
+realclean-local: distclean-local
+
+#distclean: clean
+# rm -f Makefile config.log config.cache config.status config.h stamp-h *~
+
+# For the justification of the following Makefile rules, see node
+# `Automatic Remaking' in GNU Autoconf documentation.
+Makefile: Makefile.in config.status
+ CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
+config.status: configure
+ ./config.status --recheck
+# The rules to run autoconf and autoheader are commented out. This is because
+# when the user unpacks a tarfile, configure.in might end up newer than
+# configure, but the user might not have (and does not need to have) autoconf
+# installed.
+#configure: configure.in #aclocal.m4
+# cd $(srcdir); autoconf
+
+config.h: stamp-h
+
+# This used to do a ./config.status --recheck, to update config.status with
+# any new #defines from config.h.in. The problem was that the rule itself
+# depends on config.status, so that the --recheck would get run several
+# times, which is bad if the user was trying to specify CFLAGS manually.
+# It was a big pain in the neck.
+stamp-h: config.h.in config.status
+ CONFIG_FILES=$@ CONFIG_HEADERS=config.h ./config.status
+
+#config.h.in: stamp-h.in
+#stamp-h.in: configure.in #aclocal.m4 acconfig.h
+# cd $(srcdir); autoheader
+# date > $(srcdir)/stamp-h.in \ No newline at end of file
diff --git a/Build/source/texk/ttfdump/ac/withenable.ac b/Build/source/texk/ttfdump/ac/withenable.ac
new file mode 100644
index 00000000000..5cd30903341
--- /dev/null
+++ b/Build/source/texk/ttfdump/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/ttfdump/ac/withenable.ac
+## configure options and TL libraries required for ttfdump
+KPSE_WITH_PROG([ttfdump], [kpathsea])
diff --git a/Build/source/texk/ttfdump/configure.in.orig b/Build/source/texk/ttfdump/configure.in.orig
new file mode 100644
index 00000000000..7b5ab86ac91
--- /dev/null
+++ b/Build/source/texk/ttfdump/configure.in.orig
@@ -0,0 +1,31 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT
+AC_CONFIG_SRCDIR([include/ttf.h])
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+AC_PROG_MAKE_SET
+
+dnl Checks for libraries.
+
+dnl Checks for header files.
+AC_HEADER_STDC
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+
+AC_C_BIGENDIAN
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_C_INLINE
+
+dnl Checks for library functions.
+AC_CHECK_FUNCS(strstr)
+
+
+AC_CONFIG_HEADER(config.h)
+AC_CONFIG_FILES([libttf/Makefile src/Makefile Makefile])
+AC_CONFIG_COMMANDS([default],[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h],[])
+AC_OUTPUT
diff --git a/Build/source/texk/web2c/Makefile.in.orig b/Build/source/texk/web2c/Makefile.in.orig
new file mode 100644
index 00000000000..3ac474b9c7a
--- /dev/null
+++ b/Build/source/texk/web2c/Makefile.in.orig
@@ -0,0 +1,1144 @@
+# $Id$
+# @configure_input@
+# Makefile for web2c --kb@mail.tug.org. Public domain.
+version = @WEB2CVERSION@
+
+# This makefile uses static rules with many targets (to be compatible to
+# non-gnu make) and will not work correctly when parallelized.
+# So we switch off parallel makes with gnu make.
+.NOTPARALLEL:
+
+# These lines define the memory dumps that fmts/bases/mems will make and
+# install-fmts/install-bases/install-mems will install.
+# See the Formats node in doc/web2c.texi for more details.
+fmts = olatex.fmt # amstex.fmt eplain.fmt texinfo.fmt
+efmts = latex.fmt
+pdffmts = pdfolatex.fmt
+pdfefmts = pdflatex.fmt
+afmts = lamed.fmt
+ofmts = lambda.fmt
+eofmts = elambda.fmt
+bases = # no good reason to build cmmf.base.
+mems = # mfplain.mem is probably not generally useful.
+
+# The name of the file that defines your local devices for Metafont.
+# (Only relevant during `make bases'.) I recommend `modes.mf', which
+# defines all known modes, plus useful definitions for all fonts. It's
+# available from ftp://ftp.tug.org/tex/modes.mf, among other places.
+localmodes = modes
+
+kpse_include ../make/paths.mk
+
+# Used for triptrap.
+DIFF = diff
+DIFFFLAGS =
+
+.SUFFIXES: # get rid of .p.o
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+
+XCPPFLAGS = $(PDFXCPPFLAGS)
+
+CXX = @CXX@
+CXXLD = $(CXX)
+cxx_link_command = $(CXXLD) -o $@ $(LDFLAGS)
+kpathsea_cxx_link = $(LIBTOOL) --mode=link $(cxx_link_command)
+
+@MAINT@ifeq ($(CC), gcc)
+@MAINT@XDEFS = -Wimplicit -Wreturn-type -Wcomment -Wformat
+@MAINT@endif
+
+# Make `#include <X11/...>' and `-lX...' work.
+# This matches xdvik.
+# wlibs is substituted by web2c's configure, LIBS by general configure
+# routines, and the others by AC_PATH_XTRA.
+# All the x_... variables will be empty if we aren't supporting X.
+x_cppflags = @X_CFLAGS@
+x_ldflags = @X_LIBS@
+x_pre_libs = @X_PRE_LIBS@
+x_extra_libs = @X_EXTRA_LIBS@
+x_tool_libs = @x_tool_libs@
+x_ext_lib = @x_ext_lib@
+wlibs = @wlibs@
+# Follow the library order used in X11R6 itself:
+# -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 (some may not be present).
+windowlink = $(windowlib) $(x_ldflags) $(x_tool_libs) $(x_pre_libs) $(x_ext_lib) $(wlibs) $(x_extra_libs)
+
+# With --enable-ipc, TeX may need to link with -lsocket.
+socketlibs = @socketlibs@
+
+common_makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' $(XMAKEARGS)
+window_makeargs = x_cppflags='$(x_cppflags)' $(common_makeargs)
+install_makeargs = $(makevars) $(common_makeargs)
+
+proglib = lib/lib.a
+windowlib = window/window.a
+
+#
+# The sh script that does the conversion. The "." is the directory with
+# native tools; we don't attempt cross-compiling a la luatex. The
+# $(native) variable is used in luatex.mk.
+native = .
+web2c = srcdir=$(srcdir) $(SHELL) $(srcdir)/web2c/convert $(native)
+
+# We put this in the web2c directory for lack of a better place, but it
+# is separate from (and simpler than) the actual web-to-C conversion programs.
+makecpool = $(native)/web2c/makecpool
+
+# Additional dependencies:
+web2c_common = web2c/convert web2c/common.defines
+web2c_programs = web2c/fixwrites web2c/splitup web2c/web2c $(makecpool)
+web2c_texmf = $(web2c_common) $(web2c_programs) \
+ web2c/texmf.defines web2c/coerce.h
+
+# The helper programs:
+TANGLEBOOT = @TANGLEBOOT@
+CTANGLEBOOT = @CTANGLEBOOT@
+TANGLE = @TANGLE@
+CTANGLE = @CTANGLE@
+TIE = @TIE@
+
+# Calling tangle
+tangle = WEBINPUTS=.:$(srcdir) $(TANGLE)
+ctangle = $(CTANGLE)
+tie = $(TIE)
+
+# The environment for making dumps.
+# No need to specify TEXMF, as ../kpathsea/texmf.cnf should contain
+# suitable absolute paths at this point. Those are converted to
+# SELFAUTO* paths on installation.
+dumpenv = TEXMFCNF=../kpathsea
+
+# Unfortunately, suffix rules can't have dependencies, or multiple
+# targets, and we can't assume all makes supports pattern rules.
+#.SUFFIXES: .p .c .ch .p
+#.p.c: # really depends on $(web2c_programs), and generates .h.
+# $(web2c) $*
+#.ch.p: # really depends on tangle; for mf/mp/tex, also generates .pool
+# ./tangle $(srcdir)/$*.web $<
+
+# These definitions have to come before the rules that expand them.
+# The *{ini,[0-2]}.c files are created by splitup, run as part of convert.
+# {mf,mp,tex}extra.c are created from lib/texmfmp.c, below.
+
+# Prevent Make from deleting the intermediate forms.
+.PRECIOUS: %.ch %.p %.c
+
+tex = tex
+mf = mf
+@MFN@mfn = mf-nowin
+#
+default all: programs manpages doc/web2c.info @FMU@
+check: dumps
+
+bibtex: bibtex.o
+ $(kpathsea_link) bibtex.o $(LOADLIBES)
+bibtex.c bibtex.h: $(web2c_common) $(web2c_programs) web2c/cvtbib.sed bibtex.p
+ $(web2c) bibtex
+bibtex.p: tangle bibtex.web bibtex.ch
+ $(tangle) bibtex bibtex
+check: bibtex-check
+bibtex-check: bibtex
+ test -f tests/exampl.aux || \
+ cp $(srcdir)/tests/exampl.aux tests/exampl.aux
+ TEXMFCNF=../kpathsea \
+ BSTINPUTS=$(srcdir)/tests \
+ BIBINPUTS=$(srcdir)/tests \
+ ./bibtex tests/exampl
+clean:: bibtex-clean
+bibtex-clean:
+ $(LIBTOOL) --mode=clean rm -f bibtex
+ rm -f bibtex.o bibtex.c bibtex.h bibtex.p
+ rm -f tests/exampl.blg tests/exampl.bbl
+
+ctie: ctie.o
+ $(kpathsea_link) ctie.o $(LOADLIBES)
+ctie.c: ctangle ctiedir/ctie.w ctiedir/ctie-k.ch
+ CWEBINPUTS=$(srcdir)/ctiedir $(ctangle) ctie.w ctie-k.ch
+clean:: ctie-clean
+ctie-clean:
+ $(LIBTOOL) --mode=clean rm -f ctie
+ rm -f ctie.o ctie.c
+
+cweave: cweave.o cweb.o
+ $(kpathsea_link) cweave.o cweb.o $(LOADLIBES)
+cweave.c: ctangle cwebdir/cweave.w cwebdir/cweav-w2c.ch
+ CWEBINPUTS=$(srcdir)/cwebdir $(ctangle) cweave cweav-w2c
+check: cweave-check
+cweave-check: cweave
+ CWEBINPUTS=$(srcdir)/cwebdir ./cweave common.w
+clean:: cweave-clean
+cweave-clean:
+ $(LIBTOOL) --mode=clean rm -f cweave
+ rm -f cweave.o cweave.c
+ rm -f common.tex common.scn common.idx
+
+dvicopy: dvicopy.o
+ $(kpathsea_link) dvicopy.o $(LOADLIBES)
+dvicopy.c dvicopy.h: $(web2c_common) $(web2c_programs) dvicopy.p
+ $(web2c) dvicopy
+dvicopy.p: tangle dvicopy.web dvicopy.ch
+ $(tangle) dvicopy dvicopy
+check: dvicopy-check
+dvicopy-check: dvicopy
+ TEXMFCNF=../kpathsea \
+ ./dvicopy $(srcdir)/tests/story tests/xstory.dvi
+# Redirect stderr so the terminal output will end up in the log file.
+ (TFMFONTS=$(srcdir)/tests VFFONTS=$(srcdir)/tests ./dvicopy \
+ <$(srcdir)/tests/pplr.dvi \
+ >tests/xpplr.dvi) 2>&1
+clean:: dvicopy-clean
+dvicopy-clean:
+ $(LIBTOOL) --mode=clean rm -f dvicopy
+ rm -f dvicopy.o dvicopy.c dvicopy.h dvicopy.p
+ rm -f tests/xstory.dvi tests/xpplr.dvi
+
+## dvitomp is a special case
+kpse_include dvitomp.mk
+##
+
+dvitype: dvitype.o
+ $(kpathsea_link) dvitype.o $(LOADLIBES)
+dvitype.c dvitype.h: $(web2c_common) $(web2c_programs) dvitype.p
+ $(web2c) dvitype
+dvitype.p: tangle dvitype.web dvitype.ch
+ $(tangle) dvitype dvitype
+check: dvitype-check
+dvitype-check: dvitype
+ ./dvitype -show-opcodes $(srcdir)/tests/story >tests/xstory.dvityp
+ ./dvitype --p=\*.\*.2 $(srcdir)/tests/pagenum.dvi >tests/xpagenum.typ
+clean:: dvitype-clean
+dvitype-clean:
+ $(LIBTOOL) --mode=clean rm -f dvitype
+ rm -f dvitype.o dvitype.c dvitype.h dvitype.p
+ rm -f tests/xstory.dvityp tests/xpagenum.typ
+
+gftodvi: gftodvi.o
+ $(kpathsea_link) gftodvi.o $(LOADLIBES)
+gftodvi.c gftodvi.h: $(web2c_common) $(web2c_programs) gftodvi.p
+ $(web2c) gftodvi
+gftodvi.p: tangle gftodvi.web gftodvi.ch
+ $(tangle) gftodvi gftodvi
+check: gftodvi-check
+gftodvi-check: gftodvi
+ TFMFONTS=$(srcdir)/tests ./gftodvi -verbose \
+ $(srcdir)/tests/cmr10.600gf
+ mv cmr10.dvi tests/xcmr10.dvi
+clean:: gftodvi-clean
+gftodvi-clean:
+ $(LIBTOOL) --mode=clean rm -f gftodvi
+ rm -f gftodvi.o gftodvi.c gftodvi.h gftodvi.p
+ rm -f tests/xcmr10.dvi
+
+gftopk: gftopk.o
+ $(kpathsea_link) gftopk.o $(LOADLIBES)
+gftopk.c gftopk.h: $(web2c_common) $(web2c_programs) gftopk.p
+ $(web2c) gftopk
+gftopk.p: tangle gftopk.web gftopk.ch
+ $(tangle) gftopk gftopk
+check: gftopk-check
+gftopk-check: gftopk
+ ./gftopk -verbose $(srcdir)/tests/cmr10.600gf tests/xcmr10.pk
+ ./gftopk $(srcdir)/tests/cmr10.600gf cmr10.pk && rm cmr10.pk
+clean:: gftopk-clean
+gftopk-clean:
+ $(LIBTOOL) --mode=clean rm -f gftopk
+ rm -f gftopk.o gftopk.c gftopk.h gftopk.p
+ rm -f tests/xcmr10.pk
+
+gftype: gftype.o
+ $(kpathsea_link) gftype.o $(LOADLIBES)
+gftype.c gftype.h: $(web2c_common) $(web2c_programs) gftype.p
+ $(web2c) gftype
+gftype.p: tangle gftype.web gftype.ch
+ $(tangle) gftype gftype
+check: gftype-check
+gftype-check: gftype
+ ./gftype $(srcdir)/tests/cmr10.600gf >tests/xcmr10.gft1
+ ./gftype -m -i $(srcdir)/tests/cmr10.600gf >tests/xcmr10.gft2
+clean:: gftype-clean
+gftype-clean:
+ $(LIBTOOL) --mode=clean rm -f gftype
+ rm -f gftype.o gftype.c gftype.h gftype.p
+ rm -f tests/xcmr10.gft1 tests/xcmr10.gft2
+
+mft: mft.o
+ $(kpathsea_link) mft.o $(LOADLIBES)
+mft.c mft.h: $(web2c_common) $(web2c_programs) mft.p
+ $(web2c) mft
+mft.p: tangle mft.web mft.ch
+ $(tangle) mft mft
+check: mft-check
+mft-check: mft
+ ./mft $(srcdir)/tests/io; mv io.tex tests/io.tex
+clean:: mft-clean
+mft-clean:
+ $(LIBTOOL) --mode=clean rm -f mft
+ rm -f mft.o mft.c mft.h mft.p
+ rm -f tests/io.tex
+
+patgen: patgen.o
+ $(kpathsea_link) patgen.o $(LOADLIBES)
+patgen.c patgen.h: $(web2c_common) $(web2c_programs) patgen.p
+ $(web2c) patgen
+patgen.p: tangle patgen.web patgen.ch
+ $(tangle) patgen patgen
+check: patgen-check
+patgen-check: patgen
+ ./patgen $(srcdir)/tests/dict $(srcdir)/tests/patterns tests/xpatout \
+ $(srcdir)/tests/translate <$(srcdir)/tests/patgen.in
+clean:: patgen-clean
+patgen-clean:
+ $(LIBTOOL) --mode=clean rm -f patgen
+ rm -f patgen.o patgen.c patgen.h patgen.p
+ rm -f tests/xpatout pattmp.4
+
+pktogf: pktogf.o
+ $(kpathsea_link) pktogf.o $(LOADLIBES)
+pktogf.c pktogf.h: $(web2c_common) $(web2c_programs) pktogf.p
+ $(web2c) pktogf
+pktogf.p: tangle pktogf.web pktogf.ch
+ $(tangle) pktogf pktogf
+check: pktogf-check
+pktogf-check: pktogf
+ ./pktogf -verbose $(srcdir)/tests/cmr10.pk tests/xcmr10.600gf
+ ./pktogf $(srcdir)/tests/cmr10.pk && rm cmr10.gf
+clean:: pktogf-clean
+pktogf-clean:
+ $(LIBTOOL) --mode=clean rm -f pktogf
+ rm -f pktogf.o pktogf.c pktogf.h pktogf.p
+ rm -f tests/xcmr10.600gf
+
+pktype: pktype.o
+ $(kpathsea_link) pktype.o $(LOADLIBES)
+pktype.c pktype.h: $(web2c_common) $(web2c_programs) pktype.p
+ $(web2c) pktype
+pktype.p: tangle pktype.web pktype.ch
+ $(tangle) pktype pktype
+check: pktype-check
+pktype-check: pktype
+ ./pktype $(srcdir)/tests/cmr10.pk >tests/xcmr10.pktyp
+clean:: pktype-clean
+pktype-clean:
+ $(LIBTOOL) --mode=clean rm -f pktype
+ rm -f pktype.o pktype.c pktype.h pktype.p
+ rm -f tests/xcmr10.pktyp
+
+pltotf: pltotf.o
+ $(kpathsea_link) pltotf.o $(LOADLIBES)
+pltotf.c pltotf.h: $(web2c_common) $(web2c_programs) pltotf.p
+ $(web2c) pltotf
+pltotf.p: tangle pltotf.web pltotf.ch
+ $(tangle) pltotf pltotf
+check: pltotf-check
+pltotf-check: pltotf
+ ./pltotf -verbose $(srcdir)/tests/cmr10 tests/xcmr10
+clean:: pltotf-clean
+pltotf-clean:
+ $(LIBTOOL) --mode=clean rm -f pltotf
+ rm -f pltotf.o pltotf.c pltotf.h pltotf.p
+ rm -f tests/xcmr10.tfm
+
+pooltype: pooltype.o
+ $(kpathsea_link) pooltype.o $(LOADLIBES)
+pooltype.c pooltype.h: $(web2c_common) $(web2c_programs) pooltype.p
+ $(web2c) pooltype
+pooltype.p: tangle pooltype.web pooltype.ch
+ $(tangle) pooltype pooltype
+check: pooltype-check
+pooltype-check: tex.pool
+pooltype-check: pooltype
+ ./pooltype tex.pool >tests/xtexpool.typ
+clean:: pooltype-clean
+pooltype-clean:
+ $(LIBTOOL) --mode=clean rm -f pooltype
+ rm -f pooltype.o pooltype.c pooltype.h pooltype.p
+ rm -f tests/xtexpool.typ
+
+tie: tie.o
+ $(kpathsea_link) tie.o $(LOADLIBES)
+tie.c: ctangle tiedir/tie.w tiedir/tie-w2c.ch
+ CWEBINPUTS=$(srcdir)/tiedir $(ctangle) tie.w tie-w2c.ch
+clean:: tie-clean
+tie-clean:
+ $(LIBTOOL) --mode=clean rm -f tie
+ rm -f tie.o tie.c
+
+tftopl: tftopl.o
+ $(kpathsea_link) tftopl.o $(LOADLIBES)
+tftopl.c tftopl.h: $(web2c_common) $(web2c_programs) tftopl.p
+ $(web2c) tftopl
+tftopl.p: tangle tftopl.web tftopl.ch
+ $(tangle) tftopl tftopl
+check: tftopl-check
+tftopl-check: tftopl
+ ./tftopl -verbose $(srcdir)/tests/cmr10 tests/xcmr10
+clean:: tftopl-clean
+tftopl-clean:
+ $(LIBTOOL) --mode=clean rm -f tftopl
+ rm -f tftopl.o tftopl.c tftopl.h tftopl.p
+ rm -f tests/xcmr10.pl
+
+vftovp: vftovp.o
+ $(kpathsea_link) vftovp.o $(LOADLIBES)
+vftovp.c vftovp.h: $(web2c_common) $(web2c_programs) vftovp.p
+ $(web2c) vftovp
+vftovp.p: tangle vftovp.web vftovp.ch
+ $(tangle) vftovp vftovp
+check: vftovp-check
+vftovp-check: vftovp
+ TFMFONTS=$(srcdir)/tests ./vftovp -verbose $(srcdir)/tests/ptmr ptmr tests/xptmr
+clean:: vftovp-clean
+vftovp-clean:
+ $(LIBTOOL) --mode=clean rm -f vftovp
+ rm -f vftop.o vftovp.c vftovp.h vftovp.p
+ rm -f tests/xptmr.vpl
+
+vptovf: vptovf.o
+ $(kpathsea_link) vptovf.o $(LOADLIBES)
+vptovf.c vptovf.h: $(web2c_common) $(web2c_programs) vptovf.p
+ $(web2c) vptovf
+vptovf.p: tangle vptovf.web vptovf.ch
+ $(tangle) vptovf vptovf
+check: vptovf-check
+vptovf-check: vptovf
+ ./vptovf $(srcdir)/tests/ptmr tests/xptmr tests/xptmr
+clean:: vptovf-clean
+vptovf-clean:
+ $(LIBTOOL) --mode=clean rm -f vptovf
+ rm -f vptovf.o vptovf.c vptovf.h vptovf.p
+ rm -f tests/xptmr.vf tests/xptmr.tfm
+
+weave: weave.o
+ $(kpathsea_link) weave.o $(LOADLIBES)
+weave.c weave.h: $(web2c_common) $(web2c_programs) weave.p
+ $(web2c) weave
+weave.p: tangle weave.web weave.ch
+ $(tangle) weave weave
+check: weave-check
+weave-check: weave
+ ./weave $(srcdir)/pooltype
+clean:: weave-clean
+weave-clean:
+ $(LIBTOOL) --mode=clean rm -f weave
+ rm -f weave.o weave.c weave.h weave.p
+ rm -f pooltype.tex
+
+#
+# Defines that are common to the texmf programs.
+
+triptrap: trip trap mptrap
+testdir = $(srcdir)/triptrap
+testenv = TEXMFCNF=$(testdir)
+dvitype_args = -output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*'
+
+#
+# Metafont
+mf_c = mfini.c mf0.c mf1.c
+mf_o = mfini.o mf0.o mf1.o mf-pool.o mfextra.o
+mfn_o = mfini.o mf0.o mf1.o mf-pool.o mfnowin.o
+mf: $(mf_o) $(windowlib)
+ $(kpathsea_link) $(mf_o) $(windowlink) $(LOADLIBES)
+mf-nowin: $(mfn_o) window/trap.o
+ $(kpathsea_link) $(mfn_o) window/trap.o $(LOADLIBES)
+mfnowin.o: mfnowin.c
+ $(compile) -DMFNOWIN -c $< -o $@
+$(mf_c) mfcoerce.h mfd.h: mf.p $(web2c_texmf) web2c/cvtmf1.sed web2c/cvtmf2.sed
+ $(web2c) mf
+mfextra.c: lib/texmfmp.c
+ sed s/TEX-OR-MF-OR-MP/mf/ $(srcdir)/lib/texmfmp.c >$@
+mfnowin.c: lib/texmfmp.c
+ sed s/TEX-OR-MF-OR-MP/mf/ $(srcdir)/lib/texmfmp.c >$@
+mf.p mf.pool: tangle mf.web mf-final.ch
+ $(tangle) $(srcdir)/mf.web mf-final.ch
+mf-final.ch: $(TIE) mf.web mf.ch mf-binpool.ch
+ $(TIE) -c $@ $(srcdir)/mf.web $(srcdir)/mf.ch $(srcdir)/mf-binpool.ch
+check: mf-check
+mf-check: trap mf.base
+ ./mf --progname=mf '&./mf \tracingstats:=1; end.'
+ ./mf --progname=mf $(srcdir)/tests/online
+ ./mf --progname=mf $(srcdir)/tests/one.two
+ ./mf --progname=mf $(srcdir)/tests/uno.dos
+clean:: mf-clean
+mf-clean: trap-clean
+ $(LIBTOOL) --mode=clean rm -f mf
+ $(LIBTOOL) --mode=clean rm -f mf-nowin
+ rm -f $(mf_c) mfcoerce.h mfd.h mf.p mf.pool
+ rm -f $(mf_o) mfextra.c
+ rm -f $(mfn_o) mfnowin.c
+ rm -f mf.base mf.log
+ rm -f mfput.log online.2602gf online.log one.two.log uno.log
+
+# Can't run trap and mptrap in parallel, because both write trap.{log,tfm}.
+trap: mf tftopl gftype trap-clean
+ @echo ">>> See $(testdir)/mftrap.diffs for example of acceptable diffs." >&2
+ $(LN) $(testdir)/trap.mf . # get same filename in log
+ -$(SHELL) -c '$(testenv) ./mf --progname=inimf <$(testdir)/mftrap1.in >mftrapin.fot'
+ mv trap.log mftrapin.log
+ -diff $(testdir)/mftrapin.log mftrapin.log
+ -$(SHELL) -c '$(testenv) ./mf --progname=inimf <$(testdir)/mftrap2.in >mftrap.fot'
+ mv trap.log mftrap.log
+ mv trap.tfm mftrap.tfm
+ -diff $(testdir)/mftrap.fot mftrap.fot
+ -diff $(testdir)/mftrap.log mftrap.log
+ ./tftopl ./mftrap.tfm mftrap.pl
+ -diff $(testdir)/mftrap.pl mftrap.pl
+ $(SHELL) -c '$(testenv) ./gftype -m -i ./trap.72270gf >trap.typ'
+ -diff $(testdir)/trap.typ trap.typ
+
+trap-clean:
+ rm -f trap.mf trap.base
+ rm -f mftrapin.fot mftrapin.log
+ rm -f mftrap.fot mftrap.log mftrap.tfm
+ rm -f mftrap.pl trap.72270gf trap.typ
+#
+# MetaPost
+kpse_include mpdir/mpostlib.mk
+kpse_include metapost.mk
+#
+# TeX
+tex_c = texini.c tex0.c tex1.c tex2.c
+tex_o = texini.o tex0.o tex1.o tex2.o tex-pool.o texextra.o
+tex: $(tex_o)
+ $(kpathsea_link) $(tex_o) $(socketlibs) $(LOADLIBES)
+$(tex_c) texcoerce.h texd.h: tex.p $(web2c_texmf)
+ $(web2c) tex
+texextra.c: lib/texmfmp.c
+ sed s/TEX-OR-MF-OR-MP/tex/ $(srcdir)/lib/texmfmp.c >$@
+tex.p tex.pool: tangle tex.web tex-final.ch
+ $(tangle) $(srcdir)/tex.web tex-final.ch
+tex-final.ch: $(TIE) tex.web tex.ch tex-binpool.ch
+ $(TIE) -c $@ $(srcdir)/tex.web $(srcdir)/tex.ch $(srcdir)/tex-binpool.ch
+
+# tools to load pool for tex and mf.
+#
+tex-pool.c: tex.pool $(makecpool) tmf-pool.h
+ $(makecpool) tex.pool $(srcdir)/tmf-pool.h >$@ || rm -f $@
+mf-pool.c: mf.pool $(makecpool) tmf-pool.h
+ $(makecpool) mf.pool $(srcdir)/tmf-pool.h >$@ || rm -f $@
+mf-pool.o: mf-pool.c tmf-pool.h mfd.h
+# we include mfd.h, so need lots more includes.
+ $(CC) $(CFLAGS) -I. -I.. -I$(srcdir) -I$(srcdir)/.. -DMETA_FONT -c -o $@ mf-pool.c
+
+check: tex-check
+tex-check: trip tex.fmt
+# Test truncation (but don't bother showing the warning msg).
+ ./tex --progname=tex --output-comment="`cat $(srcdir)/PROJECTS`" \
+ $(srcdir)/tests/hello 2>/dev/null \
+ && ./dvitype hello.dvi | grep olaf@infovore.xs4all.nl >/dev/null
+# \openout should show up in \write's.
+ ./tex --progname=tex $(srcdir)/tests/openout && grep xfoo openout.log
+# one.two.tex -> one.two.log
+ ./tex --progname=tex $(srcdir)/tests/one.two && ls -l one.two.log
+# uno.dos -> uno.log
+ ./tex --progname=tex $(srcdir)/tests/uno.dos && ls -l uno.log
+ ./tex --progname=tex $(srcdir)/tests/just.texi && ls -l just.log
+ -./tex --progname=tex $(srcdir)/tests/batch.tex
+ ./tex --progname=tex --shell $(srcdir)/tests/write18 | grep echo
+ TEXMFCNF=../kpathsea \
+ ./tex --mltex --progname=initex --ini $(srcdir)/tests/mltextst
+ -./tex </dev/null
+ -PATH=`pwd`:$(kpathsea_dir):$(kpathsea_srcdir):$$PATH \
+ WEB2C=$(kpathsea_srcdir) TMPDIR=.. \
+ ./tex --progname=tex '\nonstopmode\font\foo=nonesuch\end'
+clean:: tex-clean
+tex-clean: trip-clean
+ $(LIBTOOL) --mode=clean rm -f tex
+ rm -f $(tex_o) $(tex_c) texextra.c texcoerce.h texd.h
+ rm -f tex.p tex.pool
+ rm -f tex.fmt tex.log
+ rm -f hello.dvi hello.log xfoo.out openout.log on.two.log uno.log
+ rm -f just.log batch.log write18.log mltextst.log texput.log
+ rm -f missfont.log
+ rm -rf tfm
+
+trip: dvitype pltotf tftopl tex trip-clean
+ @echo ">>> See $(testdir)/trip.diffs for example of acceptable diffs." >&2
+ ./pltotf $(testdir)/trip.pl trip.tfm
+ ./tftopl ./trip.tfm trip.pl
+ -diff $(testdir)/trip.pl trip.pl
+ $(LN) $(testdir)/trip.tex . # get same filename in log
+ -$(SHELL) -c '$(testenv) ./tex --progname=initex --ini <$(testdir)/trip1.in >tripin.fot'
+ mv trip.log tripin.log
+ -diff $(testdir)/tripin.log tripin.log
+# May as well test non-ini second time through.
+ -$(SHELL) -c '$(testenv) ./tex --progname=tex <$(testdir)/trip2.in >trip.fot'
+ -diff $(testdir)/trip.fot trip.fot
+# We use $(DIFF) instead of `diff' only for those files where there
+# might actually be legitimate numerical differences.
+ -$(DIFF) $(DIFFFLAGS) $(testdir)/trip.log trip.log
+ $(SHELL) -c '$(testenv) ./dvitype $(dvitype_args) trip.dvi >trip.typ'
+ -$(DIFF) $(DIFFFLAGS) $(testdir)/trip.typ trip.typ
+
+trip-clean:
+ rm -f trip.tfm trip.pl trip.tex trip.fmt tripin.fot tripin.log
+ rm -f trip.fot trip.log trip.dvi trip.typ tripos.tex 8terminal.tex
+ rm -rf tfm
+#
+# Helper makefile fragments for pdf*tex and luatex.
+kpse_include libsluapdf.mk
+kpse_include pdftexdir/pdftexlib.mk
+kpse_include luatexdir/luatexlib.mk
+#
+# Makefile fragments:
+kpse_include synctexdir/synctex.mk
+kpse_include etexdir/etex.mk
+kpse_include omegadir/omega.mk
+kpse_include alephdir/aleph.mk
+kpse_include pdftexdir/pdftex.mk
+kpse_include xetexdir/xetex.mk
+kpse_include luatexdir/luatex.mk
+
+#
+# non-engine programs.
+programs = bibtex ctangle ctie cweave dvicopy dvitomp dvitype gftodvi gftopk \
+ gftype mft $(odvicopy) $(odvitype) $(otangle) patgen $(pdftosrc) \
+ pktogf pktype pltotf pooltype synctex tangle tftopl tie $(ttf2afm) \
+ vftovp vptovf weave
+
+# basic_engines are the binaries we build and install directly here in
+# the webdir/ directory.
+# include $(metapost) from metapost.mk even though it also includes
+# dvitomp. Hopefully that doesn't hurt.
+basic_engines = $(tex) $(mf) $(mfn) $(metapost)
+
+# engines includes the ones built in subdirectories.
+engines = $(basic_engines) $(etex) \
+ $(omega) $(aleph) \
+ $(pdftex) $(pdfetex) \
+ $(xetex) $(luatex)
+
+programs: $(programs) $(engines) $(mpware_programs) \
+ $(omegafonts_programs) $(otps_programs) $(pdftosrc)
+
+# Additional dependencies for relinking.
+# Each program and engine already depends on $(web2c_programs).
+$(web2c_programs) tangleboot ctangleboot: $(kpathsea) $(proglib)
+
+#
+# Bootstrapping tangle requires making it with itself. We use the opportunity
+# to create an up-to-date tangleboot as well.
+tangle: tangle.o
+ $(kpathsea_link) tangle.o $(LOADLIBES)
+ $(MAKE) $(common_makeargs) tangleboot.p
+tangle.c tangle.h: tangle.p
+ $(web2c) tangle
+# tangle.p is a special case, since it is needed to compile itself. We
+# convert and compile the (distributed) tangleboot.p to make a tangle
+# which we use to make the other programs. We depend on tangleboot, even
+# though we might not use it.
+tangle.p: tangleboot tangle.web tangle.ch
+ WEBINPUTS=.:$(srcdir) $(TANGLEBOOT) tangle tangle
+tangle.web:
+ @echo "You seem to be missing tangle.web, perhaps because you" >&2
+ @echo "didn't retrieve web.tar.gz, only web2c.tar.gz." >&2
+ @echo "You need both." >&2
+ @echo >&2
+ @echo "web.tar.gz should be available from the" >&2
+ @echo "same place that you got web2c.tar.gz." >&2
+ @echo "In any case, you can get it from" >&2
+ @echo "ftp://ftp.tug.org/tex/web.tar.gz." >&2
+ false
+clean:: tangle-clean
+tangle-clean:
+ $(LIBTOOL) --mode=clean rm -f tangle
+ rm -f tangle.o tangle.c tangle.h tangle.p
+
+tangleboot: tangleboot.o
+ $(kpathsea_link) tangleboot.o $(LOADLIBES)
+tangleboot.c tangleboot.h: stamp-tangle $(web2c_programs) $(web2c_common)
+ $(web2c) tangleboot
+# tangleboot.p is in the distribution
+stamp-tangle: tangleboot.p
+ date >stamp-tangle
+# This is not run unless tangle.web or tangle.ch is changed.
+# Only try to run ./tangle if it actually exists, otherwise
+# just touch tangleboot.p and build tangle.
+tangleboot.p: tangle.web tangle.ch
+ if [ -r $(TANGLE) ] || [ -r $(TANGLE).exe ]; then \
+ $(tangle) tangle tangle; \
+ mv tangle.p tangleboot.p; \
+ elif [ -r tangleboot.p ]; then \
+ touch tangleboot.p; \
+ else \
+ cp $(srcdir)/tangleboot.p .; \
+ fi
+ date >stamp-tangle
+ $(MAKE) $(common_makeargs) tangle
+clean:: tangleboot-clean
+tangleboot-clean:
+ $(LIBTOOL) --mode=clean rm -f tangleboot
+ rm -f tangleboot.o tangleboot.c tangleboot.h
+
+# Bootstrapping ctangle requires making it with itself. We use the opportunity
+# to create an up-to-date ctangleboot as well.
+ctangle: ctangle.o cweb.o
+ $(kpathsea_link) ctangle.o cweb.o $(LOADLIBES)
+ $(MAKE) $(common_makeargs) ctangleboot.c cwebboot.c
+# ctangle.c is a special case, since it is needed to compile itself.
+ctangle.c: ctangleboot cwebdir/ctangle.w cwebdir/ctang-w2c.ch
+ CWEBINPUTS=$(srcdir)/cwebdir $(CTANGLEBOOT) ctangle ctang-w2c
+cweb.c: ctangleboot cwebdir/common.w cwebdir/comm-w2c.ch
+ CWEBINPUTS=$(srcdir)/cwebdir $(CTANGLEBOOT) common comm-w2c cweb.c
+clean:: ctangle-clean
+clean:: cweb-clean
+ctangle-clean:
+ $(LIBTOOL) --mode=clean rm -f ctangle
+ rm -f ctangle.o ctangle.c
+cweb-clean:
+ rm -f cweb.o cweb.c
+
+ctangleboot: ctangleboot.o cwebboot.o
+ $(kpathsea_link) ctangleboot.o cwebboot.o $(LOADLIBES)
+# ctangleboot.c is in the distribution
+stamp-ctangle: ctangleboot.c cwebboot.c
+ctangleboot.c: cwebdir/ctangle.w cwebdir/ctang-w2c.ch
+ if [ -r $(CTANGLE) ] || [ -r $(CTANGLE).exe ]; then \
+ CWEBINPUTS=$(srcdir)/cwebdir $(CTANGLE) ctangle ctang-w2c; \
+ mv ctangle.c ctangleboot.c; \
+ elif [ -r ctangleboot.c ]; then \
+ touch ctangleboot.c; \
+ else \
+ cp $(srcdir)/ctangleboot.c .; \
+ fi
+ date >stamp-ctangle
+ $(MAKE) $(common_makeargs) ctangle
+cwebboot.c: cwebdir/common.w cwebdir/comm-w2c.ch
+ if [ -r $(CTANGLE) ] || [ -r $(CTANGLE).exe ]; then \
+ CWEBINPUTS=$(srcdir)/cwebdir $(CTANGLE) common comm-w2c cweb.c; \
+ mv cweb.c cwebboot.c; \
+ elif [ -r cwebboot.c ]; then \
+ touch cwebboot.c; \
+ else \
+ cp $(srcdir)/cwebboot.c .; \
+ fi
+ date >stamp-ctangle
+ $(MAKE) $(common_makeargs) ctangle
+clean:: ctangleboot-clean
+clean:: cwebboot-clean
+ctangleboot-clean:
+ $(LIBTOOL) --mode=clean rm -f ctangleboot
+ rm -f ctangleboot.o
+cwebboot-clean:
+ rm -f cwebboot.o
+
+# Even web2c itself uses the library.
+lib_sources = lib/alloca.c lib/basechsuffix.c lib/chartostring.c \
+ lib/eofeoln.c lib/fprintreal.c lib/input2int.c lib/inputint.c lib/main.c \
+ lib/openclose.c lib/printversion.c lib/uexit.c lib/usage.c lib/version.c \
+ lib/zround.c
+$(proglib): $(lib_sources) stamp-auto
+ cd lib && $(MAKE) $(common_makeargs)
+
+# No exceptions in this library.
+window_sources = $(srcdir)/window/*.c
+$(windowlib): mfd.h $(window_sources)
+ cd window && $(MAKE) $(window_makeargs)
+window/trap.o: $(srcdir)/window/trap.c
+ cd window && $(MAKE) $(common_makeargs) trap.o
+
+# The web2c program consists of several executables.
+web2c/fixwrites: web2c/fixwrites.c web2c/kps.c
+ cd web2c && $(MAKE) $(common_makeargs) fixwrites
+web2c/splitup: web2c/splitup.c web2c/kps.c
+ cd web2c && $(MAKE) $(common_makeargs) splitup
+web2c/web2c: web2c/main.c web2c/web2c.h web2c/web2c.l web2c/web2c.y web2c/kps.c
+ cd web2c && $(MAKE) $(common_makeargs) web2c
+$(makecpool): web2c/makecpool.c
+ cd web2c && $(MAKE) $(common_makeargs) makecpool
+
+kpse_include ../make/tkpathsea.mk
+
+#
+# Making dumps.
+all_fmts = tex.fmt $(fmts)
+all_bases = mf.base $(bases)
+all_mems = mpost.mem $(mems)
+
+# We used to build these by default, but nowadays the dumps are created
+# completely separately, e.g., at runtime by mktexfmt. So just leave it
+# as an optional extra target.
+dumps: fmts bases mems
+fmts: $(all_fmts)
+bases: $(all_bases)
+mems: $(all_mems)
+
+tex.fmt: tex
+ $(dumpenv) $(MAKE) progname=tex files="plain.tex cmr10.tfm" prereq-check
+ $(dumpenv) ./tex --progname=tex --jobname=tex --ini \\input plain \\dump </dev/null
+
+olatex.fmt: tex
+ $(dumpenv) $(MAKE) progname=olatex files="latex.ltx" prereq-check
+ $(dumpenv) ./tex --progname=olatex --jobname=olatex --ini \\input latex.ltx </dev/null
+
+mltex.fmt: tex
+ $(dumpenv) $(MAKE) progname=mltex files="plain.tex cmr10.tfm" prereq-check
+ $(dumpenv) ./tex --mltex --progname=mltex --jobname=mltex --ini \\input plain \\dump </dev/null
+
+mf.base: mf
+ $(dumpenv) $(MAKE) progname=mf files="plain.mf cmr10.mf $(localmodes).mf" prereq-check
+ $(dumpenv) ./mf --progname=mf --jobname=mf --ini \\input plain input $(localmodes) dump </dev/null
+
+mpost.mem: mpost
+ $(dumpenv) $(MAKE) progname=mpost files=plain.mp prereq-check
+ $(dumpenv) ./mpost --progname=mpost --jobname=mpost --ini \\input plain dump </dev/null
+
+# This is meant to be called recursively, with $(files) set.
+prereq-check: $(kpathsea_dir)/kpsewhich
+ $(kpathsea_dir)/kpsewhich --progname=$(progname) $(files) >/dev/null || $(MAKE) prereq-lose >/dev/null
+
+prereq-lose:
+ @echo "You seem to be missing input files necessary to make the" >&2
+ @echo "basic formats (some or all of: $(files))." >&2
+ @echo "Perhaps you've defined the default paths incorrectly, or" >&2
+ @echo "perhaps you have environment variables set pointing" >&2
+ @echo "to an incorrect location. See ../kpathsea/BUGS." >&2
+ @echo >&2
+ @echo "If you simply do not have the files, you can" >&2
+ @echo "retrieve a minimal set of input files from CTAN hosts." >&2
+ false
+
+$(kpathsea_dir)/kpsewhich: $(kpathsea)
+
+amstex.fmt: tex
+ $(dumpenv) ./tex --progname=amstex --jobname=amstex --ini amstex.ini </dev/null
+
+# Texinfo changes the escape character from `\' to `@'.
+texinfo.fmt: tex.fmt
+ $(dumpenv) ./tex --progname=texinfo --jobname=texinfo --ini texinfo @dump </dev/null
+
+eplain.fmt: tex.fmt
+ touch eplain.aux # Makes cross-reference warnings work right.
+ $(dumpenv) ./tex --progname=eplain --jobname=eplain --ini \&./tex eplain \\dump </dev/null
+
+#
+install: install-exec install-data
+install-exec:: install-programs
+
+# Installation directories.
+$(bindir)::
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+$(texpooldir)::
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(texpooldir)
+$(mfpooldir)::
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(mfpooldir)
+$(mppooldir)::
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(mppooldir)
+$(fmtdir)::
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(fmtdir)
+$(basedir)::
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(basedir)
+$(memdir)::
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(memdir)
+$(web2cdir)::
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(web2cdir)
+
+# Installing the binaries. Each of the *dir/*.mk files (except etex)
+# add to this target via a dependency-only rule, to install their
+# respective engines.
+install-programs: $(programs) $(basic_engines) $(bindir)
+ for p in $(programs) $(basic_engines); do \
+ $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
+
+# We do not attempt to install any of the per-format symlinks, leaving
+# that to a separate run of texlinks.
+
+# Always do plain.*, so examples from the TeXbook (etc.) will work.
+# This target is not called, since it depends on the whole texmf tree,
+# but we leave it for posterity.
+install-fmts: install-tex-fmts
+install-tex-fmts: fmts $(fmtdir)
+ fmts="$(all_fmts)"; \
+ for f in $$fmts; do $(INSTALL_DATA) $$f $(fmtdir)/$$f; done
+ cd $(fmtdir) && (rm -f plain.fmt; $(LN) tex.fmt plain.fmt)
+ fmts="$(fmts)"; \
+ for f in $$fmts; do base=`basename $$f .fmt`; \
+ (cd $(bindir) && (rm -f $$base; $(LN) tex $$base)); done
+
+install-bases: install-mf-bases
+install-mf-bases: bases $(basedir)
+ bases="$(all_bases)"; \
+ for f in $$bases; do $(INSTALL_DATA) $$f $(basedir)/$$f; done
+ cd $(basedir) && (rm -f plain.base; $(LN) mf.base plain.base)
+ bases="$(bases)"; \
+ for f in $$bases; do base=`basename $$f .base`;\
+ (cd $(bindir) && (rm -f $$base; $(LN) mf $$base)); done
+
+install-mems: install-mpost-mems
+install-mpost-mems: mems $(memdir)
+ mems="$(all_mems)"; \
+ for f in $$mems; do $(INSTALL_DATA) $$f $(memdir)/$$f; done
+ cd $(memdir) && (rm -f plain.mem; $(LN) mpost.mem plain.mem)
+ mems="$(mems)"; \
+ for f in $$mems; do base=`basename $$f .mem`; \
+ (cd $(bindir) && (rm -f $$base; $(LN) mpost $$base)); done
+
+# Auxiliary files.
+install-data:: $(web2cdir)
+ cd doc && $(MAKE) $(install_makeargs) install-data
+ cd man && $(MAKE) $(install_makeargs) install-data
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir) $(man5dir)
+ $(INSTALL_DATA) $(srcdir)/tiedir/tie.1 $(man1dir)/tie.$(manext)
+ $(INSTALL_DATA) $(srcdir)/ctiedir/ctie.1 $(man1dir)/ctie.$(manext)
+ $(INSTALL_DATA) $(srcdir)/synctexdir/man1/synctex.1 $(man1dir)/synctex.$(manext)
+ $(INSTALL_DATA) $(srcdir)/synctexdir/man5/synctex.5 $(man5dir)/synctex.5
+
+# Dummy target.
+uninstall uninstall-exec uninstall-data:
+ @echo "*** Warning: uninstall is a dummy target in web2c/Makefile"
+
+# The distribution comes with up-to-date .info* files,
+# so this should never be used unless something goes wrong
+# with the unpacking, or you modify the manual.
+doc/web2c.info:
+ cd doc && $(MAKE) info
+info dvi:
+ cd doc && $(MAKE) $@
+
+# Manual pages
+manpages:
+ cd man && $(MAKE) all
+
+#
+# make dist won't work for anyone but me. Sorry.
+
+@MAINT@all-dist: dist web-dist etex-dist omega-dist aleph-dist pdftex-dist libs-dist
+@MAINT@
+@MAINT@distname = web2c
+@MAINT@program_files = PROJECTS *.ac *.ch tangleboot.p
+@MAINT@# The files that omega places in the main directory.
+@MAINT@omega_files = omegamem.h {odvicopy,odvitype,otangle}.{web,ch}
+@MAINT@
+@MAINT@triptrapdiffs: triptrap/trip.diffs triptrap/mftrap.diffs triptrap/mptrap.diffs
+@MAINT@triptrap/trip.diffs: tex
+@MAINT@ $(MAKE) trip | tail +1 >triptrap/trip.diffs
+@MAINT@triptrap/mftrap.diffs: mf
+@MAINT@ $(MAKE) trap | tail +1 >triptrap/mftrap.diffs
+@MAINT@triptrap/mptrap.diffs: mpost
+@MAINT@ $(MAKE) mptrap | tail +1 >triptrap/mptrap.diffs
+@MAINT@
+@MAINT@tests/check.log: $(programs) $(engines)
+@MAINT@ $(MAKE) check | tail +1 >tests/check.log
+@MAINT@
+@MAINT@dist_subdirs = doc lib $(mpware) tests web2c window
+@MAINT@pre-dist-$(distname): depend triptrapdiffs tests/check.log tangleboot.p
+@MAINT@ cd web2c && $(MAKE) lex.yy.c y_tab.c
+@MAINT@ cd doc && $(MAKE) doc dvi
+@MAINT@
+@MAINT@post-dist-$(distname):
+@MAINT@# Make the subdirectories.
+@MAINT@ for d in $(dist_subdirs); do \
+@MAINT@ mkdir -p $(texk_distdir)/$(distname)/$$d; done
+@MAINT@# Link files in subdirectories.
+@MAINT@ for f in `find $(dist_subdirs) \
+@MAINT@ \( -name README \
+@MAINT@ -o -name convert \
+@MAINT@ -o -name ChangeLog \
+@MAINT@ -o -name 'coerce.*' \
+@MAINT@ -o -name ref.aux \
+@MAINT@ -o -name ref.bbl \
+@MAINT@ -o -name ref.tex \
+@MAINT@ -o -name ref.txi \
+@MAINT@ -o -name texinfo.bst \
+@MAINT@ -o -name web2c.cps \
+@MAINT@ -o -name web2c.aux \
+@MAINT@ -o -name '*.asm' \
+@MAINT@ -o -name '*.[chly]' \
+@MAINT@ -o -name '*.defines' \
+@MAINT@ -o -name '*.in' \
+@MAINT@ -o -name '*.info*' \
+@MAINT@ -o -name '*.map' \
+@MAINT@ -o -name '*.sed' \
+@MAINT@ -o -name '*.tcx' \
+@MAINT@ -o -name '*.texi' \
+@MAINT@ \) -print`; do \
+@MAINT@ ln $$f $(distdir)/`dirname $$f`; done
+@MAINT@# Handle the dependeny files in the subdirectories.
+@MAINT@ for d in lib $(mpware) web2c window; do \
+@MAINT@ cp -p $$d/depend.mk $(texk_distdir)/$(distname)/$$d; done
+@MAINT@# Other subdirectories.
+@MAINT@ mkdir $(distdir)/triptrap && cd $(distdir)/triptrap && \
+@MAINT@ for i in ../../../../triptrap/*; do \
+@MAINT@ if test -f $$i; then ln -s $$i .; fi; done
+@MAINT@ mkdir $(distdir)/tiedir && cd $(distdir)/tiedir && \
+@MAINT@ for i in ../../../../tiedir/*; do \
+@MAINT@ if test -f $$i; then ln -s $$i .; fi; done
+@MAINT@ mkdir $(distdir)/ctiedir && cd $(distdir)/ctiedir && \
+@MAINT@ for i in ../../../../ctiedir/*; do \
+@MAINT@ if test -f $$i; then ln -s $$i .; fi; done
+@MAINT@ mkdir $(distdir)/cwebdir && cd $(distdir)/cwebdir && \
+@MAINT@ for i in ../../../../cwebdir/*; do \
+@MAINT@ if test -f $$i; then ln -s $$i .; fi; done
+@MAINT@ mkdir $(distdir)/cwebdir/examples && cd $(distdir)/cwebdir/examples && \
+@MAINT@ for i in ../../../../cwebdir/examples/*; do \
+@MAINT@ if test -f $$i; then ln -s $$i .; fi; done
+@MAINT@ mkdir $(distdir)/man && cd $(distdir)/man && \
+@MAINT@ for i in ../../../../man/*; do \
+@MAINT@ if test -f $$i; then ln -s $$i .; fi; done;
+@MAINT@ cd $(distdir)/man && rm -f *.1 Makefile sedscript
+@MAINT@ rm -f $(distdir)/window/x11.c
+@MAINT@ rm -f $(distdir)/tests/patgen.in
+@MAINT@ cd $(distdir)/tests && (rm just.texi; ln -s ../../../../tests/* .; rm -f x* CVS)
+@MAINT@ cd $(distdir)/tests && rm -f missfont.log ptmr.mpx io.tex exampl.b??
+@MAINT@# We supply the flex/bison output in case the user can't generate them.
+@MAINT@ cd $(distdir)/web2c; ../../../../../rename 's/$$/-dist/' lex.yy.c y_tab.[ch]
+@MAINT@# Remove cruft.
+@MAINT@ cd $(distdir); rm -f $(addsuffix .c, $(programs) tangleboot)
+@MAINT@ cd $(distdir); rm -f $(addsuffix .h, $(programs) tangleboot)
+@MAINT@ cd $(distdir); rm -f etex.ch omega.ch aleph.ch
+@MAINT@ cd $(distdir); rm -f pdftex.ch
+@MAINT@ cd $(distdir); bash -c "rm -f tests/x* tests/allbib.{bbl,blg,dvi,log}"
+@MAINT@ cd $(distdir)/tests && ln -s ../../../../tests/xampl.bib .
+@MAINT@ cd $(distdir); bash -c "rm -f $(omega_files) alephmem.h"
+@MAINT@ cd $(distdir); bash -c "rm -f cweb.c *{coerce,d}.h"
+@MAINT@ cd $(distdir); bash -c "rm -f omega*.c aleph*.c"
+@MAINT@ cd $(distdir); bash -c "rm -f tex*.c etex*.c"
+@MAINT@ cd $(distdir); bash -c "rm -f pdftex*.c"
+@MAINT@ cd $(distdir); bash -c "rm -f mf*.c mp*.c"
+@MAINT@ cd $(distdir); bash -c "rm -f macnames.c *extra.c"
+@MAINT@ touch $(distdir)/doc/*.info*
+@MAINT@
+@MAINT@web-dist:
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@ mkdir -p $(distdir)
+@MAINT@ for f in *.web; do ln $$f $(distdir); done
+@MAINT@ rm -f $(distdir)/etex.web $(distdir)/omega.web $(distdir)/aleph.web
+@MAINT@ rm -f $(distdir)/pdfetex.web
+@MAINT@ cd $(distdir); bash -c "rm -f $(omega_files)"
+@MAINT@ chmod -w $(distdir)/*
+@MAINT@ GZIP=-9 tar czf web-$(version).tar.gz $(top_distdir)
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@
+@MAINT@etex-dist: etexdir/etex.version
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@ mkdir -p $(distdir)/etexdir
+@MAINT@ cp -rp etexdir/* $(distdir)/etexdir
+@MAINT@ rm -rf $(distdir)/etexdir/CVS $(distdir)/etexdir/*/CVS
+@MAINT@ rm -f $(distdir)/etexdir/etexextra.h $(distdir)/etexdir/etex.version
+@MAINT@ GZIP=-9 tar czf web2c-$(version)-etex-`cat etexdir/etex.version`.tar.gz $(top_distdir)
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@
+@MAINT@omega-dist:
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@ mkdir -p $(distdir)/omegadir
+@MAINT@ mkdir -p $(distdir)/omegaware $(distdir)/omegafonts $(distdir)/otps
+@MAINT@ cp -p omegadir/* $(distdir)/omegadir
+@MAINT@ cd omegafonts && $(MAKE) lex.yy.c y_tab.c
+@MAINT@ for f in omegafonts/*.[chly] omegafonts/*.in; do cp -p $$f $(distdir)/omegafonts; done
+@MAINT@ cp -p omegaware/* $(distdir)/omegaware
+@MAINT@ cd otps && $(MAKE) lex.yy.c y_tab.c
+@MAINT@ for f in otps/*.[chly] otps/*.in; do cp -p $$f $(distdir)/otps; done
+@MAINT@ cp -p otps/mkocp otps/mkofm $(distdir)/otps
+@MAINT@# We supply the flex/bison output in case the user can't generate them.
+@MAINT@ cd $(distdir)/omegafonts; ../../../../../rename 's/$$/-dist/' lex.yy.c y_tab.[ch]
+@MAINT@ cd $(distdir)/otps; ../../../../../rename 's/$$/-dist/' lex.yy.c y_tab.[ch]
+@MAINT@ GZIP=-9 tar czf web2c-$(version)-omega-`cat omegadir/omega.version`.tar.gz $(top_distdir)
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@
+@MAINT@aleph-dist: alephdir/aleph.version
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@ mkdir -p $(distdir)/alephdir
+@MAINT@ cp -p alephdir/* $(distdir)/alephdir
+@MAINT@ @echo "*** Removing generated files ***"
+@MAINT@ rm -f $(distdir)/alephdir/alephextra.h
+@MAINT@ GZIP=-9 tar czf web2c-$(version)-aleph-`cat alephdir/aleph.version`.tar.gz $(top_distdir)
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@
+@MAINT@pdfetex-dist: pdfetexdir/pdfetex.version
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@ mkdir -p $(distdir)/pdfetexdir
+@MAINT@ cp -rp pdfetexdir/* $(distdir)/pdfetexdir
+@MAINT@ rm -rf $(distdir)/pdf*texdir/CVS $(distdir)/pdf*texdir/*/CVS
+@MAINT@ rm -f $(distdir)/pdf*texdir/Makefile
+@MAINT@ rm -f $(distdir)/pdf*texdir/*.[oa]
+@MAINT@ rm -f $(distdir)/pdf*texdir/*/config.*
+@MAINT@ rm -f $(distdir)/pdf*texdir/*/Makefile
+@MAINT@ rm -f $(distdir)/pdf*texdir/*/*.[oa]
+@MAINT@ rm -f $(distdir)/pdf*texdir/*/*/Makefile
+@MAINT@ rm -f $(distdir)/pdf*texdir/*/*/*.[ao]
+@MAINT@ rm -f $(distdir)/pdf*texdir/*/*/pdftoepdf.cc
+@MAINT@ rm -f $(distdir)/pdf*texdir/*/*/epdf.h
+@MAINT@ rm -f $(distdir)/pdf*texdir/pdf*texextra.h
+@MAINT@ rm -f $(distdir)/pdf*texdir/pdf*tex.version
+@MAINT@ mkdir -p $(top_distdir)/libs/xpdf
+@MAINT@ cp -rp $(top_srcdir)/../../libs/xpdf/* $(top_distdir)/libs/xpdf
+@MAINT@ rm -rf $(top_distdir)/libs/xpdf/CVS $(top_distdir)/libs/xpdf/*/CVS
+@MAINT@ rm -f $(top_distdir)/libs/xpdf/Makefile
+@MAINT@ rm -f $(top_distdir)/libs/xpdf/config.*
+@MAINT@ rm -f $(top_distdir)/libs/xpdf/aconf.h
+@MAINT@ rm -f $(top_distdir)/libs/xpdf/*/Makefile
+@MAINT@ rm -f $(top_distdir)/libs/xpdf/*/*.[oa]
+@MAINT@ rm -f $(top_distdir)/libs/xpdf/*/c-auto.h
+@MAINT@ GZIP=-9 tar czf web2c-$(version)-pdftex-`cat pdfetexdir/pdfetex.version`.tar.gz $(top_distdir)
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@
+@MAINT@libs-dist:
+@MAINT@ rm -rf $(top_distdir)
+@MAINT@ mkdir -p $(libs_distdir)/zlib
+@MAINT@ cp -rp $(top_srcdir)/../../libs/zlib/* $(libs_distdir)/zlib
+@MAINT@ mkdir -p $(libs_distdir)/libpng
+@MAINT@ cp -rp $(top_srcdir)/../../libs/libpng/* $(libs_distdir)/libpng
+@MAINT@ mkdir -p $(libs_distdir)/md5
+@MAINT@ cp -rp $(top_srcdir)/../../libs/md5/* $(libs_distdir)/md5
+@MAINT@ rm -f $(libs_distdir)/*/Makefile
+@MAINT@ rm -f $(libs_distdir)/*/config.*
+@MAINT@ rm -f $(libs_distdir)/*/c-auto.h
+@MAINT@ rm -f $(libs_distdir)/*/*.[oa]
+@MAINT@ GZIP=-9 tar czf web2c-$(version)-pdfetexlibs.tar.gz $(top_distdir)
+@MAINT@ rm -rf $(top_distdir)
+
+kpse_include ../make/dist.mk
+
+kpse_include ../make/config.mk
+
+@MAINT@$(srcdir)/configure: $(srcdir)/withenable.ac
+
+#
+
+installcheck:
+ cd $(srcdir)/tests && bibtex allbib
+ mf '\mode:=ljfour; input logo10' && tftopl logo10.tfm >/dev/null
+ tex '\nonstopmode \tracingstats=1 \input story \bye'
+
+#
+# Cleaning.
+all_subdirs = doc lib man $(mpware) web2c window $(omegafonts) $(otps) \
+ $(pdftexdir) $(mpostdir) $(luatexdir)
+
+# Having a multiple-target rule with the subdir loop fails because of
+# the dependencies introduced by clean.mk. Yet, we want the
+# dependencies here at the top level so that distclean will run the
+# clean rules, etc. So, sigh, put the subdir loop in each target and
+# only run it if we have a Makefile. Alternatively, we could do as
+# Automake does.
+
+mostlyclean:: tangleboot-clean ctangleboot-clean
+ test ! -r lib/Makefile \
+ || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
+clean::
+ test ! -r lib/Makefile \
+ || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
+ rm -f *.log *.fmt *.base *.mem *.fls *.ofl *.aux
+distclean::
+ test ! -r lib/Makefile \
+ || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
+extraclean::
+ test ! -r lib/Makefile \
+ || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
+maintainer-clean::
+ test ! -r lib/Makefile \
+ || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
+
+kpse_include ../make/clean.mk
+
+@MAINT@depend::
+@MAINT@ for d in lib $(mpware) web2c window $(otps); do \
+@MAINT@ (cd $$d && $(MAKE) depend); done
+
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
+
+#
+# Local variables:
+# page-delimiter: "^# \f"
+# End:
diff --git a/Build/source/texk/web2c/ac/web2c.ac b/Build/source/texk/web2c/ac/web2c.ac
new file mode 100644
index 00000000000..e5f0d273d1f
--- /dev/null
+++ b/Build/source/texk/web2c/ac/web2c.ac
@@ -0,0 +1,62 @@
+## texk/web2c/ac/web2c.ac
+## configure options for TeX and MF
+AC_ARG_WITH([editor],
+ [AS_HELP_STRING([--with-editor=CMD],
+ [invoke CMD from the `e' option @<:@vi +%d %s@:>@])])[]dnl
+AC_ARG_ENABLE([auto-core],
+ [AS_HELP_STRING([--enable-auto-core],
+ [cause TeX&MF to dump core, given a certain filename])])[]dnl
+AC_ARG_ENABLE([dump-share],
+ [AS_HELP_STRING([--disable-dump-share],
+ [make fmt/base/mem files architecture-dependent])])[]dnl
+AC_ARG_ENABLE([fmtutil],
+ [AS_HELP_STRING([--enable-fmtutil],
+ [use fmtutil for build dumps])])[]dnl
+## configure options for TeX
+AC_ARG_ENABLE([ipc],
+ [AS_HELP_STRING([--enable-ipc],
+ [enable TeX's --ipc option, i.e., pipe to a program])])[]dnl
+m4_define([kpse_tex_progs], [dnl
+[[tex], [yes], [no], [TeX], []],
+[[etex], [no], [yes], [e-TeX], []],
+[[omega], [no], [no], [Omega], []],
+[[aleph], [yes], [no], [Aleph], []],
+[[pdftex], [yes], [yes], [pdfTeX], [xpdf libpng obsdcompat]],
+[[luatex], [yes], [no], [luaTeX], [xpdf libpng obsdcompat]],
+[[xetex], [no], [yes], [XeTeX], [xpdf libpng freetype2]],
+])[]dnl
+m4_foreach([Kpse_Prog], [kpse_tex_progs],
+ [m4_ifset([Kpse_Prog],
+ [KPSE_WITH_XTEX(Kpse_Prog)])])[]dnl
+## configure options for MF
+AC_ARG_ENABLE([mf],
+ [AS_HELP_STRING([--disable-mf],
+ [do not build METAFONT])])[]dnl
+AC_ARG_ENABLE([mf-nowin],
+ [AS_HELP_STRING([--enable-mf-nowin],
+ [build a separate non-windows-capable METAFONT],
+ [30])])[]dnl
+AC_ARG_WITH([mf-x-toolkit],
+ [AS_HELP_STRING([--with-mf-x-toolkit],
+ [Use X toolkit for METAFONT])])[]dnl
+m4_define([kpse_mf_win], [dnl
+[[epsf], [EPSF], [EPSF pseudo]],
+[[hp2627], [HP2627], [HP 2627]],
+[[mftalk], [MFTALK], [mftalk (generic server)]],
+[[next], [NEXT], [NeXT]],
+[[regis], [REGIS], [Regis]],
+[[suntools], [SUN], [old Suntools (this is not X)]],
+[[tektronix], [TEKTRONIX], [Tektronix]],
+[[uniterm], [UNITERM], [Uniterm]],
+])[]dnl
+m4_foreach([Kpse_Win], [kpse_mf_win],
+ [m4_ifset([Kpse_Win],
+ [KPSE_WITH_MFWIN(Kpse_Win)])])[]dnl
+## configure options for MP
+AC_ARG_ENABLE([mp],
+ [AS_HELP_STRING([--disable-mp],
+ [do not build METAPOST])])[]dnl
+## configure options for WEB programs
+AC_ARG_ENABLE([web-progs],
+ [AS_HELP_STRING([--disable-web-progs],
+ [do not build WEB programs bibtex ... weave])])[]dnl
diff --git a/Build/source/texk/web2c/ac/withenable.ac b/Build/source/texk/web2c/ac/withenable.ac
new file mode 100644
index 00000000000..be83880a3e5
--- /dev/null
+++ b/Build/source/texk/web2c/ac/withenable.ac
@@ -0,0 +1,4 @@
+## texk/web2c/ac/withenable.ac
+## configure options and TL libraries required for web2c
+KPSE_WITH_PROG([web2c], [kpathsea zlib], , [TeX & Co.])
+m4_include(kpse_TL[texk/web2c/ac/web2c.ac])
diff --git a/Build/source/texk/web2c/alephdir/am/aleph.am b/Build/source/texk/web2c/alephdir/am/aleph.am
new file mode 100644
index 00000000000..1643770a4d0
--- /dev/null
+++ b/Build/source/texk/web2c/alephdir/am/aleph.am
@@ -0,0 +1,102 @@
+## texk/web2c/alephdir/am/aleph.am: Makefile fragment for Aleph.
+
+## Aleph
+##
+if ALEPH
+bin_PROGRAMS += aleph
+endif ALEPH
+
+## With --enable-ipc, Aleph may need to link with -lsocket.
+aleph_LDADD = $(LDADD) $(socketlibs)
+
+aleph_CPPFLAGS = -I$(srcdir)/alephdir $(AM_CPPFLAGS)
+aleph_c_h = alephini.c aleph0.c aleph1.c aleph2.c aleph3.c alephcoerce.h alephd.h
+nodist_aleph_SOURCES = $(aleph_c_h) aleph-pool.c alephextra.c
+aleph_SOURCES = \
+ alephdir/aleph.c \
+ alephdir/alephbis.c \
+ alephdir/alephextra.h \
+ alephdir/alephmem.h \
+ alephdir/aleph-pool.h
+## We must create alephd.h before compiling the aleph_SOURCES,
+## but certainly don't want to create alephd.h if Aleph is not built.
+if ALEPH
+$(aleph_SOURCES): alephd.h
+endif ALEPH
+$(aleph_c_h): aleph-web2c
+aleph-web2c: aleph.p $(web2c_texmf) alephdir/aleph.defines
+ $(web2c) aleph
+ echo timestamp >$@
+ touch $(aleph_c_h)
+alephextra.c: lib/texmfmp.c alephdir/alephextra.h alephd.h
+ sed s/TEX-OR-MF-OR-MP/aleph/ $(srcdir)/lib/texmfmp.c >$@
+aleph.p aleph.pool: aleph-tangle
+aleph-tangle: otangle aleph.web aleph.ch
+ $(otangle) aleph aleph
+ echo timestamp >$@
+ touch aleph.p aleph.pool
+aleph-pool.c: aleph.pool $(makecpool) alephdir/aleph-pool.h
+ $(makecpool) aleph.pool $(srcdir)/alephdir/aleph-pool.h >$@ || rm -f $@
+## Generate aleph.web
+aleph_web_srcs = \
+ tex.web \
+ alephdir/om16bit.ch \
+ alephdir/omstr.ch \
+ alephdir/omfont.ch \
+ alephdir/omchar.ch \
+ alephdir/omfi.ch \
+ alephdir/ompar.ch \
+ alephdir/omocp.ch \
+ alephdir/omfilter.ch \
+ alephdir/omtrans.ch \
+ alephdir/omdir.ch \
+ alephdir/eobase.ch \
+ alephdir/eofmt.ch \
+ alephdir/eomem.ch \
+ alephdir/eo16bit.ch \
+ alephdir/eoext.ch \
+ alephdir/eoeqtb.ch \
+ alephdir/eofix.ch \
+ alephdir/eocprt.ch \
+ alephdir/eonewdir.ch \
+ alephdir/eover.ch \
+ alephdir/eopage.ch \
+ alephdir/eochar.ch
+aleph.web: $(TIE) $(aleph_web_srcs)
+ $(tie) -m aleph.web $(aleph_web_srcs)
+## Generate aleph.ch
+aleph_ch_srcs = \
+ alephdir/com16bit.ch \
+ alephdir/comstr.ch \
+ alephdir/comfont.ch \
+ alephdir/comchar.ch \
+ alephdir/comfi.ch \
+ alephdir/compar.ch \
+ alephdir/comocp.ch \
+ alephdir/comfilter.ch \
+ alephdir/comtrans.ch \
+ alephdir/comdir.ch \
+ alephdir/comsrcspec.ch \
+ alephdir/ceostuff.ch
+aleph.ch: $(TIE) aleph.web $(aleph_ch_srcs)
+ $(tie) -c aleph.ch aleph.web $(aleph_ch_srcs)
+EXTRA_DIST += $(aleph_web_srcs) $(aleph_ch_srcs) lib/texmfmp.c
+DISTCLEANFILES += $(nodist_aleph_SOURCES) aleph.web aleph.ch aleph-web2c \
+ aleph.p aleph.pool aleph-tangle
+
+EXTRA_DIST += \
+ alephdir/ChangeLog \
+ alephdir/Makefile \
+ alephdir/aleph.defines \
+ alephdir/aleph.version \
+ alephdir/eomega.ech \
+ alephdir/etex.ch \
+ alephdir/omega.ch0 \
+ alephdir/omega.ch1 \
+ alephdir/omega.ch2 \
+ alephdir/omxml.ch
+
+## Eventually delete these files
+##
+EXTRA_DIST += alephdir/aleph.mk
+
diff --git a/Build/source/texk/web2c/am/bootstrap.am b/Build/source/texk/web2c/am/bootstrap.am
new file mode 100644
index 00000000000..ad01159d6f1
--- /dev/null
+++ b/Build/source/texk/web2c/am/bootstrap.am
@@ -0,0 +1,110 @@
+## texk/web2c/am/bootstrap.am: Makefile fragment for tangle and ctangle.
+
+## Bootstrapping tangle requires making it with itself. We use the opportunity
+## to create an up-to-date tangleboot as well.
+bin_PROGRAMS += tangle
+nodist_tangle_SOURCES = tangle.c tangle.h
+tangle.c tangle.h: tangle-web2c
+tangle-web2c: tangle.p
+ $(web2c) tangle
+ echo timestamp >$@
+ touch tangle.c tangle.h
+## tangle.p is a special case, since it is needed to compile itself. We
+## convert and compile the (distributed) tangleboot.p to make a tangle
+## which we use to make the other programs. We depend on tangleboot, even
+## though we might not use it.
+EXTRA_DIST += tangle.web tangle.ch
+tangle.p: tangleboot tangle.web tangle.ch
+ WEBINPUTS=.:$(srcdir) $(tangleboot) tangle tangle
+tangle.web:
+ @echo "You seem to be missing tangle.web, perhaps because you" >&2
+ @echo "didn't retrieve web.tar.gz, only web2c.tar.gz." >&2
+ @echo "You need both." >&2
+ @echo >&2
+ @echo "web.tar.gz should be available from the" >&2
+ @echo "same place that you got web2c.tar.gz." >&2
+ @echo "In any case, you can get it from" >&2
+ @echo "ftp://ftp.tug.org/tex/web.tar.gz." >&2
+ false
+DISTCLEANFILES += tangle.c tangle.h tangle.p tangle-web2c
+
+noinst_PROGRAMS += tangleboot
+nodist_tangleboot_SOURCES = tangleboot.c tangleboot.h
+tangleboot.c tangleboot.h: stamp-tangle $(web2c_programs) $(web2c_common)
+ $(web2c) tangleboot
+## tangleboot.p is in the distribution
+EXTRA_DIST += tangleboot.p
+stamp-tangle: tangleboot.p
+ date >stamp-tangle
+## This is not run unless tangle.web or tangle.ch is changed.
+## Only try to run ./tangle if it actually exists, otherwise
+## just touch tangleboot.p and build tangle.
+tangleboot.p: tangle.web tangle.ch
+ if [ -r $(TANGLE) ] || [ -r $(TANGLE).exe ]; then \
+ $(tangle) tangle tangle; \
+ mv tangle.p tangleboot.p; \
+ elif [ -r tangleboot.p ]; then \
+ touch tangleboot.p; \
+ else \
+ cp $(srcdir)/tangleboot.p .; \
+ fi
+ date >stamp-tangle
+ $(MAKE) $(AM_MAKEFLAGS) tangle
+DISTCLEANFILES += stamp-tangle tangleboot.c tangleboot.h
+
+## Bootstrapping ctangle requires making it with itself. We use the opportunity
+## to create an up-to-date ctangleboot as well.
+bin_PROGRAMS += ctangle
+nodist_ctangle_SOURCES = ctangle.c cweb.c
+## ctangle.c is a special case, since it is needed to compile itself.
+## We depend on ctangleboot, even though we might not use it.
+EXTRA_DIST += cwebdir
+## We install man/cweb.man, not cwebdir/cweb.1
+## nodist_man_MANS += cwebdir/cweb.1
+ctangle.c: ctangleboot cwebdir/ctangle.w cwebdir/ctang-w2c.ch
+ CWEBINPUTS=$(srcdir)/cwebdir $(ctangleboot) ctangle ctang-w2c
+cweb.c: ctangleboot cwebdir/common.w cwebdir/comm-w2c.ch
+ CWEBINPUTS=$(srcdir)/cwebdir $(ctangleboot) common comm-w2c cweb.c
+DISTCLEANFILES += ctangle.c cweb.c
+
+noinst_PROGRAMS += ctangleboot
+nodist_ctangleboot_SOURCES = ctangleboot.c cwebboot.c
+## ctangleboot.c and cwebboot.c are in the distribution
+EXTRA_DIST += ctangleboot.c cwebboot.c
+stamp-ctangle: ctangleboot.c cwebboot.c
+ date >stamp-ctangle
+## This is not run unless one of the cwebdir/* files is changed.
+## Only try to run ./ctangle if it actually exists, otherwise
+## just touch ctangleboot.c and/or cwebboot.c and build ctangle.
+ctangleboot.c: cwebdir/ctangle.w cwebdir/ctang-w2c.ch
+ if [ -r $(CTANGLE) ] || [ -r $(CTANGLE).exe ]; then \
+ CWEBINPUTS=$(srcdir)/cwebdir $(ctangle) ctangle ctang-w2c; \
+ mv ctangle.c ctangleboot.c; \
+ elif [ -r ctangleboot.c ]; then \
+ touch ctangleboot.c; \
+ else \
+ cp $(srcdir)/ctangleboot.c .; \
+ fi
+ date >stamp-ctangle
+ $(MAKE) $(AM_MAKEFLAGS) ctangle
+cwebboot.c: cwebdir/common.w cwebdir/comm-w2c.ch
+ if [ -r $(CTANGLE) ] || [ -r $(CTANGLE).exe ]; then \
+ CWEBINPUTS=$(srcdir)/cwebdir $(ctangle) common comm-w2c cweb.c; \
+ mv cweb.c cwebboot.c; \
+ elif [ -r cwebboot.c ]; then \
+ touch cwebboot.c; \
+ else \
+ cp $(srcdir)/cwebboot.c .; \
+ fi
+ date >stamp-ctangle
+ $(MAKE) $(AM_MAKEFLAGS) ctangle
+DISTCLEANFILES += stamp-ctangle
+
+## Tests
+
+dist_check_SCRIPTS += tangle.test
+
+TESTS += tangle.test
+
+DISTCLEANFILES += cftest.p
+
diff --git a/Build/source/texk/web2c/am/cweb.am b/Build/source/texk/web2c/am/cweb.am
new file mode 100644
index 00000000000..7bdbde25a19
--- /dev/null
+++ b/Build/source/texk/web2c/am/cweb.am
@@ -0,0 +1,30 @@
+## texk/web2c/am/cweb.am: Makefile fragment for cweb programs (except ctangle).
+
+bin_PROGRAMS += ctie
+nodist_ctie_SOURCES = ctie.c
+EXTRA_DIST += ctiedir
+nodist_man_MANS += ctiedir/ctie.1
+ctie.c: ctangle ctiedir/ctie.w ctiedir/ctie-k.ch
+ CWEBINPUTS=$(srcdir)/ctiedir $(ctangle) ctie.w ctie-k.ch
+DISTCLEANFILES += ctie.c
+
+bin_PROGRAMS += cweave
+nodist_cweave_SOURCES = cweave.c cweb.c
+cweave.c: ctangle cwebdir/cweave.w cwebdir/cweav-w2c.ch
+ CWEBINPUTS=$(srcdir)/cwebdir $(ctangle) cweave cweav-w2c
+DISTCLEANFILES += cweave.c
+
+bin_PROGRAMS += tie
+nodist_tie_SOURCES = tie.c
+EXTRA_DIST += tiedir
+nodist_man_MANS += tiedir/tie.1
+tie.c: ctangle tiedir/tie.w tiedir/tie-w2c.ch
+ CWEBINPUTS=$(srcdir)/tiedir $(ctangle) tie.w tie-w2c.ch
+DISTCLEANFILES += tie.c
+
+## Tests
+
+TESTS += tiedir/tie.test
+
+DISTCLEANFILES += tie.outc tie.outm
+
diff --git a/Build/source/texk/web2c/am/texmf.am b/Build/source/texk/web2c/am/texmf.am
new file mode 100644
index 00000000000..8d65e7bd065
--- /dev/null
+++ b/Build/source/texk/web2c/am/texmf.am
@@ -0,0 +1,108 @@
+## texk/web2c/am/texmf.am: Makefile fragment for TeX and MF.
+
+## Common for MF and TeX
+EXTRA_DIST += \
+ lib/mfmpi386.asm \
+ lib/mfmpw32.c \
+ lib/texmfmp.c \
+ texmfmem.h \
+ texmfmp-help.h \
+ texmfmp.h
+
+## TeX
+##
+if TEX
+bin_PROGRAMS += tex
+endif TEX
+
+tex_CPPFLAGS =
+
+## With --enable-ipc, TeX may need to link with -lsocket.
+tex_LDADD = $(LDADD) $(socketlibs)
+
+tex_c_h = texini.c tex0.c tex1.c tex2.c texcoerce.h texd.h
+nodist_tex_SOURCES = $(tex_c_h) tex-pool.c texextra.c
+$(tex_c_h): tex-web2c
+tex-web2c: tex.p $(web2c_texmf)
+ $(web2c) tex
+ : $(synctex_convert_tex)
+ echo timestamp >$@
+ touch $(tex_c_h)
+texextra.c: lib/texmfmp.c texd.h
+ sed s/TEX-OR-MF-OR-MP/tex/ $(srcdir)/lib/texmfmp.c >$@
+tex.p tex.pool: tex-tangle
+tex-tangle: $(TANGLE) tex.web tex-final.ch
+ $(tangle) tex.web tex-final.ch
+ echo timestamp >$@
+ touch tex.p tex.pool
+tex-pool.c: tex.pool $(makecpool) tmf-pool.h
+ $(makecpool) tex.pool $(srcdir)/tmf-pool.h >$@ || rm -f $@
+## Generate tex-final.ch
+tex-final.ch: $(TIE) $(tex_ch_srcs)
+ $(tie) -c $@ $(tex_ch_srcs)
+tex_ch_srcs = \
+ tex.web \
+ tex.ch \
+ $(tex_ch_synctex) \
+ tex-binpool.ch
+##
+EXTRA_DIST += $(tex_ch_srcs) lib/texmfmp.c tmf-pool.h
+
+DISTCLEANFILES += $(nodist_tex_SOURCES) tex-final.ch tex-web2c \
+ tex.p tex.pool tex-tangle
+
+## Metafont
+##
+if MF
+bin_PROGRAMS += mf
+endif MF
+
+nodist_mf_SOURCES = mfextra.c
+mf_CPPFLAGS = $(X_CFLAGS)
+mf_LDADD = libmf.a $(LDADD) $(windowlib) $(mf_x_libs)
+if MFN
+bin_PROGRAMS += mf-nowin
+nodist_mf_nowin_SOURCES = mfextra.c
+mf_nowin_CPPFLAGS = $(X_CFLAGS) -DMFNOWIN
+mf_nowin_LDADD = libmf.a $(LDADD) $(windowlib)
+endif MFN
+
+windowlib = window/libwindow.a
+$(windowlib): mfd.h $(srcdir)/window/*.c
+ cd window && $(MAKE) $(AM_MAKEFLAGS) libwindow.a
+## Make `#include <X11/...>' and `-lX...' work.
+## This matches xdvik.
+## wlibs is substituted by web2c's configure, LIBS by general configure
+## routines, and the others by AC_PATH_XTRA.
+## All the x_... and X_... variables will be empty if we aren't supporting X.
+## Follow the library order used in X11R6 itself:
+## -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 (some may not be present).
+mf_x_libs = $(X_LIBS) $(x_tool_libs) $(X_PRE_LIBS) $(x_ext_lib) $(wlibs) $(X_EXTRA_LIBS)
+
+## mf and mf-nowin compile mfextra.c with different CPPFLAGS.
+## Automake, however, does not support CPPFLAGS for individual source files.
+## To avoid compiling everything twice, the common objects are in a library.
+EXTRA_LIBRARIES += libmf.a
+mf_c_h = mfini.c mf0.c mf1.c mfcoerce.h mfd.h
+nodist_libmf_a_SOURCES = $(mf_c_h) mf-pool.c
+libmf_a_CPPFLAGS = -DMETA_FONT
+$(mf_c_h): mf-web2c
+mf-web2c: mf.p $(web2c_texmf) web2c/cvtmf1.sed web2c/cvtmf2.sed
+ $(web2c) mf
+ echo timestamp >$@
+ touch $(mf_c_h)
+EXTRA_DIST += mf.web mf-binpool.ch mf.ch mftalk.h lib/texmfmp.c tmf-pool.h
+mfextra.c: lib/texmfmp.c mfd.h
+ sed s/TEX-OR-MF-OR-MP/mf/ $(srcdir)/lib/texmfmp.c >$@
+mf.p mf.pool: mf-tangle
+mf-tangle: $(TANGLE) mf.web mf-final.ch
+ $(tangle) mf.web mf-final.ch
+ echo timestamp >$@
+ touch mf.p mf.pool
+mf-final.ch: $(TIE) mf.web mf.ch mf-binpool.ch
+ $(tie) -c $@ mf.web mf.ch mf-binpool.ch
+mf-pool.c: mf.pool $(makecpool) tmf-pool.h
+ $(makecpool) mf.pool $(srcdir)/tmf-pool.h >$@ || rm -f $@
+DISTCLEANFILES += $(nodist_libmf_a_SOURCES) mfextra.c mf-final.ch mf-web2c \
+ mf.p mf.pool mf-tangle
+
diff --git a/Build/source/texk/web2c/am/web.am b/Build/source/texk/web2c/am/web.am
new file mode 100644
index 00000000000..951e4fded6c
--- /dev/null
+++ b/Build/source/texk/web2c/am/web.am
@@ -0,0 +1,166 @@
+## texk/web2c/am/web.am: Makefile fragment for normal web programs (except tangle).
+
+web_programs = bibtex dvicopy dvitomp dvitype gftodvi gftopk gftype mft \
+ patgen pktogf pktype pltotf pooltype tftopl vftovp vptovf weave
+
+if WEB
+bin_PROGRAMS += $(web_programs)
+endif WEB
+
+EXTRA_DIST += $(web_programs:=.web) $(web_programs:=.ch)
+DISTCLEANFILES += $(web_programs:=.c) $(web_programs:=.h) \
+ $(web_programs:=.p) $(web_programs:=-web2c)
+
+nodist_bibtex_SOURCES = bibtex.c bibtex.h
+bibtex.c bibtex.h: bibtex-web2c
+bibtex-web2c: $(web2c_common) $(web2c_programs) web2c/cvtbib.sed bibtex.p
+ $(web2c) bibtex
+ echo timestamp >$@
+ touch bibtex.c bibtex.h
+bibtex.p: tangle bibtex.web bibtex.ch
+ $(tangle) bibtex bibtex
+
+nodist_dvicopy_SOURCES = dvicopy.c dvicopy.h
+dvicopy.c dvicopy.h: dvicopy-web2c
+dvicopy-web2c: $(web2c_common) $(web2c_programs) dvicopy.p
+ $(web2c) dvicopy
+ echo timestamp >$@
+ touch dvicopy.c dvicopy.h
+dvicopy.p: tangle dvicopy.web dvicopy.ch
+ $(tangle) dvicopy dvicopy
+
+nodist_dvitomp_SOURCES = dvitomp.c dvitomp.h
+dvitomp.c dvitomp.h: dvitomp-web2c
+dvitomp-web2c: $(web2c_common) $(web2c_programs) dvitomp.p
+ $(web2c) dvitomp
+ echo timestamp >$@
+ touch dvitomp.c dvitomp.h
+dvitomp.p: tangle dvitomp.web dvitomp.ch
+ $(tangle) dvitomp dvitomp
+
+nodist_dvitype_SOURCES = dvitype.c dvitype.h
+dvitype.c dvitype.h: dvitype-web2c
+dvitype-web2c: $(web2c_common) $(web2c_programs) dvitype.p
+ $(web2c) dvitype
+ echo timestamp >$@
+ touch dvitype.c dvitype.h
+dvitype.p: tangle dvitype.web dvitype.ch
+ $(tangle) dvitype dvitype
+
+nodist_gftodvi_SOURCES = gftodvi.c gftodvi.h
+gftodvi.c gftodvi.h: gftodvi-web2c
+gftodvi-web2c: $(web2c_common) $(web2c_programs) gftodvi.p
+ $(web2c) gftodvi
+ echo timestamp >$@
+ touch gftodvi.c gftodvi.h
+gftodvi.p: tangle gftodvi.web gftodvi.ch
+ $(tangle) gftodvi gftodvi
+gftodvi_SOURCES = gftodmem.h
+
+nodist_gftopk_SOURCES = gftopk.c gftopk.h
+gftopk.c gftopk.h: gftopk-web2c
+gftopk-web2c: $(web2c_common) $(web2c_programs) gftopk.p
+ $(web2c) gftopk
+ echo timestamp >$@
+ touch gftopk.c gftopk.h
+gftopk.p: tangle gftopk.web gftopk.ch
+ $(tangle) gftopk gftopk
+
+nodist_gftype_SOURCES = gftype.c gftype.h
+gftype.c gftype.h: gftype-web2c
+gftype-web2c: $(web2c_common) $(web2c_programs) gftype.p
+ $(web2c) gftype
+ echo timestamp >$@
+ touch gftype.c gftype.h
+gftype.p: tangle gftype.web gftype.ch
+ $(tangle) gftype gftype
+
+nodist_mft_SOURCES = mft.c mft.h
+mft.c mft.h: mft-web2c
+mft-web2c: $(web2c_common) $(web2c_programs) mft.p
+ $(web2c) mft
+ echo timestamp >$@
+ touch mft.c mft.h
+mft.p: tangle mft.web mft.ch
+ $(tangle) mft mft
+
+nodist_patgen_SOURCES = patgen.c patgen.h
+patgen.c patgen.h: patgen-web2c
+patgen-web2c: $(web2c_common) $(web2c_programs) patgen.p
+ $(web2c) patgen
+ echo timestamp >$@
+ touch patgen.c patgen.h
+patgen.p: tangle patgen.web patgen.ch
+ $(tangle) patgen patgen
+
+nodist_pktogf_SOURCES = pktogf.c pktogf.h
+pktogf.c pktogf.h: pktogf-web2c
+pktogf-web2c: $(web2c_common) $(web2c_programs) pktogf.p
+ $(web2c) pktogf
+ echo timestamp >$@
+ touch pktogf.c pktogf.h
+pktogf.p: tangle pktogf.web pktogf.ch
+ $(tangle) pktogf pktogf
+
+nodist_pktype_SOURCES = pktype.c pktype.h
+pktype.c pktype.h: pktype-web2c
+pktype-web2c: $(web2c_common) $(web2c_programs) pktype.p
+ $(web2c) pktype
+ echo timestamp >$@
+ touch pktype.c pktype.h
+pktype.p: tangle pktype.web pktype.ch
+ $(tangle) pktype pktype
+
+nodist_pltotf_SOURCES = pltotf.c pltotf.h
+pltotf.c pltotf.h: pltotf-web2c
+pltotf-web2c: $(web2c_common) $(web2c_programs) pltotf.p
+ $(web2c) pltotf
+ echo timestamp >$@
+ touch pltotf.c pltotf.h
+pltotf.p: tangle pltotf.web pltotf.ch
+ $(tangle) pltotf pltotf
+
+nodist_pooltype_SOURCES = pooltype.c pooltype.h
+pooltype.c pooltype.h: pooltype-web2c
+pooltype-web2c: $(web2c_common) $(web2c_programs) pooltype.p
+ $(web2c) pooltype
+ echo timestamp >$@
+ touch pooltype.c pooltype.h
+pooltype.p: tangle pooltype.web pooltype.ch
+ $(tangle) pooltype pooltype
+
+nodist_tftopl_SOURCES = tftopl.c tftopl.h
+tftopl.c tftopl.h: tftopl-web2c
+tftopl-web2c: $(web2c_common) $(web2c_programs) tftopl.p
+ $(web2c) tftopl
+ echo timestamp >$@
+ touch tftopl.c tftopl.h
+tftopl.p: tangle tftopl.web tftopl.ch
+ $(tangle) tftopl tftopl
+
+nodist_vftovp_SOURCES = vftovp.c vftovp.h
+vftovp.c vftovp.h: vftovp-web2c
+vftovp-web2c: $(web2c_common) $(web2c_programs) vftovp.p
+ $(web2c) vftovp
+ echo timestamp >$@
+ touch vftovp.c vftovp.h
+vftovp.p: tangle vftovp.web vftovp.ch
+ $(tangle) vftovp vftovp
+
+nodist_vptovf_SOURCES = vptovf.c vptovf.h
+vptovf.c vptovf.h: vptovf-web2c
+vptovf-web2c: $(web2c_common) $(web2c_programs) vptovf.p
+ $(web2c) vptovf
+ echo timestamp >$@
+ touch vptovf.c vptovf.h
+vptovf.p: tangle vptovf.web vptovf.ch
+ $(tangle) vptovf vptovf
+
+nodist_weave_SOURCES = weave.c weave.h
+weave.c weave.h: weave-web2c
+weave-web2c: $(web2c_common) $(web2c_programs) weave.p
+ $(web2c) weave
+ echo timestamp >$@
+ touch weave.c weave.h
+weave.p: tangle weave.web weave.ch
+ $(tangle) weave weave
diff --git a/Build/source/texk/web2c/cftests/cftest.ch b/Build/source/texk/web2c/cftests/cftest.ch
new file mode 100644
index 00000000000..220bf25a756
--- /dev/null
+++ b/Build/source/texk/web2c/cftests/cftest.ch
@@ -0,0 +1,7 @@
+% Replace seven_bits by eight_bits.
+
+@x
+@!seven_bits=0..127; {seven-bit numbers, a subrange of the integers}
+@y
+@!eight_bits=0..255; {eight-bit numbers, a subrange of the integers}
+@z
diff --git a/Build/source/texk/web2c/cftests/cftest.p b/Build/source/texk/web2c/cftests/cftest.p
new file mode 100644
index 00000000000..197bae6e97a
--- /dev/null
+++ b/Build/source/texk/web2c/cftests/cftest.p
@@ -0,0 +1,2 @@
+{1:}program CFtest;type{2:}eightbits=0..255;
+{:2}{:1}{3:}begin writeln('This is CFtest');end.{:3}
diff --git a/Build/source/texk/web2c/cftests/cftest.web b/Build/source/texk/web2c/cftests/cftest.web
new file mode 100644
index 00000000000..a49ba6a1947
--- /dev/null
+++ b/Build/source/texk/web2c/cftests/cftest.web
@@ -0,0 +1,15 @@
+% This is not a real program, only to test if tangle works.
+
+@* Introduction.
+This is just a test.
+
+@p program CF_test;
+type @<Types in the outer block@>
+
+@ @<Types...@>=
+@!seven_bits=0..127; {seven-bit numbers, a subrange of the integers}
+
+@* Main program.
+
+@p begin write_ln('This is CFtest');
+end.
diff --git a/Build/source/texk/web2c/cftests/lcftest.p b/Build/source/texk/web2c/cftests/lcftest.p
new file mode 100644
index 00000000000..ab3074345bf
--- /dev/null
+++ b/Build/source/texk/web2c/cftests/lcftest.p
@@ -0,0 +1,2 @@
+{1:}program CFtest;type{2:}eightbits=0..255;{:2}{:1}{3:}
+begin writeln('This is CFtest');end.{:3}
diff --git a/Build/source/texk/web2c/cftests/ocftest.p b/Build/source/texk/web2c/cftests/ocftest.p
new file mode 100644
index 00000000000..ab3074345bf
--- /dev/null
+++ b/Build/source/texk/web2c/cftests/ocftest.p
@@ -0,0 +1,2 @@
+{1:}program CFtest;type{2:}eightbits=0..255;{:2}{:1}{3:}
+begin writeln('This is CFtest');end.{:3}
diff --git a/Build/source/texk/web2c/configure.in.orig b/Build/source/texk/web2c/configure.in.orig
new file mode 100644
index 00000000000..d1034db49ad
--- /dev/null
+++ b/Build/source/texk/web2c/configure.in.orig
@@ -0,0 +1,502 @@
+dnl Process this file with Autoconf to produce a configure script for Web2c.
+dnl
+dnl Some things are no longer configurable:
+dnl - SMALL{TeX,MF,BibTeX}: too painful to maintain the separate patch
+dnl files, and, for TeX, texmfmem.h would have to be fixed to support
+dnl more than 256 fonts.
+dnl - NONASCII: necessary for the character translation feature.
+dnl - REGFIX: modern compilers mostly ignore register declarations, anyway.
+dnl The code for these things remains (where applicable), so you can
+dnl get these features if you are willing to hack the sources. If not,
+dnl it'll take a good argument to convince me to invest the time to make
+dnl them configurable.
+dnl
+dnl We don't use (for example) tex/tex.web because people who only want
+dnl to build part of the distribution may not have any given program.
+dnl Even main.c isn't guaranteed, but then nothing is, really ...
+AC_INIT(web2c/main.c)
+
+WEB2CVERSION=7.5.7
+AC_SUBST(WEB2CVERSION)
+AC_DEFINE_UNQUOTED(WEB2CVERSION," (Web2C $WEB2CVERSION)")
+
+dnl Write output here, instead of putting a zillion -D's on the command line.
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in],
+ [sed 's/^#define PACKAGE_/#define WEB2C_PACKAGE_/' c-auto.h >c-auto.tmp && mv -f c-auto.tmp c-auto.h
+ date >stamp-auto])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+AC_PROG_YACC
+AC_PROG_LEX
+# Work around a problem with Flex Version 2.5.31 which needs -l flag.
+# Since all recent versions of flex support -l, don't check for the
+# specific version, but check that at least "--version" is supported.
+# We also want to catch LEX=/some/where/flex, so:
+case $LEX in
+ *flex) $LEX --version >/dev/null 2>&1 && LEX="$LEX -l" ;;
+esac
+AC_PROG_RANLIB
+AC_CHECK_HEADERS(sys/time.h sys/timeb.h locale.h)
+AC_CHECK_FUNCS(strerror gettimeofday ftime mkstemp mktemp setlocale strlcat strlcpy fmax)
+
+AC_TYPE_SIGNAL
+
+pb_AC_ASM_UNDERSCORE
+
+dnl pdfTeX likes inline functions in C code.
+AC_C_INLINE
+
+dnl These are standard among *NIX systems, but not when cross-compiling
+AC_DEFUN([CF_SUBST],
+[AC_MSG_CHECKING(for $1 (symbol $2))
+AC_CACHE_VAL(cf_cv_subst_$2,[
+test -z "[$]$2" && $2=$3
+cf_cv_subst_$2=[$]$2])
+$2=${cf_cv_subst_$2}
+AC_MSG_RESULT([$]$2)
+AC_SUBST($2)
+])dnl
+CF_SUBST(loader,LD,ld)
+CF_SUBST(archiver,AR,ar)
+CF_SUBST(archiver options,ARFLAGS,rc)
+
+# Needed on A/UX 3.0. I don't want to pull in other -lposix's, though.
+# From: bernt@weinberg.pop.bio.aau.dk (Bernt Guldbrandtsen)
+if test `(uname) 2>/dev/null` = aux; then
+ AC_CHECK_LIB(posix, sigemptyset)
+fi
+
+dnl These tests prevent reliable cross-compilation. Sigh.
+dnl Some special hacks are used to make cross-compilation
+dnl succeed in one special case.
+
+AC_UNSET_CC
+AC_C_CHAR_UNSIGNED
+AC_C_BIGENDIAN
+AC_CHECK_SIZEOF(long)
+AC_RESET_CC
+
+# --with and --enable options.
+test "x$with_x_toolkit" = xyes && with_x=yes
+test "x$with_x_toolkit" = xxt && with_x=yes
+test "x$with_x_toolkit" = xathena && with_x=yes
+test "x$with_x" = xno && with_x_toolkit=no
+
+: ${with_x=no} # tell PATH_XTRA no X by default, if not specified.
+
+sinclude(withenable.ac)
+sinclude(../kpathsea/withenable.ac)
+sinclude(../../libs/zlib/withenable.ac)
+sinclude(../../libs/libpng/withenable.ac)
+sinclude(../../libs/zlib/zlib.ac)
+sinclude(../../libs/libpng/libpng.ac)
+sinclude(../../libs/xpdf/libxpdf.ac)
+sinclude(../../libs/obsdcompat/libobsd-compat.ac)
+sinclude(../../libs/freetype2/withenable.ac)
+sinclude(../../libs/freetype2/freetype2.ac)
+sinclude(../../libs/teckit/withenable.ac)
+sinclude(../../libs/teckit/teckit.ac)
+sinclude(../../libs/icu-xetex/withenable.ac)
+sinclude(../../libs/icu-xetex/icu-xetex.ac)
+sinclude(../../libs/graphite-engine/withenable.ac)
+sinclude(../../libs/graphite-engine/graphite-engine.ac)
+
+# Whether to build mf-nowin.
+: ${with_mf_nowin=no} # Default.
+if test "x$with_mf_nowin" = xyes; then
+ MFN=
+else
+ MFN='#! '
+fi
+AC_SUBST(MFN)
+
+# For Omega.
+if test -d $srcdir/omegadir; then
+ test "${with_omega+set}" = set || with_omega=yes
+else
+ if test "x$with_omega" = xyes; then
+ AC_MSG_WARN(The Omega sources are not available.)
+ fi
+ with_omega=no
+fi
+if test "x$with_omega" = xyes; then
+ OMEGA=
+ KPSE_CONFIG_FILES([omegafonts/Makefile otps/Makefile])
+else
+ OMEGA='#! '
+fi
+AC_SUBST(OMEGA)
+
+# For Aleph
+if test -d $srcdir/alephdir && test -d $srcdir/omegadir; then
+ test "${with_aleph+set}" = set || with_aleph=yes
+else
+ if test "x$with_aleph" = xyes; then
+ AC_MSG_WARN(The Aleph sources are not available.)
+ fi
+ with_aleph=no
+fi
+if test "x$with_aleph" = xyes; then
+ ALEPH=
+else
+ ALEPH='#! '
+fi
+AC_SUBST(ALEPH)
+
+# For pdfTeX.
+if test -d $srcdir/pdftexdir; then
+ # Create build dir, if necessary.
+ test -d pdftexdir || mkdir pdftexdir
+ test "${with_pdftex+set}" = set || with_pdftex=yes
+else
+ if test "x$with_pdftex" = xyes; then
+ AC_MSG_WARN(The pdfTeX sources are not available.)
+ fi
+ with_pdftex=no
+fi
+
+# For pdfeTeX
+if test -d $srcdir/pdftexdir; then
+ test "${with_pdfetex+set}" = set || with_pdfetex=yes
+else
+ if test "x$with_pdfetex" = xyes; then
+ AC_MSG_WARN(Not all sources of pdfeTeX are available.)
+ fi
+ with_pdfetex=no
+fi
+
+# For luaTeX.
+if test -d $srcdir/luatexdir; then
+ # Create build dir, if necessary.
+ test -d luatexdir || mkdir luatexdir
+ test "${with_luatex+set}" = set || with_luatex=yes
+else
+ if test "x$with_luatex" = xyes; then
+ AC_MSG_WARN(The luaTeX sources are not available.)
+ fi
+ with_luatex=no
+fi
+
+# For XeTeX
+if test -d $srcdir/xetexdir \
+ && test -d $srcdir/etexdir; then
+ test "${with_xetex+set}" = set || with_xetex=yes
+else
+ if test "x$with_xetex" = xyes; then
+ AC_MSG_WARN(Not all sources of XeTeX are available.)
+ fi
+ with_xetex=no
+fi
+
+# Check whether C++ compiler works. Prevent exit if it doesn't.
+if test "x$with_pdftex" = xyes ||
+ test "x$with_luatex" = xyes ||
+ test "x$with_pdfetex" = xyes ||
+ test "x$with_xetex" = xyes
+then
+ # First test whether the compiler works in a subshell, and if so,
+ # do it again in the main shell so we see the result.
+(
+ AC_PROG_CXX
+) && {
+ AC_PROG_CXX
+} || {
+ test "x$with_pdftex" = xyes \
+ && AC_MSG_WARN(No C++ compiler: pdfTeX will not be compiled.)
+ test "x$with_pdfetex" = xyes \
+ && AC_MSG_WARN(No C++ compiler: pdfeTeX will not be compiled.)
+ test "x$with_luatex" = xyes \
+ && AC_MSG_WARN(No C++ compiler: luaTeX will not be compiled.)
+ test "x$with_xetex" = xyes \
+ && AC_MSG_WARN(No C++ compiler: XeTeX will not be compiled.)
+ with_pdftex=no
+ with_pdfetex=no
+ with_luatex=no
+ with_xetex=no
+ true
+}
+fi
+
+# Check if we can link the C++ runtime lib statically, if we're building
+# some binary that will need it. And, only try the magic hack, if C++ is
+# GNU C++ (i.e. if $ac_cv_prog_gxx=yes). The reason for using a static
+# C++ runtime is that binaries are more portable. That's important only
+# if you are distributing binaries, so it is disabled by default.
+#
+flags_try1='-nodefaultlibs -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm -lgcc_eh -lgcc -lc -lgcc_eh -lgcc'
+flags_try2='-nodefaultlibs -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm -lgcc -lc -lgcc'
+CXXLDEXTRA=
+CXXHACKLINK='$(kpathsea_cxx_link)'
+CXXHACKLDLIBS='$(LOADLIBES)'
+if test "x$with_cxx_runtime_hack" = xyes &&
+ { test "x$with_pdftex" = xyes ||
+ test "x$with_luatex" = xyes ||
+ test "x$with_pdfetex" = xyes ||
+ test "x$with_xetex" = xyes; }
+then
+ AC_MSG_CHECKING(for statically linking C++ runtime library)
+
+ cpp_link_hack=false
+ old_flags=$flags
+ old_ac_ext=$ac_ext
+ old_ac_link=$ac_link
+ if test "$ac_cv_prog_gxx" = yes; then
+
+ # New C++ compilers choke on <iostream.h>, thanks to the
+ # backward-incompatible standard. At this point, our code is
+ # using the new-style <iostream>, and so our test should follow suit.
+ #
+ ac_ext=C
+ cat > conftest.$ac_ext << EOF
+#include <iostream>
+ using namespace std;
+int main()
+{
+ cout <<"worksok\n";
+}
+EOF
+ for flags in "$flags_try1" "$flags_try2"; do
+ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS $flags 1>&5'
+ if { (eval echo configure: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ case `(./conftest; exit) 2>/dev/null` in
+ worksok)
+ cpp_link_hack=true; break;;
+ esac
+ else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ done
+ fi
+
+ if $cpp_link_hack; then
+ CXXLDEXTRA=$flags
+ CXXHACKLINK='$(cxx_link_command)'
+ CXXHACKLDLIBS='$(proglib) $(kpathsea_dir)/.libs/libkpathsea.a $(LIBS) $(XLOADLIBES)'
+ AC_MSG_RESULT(ok using $flags)
+ else
+ AC_MSG_RESULT(not supported)
+ fi
+
+ flags=$old_flags
+ ac_ext=$old_ac_ext
+ ac_link=$old_ac_link
+fi
+AC_SUBST(CXXLDEXTRA)
+AC_SUBST(CXXHACKLINK)
+AC_SUBST(CXXHACKLDLIBS)
+
+if test "x$with_pdftex" = xyes; then
+ PTEX=
+else
+ PTEX='#! '
+fi
+AC_SUBST(PTEX)
+
+if test "x$with_pdfetex" = xyes; then
+ PETEX=
+else
+ PETEX='#! '
+fi
+AC_SUBST(PETEX)
+
+if test "x$with_luatex" = xyes; then
+ LTEX=
+else
+ LTEX='#! '
+fi
+AC_SUBST(LTEX)
+
+if test "x$with_xetex" = xyes; then
+ XETEX=
+else
+ XETEX='#! '
+fi
+AC_SUBST(XETEX)
+
+sinclude(xetexdir/withenable.ac)
+sinclude(xetexdir/tests.ac)
+
+sinclude(xetexdir/acx_pthread.m4)
+ACX_PTHREAD
+
+# the following is for OpenBSD, where the PTHREAD_CFLAGS setting is defeated by -nodefaultlibs in the xetex link;
+# similar hackery might be needed on other systems (groan) -- JK 2007-01-07
+case "${host}" in
+*-*-*bsd*)
+ if test "x$PTHREAD_LIBS" = "x"; then
+ PTHREAD_LIBS="-lpthread"
+ fi ;;
+esac
+
+if test "x$with_xetex" = xyes; then
+ AC_HAS_CARBON
+
+ if test "x$has_carbon" = "xyes"; then
+ XETEX_MACOSX=
+ XETEX_GENERIC='#! '
+ else
+ XETEX_MACOSX='#! '
+ XETEX_GENERIC=
+
+ AC_HAS_LIBFONTCONFIG
+ if test "x$LDFONTCONFIG" = "x"; then
+ AC_MSG_ERROR([
+Cannot build XeTeX without libfontconfig.
+Use the --with-fontconfig=DIR option to specify the prefix where
+fontconfig is installed.
+ ])
+ fi
+ AC_SUBST(FONTCONFIGCPPFLAGS)
+ AC_SUBST(FONTCONFIGLDFLAGS)
+ AC_SUBST(LDFONTCONFIG)
+ fi
+ AC_SUBST(XETEX_MACOSX)
+ AC_SUBST(XETEX_GENERIC)
+
+ if test "x$with_graphite" = xno; then
+ XETEX_GRAPHITE='#! '
+ else
+ XETEX_GRAPHITE=
+ fi
+ AC_SUBST(XETEX_GRAPHITE)
+fi
+
+
+# For e-TeX, three choices: no, yes, and tex. In the latter case, we
+# have to comment out the normal TeX build (TEX), as well as enable the
+# e-TeX build (ETEX) and the replacement of TeX with e-TeX in compatibilty
+# mode(CTEX).
+if test -d $srcdir/etexdir; then
+ # Create build dir, if necessary.
+ test -d etexdir || mkdir etexdir
+ test "${with_etex+set}" = set || with_etex=yes
+else
+ if test "x$with_etex" = xyes; then
+ AC_MSG_WARN(The e-TeX sources are not available.)
+ fi
+ with_etex=no
+fi
+if test "x$with_etex" = xyes; then
+ ETEX=
+else
+ ETEX='#! '
+fi
+AC_SUBST(ETEX)
+
+
+# --with-x* options: Distinguish no X at all, no toolkit, or toolkit.
+AC_PATH_XTRA
+if test "x$with_x" = xyes; then
+ if test -n "$x_libraries"; then
+ XLFLAG="-L$x_libraries"
+ wlibs="-lX11 $wlibs $XLFLAG"
+ else
+ wlibs="-lX11 $wlibs"
+ fi
+ if test -z "$x_ext_lib"; then # allow envvar override
+ AC_CHECK_LIB(Xext, XextCreateExtension,
+ x_ext_lib=-lXext, :, $wlibs $X_EXTRA_LIBS $XLFLAG)
+ fi
+ if test "x$with_mf_x_toolkit" = xno; then
+ wfile=x11-Xlib.c
+ else
+ # Effectively demote --with-x-toolkit=athena to xt since
+ # the code does not distinguish.
+ x_tool_libs="-lXt $x_tool_libs"
+ wfile=x11-Xt.c
+ fi
+ test -d window || mkdir window
+ case "$srcdir" in
+ /*) wfile=$srcdir/window/$wfile;;
+ .) ;;
+ *) wfile=../$srcdir/window/$wfile;;
+ esac
+ (cd window && (rm -f x11.c; $LN_S $wfile x11.c))
+ AC_DEFINE([X11WIN], 1, [Define to include X11 window in Metafont.])
+fi
+AC_SUBST(x_ext_lib)
+AC_SUBST(x_tool_libs)
+AC_SUBST(wlibs)
+
+if test "x$enable_fmtutil" = xyes; then
+ FMU='# '
+else
+ FMU=
+fi
+AC_SUBST(FMU)
+
+# Don't bother with pdflib unless pdf*TeX is requested.
+if test "$with_pdftex" = yes || \
+ test "$with_pdfetex" = yes
+then
+ KPSE_CONFIG_FILES([pdftexdir/Makefile])
+fi
+
+# Ditto luatex.
+if test "$with_luatex" = yes; then
+ KPSE_CONFIG_FILES([luatexdir/Makefile])
+fi
+
+dnl Create tests subdirectory.
+test -d tests || mkdir tests
+
+# Is libm present. FIXME: do we need it at all?
+AC_CHECK_LIB(m, main)
+
+# For cross-compilation. Put at the end so there is a fair chance
+# these are still visible when the configure script has finished.
+
+# The variables we need to build binaries that will run on the build
+# machine: BUILDCC, BUILDCFLAGS, BUILDCCLD.
+KPSE_CROSS_BUILD_VAR(CC, cc)
+KPSE_CROSS_BUILD_VAR(CFLAGS, $(BUILDXCFLAGS))
+KPSE_CROSS_BUILD_VAR(CPPFLAGS, $(BUILDXCPPFLAGS))
+KPSE_CROSS_BUILD_VAR(LDFLAGS, $(BUILDXLDFLAGS))
+KPSE_CROSS_BUILD_VAR(CCLD, $(BUILDCC))
+
+# And supporting programs we need to have available on the build
+# machine.
+KPSE_CROSS_PATH_PROG(TANGLEBOOT, tangle, ./tangleboot)
+KPSE_CROSS_PATH_PROG(TANGLE, tangle, ./tangle)
+KPSE_CROSS_PATH_PROG(CTANGLEBOOT, ctangle, ./ctangleboot)
+KPSE_CROSS_PATH_PROG(CTANGLE, ctangle, ./ctangle)
+KPSE_CROSS_PATH_PROG(TIE, tie, ./tie)
+if test "x$with_omega" = xyes || test "x$with_aleph" = xyes || test "x$with_xetex" = xyes; then
+KPSE_CROSS_PATH_PROG(OTANGLE, otangle, ./otangle)
+fi
+
+AH_TOP([/* c-auto.h: defines for web2c, as determined by configure.
+
+ Copyright 1994-97, 2008 Karl Berry.
+ Copyright 1997-99, 2002, 2005 Olaf Weber.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Guard against double inclusion. */
+#ifndef WEB2C_C_AUTO_H
+#define WEB2C_C_AUTO_H
+
+/* web2c: the version string. */
+#define WEB2CVERSION "REPLACE-WITH-WEB2CVERSION"])
+AH_BOTTOM([#endif /* !WEB2C_C_AUTO_H */])
+
+dnl Generate `Makefile's, `config.status', and our header file.
+KPSE_CONFIG_FILES([Makefile doc/Makefile lib/Makefile man/Makefile mpware/Makefile
+ mpdir/Makefile web2c/Makefile window/Makefile])
+AC_OUTPUT
diff --git a/Build/source/texk/web2c/doc/Makefile.in.orig b/Build/source/texk/web2c/doc/Makefile.in.orig
new file mode 100644
index 00000000000..f6ba92e8582
--- /dev/null
+++ b/Build/source/texk/web2c/doc/Makefile.in.orig
@@ -0,0 +1,64 @@
+# @configure_input@
+# Makefile for Web2c documentation.
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include kpathsea.mk
+kpse_include ../make/texi.mk
+
+info: web2c.info
+dvi: web2c.dvi
+
+web2c.info: install.texi ref.txi
+all: web2c.info web2c.dvi
+
+@MAINT@INSTALL: install.texi
+@MAINT@ $(MAKEINFO) $(one_info) $(MAKEINFO_FLAGS) $< -o $@
+@MAINT@ $(SHELL) $(top_srcdir)/../add-info-toc $@
+@MAINT@doc: info INSTALL
+@MAINT@
+@MAINT@ref.txi: ref.bbl
+@MAINT@ sed -e 's/~/ /g' \
+@MAINT@ -e 's/\\[-`'\''"c^]//g' \
+@MAINT@ -e 's/\\emdash */---/g' \
+@MAINT@ -e 's/metapost/MetaPost/g' \
+@MAINT@ -e 's/\\MF/Metafont/g' \
+@MAINT@ -e 's/\\METAFONT/METAFONT/g' \
+@MAINT@ -e 's/\\TUB/TUGboat/g' \
+@MAINT@ -e 's/\\LaTeX/La@TeX/g' \
+@MAINT@ -e 's/\\AMSTEX/AMS@TeX/g' \
+@MAINT@ -e 's/\\AmSTeX/AMS@TeX/g' \
+@MAINT@ -e 's/\\TeX/@TeX/g' \
+@MAINT@ -e 's/\\noopsort{[^}]*}//g' \
+@MAINT@ -e 's/[{}\]//g' \
+@MAINT@ -e 's/@\[/{/g' \
+@MAINT@ -e 's/@\]/}/g' \
+@MAINT@ -e 's/@TeX/@TeX{}/g' \
+@MAINT@ $< >$@
+@MAINT@
+@MAINT@ref.bbl: ref.aux texinfo.bst
+@MAINT@ -bibtex ref
+@MAINT@
+@MAINT@ref.aux: ref.tex
+@MAINT@ rm -f ref.bbl
+@MAINT@ tex '\nonstopmode \input ref'
+
+Makefile: Makefile.in ../config.status
+ cd .. && $(SHELL) config.status
+
+install: install-exec install-data
+install-exec:
+install-data: web2c.info
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(infodir)
+ $(INSTALL_DATA) $(srcdir)/web2c.i* $(infodir)/
+#
+ $(POST_INSTALL)
+ if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
+ install-info --info-dir=$(infodir) $(infodir)/web2c.info; \
+ else true; fi
+
+check: all
+
+#html: texi2html -expandinfo -number -menu -split_chapter
+
+kpse_include ../make/clean.mk
diff --git a/Build/source/texk/web2c/etexdir/am/etex.am b/Build/source/texk/web2c/etexdir/am/etex.am
new file mode 100644
index 00000000000..e334bc23b3f
--- /dev/null
+++ b/Build/source/texk/web2c/etexdir/am/etex.am
@@ -0,0 +1,77 @@
+## texk/web2c/etexdir/am/etex.am: Makefile fragment for e-TeX.
+
+## e-TeX
+##
+if ETEX
+bin_PROGRAMS += etex
+endif ETEX
+
+etex_CPPFLAGS =
+
+## With --enable-ipc, e-TeX may need to link with -lsocket.
+etex_LDADD = $(LDADD) $(socketlibs)
+
+etex_c_h = etexini.c etex0.c etex1.c etex2.c etexcoerce.h etexd.h
+nodist_etex_SOURCES = $(etex_c_h) etex-pool.c etexextra.c etexdir/etexextra.h
+$(etex_c_h): etex-web2c
+etex-web2c: etex.p $(web2c_texmf)
+ $(web2c) etex
+ : $(synctex_convert_etex)
+ echo timestamp >$@
+ touch $(etex_c_h)
+etexextra.c: etexdir/etexextra.h lib/texmfmp.c etexd.h
+ sed s/TEX-OR-MF-OR-MP/etex/ $(srcdir)/lib/texmfmp.c >$@
+etex.p etex.pool: etex-tangle
+etex-tangle: tangle etex.web etex.ch
+ $(tangle) etex etex
+ echo timestamp >$@
+ touch etex.p etex.pool
+etex-pool.c: etex.pool $(makecpool) tmf-pool.h
+ $(makecpool) etex.pool $(srcdir)/tmf-pool.h >$@ || rm -f $@
+## Extract etex version
+etexdir/etex.version: etexdir/etex.ch
+ $(mkdir_p) etexdir
+ grep '^@d eTeX_version_string==' $(srcdir)/etexdir/etex.ch \
+ | sed "s/^.*'-//;s/'.*$$//" >etexdir/etex.version
+etexdir/etexextra.h: etexdir/etexextra.in etexdir/etex.version
+ sed s/ETEX-VERSION/`cat etexdir/etex.version`/ \
+ $(srcdir)/etexdir/etexextra.in >$@
+## Generate etex.web
+etex.web: $(TIE) $(etex_web_srcs)
+ $(tie) -m etex.web $(etex_web_srcs)
+etex_web_srcs = \
+ tex.web \
+ etexdir/etex.ch \
+ etexdir/etex.fix
+## Generate etex.ch
+etex.ch: $(TIE) etex.web $(etex_ch_srcs)
+ $(tie) -c etex.ch etex.web $(etex_ch_srcs)
+
+etex_ch_srcs = \
+ etexdir/tex.ch0 \
+ tex.ch \
+ $(etex_ch_synctex) \
+ etexdir/tex.ch1 \
+ etexdir/tex.ech \
+ etexdir/etex-binpool.ch
+##
+EXTRA_DIST += $(etex_web_srcs) $(etex_ch_srcs) etexdir/etexextra.in \
+ lib/texmfmp.c tmf-pool.h
+
+DISTCLEANFILES += $(nodist_etex_SOURCES) etex.web etex.ch etex-web2c \
+ etex.p etex.pool etex-tangle etexdir/etex.version
+
+EXTRA_DIST += \
+ etexdir/ChangeLog \
+ etexdir/INSTALL \
+ etexdir/README \
+ etexdir/etex_gen.tex
+
+## Not used
+##
+EXTRA_DIST += etexdir/etex.mak
+
+## Eventually delete these files
+##
+EXTRA_DIST += etexdir/etex.mk
+
diff --git a/Build/source/texk/web2c/luatexdir/am/luatex.am b/Build/source/texk/web2c/luatexdir/am/luatex.am
new file mode 100644
index 00000000000..6dbeee810fd
--- /dev/null
+++ b/Build/source/texk/web2c/luatexdir/am/luatex.am
@@ -0,0 +1,564 @@
+## texk/web2c/luatexdir/am/luatex.am: Makefile fragment for luaTeX.
+
+## luaTeX
+##
+if LUATEX
+bin_PROGRAMS += luatex
+endif LUATEX
+
+## Force Automake to use CXXLD for linking
+nodist_EXTRA_luatex_SOURCES = dummy.cxx
+
+luatex_tangle = WEBINPUTS=$(srcdir)/luatexdir $(buildenv) $(LUATANGLE)
+
+luatex_CPPFLAGS = $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) $(XPDF_INCLUDES)
+luatex_CPPFLAGS += $(OBSDCOMPAT_INCLUDES) -I$(srcdir)/libmd5
+luatex_CPPFLAGS += -Iluatexdir -I$(srcdir)/luatexdir -I$(srcdir)/luatexdir/lua51
+luatex_CPPFLAGS += -Dextra_version_info=`date +-%Y%m%d%H`
+
+luatex_ldadd = libluatex.a libff.a libluamisc.a libzzip.a liblua51.a
+luatex_ldadd += $(LIBPNG_LIBS) $(ZLIB_LIBS) $(XPDF_LIBS)
+luatex_ldadd += $(OBSDCOMPAT_LIBS) libmd5.a
+
+luatex_LDADD = $(luatex_ldadd) $(LDADD) $(socketlibs)
+
+luatex_DEPENDENCIES = $(proglib) libluatex.a
+luatex_DEPENDENCIES += $(LIBPNG_DEPEND) $(ZLIB_DEPEND) $(XPDF_DEPEND)
+luatex_DEPENDENCIES += $(OBSDCOMPAT_DEPEND) libmd5.a
+
+luatex_c_h = luatexini.c luatex0.c luatex1.c luatex2.c luatex3.c luatexcoerce.h luatexd.h
+nodist_luatex_SOURCES = $(luatex_c_h) luatex-pool.c luatexextra.c luatexdir/luatexextra.h
+$(luatex_c_h): luatex-web2c
+luatex-web2c: luatex.p $(web2c_texmf) luatexdir/luatex.defines
+ $(web2c) luatex
+ echo timestamp >$@
+ touch $(luatex_c_h)
+luatexextra.c: luatexd.h luatexdir/luatexextra.h lib/texmfmp.c
+ sed s/TEX-OR-MF-OR-MP/luatex/ $(srcdir)/lib/texmfmp.c >$@
+luatex_sources = luatexdir/luatex.web luatexdir/luatex.ch
+luatex.p luatex.pool: luatex-tangle
+luatex-tangle: luatangle $(luatex_sources)
+ $(luatex_tangle) --underlines luatex luatex
+ echo timestamp >$@
+ touch luatex.p luatex.pool
+luatex-pool.c: luatex.pool $(makecpool) luatexdir/ptexlib.h luatexd.h
+ $(makecpool) luatex.pool luatexdir/ptexlib.h >$@ || rm -f $@
+## Extract luatex version
+luatexdir/luatex.version: luatexdir/luatex.web
+ $(mkdir_p) luatexdir
+ grep '^@d luatex_version_string==' $(srcdir)/luatexdir/luatex.web \
+ | sed "s/^.*=='//;s/'.*$$//" >luatexdir/luatex.version
+luatexdir/luatexextra.h: luatexdir/luatexextra.in luatexdir/luatex.version
+ sed -e s/LUATEX-VERSION/`cat luatexdir/luatex.version`/ \
+ $(srcdir)/luatexdir/luatexextra.in >$@
+
+EXTRA_DIST += $(luatex_sources) \
+ luatexdir/luatex.defines \
+ luatexdir/luatexextra.in \
+ luatexdir/ptexlib.h
+
+DISTCLEANFILES += $(nodist_luatex_SOURCES) luatex-web2c \
+ luatex.p luatex.pool luatex-tangle luatexdir/luatex.version
+
+## luatangle
+##
+if LUATEX
+bin_PROGRAMS += luatangle
+endif LUATEX
+
+nodist_luatangle_SOURCES = luatangle.c luatangle.h
+luatangle.c luatangle.h: $(web2c_common) $(web2c_programs) luatangle.p
+ $(web2c) luatangle
+EXTRA_DIST += $(luatangle_sources)
+luatangle_sources = luatexdir/luatangle.web luatexdir/luatangle.ch
+luatangle.p: tangle $(luatangle_sources)
+ WEBINPUTS=$(srcdir)/luatexdir $(buildenv) $(TANGLE) luatangle luatangle
+DISTCLEANFILES += luatangle.c luatangle.h luatangle.p
+
+## liblua51
+##
+EXTRA_LIBRARIES += liblua51.a
+
+liblua51_a_CPPFLAGS = -I$(top_srcdir)/luatexdir/lua51
+if !MINGW32
+liblua51_a_CPPFLAGS += -DLUA_USE_POSIX
+endif !MINGW32
+
+liblua51_a_SOURCES = \
+ luatexdir/lua51/lapi.c \
+ luatexdir/lua51/lapi.h \
+ luatexdir/lua51/lauxlib.c \
+ luatexdir/lua51/lauxlib.h \
+ luatexdir/lua51/lbaselib.c \
+ luatexdir/lua51/lcoco.c \
+ luatexdir/lua51/lcoco.h \
+ luatexdir/lua51/lcode.c \
+ luatexdir/lua51/lcode.h \
+ luatexdir/lua51/ldblib.c \
+ luatexdir/lua51/ldebug.c \
+ luatexdir/lua51/ldebug.h \
+ luatexdir/lua51/ldo.c \
+ luatexdir/lua51/ldo.h \
+ luatexdir/lua51/ldump.c \
+ luatexdir/lua51/lfunc.c \
+ luatexdir/lua51/lfunc.h \
+ luatexdir/lua51/lgc.c \
+ luatexdir/lua51/lgc.h \
+ luatexdir/lua51/linit.c \
+ luatexdir/lua51/liolib.c \
+ luatexdir/lua51/llex.c \
+ luatexdir/lua51/llex.h \
+ luatexdir/lua51/llimits.h \
+ luatexdir/lua51/lmathlib.c \
+ luatexdir/lua51/lmem.c \
+ luatexdir/lua51/lmem.h \
+ luatexdir/lua51/loadlib.c \
+ luatexdir/lua51/lobject.c \
+ luatexdir/lua51/lobject.h \
+ luatexdir/lua51/lopcodes.c \
+ luatexdir/lua51/lopcodes.h \
+ luatexdir/lua51/loslib.c \
+ luatexdir/lua51/lparser.c \
+ luatexdir/lua51/lparser.h \
+ luatexdir/lua51/lstate.c \
+ luatexdir/lua51/lstate.h \
+ luatexdir/lua51/lstring.c \
+ luatexdir/lua51/lstring.h \
+ luatexdir/lua51/lstrlib.c \
+ luatexdir/lua51/ltable.c \
+ luatexdir/lua51/ltable.h \
+ luatexdir/lua51/ltablib.c \
+ luatexdir/lua51/ltm.c \
+ luatexdir/lua51/ltm.h \
+ luatexdir/lua51/lua.h \
+ luatexdir/lua51/luaconf.h \
+ luatexdir/lua51/lualib.h \
+ luatexdir/lua51/lundump.c \
+ luatexdir/lua51/lundump.h \
+ luatexdir/lua51/lvm.c \
+ luatexdir/lua51/lvm.h \
+ luatexdir/lua51/lzio.c \
+ luatexdir/lua51/lzio.h
+
+## Not used
+##
+EXTRA_DIST += \
+ luatexdir/lua51/Makefile \
+ luatexdir/lua51/lua.c \
+ luatexdir/lua51/luac.c \
+ luatexdir/lua51/print.c
+
+## zziplib
+##
+EXTRA_LIBRARIES += libzzip.a
+
+libzzip_a_DEPENDENCIES = liblua51.a
+
+libzzip_a_CPPFLAGS = \
+ $(KPSE_ZLIB_INCLUDES) \
+ -I$(top_srcdir)/luatexdir/zziplib
+
+libzzip_a_SOURCES = \
+ luatexdir/zziplib/zzip/__debug.h \
+ luatexdir/zziplib/zzip/__dirent.h \
+ luatexdir/zziplib/zzip/__fnmatch.h \
+ luatexdir/zziplib/zzip/__hints.h \
+ luatexdir/zziplib/zzip/__mmap.h \
+ luatexdir/zziplib/zzip/_config.h \
+ luatexdir/zziplib/zzip/conf.h \
+ luatexdir/zziplib/zzip/dir.c \
+ luatexdir/zziplib/zzip/err.c \
+ luatexdir/zziplib/zzip/fetch.c \
+ luatexdir/zziplib/zzip/fetch.h \
+ luatexdir/zziplib/zzip/file.c \
+ luatexdir/zziplib/zzip/file.h \
+ luatexdir/zziplib/zzip/format.h \
+ luatexdir/zziplib/zzip/info.c \
+ luatexdir/zziplib/zzip/info.h \
+ luatexdir/zziplib/zzip/lib.h \
+ luatexdir/zziplib/zzip/memdisk.c \
+ luatexdir/zziplib/zzip/memdisk.h \
+ luatexdir/zziplib/zzip/mmapped.c \
+ luatexdir/zziplib/zzip/mmapped.h \
+ luatexdir/zziplib/zzip/plugin.c \
+ luatexdir/zziplib/zzip/plugin.h \
+ luatexdir/zziplib/zzip/stdint.h \
+ luatexdir/zziplib/zzip/stat.c \
+ luatexdir/zziplib/zzip/types.h \
+ luatexdir/zziplib/zzip/write.c \
+ luatexdir/zziplib/zzip/zip.c \
+ luatexdir/zziplib/zzip/zzip.h
+
+EXTRA_DIST += \
+ luatexdir/zziplib/COPYING.LIB \
+ luatexdir/zziplib/ChangeLog \
+ luatexdir/zziplib/README \
+ luatexdir/zziplib/TODO \
+ luatexdir/zziplib/zziplib.spec
+
+## Not used
+##
+EXTRA_DIST += \
+ luatexdir/zziplib/Makefile.am \
+ luatexdir/zziplib/Makefile.in \
+ luatexdir/zziplib/Makefile.mk \
+ luatexdir/zziplib/SDL \
+ luatexdir/zziplib/aclocal.m4 \
+ luatexdir/zziplib/bins \
+ luatexdir/zziplib/config.h.in \
+ luatexdir/zziplib/configure \
+ luatexdir/zziplib/configure.ac \
+ luatexdir/zziplib/docs \
+ luatexdir/zziplib/m4 \
+ luatexdir/zziplib/msvc6 \
+ luatexdir/zziplib/msvc7 \
+ luatexdir/zziplib/msvc8 \
+ luatexdir/zziplib/test \
+ luatexdir/zziplib/uses \
+ luatexdir/zziplib/zzip/Makefile \
+ luatexdir/zziplib/zzip/Makefile.am \
+ luatexdir/zziplib/zzip/Makefile.in \
+ luatexdir/zziplib/zzip/_msvc.h \
+ luatexdir/zziplib/zzip/_msvc.sed \
+ luatexdir/zziplib/zzip/autoconf.h \
+ luatexdir/zziplib/zzip/fseeko.c \
+ luatexdir/zziplib/zzip/fseeko.h \
+ luatexdir/zziplib/zzip/zziplib.wpj \
+ luatexdir/zziplib/zzipback.sed \
+ luatexdir/zziplib/zzipwrap
+
+## libluamisc (luafilesystem, luamd5, luapeg, luazip, luazlib,
+## and slnunicode)
+EXTRA_LIBRARIES += libluamisc.a
+
+libluamisc_a_DEPENDENCIES = $(KPSE_ZLIB_DEPEND) libzzip.a
+
+libluamisc_a_CPPFLAGS = \
+ $(KPSE_ZLIB_INCLUDES) \
+ -I$(top_srcdir)/luatexdir/lua51 \
+ -I$(top_srcdir)/luatexdir/zziplib
+
+libluamisc_a_SOURCES = \
+ luatexdir/luafilesystem/src/lfs.c \
+ luatexdir/luafilesystem/src/lfs.h \
+ luatexdir/luamd5/md5.c \
+ luatexdir/luamd5/md5.h \
+ luatexdir/luamd5/md5lib.c \
+ luatexdir/luapeg/lpeg.c \
+ luatexdir/luazip/src/luazip.c \
+ luatexdir/luazip/src/luazip.h \
+ luatexdir/luazlib/lgzip.c \
+ luatexdir/luazlib/lzlib.c \
+ luatexdir/slnunicode/slnunico.c
+
+## Included by slnunico.c
+EXTRA_libluamisc_a_SOURCES = luatexdir/slnunicode/slnudata.c
+
+## Not used
+##
+EXTRA_DIST += \
+ luatexdir/luafilesystem/Makefile \
+ luatexdir/luafilesystem/config \
+ luatexdir/luafilesystem/doc \
+ luatexdir/luafilesystem/tests \
+ luatexdir/luafilesystem/vc6 \
+ luatexdir/luamd5/makefile \
+ luatexdir/luamd5/md5.html \
+ luatexdir/luamd5/md5.lua \
+ luatexdir/luamd5/md5tests.lua \
+ luatexdir/luazip/Makefile \
+ luatexdir/luazip/README \
+ luatexdir/luazip/config \
+ luatexdir/luazip/doc \
+ luatexdir/luazip/tests \
+ luatexdir/luazip/vc6 \
+ luatexdir/luazip/vc7 \
+ luatexdir/luazlib/Makefile \
+ luatexdir/luazlib/README \
+ luatexdir/luazlib/gzip.lua \
+ luatexdir/luazlib/test_gzip.lua \
+ luatexdir/luazlib/test_zlib.lua \
+ luatexdir/luazlib/zlib.lua \
+ luatexdir/slnunicode/unitest
+
+## luafontforge
+##
+EXTRA_LIBRARIES += libff.a
+
+libff_a_DEPENDENCIES = libluamisc.a
+
+libff_a_CPPFLAGS = \
+ -DFONTFORGE_CONFIG_NO_WINDOWING_UI=1 -DLUA_FF_LIB=1 \
+ -D_NO_PYTHON=1 -DX_DISPLAY_MISSING=1 -DNODYNAMIC=1 \
+ -D_NO_FREETYPE=1 -D_NO_LIBUNINAMESLIST=1 -UHAVE_LIBINTL_H \
+ -I$(top_srcdir)/luatexdir/lua51 \
+ -I$(top_srcdir)/luatexdir/luafontforge/fontforge/inc \
+ -I$(top_srcdir)/luatexdir/luafontforge/fontforge/fontforge
+
+libff_a_SOURCES = \
+ luatexdir/luafontforge/fontforge/Unicode/alphabet.c \
+ luatexdir/luafontforge/fontforge/Unicode/char.c \
+ luatexdir/luafontforge/fontforge/Unicode/cjk.c \
+ luatexdir/luafontforge/fontforge/Unicode/gwwiconv.c \
+ luatexdir/luafontforge/fontforge/Unicode/memory.c \
+ luatexdir/luafontforge/fontforge/Unicode/ustring.c \
+ luatexdir/luafontforge/fontforge/fontforge/autohint.c \
+ luatexdir/luafontforge/fontforge/fontforge/charview.c \
+ luatexdir/luafontforge/fontforge/fontforge/configure-pfaedit.h \
+ luatexdir/luafontforge/fontforge/fontforge/contextchain.c \
+ luatexdir/luafontforge/fontforge/fontforge/edgelist.h \
+ luatexdir/luafontforge/fontforge/fontforge/edgelist2.h \
+ luatexdir/luafontforge/fontforge/fontforge/encoding.c \
+ luatexdir/luafontforge/fontforge/fontforge/featurefile.c \
+ luatexdir/luafontforge/fontforge/fontforge/fontinfo.c \
+ luatexdir/luafontforge/fontforge/fontforge/fontview.c \
+ luatexdir/luafontforge/fontforge/fontforge/fvfonts.c \
+ luatexdir/luafontforge/fontforge/fontforge/groups.h \
+ luatexdir/luafontforge/fontforge/fontforge/kernclass.c \
+ luatexdir/luafontforge/fontforge/fontforge/lookups.c \
+ luatexdir/luafontforge/fontforge/fontforge/macbinary.c \
+ luatexdir/luafontforge/fontforge/fontforge/macenc.c \
+ luatexdir/luafontforge/fontforge/fontforge/namelist.c \
+ luatexdir/luafontforge/fontforge/fontforge/ofl.h \
+ luatexdir/luafontforge/fontforge/fontforge/parsepfa.c \
+ luatexdir/luafontforge/fontforge/fontforge/parsettf.c \
+ luatexdir/luafontforge/fontforge/fontforge/parsettfatt.c \
+ luatexdir/luafontforge/fontforge/fontforge/parsettfvar.c \
+ luatexdir/luafontforge/fontforge/fontforge/pfaedit.h \
+ luatexdir/luafontforge/fontforge/fontforge/pfaeditui.h \
+ luatexdir/luafontforge/fontforge/fontforge/plugins.h \
+ luatexdir/luafontforge/fontforge/fontforge/prefs.c \
+ luatexdir/luafontforge/fontforge/fontforge/psfont.h \
+ luatexdir/luafontforge/fontforge/fontforge/psread.c \
+ luatexdir/luafontforge/fontforge/fontforge/pua.c \
+ luatexdir/luafontforge/fontforge/fontforge/sd.h \
+ luatexdir/luafontforge/fontforge/fontforge/splinefill.c \
+ luatexdir/luafontforge/fontforge/fontforge/splinefont.h \
+ luatexdir/luafontforge/fontforge/fontforge/splineorder2.c \
+ luatexdir/luafontforge/fontforge/fontforge/splineoverlap.c \
+ luatexdir/luafontforge/fontforge/fontforge/splinerefigure.c \
+ luatexdir/luafontforge/fontforge/fontforge/splinesave.c \
+ luatexdir/luafontforge/fontforge/fontforge/splinestroke.c \
+ luatexdir/luafontforge/fontforge/fontforge/splineutil.c \
+ luatexdir/luafontforge/fontforge/fontforge/splineutil2.c \
+ luatexdir/luafontforge/fontforge/fontforge/stamp.c \
+ luatexdir/luafontforge/fontforge/fontforge/start.c \
+ luatexdir/luafontforge/fontforge/fontforge/stemdb.c \
+ luatexdir/luafontforge/fontforge/fontforge/stemdb.h \
+ luatexdir/luafontforge/fontforge/fontforge/tottf.c \
+ luatexdir/luafontforge/fontforge/fontforge/tottfgpos.c \
+ luatexdir/luafontforge/fontforge/fontforge/ttf.h \
+ luatexdir/luafontforge/fontforge/fontforge/tottfvar.c \
+ luatexdir/luafontforge/fontforge/fontforge/ttfspecial.c \
+ luatexdir/luafontforge/fontforge/fontforge/unicoderange.h \
+ luatexdir/luafontforge/fontforge/fontforge/views.h \
+ luatexdir/luafontforge/fontforge/inc/basics.h \
+ luatexdir/luafontforge/fontforge/inc/chardata.h \
+ luatexdir/luafontforge/fontforge/inc/charset.h \
+ luatexdir/luafontforge/fontforge/inc/dynamic.h \
+ luatexdir/luafontforge/fontforge/inc/fileutil.h \
+ luatexdir/luafontforge/fontforge/inc/gdraw.h \
+ luatexdir/luafontforge/fontforge/inc/gfile.h \
+ luatexdir/luafontforge/fontforge/inc/ggadget.h \
+ luatexdir/luafontforge/fontforge/inc/gicons.h \
+ luatexdir/luafontforge/fontforge/inc/gio.h \
+ luatexdir/luafontforge/fontforge/inc/gkeysym.h \
+ luatexdir/luafontforge/fontforge/inc/gprogress.h \
+ luatexdir/luafontforge/fontforge/inc/gresource.h \
+ luatexdir/luafontforge/fontforge/inc/gwidget.h \
+ luatexdir/luafontforge/fontforge/inc/gwwiconv.h \
+ luatexdir/luafontforge/fontforge/inc/intl.h \
+ luatexdir/luafontforge/fontforge/inc/ustring.h \
+ luatexdir/luafontforge/fontforge/inc/utype.h \
+ luatexdir/luafontforge/src/ffdummies.c \
+ luatexdir/luafontforge/src/luafflib.c
+
+EXTRA_DIST += \
+ luatexdir/luafontforge/ChangeLog \
+ luatexdir/luafontforge/fontforge/AUTHORS \
+ luatexdir/luafontforge/fontforge/INSTALL \
+ luatexdir/luafontforge/fontforge/LICENSE \
+ luatexdir/luafontforge/fontforge/VERSION
+
+## Not used
+##
+EXTRA_DIST += \
+ luatexdir/luafontforge/Makefile \
+ luatexdir/luafontforge/fontforge/Makefile \
+ luatexdir/luafontforge/fontforge/Unicode/Makefile \
+ luatexdir/luafontforge/fontforge/Unicode/descrip.mms \
+ luatexdir/luafontforge/fontforge/descrip.mms \
+ luatexdir/luafontforge/fontforge/fontforge/Makefile \
+ luatexdir/luafontforge/fontforge/fontforge/descrip.mms \
+ luatexdir/luafontforge/fontforge/fontforge/lff.opt \
+ luatexdir/luafontforge/fontforge/fontforge/scriptfuncs.h \
+ luatexdir/luafontforge/fontforge/fontforge/scripting.h \
+ luatexdir/luafontforge/fontforge/fontforge/sfd1.h \
+ luatexdir/luafontforge/fontforge/fontforge/stamper.c \
+ luatexdir/luafontforge/fontforge/fontforge/xlib.opt
+
+## libluatex
+##
+EXTRA_LIBRARIES += libluatex.a
+
+libluatex_a_DEPENDENCIES = libff.a
+
+libluatex_a_CPPFLAGS = $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) $(XPDF_INCLUDES)
+libluatex_a_CPPFLAGS += $(OBSDCOMPAT_INCLUDES) -I$(srcdir)/libmd5
+libluatex_a_CPPFLAGS += -Iluatexdir -I$(srcdir)/luatexdir -I$(srcdir)/luatexdir/lua51
+libluatex_a_CPPFLAGS += -DpdfTeX
+
+libluatex_a_SOURCES = \
+ luatexdir/avl.c \
+ luatexdir/avl.h \
+ luatexdir/avlstuff.c \
+ luatexdir/avlstuff.h \
+ luatexdir/font/dofont.c \
+ luatexdir/font/luafont.c \
+ luatexdir/font/mapfile.c \
+ luatexdir/font/pkin.c \
+ luatexdir/font/sfnt.c \
+ luatexdir/font/sfnt.h \
+ luatexdir/font/subfont.c \
+ luatexdir/font/texfont.c \
+ luatexdir/font/texfont.h \
+ luatexdir/font/tfmofm.c \
+ luatexdir/font/tounicode.c \
+ luatexdir/font/tt_glyf.c \
+ luatexdir/font/tt_glyf.h \
+ luatexdir/font/tt_table.c \
+ luatexdir/font/tt_table.h \
+ luatexdir/font/vfovf.c \
+ luatexdir/font/vfpacket.c \
+ luatexdir/font/writecff.c \
+ luatexdir/font/writecff.h \
+ luatexdir/font/writeenc.c \
+ luatexdir/font/writefont.c \
+ luatexdir/font/writet1.c \
+ luatexdir/font/writet3.c \
+ luatexdir/font/writettf.c \
+ luatexdir/font/writettf.h \
+ luatexdir/font/writetype0.c \
+ luatexdir/font/writetype2.c \
+ luatexdir/hyphen.h \
+ luatexdir/image/epdf.c \
+ luatexdir/image/epdf.h \
+ luatexdir/image/image.h \
+ luatexdir/image/pdftoepdf.cc \
+ luatexdir/image/writeimg.c \
+ luatexdir/image/writejbig2.c \
+ luatexdir/image/writejbig2.h \
+ luatexdir/image/writejpg.c \
+ luatexdir/image/writepng.c \
+ luatexdir/lang/hnjalloc.c \
+ luatexdir/lang/hnjalloc.h \
+ luatexdir/lang/hyphen.c \
+ luatexdir/lang/texlang.c \
+ luatexdir/lua/lcallbacklib.c \
+ luatexdir/lua/lfontlib.c \
+ luatexdir/lua/limglib.c \
+ luatexdir/lua/lkpselib.c \
+ luatexdir/lua/llanglib.c \
+ luatexdir/lua/llualib.c \
+ luatexdir/lua/lmplib.c \
+ luatexdir/lua/lnodelib.c \
+ luatexdir/lua/loslibext.c \
+ luatexdir/lua/lpdflib.c \
+ luatexdir/lua/lstatslib.c \
+ luatexdir/lua/ltexiolib.c \
+ luatexdir/lua/ltexlib.c \
+ luatexdir/lua/ltokenlib.c \
+ luatexdir/lua/luainit.c \
+ luatexdir/lua/luanode.c \
+ luatexdir/lua/luastuff.c \
+ luatexdir/lua/luatex.c \
+ luatexdir/lua/luatoken.c \
+ luatexdir/lua/texluac.c \
+ luatexdir/luatex-api.h \
+ luatexdir/luatex.h \
+ luatexdir/managed-sa.c \
+ luatexdir/managed-sa.h \
+ luatexdir/mathcodes.c \
+ luatexdir/nodes.h \
+ luatexdir/ptexmac.h \
+ luatexdir/svnversion.h \
+ luatexdir/tex/linebreak.c \
+ luatexdir/tex/postlinebreak.c \
+ luatexdir/tex/texnodes.c \
+ luatexdir/tex/texpdf.c \
+ luatexdir/tex/textoken.c \
+ luatexdir/textcodes.c \
+ luatexdir/tokens.h \
+ luatexdir/utils.c \
+ luatexdir/writezip.c
+
+nodist_libluatex_a_SOURCES = $(lua_mp_c_h)
+
+## We must create lua_mp_c_h before compiling the libluatex_a_SOURCES,
+## but certainly don't want to create lua_mp_c_h if luaTeX is not built.
+if LUATEX
+$(libluatex_a_SOURCES): $(lua_mp_c_h)
+endif LUATEX
+
+## These files are mutually dependent
+lua_mp_c_h = luatexdir/mp.c luatexdir/mplib.h luatexdir/mpmp.h
+lua_mp_c_h += luatexdir/mppsout.h luatexdir/psout.c
+lua_mp_web = luatexdir/lua/mp.w luatexdir/lua/psout.w
+$(lua_mp_c_h): mp-ctangle
+mp-ctangle: ctangle $(lua_mp_web) luatexd.h
+ $(mkdir_p) luatexdir
+ CWEBINPUTS=$(srcdir)/luatexdir/lua $(ctangle) mp.w
+ CWEBINPUTS=$(srcdir)/luatexdir/lua $(ctangle) psout.w
+ rm -f $(lua_mp_c_h)
+ mv mp.c mplib.h mpmp.h mppsout.h psout.c luatexdir
+ echo timestamp >$@
+ touch $(lua_mp_c_h)
+
+EXTRA_DIST += $(lua_mp_web)
+
+DISTCLEANFILES += $(lua_mp_c_h) mp-ctangle
+
+## included by luatexdir/font/writettf.c
+EXTRA_libluatex_a_SOURCES = luatexdir/font/macnames.c
+
+EXTRA_DIST += \
+ luatexdir/ChangeLog \
+ luatexdir/NEWS \
+ luatexdir/README \
+ luatexdir/change-files.txt \
+ luatexdir/font/subfont.txt
+
+## Not used (pdftosrc and ttf2afm)
+##
+EXTRA_DIST += \
+ luatexdir/pdftosrc.1 \
+ luatexdir/pdftosrc.cc \
+ luatexdir/pdftosrc.rc \
+ luatexdir/ttf2afm.c \
+ luatexdir/ttf2afm.rc
+
+## included by luatexdir/ttf2afm.c
+EXTRA_DIST += luatexdir/macnames.c
+
+## Tests
+
+dist_check_SCRIPTS += luatexdir/luatangle.test
+
+if LUATEX
+TESTS += luatexdir/luatangle.test
+endif LUATEX
+
+DISTCLEANFILES += cftest.p
+
+## Eventually delete these files
+##
+EXTRA_DIST += \
+ luatexdir/.indent.pro \
+ luatexdir/Makefile.in \
+ luatexdir/depend.mk \
+ luatexdir/font/.indent.pro \
+ luatexdir/image/.indent.pro \
+ luatexdir/lua/.indent.pro \
+ luatexdir/luatex.mk \
+ luatexdir/luatexlib.mk
+
diff --git a/Build/source/texk/web2c/mpdir/Makefile.in.orig b/Build/source/texk/web2c/mpdir/Makefile.in.orig
new file mode 100644
index 00000000000..8b51105e713
--- /dev/null
+++ b/Build/source/texk/web2c/mpdir/Makefile.in.orig
@@ -0,0 +1,41 @@
+# @configure_input@
+# Makefile for libmpost - taco@elvenkind.com, but
+# mostly ripped off from Makefile.in from pdftex
+# $Id $
+
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+kpse_include ../make/library.mk
+
+kpathsea_srcdir_parent = $(srcdir)/../..
+kpathsea_dir_parent = ../..
+
+ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir) -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent)
+CXX = @CXX@
+
+XCPPFLAGS=-I.. -I$(srcdir)/.. -I../.. -I$(srcdir)/../..
+
+OBJS = mapfile.o avl.o avlstuff.o utils.o writeenc.o writet1.o writefont.o turningnumber.o
+
+all: libmpost.a makecpool
+
+libmpost.a: $(OBJS)
+ rm -f $@
+ $(AR) $(ARFLAGS) $@ $(OBJS)
+ $(RANLIB) $@
+
+makecpool: makecpool.o
+ $(link_command) makecpool.o
+
+kpse_include ../make/clean.mk
+
+clean::
+ rm -f libmpost.a makecpool
+
+depend:
+ rm -f $(OBJS)
+ XXCFLAGS=-MM XCFLAGS=-MM $(MAKE) -k $(OBJS) | \
+ grep -v "^$(CC)\|$(CXX)\|$(AR)\|make" | \
+ sed 's: [^ ]*/\.\./libs/[^ ]*::g' > $(srcdir)/depend.mk
+
+kpse_include mpdir/depend.mk
diff --git a/Build/source/texk/web2c/mpdir/am/mp.am b/Build/source/texk/web2c/mpdir/am/mp.am
new file mode 100644
index 00000000000..eb89d5b0e96
--- /dev/null
+++ b/Build/source/texk/web2c/mpdir/am/mp.am
@@ -0,0 +1,59 @@
+## texk/web2c/mpdir/am/mp.am: Makefile fragment for MetaPost.
+
+## MetaPost
+##
+if MP
+bin_PROGRAMS += mpost
+endif MP
+
+mpost_CPPFLAGS = -I$(srcdir)/mpdir
+mpost_LDADD = libmpost.a $(LDADD)
+mpost_c_h = mpini.c mp0.c mp1.c mp2.c mpcoerce.h mpd.h
+nodist_mpost_SOURCES = $(mpost_c_h) mp-pool.c mpextra.c
+$(mpost_c_h): mp-web2c
+mp-web2c: mp.p $(web2c_texmf) mpdir/mp.defines web2c/cvtmf1.sed web2c/cvtmf2.sed
+ $(web2c) mp
+ echo timestamp >$@
+ touch $(mpost_c_h)
+EXTRA_DIST += mp.web mp.ch lib/texmfmp.c mpdir/mp.defines mpdir/mplib.h
+mpextra.c: lib/texmfmp.c mpd.h
+ sed s/TEX-OR-MF-OR-MP/mp/ $(srcdir)/lib/texmfmp.c >$@
+mp.p mp.pool: mp-tangle
+mp-tangle: tangle mp.web mp.ch
+ $(tangle) mp mp
+ echo timestamp >$@
+ touch mp.p mp.pool
+mp-pool.c: mp.pool $(makecpool) mpdir/mplib.h
+ $(makecpool) mp.pool $(srcdir)/mpdir/mplib.h >$@ || rm -f $@
+DISTCLEANFILES += $(nodist_mpost_SOURCES) mp-web2c \
+ mp.p mp.pool mp-tangle
+
+## libmpost
+##
+EXTRA_LIBRARIES += libmpost.a
+
+libmpost_a_CPPFLAGS = -I$(srcdir)/mpdir
+
+libmpost_a_SOURCES = \
+ mpdir/avl.c \
+ mpdir/avl.h \
+ mpdir/avlstuff.c \
+ mpdir/avlstuff.h \
+ mpdir/mapfile.c \
+ mpdir/mpmac.h \
+ mpdir/turningnumber.c \
+ mpdir/utils.c \
+ mpdir/writeenc.c \
+ mpdir/writefont.c \
+ mpdir/writet1.c
+
+## We must create mpd.h before compiling the libmpost_a_SOURCES.
+$(libmpost_a_SOURCES): mpd.h
+
+## Eventually delete these files
+##
+EXTRA_DIST += \
+ metapost.mk \
+ mpdir/Makefile.in.orig \
+ mpdir/mpostlib.mk
+
diff --git a/Build/source/texk/web2c/mpware/Makefile.in.orig b/Build/source/texk/web2c/mpware/Makefile.in.orig
new file mode 100644
index 00000000000..d898b37884f
--- /dev/null
+++ b/Build/source/texk/web2c/mpware/Makefile.in.orig
@@ -0,0 +1,63 @@
+# @configure_input@
+# Makefile for the MetaPost support programs.
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+kpse_include kpathsea.mk
+
+proglib = ../lib/lib.a
+programs = dmp mpto newer makempx
+
+default: all
+all: $(programs)
+
+dmp: dmp.o dmp_ffile.o
+ $(kpathsea_link) dmp.o dmp_ffile.o $(LOADLIBES)
+mpto: mpto.o
+ $(kpathsea_link) mpto.o
+newer: newer.o
+ $(link_command) newer.o
+makempx: makempx.o
+ $(kpathsea_link) makempx.o $(LOADLIBES)
+
+dmp.o dmp_ffile.o: dmp.h
+
+newer.o dmp.o makempx.o: ../c-auto.h
+
+checkdir = $(srcdir)/../check
+check: mpto makempx newer dmp
+ makempx $(checkdir)/label.mp ../check/xlabel.mpx
+ ./mpto -tex $(checkdir)/testex.mp | diff $(checkdir)/testex.tex -
+ sed '16s/^%//' <$(checkdir)/testex.mp >testex1
+ -mpto -tex testex1 >/dev/null 2>testex2
+ sed '17s/^%//' <$(checkdir)/testex.mp >testex1
+ -mpto -tex testex1 >/dev/null 2>>testex2
+ sed '18s/^%//' <$(checkdir)/testex.mp >testex1
+ -mpto -tex testex1 >/dev/null 2>>testex2
+ sed '19s/^%//' <$(checkdir)/testex.mp >testex1
+ -mpto -tex testex1 >/dev/null 2>>testex2
+ sed '20s/^%//' <$(checkdir)/testex.mp >testex1
+ -mpto -tex testex1 >/dev/null 2>>testex2
+ diff $(checkdir)/testex.err testex2
+
+Makefile: Makefile.in ../config.status
+ cd .. && $(SHELL) config.status
+
+install: install-exec install-data
+install-exec: $(programs)
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir) $(scriptdir)
+ $(INSTALL_PROGRAM) newer $(bindir)/newer
+ $(INSTALL_LIBTOOL_PROG) dmp $(bindir)
+ $(INSTALL_LIBTOOL_PROG) mpto $(bindir)
+ $(INSTALL_LIBTOOL_PROG) makempx $(bindir)
+install-data:
+
+kpse_include ../make/tkpathsea.mk
+kpse_include ../make/clean.mk
+
+mostlyclean::
+ rm -f testex1 testex2
+
+kpse_include ../make/rdepend.mk
+kpse_include mpware/depend.mk
diff --git a/Build/source/texk/web2c/omegadir/am/omega.am b/Build/source/texk/web2c/omegadir/am/omega.am
new file mode 100644
index 00000000000..77d97ab50ed
--- /dev/null
+++ b/Build/source/texk/web2c/omegadir/am/omega.am
@@ -0,0 +1,88 @@
+## texk/web2c/omegadir/am/omega.am: Makefile fragment for Omega.
+
+## Omega
+##
+if OMEGA
+bin_PROGRAMS += omega
+endif OMEGA
+
+## With --enable-ipc, Omega may need to link with -lsocket.
+omega_LDADD = $(LDADD) $(socketlibs)
+
+omega_CPPFLAGS = -I$(srcdir)/omegadir $(AM_CPPFLAGS)
+omega_c_h = omegaini.c omega0.c omega1.c omega2.c omega3.c omegacoerce.h omegad.h
+nodist_omega_SOURCES = $(omega_c_h) omega-pool.c omegaextra.c
+omega_SOURCES = \
+ omegadir/omega.c \
+ omegadir/omegabis.c \
+ omegadir/omegaextra.h \
+ omegadir/omegamem.h \
+ omegadir/omega-pool.h
+## We must create omegad.h before compiling the omega_SOURCES,
+## but certainly don't want to create omegad.h if Omega is not built.
+if OMEGA
+$(omega_SOURCES): omegad.h
+endif OMEGA
+$(omega_c_h): omega-web2c
+omega-web2c: omega.p $(web2c_texmf) omegadir/omega.defines
+ $(web2c) omega
+ echo timestamp >$@
+ touch $(omega_c_h)
+omegaextra.c: lib/texmfmp.c omegad.h
+ sed s/TEX-OR-MF-OR-MP/omega/ $(srcdir)/lib/texmfmp.c >$@
+omega.p omega.pool: omega-tangle
+omega-tangle: otangle omega.web omega.ch
+ $(otangle) omega omega
+ echo timestamp >$@
+ touch omega.p omega.pool
+omega-pool.c: omega.pool $(makecpool) omegadir/omega-pool.h
+ $(makecpool) omega.pool $(srcdir)/omegadir/omega-pool.h >$@ || rm -f $@
+## Generate omega.web
+omega_web_srcs = \
+ tex.web \
+ omegadir/omnode.ch \
+ omegadir/om16bit.ch \
+ omegadir/omstr.ch \
+ omegadir/omfont.ch \
+ omegadir/omchar.ch \
+ omegadir/omfi.ch \
+ omegadir/ompar.ch \
+ omegadir/omocp.ch \
+ omegadir/omfilter.ch \
+ omegadir/omtrans.ch \
+ omegadir/omdir.ch \
+ omegadir/omcprt.ch \
+ omegadir/omxml.ch
+omega.web: $(TIE) $(omega_web_srcs)
+ $(tie) -m omega.web $(omega_web_srcs)
+## Generate omega.ch
+omega_ch_srcs = \
+ omegadir/comnode.ch \
+ omegadir/com16bit.ch \
+ omegadir/comstr.ch \
+ omegadir/comfont.ch \
+ omegadir/comchar.ch \
+ omegadir/comfi.ch \
+ omegadir/compar.ch \
+ omegadir/comocp.ch \
+ omegadir/comfilter.ch \
+ omegadir/comtrans.ch \
+ omegadir/comdir.ch \
+ omegadir/comxml.ch \
+ omegadir/comsrcspec.ch
+omega.ch: $(TIE) omega.web $(omega_ch_srcs)
+ $(tie) -c omega.ch omega.web $(omega_ch_srcs)
+EXTRA_DIST += $(omega_web_srcs) $(omega_ch_srcs) lib/texmfmp.c
+DISTCLEANFILES += $(nodist_omega_SOURCES) omega.web omega.ch omega-web2c \
+ omega.p omega.pool omega-tangle
+
+EXTRA_DIST += \
+ omegadir/ChangeLog \
+ omegadir/README \
+ omegadir/omega.defines \
+ omegadir/omega.version
+
+## Eventually delete these files
+##
+EXTRA_DIST += omegadir/omega.mk
+
diff --git a/Build/source/texk/web2c/omegafonts/Makefile.in.orig b/Build/source/texk/web2c/omegafonts/Makefile.in.orig
new file mode 100644
index 00000000000..9fb8d3f1cf7
--- /dev/null
+++ b/Build/source/texk/web2c/omegafonts/Makefile.in.orig
@@ -0,0 +1,73 @@
+# @configure_input@
+# Makefile for omegafonts.
+
+# These get expanded from the parent directory, not this one.
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+kpse_include ../make/paths.mk
+kpse_include kpathsea.mk
+
+LEX = @LEX@
+#LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+YACC = @YACC@
+
+proglib = ../lib/lib.a
+programs = omfonts
+linked_programs = ofm2opl opl2ofm ovf2ovp ovp2ovf
+scripts =
+
+omfonts_objects = omfonts.o y_tab.o $(LEX_OUTPUT_ROOT).o \
+ char_routines.o dimen_routines.o error_routines.o \
+ header_routines.o ligkern_routines.o list_routines.o \
+ out_routines.o param_routines.o print_routines.o \
+ font_routines.o extra_routines.o out_ofm.o \
+ parse_ofm.o
+h_files = char_routines.h dimen_routines.h error_routines.h \
+ font_routines.h header_routines.h ligkern_routines.h \
+ list_routines.h out_routines.h param_routines.h print_routines.h \
+ extra_routines.h manifests.h parser.h out_ofm.h dvi.h \
+ parse_ofm.h omfonts.h
+
+all: $(programs)
+$(omfonts_objects): Makefile
+omfonts: $(omfonts_objects)
+ $(kpathsea_link) $(omfonts_objects) $(LEXLIB) $(LOADLIBES)
+
+omfonts.o: omfonts.c y_tab.h
+y_tab.c y_tab.h: pl.y
+ $(YACC) -d -v $(srcdir)/pl.y
+ -test -f y.tab.c && mv -f y.tab.c y_tab.c
+ -test -f y.tab.h && mv -f y.tab.h y_tab.h
+$(LEX_OUTPUT_ROOT).o: parser.h y_tab.h
+$(LEX_OUTPUT_ROOT).c: pl.l
+ $(LEX) $(srcdir)/pl.l
+
+
+
+$(programs): $(proglib) $(kpathsea)
+
+$(omfonts_objects): $(h_files)
+
+install: install-exec
+install-exec:: install-links
+
+install-programs: $(programs)
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
+
+install-links: install-programs
+ for f in ""$(linked_programs); do \
+ cd $(bindir) && (rm -f $$f; $(LN) omfonts $$f); done
+
+Makefile: Makefile.in ../config.status
+ cd .. && $(SHELL) config.status
+
+kpse_include ../make/tkpathsea.mk
+kpse_include ../make/clean.mk
+
+clean::
+ rm -f y_tab.c y_tab.h y.out* yacc.* $(LEX_OUTPUT_ROOT).c
+
+kpse_include ../make/rdepend.mk
+kpse_include omegafonts/depend.mk
diff --git a/Build/source/texk/web2c/omegaware/am/omegaware.am b/Build/source/texk/web2c/omegaware/am/omegaware.am
new file mode 100644
index 00000000000..acb4102d308
--- /dev/null
+++ b/Build/source/texk/web2c/omegaware/am/omegaware.am
@@ -0,0 +1,106 @@
+## texk/web2c/omegaware/am/omegaware.am: Makefile fragment for omegaware web programs.
+
+omegaware_tools = odvicopy odvitype otangle
+omegaware_font_tools = ofm2opl opl2ofm ovf2ovp ovp2ovf
+omegaware_programs = $(omegaware_tools) $(omegaware_font_tools)
+
+if OTANGLE
+bin_PROGRAMS += $(omegaware_tools)
+if !OMFONTS
+bin_PROGRAMS += $(omegaware_font_tools)
+endif !OMFONTS
+endif OTANGLE
+
+EXTRA_DIST += omegaware/ChangeLog
+DISTCLEANFILES += $(omegaware_programs:=.c) $(omegaware_programs:=.h) \
+ $(omegaware_programs:=.p) $(omegaware_programs:=-web2c)
+
+ow_tangle = WEBINPUTS=$(srcdir)/omegaware $(buildenv) $(TANGLE)
+
+nodist_odvicopy_SOURCES = odvicopy.c odvicopy.h
+odvicopy.c odvicopy.h: odvicopy-web2c
+odvicopy-web2c: $(web2c_common) $(web2c_programs) odvicopy.p
+ $(web2c) odvicopy
+ echo timestamp >$@
+ touch odvicopy.c odvicopy.h
+EXTRA_DIST += $(odvicopy_sources)
+odvicopy_sources = omegaware/odvicopy.web omegaware/odvicopy.ch
+odvicopy.p: tangle $(odvicopy_sources)
+ $(ow_tangle) odvicopy odvicopy
+
+nodist_odvitype_SOURCES = odvitype.c odvitype.h
+odvitype.c odvitype.h: odvitype-web2c
+odvitype-web2c: $(web2c_common) $(web2c_programs) odvitype.p
+ $(web2c) odvitype
+ echo timestamp >$@
+ touch odvitype.c odvitype.h
+EXTRA_DIST += $(odvitype_sources)
+odvitype_sources = omegaware/odvitype.web omegaware/odvitype.ch
+odvitype.p: tangle $(odvitype_sources)
+ $(ow_tangle) odvitype odvitype
+
+nodist_ofm2opl_SOURCES = ofm2opl.c ofm2opl.h
+ofm2opl.c ofm2opl.h: ofm2opl-web2c
+ofm2opl-web2c: $(web2c_common) $(web2c_programs) ofm2opl.p
+ $(web2c) ofm2opl
+ echo timestamp >$@
+ touch ofm2opl.c ofm2opl.h
+EXTRA_DIST += $(ofm2opl_sources)
+ofm2opl_sources = omegaware/ofm2opl.web omegaware/ofm2opl.ch
+ofm2opl.p: tangle $(ofm2opl_sources)
+ $(ow_tangle) ofm2opl ofm2opl
+
+nodist_opl2ofm_SOURCES = opl2ofm.c opl2ofm.h
+opl2ofm.c opl2ofm.h: opl2ofm-web2c
+opl2ofm-web2c: $(web2c_common) $(web2c_programs) opl2ofm.p
+ $(web2c) opl2ofm
+ echo timestamp >$@
+ touch opl2ofm.c opl2ofm.h
+EXTRA_DIST += $(opl2ofm_sources)
+opl2ofm_sources = omegaware/opl2ofm.web omegaware/opl2ofm.ch
+opl2ofm.p: tangle $(opl2ofm_sources)
+ $(ow_tangle) opl2ofm opl2ofm
+
+nodist_otangle_SOURCES = otangle.c otangle.h
+otangle.c otangle.h: otangle-web2c
+otangle-web2c: $(web2c_common) $(web2c_programs) otangle.p
+ $(web2c) otangle
+ echo timestamp >$@
+ touch otangle.c otangle.h
+EXTRA_DIST += $(otangle_sources)
+otangle_sources = omegaware/otangle.web omegaware/otangle.ch
+otangle.p: tangle $(otangle_sources)
+ $(ow_tangle) otangle otangle
+
+nodist_ovf2ovp_SOURCES = ovf2ovp.c ovf2ovp.h
+ovf2ovp.c ovf2ovp.h: ovf2ovp-web2c
+ovf2ovp-web2c: $(web2c_common) $(web2c_programs) ovf2ovp.p
+ $(web2c) ovf2ovp
+ echo timestamp >$@
+ touch ovf2ovp.c ovf2ovp.h
+EXTRA_DIST += $(ovf2ovp_sources)
+ovf2ovp_sources = omegaware/ovf2ovp.web omegaware/ovf2ovp.ch
+ovf2ovp.p: tangle $(ovf2ovp_sources)
+ $(ow_tangle) ovf2ovp ovf2ovp
+
+nodist_ovp2ovf_SOURCES = ovp2ovf.c ovp2ovf.h
+ovp2ovf.c ovp2ovf.h: ovp2ovf-web2c
+ovp2ovf-web2c: $(web2c_common) $(web2c_programs) ovp2ovf.p
+ $(web2c) ovp2ovf
+ echo timestamp >$@
+ touch ovp2ovf.c ovp2ovf.h
+EXTRA_DIST += $(ovp2ovf_sources)
+ovp2ovf_sources = omegaware/ovp2ovf.web omegaware/ovp2ovf.ch
+ovp2ovf.p: tangle $(ovp2ovf_sources)
+ $(ow_tangle) ovp2ovf ovp2ovf
+
+## Tests
+
+dist_check_SCRIPTS += omegaware/otangle.test
+
+if OTANGLE
+TESTS += omegaware/otangle.test
+endif OTANGLE
+
+DISTCLEANFILES += cftest.p
+
diff --git a/Build/source/texk/web2c/omegaware/otangle.test b/Build/source/texk/web2c/omegaware/otangle.test
new file mode 100755
index 00000000000..e045d106582
--- /dev/null
+++ b/Build/source/texk/web2c/omegaware/otangle.test
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+TEXMFCNF=$srcdir/../kpathsea WEBINPUTS=$srcdir/cftests \
+ ./otangle cftest cftest || exit 1
+
+diff cftest.p $srcdir/cftests/ocftest.p || exit 1
+
diff --git a/Build/source/texk/web2c/otps/Makefile.in.orig b/Build/source/texk/web2c/otps/Makefile.in.orig
new file mode 100644
index 00000000000..ee81a2d2a9c
--- /dev/null
+++ b/Build/source/texk/web2c/otps/Makefile.in.orig
@@ -0,0 +1,53 @@
+# @configure_input@
+# Makefile for otps.
+
+# These get expanded from the parent directory, not this one.
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+kpse_include ../make/paths.mk
+kpse_include kpathsea.mk
+
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+YACC = @YACC@
+
+proglib = ../lib/lib.a
+programs = otp2ocp outocp
+scripts = mkocp mkofm
+
+otp2ocp_objects = otp2ocp.o routines.o y_tab.o $(LEX_OUTPUT_ROOT).o
+all: $(programs)
+otp2ocp: $(otp2ocp_objects)
+ $(kpathsea_link) $(otp2ocp_objects) $(LEXLIB) $(LOADLIBES)
+
+otp2ocp.o: otp2ocp.c y_tab.h
+y_tab.c y_tab.h: otp.y
+ $(YACC) -d -v $(srcdir)/otp.y
+ -test -f y.tab.c && mv -f y.tab.c y_tab.c
+ -test -f y.tab.h && mv -f y.tab.h y_tab.h
+$(LEX_OUTPUT_ROOT).o: otp.h
+$(LEX_OUTPUT_ROOT).c: otp.l
+ $(LEX) $(srcdir)/otp.l
+
+outocp: outocp.o
+ $(kpathsea_link) outocp.o $(LOADLIBES)
+
+$(programs): $(proglib) $(kpathsea)
+
+install-programs: $(programs)
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done
+ for p in $(scripts); do $(INSTALL_SCRIPT) $(srcdir)/$$p $(scriptdir); done
+
+Makefile: Makefile.in ../config.status
+ cd .. && $(SHELL) config.status
+
+kpse_include ../make/tkpathsea.mk
+kpse_include ../make/clean.mk
+
+clean::
+ rm -f y_tab.c y_tab.h y.out* yacc.* $(LEX_OUTPUT_ROOT).c
+
+kpse_include ../make/rdepend.mk
+kpse_include otps/depend.mk
diff --git a/Build/source/texk/web2c/pdftexdir/Makefile.in.orig b/Build/source/texk/web2c/pdftexdir/Makefile.in.orig
new file mode 100644
index 00000000000..23b083a5be0
--- /dev/null
+++ b/Build/source/texk/web2c/pdftexdir/Makefile.in.orig
@@ -0,0 +1,71 @@
+# Makefile for libpdf - te@dbs.uni-hannover.de
+# $Id$
+
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+kpse_include ../make/library.mk
+
+kpathsea_srcdir_parent = $(srcdir)/../..
+kpathsea_dir_parent = ../..
+
+ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) \
+ -I. -I$(srcdir) \
+ -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) \
+ @LIBXPDFCPPFLAGS@ \
+ -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. \
+ -I$(LIBOBSDCOMPATSRCDIR) -I$(LIBOBSDCOMPATSRCDIR)/.. \
+ -DPDF_PARSER_ONLY
+CXX = @CXX@
+
+.SUFFIXES: .cc .o
+.cc.o:
+ $(CXX) $(ALL_CXXFLAGS) -c $<
+
+# XCFLAGS=-Wstrict-prototypes -Wmissing-prototypes
+
+LIBPNGDIR=../../../libs/libpng
+LIBPNGSRCDIR=$(srcdir)/$(LIBPNGDIR)
+
+ZLIBDIR=../../../libs/zlib
+ZLIBSRCDIR=$(srcdir)/$(ZLIBDIR)
+
+LIBXPDFDIR=../../../libs/xpdf
+LIBXPDFSRCDIR=$(srcdir)/$(LIBXPDFDIR)
+
+LIBMD5DIR=../../../libs/md5
+LIBMD5SRCDIR=$(srcdir)/$(LIBMD5DIR)
+
+LIBOBSDCOMPATDIR=../../../libs/obsdcompat
+LIBOBSDCOMPATSRCDIR=$(srcdir)/$(LIBOBSDCOMPATDIR)
+
+XCPPFLAGS=-I.. -I$(srcdir)/.. -I../.. -I$(srcdir)/../.. -I$(LIBMD5DIR) \
+ -I$(LIBMD5SRCDIR) @LIBPNGCPPFLAGS@ @ZLIBCPPFLAGS@ \
+ -I$(LIBXPDFDIR) -I$(LIBXPDFDIR)/.. -I$(LIBXPDFSRCDIR) -I$(LIBXPDFSRCDIR)/.. \
+ -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATSRCDIR) \
+ -I$(LIBOBSDCOMPATSRCDIR)/.. -DpdfTeX
+
+OBJS = epdf.o mapfile.o utils.o vfpacket.o pkin.o \
+writefont.o writet1.o writet3.o writezip.o writeenc.o writettf.o \
+writejpg.o writejbig2.o writepng.o writeimg.o pdftoepdf.o avl.o avlstuff.o subfont.o tounicode.o
+
+all: libpdf.a
+
+pdftosrc.o: $(srcdir)/pdftosrc.cc
+
+libpdf.a: $(OBJS)
+ rm -f $@
+ $(AR) $(ARFLAGS) $@ $(OBJS)
+ $(RANLIB) $@
+
+kpse_include ../make/clean.mk
+
+clean::
+ rm -f libpdf.a ttf2afm pdftosrc
+
+depend:
+ rm -f $(OBJS) ttf2afm.o pdftosrc.o
+ XXCFLAGS=-MM XCFLAGS=-MM $(MAKE) -k $(OBJS) ttf2afm.o pdftosrc.o | \
+ grep -v "^$(CC)\|$(CXX)\|$(AR)\|make\" | \
+ sed 's: [^ ]*/\.\./libs/[^ ]*::g' > $(srcdir)/depend.mk
+
+kpse_include pdftexdir/depend.mk
diff --git a/Build/source/texk/web2c/pdftexdir/am/pdftex.am b/Build/source/texk/web2c/pdftexdir/am/pdftex.am
new file mode 100644
index 00000000000..f51b3a3e4af
--- /dev/null
+++ b/Build/source/texk/web2c/pdftexdir/am/pdftex.am
@@ -0,0 +1,163 @@
+## texk/web2c/pdftexdir/am/pdftex.am: Makefile fragment for pdfTeX.
+
+pdftex_cppflags = $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) $(XPDF_INCLUDES)
+pdftex_cppflags += $(OBSDCOMPAT_INCLUDES) -I$(srcdir)/libmd5
+pdftex_cppflags += -I$(srcdir)/pdftexdir
+
+pdftex_ldadd = libpdftex.a $(LIBPNG_LIBS) $(ZLIB_LIBS) $(XPDF_LIBS)
+pdftex_ldadd += $(OBSDCOMPAT_LIBS) libmd5.a
+
+pdftex_dependencies = $(proglib)
+pdftex_dependencies += $(LIBPNG_DEPEND) $(ZLIB_DEPEND) $(XPDF_DEPEND)
+pdftex_dependencies += $(OBSDCOMPAT_DEPEND) libmd5.a
+
+## pdfTeX
+##
+if PDFTEX
+bin_PROGRAMS += pdftex
+endif PDFTEX
+
+## Force Automake to use CXXLD for linking
+nodist_EXTRA_pdftex_SOURCES = dummy.cxx
+
+pdf_tangle = WEBINPUTS=.:$(srcdir)/pdftexdir $(buildenv) $(TANGLE)
+
+pdftex_CPPFLAGS = $(pdftex_cppflags)
+
+pdftex_LDADD = $(pdftex_ldadd) $(LDADD) $(socketlibs)
+
+pdftex_DEPENDENCIES = $(pdftex_dependencies) libpdftex.a
+
+pdftex_c_h = pdftexini.c pdftex0.c pdftex1.c pdftex2.c pdftex3.c pdftexcoerce.h pdftexd.h
+nodist_pdftex_SOURCES = $(pdftex_c_h) pdftex-pool.c pdftexextra.c pdftexdir/pdftexextra.h
+$(pdftex_c_h): pdftex-web2c
+pdftex-web2c: pdftex.p $(web2c_texmf) pdftexdir/pdftex.defines
+ $(web2c) pdftex
+ : $(synctex_convert_pdftex)
+ echo timestamp >$@
+ touch $(pdftex_c_h)
+pdftexextra.c: pdftexd.h pdftexdir/pdftexextra.h lib/texmfmp.c pdftexd.h
+ sed s/TEX-OR-MF-OR-MP/pdftex/ $(srcdir)/lib/texmfmp.c >$@
+pdftex.p pdftex.pool: pdftex-tangle
+pdftex-tangle: tangle pdftexdir/pdftex.web pdftex.ch
+ $(pdf_tangle) pdftex pdftex
+ echo timestamp >$@
+ touch pdftex.p pdftex.pool
+pdftex-pool.c: pdftex.pool $(makecpool) pdftexdir/ptexlib.h pdftexd.h
+ $(makecpool) pdftex.pool pdftexdir/ptexlib.h >$@ || rm -f $@
+## Extract pdftex version
+pdftexdir/pdftex.version: pdftexdir/pdftex.web
+ $(mkdir_p) pdftexdir
+ grep '^@d pdftex_version_string==' $(srcdir)/pdftexdir/pdftex.web \
+ | sed "s/^.*'-//;s/'.*$$//" >pdftexdir/pdftex.version
+pdftexdir/pdftexextra.h: pdftexdir/pdftexextra.in pdftexdir/pdftex.version etexdir/etex.version
+ sed -e s/PDFTEX-VERSION/`cat $(pdftexdir)/pdftex.version`/ \
+ -e s/ETEX-VERSION/`cat etexdir/etex.version`/ \
+ $(srcdir)/pdftexdir/pdftexextra.in >$@
+## Generate pdftex.ch
+pdftex.ch: $(TIE) $(pdftex_ch_srcs)
+ $(tie) -c pdftex.ch $(pdftex_ch_srcs)
+pdftex_ch_srcs = \
+ pdftexdir/pdftex.web \
+ pdftexdir/tex.ch0 \
+ tex.ch \
+ $(pdftex_ch_synctex) \
+ pdftexdir/pdftex.ch
+##
+EXTRA_DIST += $(pdftex_ch_srcs) \
+ pdftexdir/pdftex.defines pdftexdir/pdftex.h pdftexdir/pdftexextra.in
+
+DISTCLEANFILES += $(nodist_pdftex_SOURCES) pdftex.ch pdftex-web2c \
+ pdftex.p pdftex.pool pdftex-tangle pdftexdir/pdftex.version
+
+## ttf2afm
+##
+bin_PROGRAMS += ttf2afm
+
+ttf2afm_CPPFLAGS = -I$(srcdir)/pdftexdir
+
+ttf2afm_SOURCES = pdftexdir/ttf2afm.c
+
+## included by pdftexdir/ttf2afm.c
+EXTRA_ttf2afm_SOURCES = pdftexdir/macnames.c
+
+## pdftosrc
+##
+bin_PROGRAMS += pdftosrc
+
+## Force Automake to use CXXLD for linking
+nodist_EXTRA_pdftosrc_SOURCES = dummy.cxx
+
+pdftosrc_CPPFLAGS = $(pdftex_cppflags)
+
+pdftosrc_SOURCES = pdftexdir/pdftosrc.cc
+
+pdftosrc_LDADD = $(pdftex_ldadd) $(LDADD)
+
+pdftosrc_DEPENDENCIES = $(pdftex_dependencies) libpdftex.a
+
+## libpdftex
+##
+EXTRA_LIBRARIES += libpdftex.a
+
+libpdftex_a_CPPFLAGS = $(pdftex_cppflags)
+
+libpdftex_a_SOURCES = \
+ pdftexdir/avl.c \
+ pdftexdir/avl.h \
+ pdftexdir/avlstuff.c \
+ pdftexdir/avlstuff.h \
+ pdftexdir/epdf.c \
+ pdftexdir/epdf.h \
+ pdftexdir/image.h \
+ pdftexdir/mapfile.c \
+ pdftexdir/pdftex.h \
+ pdftexdir/pdftoepdf.cc \
+ pdftexdir/pkin.c \
+ pdftexdir/ptexlib.h \
+ pdftexdir/ptexmac.h \
+ pdftexdir/subfont.c \
+ pdftexdir/tounicode.c \
+ pdftexdir/utils.c \
+ pdftexdir/vfpacket.c \
+ pdftexdir/writeenc.c \
+ pdftexdir/writefont.c \
+ pdftexdir/writeimg.c \
+ pdftexdir/writejbig2.c \
+ pdftexdir/writejbig2.h \
+ pdftexdir/writejpg.c \
+ pdftexdir/writepng.c \
+ pdftexdir/writet1.c \
+ pdftexdir/writet3.c \
+ pdftexdir/writettf.c \
+ pdftexdir/writettf.h \
+ pdftexdir/writezip.c
+
+## We must create pdftexd.h before compiling the libpdftex_a_SOURCES,
+## but certainly don't want to create pdftexd.h if pdfTeX is not built.
+if PDFTEX
+$(libpdftex_a_SOURCES): pdftexd.h
+endif PDFTEX
+
+## included by pdftexdir/writettf.c
+EXTRA_libpdftex_a_SOURCES = pdftexdir/macnames.c
+
+EXTRA_DIST += \
+ pdftexdir/ChangeLog \
+ pdftexdir/NEWS \
+ pdftexdir/README \
+ pdftexdir/change-files.txt
+
+## Not used
+##
+EXTRA_DIST += \
+ pdftexdir/.indent.pro \
+ pdftexdir/pdftex.mak
+
+## Eventually delete these files
+##
+EXTRA_DIST += \
+ pdftexdir/Makefile.in.orig \
+ pdftexdir/pdftex.mk \
+ pdftexdir/pdftexlib.mk
+
diff --git a/Build/source/texk/web2c/synctexdir/am/synctex.am b/Build/source/texk/web2c/synctexdir/am/synctex.am
new file mode 100644
index 00000000000..03d793eac69
--- /dev/null
+++ b/Build/source/texk/web2c/synctexdir/am/synctex.am
@@ -0,0 +1,172 @@
+## texk/web2c/synctexdir/am/synctex.am: Makefile fragment for SyncTeX.
+
+## The SyncTeX tool
+
+bin_PROGRAMS += synctex
+
+synctex_SOURCES = \
+ synctexdir/synctex_main.c \
+ synctexdir/synctex_parser.c \
+ synctexdir/synctex_parser.h \
+ synctexdir/synctex_parser_local.h
+
+synctex_CPPFLAGS = -I$(srcdir)/synctexdir $(ZLIB_INCLUDES) -DSYNCTEX_USE_LOCAL_HEADER
+
+synctex_LDADD = $(ZLIB_LIBS)
+
+synctex_DEPENDENCIES = $(ZLIB_DEPEND)
+
+dist_man_MANS += synctexdir/man1/synctex.1 synctexdir/man5/synctex.5
+
+EXTRA_DIST += \
+ synctexdir/INSTALL \
+ synctexdir/Makefile \
+ synctexdir/Makefile.in \
+ synctexdir/README.txt
+
+## SyncTeX infrastructure: common for all engines
+
+EXTRA_DIST += \
+ synctexdir/synctex-common.h \
+ synctexdir/synctex-convert.sh \
+ synctexdir/synctex.c \
+ synctexdir/synctex.defines \
+ synctexdir/synctex.h
+
+## SyncTeX infrastructure: TeX
+
+if TEX_SYNCTEX
+
+tex_CPPFLAGS += -I$(srcdir)/synctexdir $(ZLIB_INCLUDES)
+
+tex_LDADD += $(ZLIB_LIBS)
+
+tex_ch_synctex = \
+ synctexdir/synctex-mem.ch0 \
+ synctexdir/synctex-mem.ch1 \
+ synctexdir/synctex-mem.ch2 \
+ synctexdir/synctex-rec.ch0 \
+ synctexdir/synctex-rec.ch1 \
+ synctexdir/synctex-rec.ch2
+
+dist_tex_SOURCES = \
+ synctexdir/synctex.h \
+ synctexdir/synctex-common.h \
+ synctexdir/synctex-tex.h
+
+nodist_tex_SOURCES += \
+ synctex.c
+
+synctex_convert_tex = && $(SHELL) $(srcdir)/synctexdir/synctex-convert.sh tex
+
+else !TEX_SYNCTEX
+
+synctex_convert_tex = && echo "warning: SyncTeX for TeX is NOT enabled"
+
+endif !TEX_SYNCTEX
+
+synctex.c: texd.h synctexdir/synctex.c $(dist_tex_SOURCES)
+ sed s/TEX-OR-MF-OR-MP/tex/ $(srcdir)/synctexdir/synctex.c >$@
+
+EXTRA_DIST += \
+ synctexdir/synctex-mem.ch0 \
+ synctexdir/synctex-mem.ch1 \
+ synctexdir/synctex-mem.ch2 \
+ synctexdir/synctex-rec.ch0 \
+ synctexdir/synctex-rec.ch1 \
+ synctexdir/synctex-rec.ch2
+
+## SyncTeX infrastructure: e-TeX
+
+if ETEX_SYNCTEX
+
+etex_CPPFLAGS += -I$(srcdir)/synctexdir $(ZLIB_INCLUDES)
+
+etex_LDADD += $(ZLIB_LIBS)
+
+etex_ch_synctex = \
+ synctexdir/synctex-mem.ch0 \
+ synctexdir/synctex-mem.ch1 \
+ synctexdir/synctex-e-mem.ch0 \
+ synctexdir/synctex-e-mem.ch1 \
+ synctexdir/synctex-rec.ch0 \
+ synctexdir/synctex-rec.ch1 \
+ synctexdir/synctex-e-rec.ch0 \
+ synctexdir/synctex-e-rec.ch1
+
+dist_etex_SOURCES = \
+ synctexdir/synctex.h \
+ synctexdir/synctex-common.h \
+ synctexdir/synctex-etex.h
+
+nodist_etex_SOURCES += \
+ synctex-e.c
+
+synctex_convert_etex = && $(SHELL) $(srcdir)/synctexdir/synctex-convert.sh etex
+
+else !ETEX_SYNCTEX
+
+synctex_convert_etex = && echo "warning: SyncTeX for e-TeX is NOT enabled"
+
+endif !ETEX_SYNCTEX
+
+synctex-e.c: etexd.h synctexdir/synctex.c $(dist_etex_SOURCES)
+ sed s/TEX-OR-MF-OR-MP/etex/ $(srcdir)/synctexdir/synctex.c >$@
+
+EXTRA_DIST += \
+ synctexdir/synctex-e-mem.ch0 \
+ synctexdir/synctex-e-mem.ch1 \
+ synctexdir/synctex-e-rec.ch0 \
+ synctexdir/synctex-e-rec.ch1
+
+## SyncTeX infrastructure: pdfTeX
+
+if PDFTEX_SYNCTEX
+
+pdftex_CPPFLAGS += -I$(srcdir)/synctexdir
+
+pdftex_ch_synctex = \
+ synctexdir/synctex-mem.ch0 \
+ synctexdir/synctex-mem.ch1 \
+ synctexdir/synctex-e-mem.ch0 \
+ synctexdir/synctex-e-mem.ch1 \
+ synctexdir/synctex-rec.ch0 \
+ synctexdir/synctex-rec.ch1 \
+ synctexdir/synctex-e-rec.ch0 \
+ synctexdir/synctex-e-rec.ch1 \
+ synctexdir/synctex-pdf-rec.ch2
+
+dist_pdftex_SOURCES = \
+ synctexdir/synctex.h \
+ synctexdir/synctex-common.h \
+ synctexdir/synctex-pdftex.h
+
+nodist_pdftex_SOURCES += \
+ synctex-pdf.c
+
+synctex_convert_pdftex = && $(SHELL) $(srcdir)/synctexdir/synctex-convert.sh pdftex
+
+else !PDFTEX_SYNCTEX
+
+synctex_convert_pdftex = && echo "warning: SyncTeX for pdfTeX is NOT enabled"
+
+endif !PDFTEX_SYNCTEX
+
+synctex-pdf.c: pdftexd.h synctexdir/synctex.c $(dist_pdftex_SOURCES)
+ sed s/TEX-OR-MF-OR-MP/pdftex/ $(srcdir)/synctexdir/synctex.c >$@
+
+EXTRA_DIST += \
+ synctexdir/synctex-pdf-rec.ch2
+
+## SyncTeX infrastructure: XeTeX
+
+EXTRA_DIST += \
+ synctexdir/synctex-xe-mem.ch2 \
+ synctexdir/synctex-xe-rec.ch2 \
+ synctexdir/synctex-xe-rec.ch3 \
+ synctexdir/synctex-xetex.h
+
+## Eventually delete these files
+##
+EXTRA_DIST += synctexdir/am/synctex.mk synctexdir/synctex.mk
+
diff --git a/Build/source/texk/web2c/synctexdir/am/synctex.mk b/Build/source/texk/web2c/synctexdir/am/synctex.mk
new file mode 100644
index 00000000000..3f3c4a0293a
--- /dev/null
+++ b/Build/source/texk/web2c/synctexdir/am/synctex.mk
@@ -0,0 +1,42 @@
+
+### SyncTeX support in xetex
+# Actually, xetex cannot build without SyncTeX because the tex.web
+# code does not provide proper entry points
+# list of change files
+xetex_ch_srcs-with_synctex-mem_only = \
+ $(synctex_dir)/synctex-mem.ch0 \
+ $(synctex_dir)/synctex-e-mem.ch0 \
+ $(synctex_dir)/synctex-e-mem.ch1 \
+ $(synctex_dir)/synctex-xe-mem.ch2
+xetex_ch_srcs-with_synctex = \
+ $(xetex_ch_srcs-with_synctex-mem_only) \
+ $(synctex_dir)/synctex-rec.ch0 \
+ $(synctex_dir)/synctex-e-rec.ch0 \
+ $(synctex_dir)/synctex-xe-rec.ch2
+xetex_ch_srcs-without_synctex =
+xetex_post_ch_srcs-with_synctex = \
+ $(synctex_dir)/synctex-xe-rec.ch3
+xetex_post_ch_srcs-without_synctex =
+# The C sources and headers
+xetex_o-with_synctex = synctex-xe.o
+xetex_o-without_synctex =
+synctex-xe.h: $(synctex_dir)/synctex.h
+ cat $(synctex_dir)/synctex.h >$@
+synctex-xetex.h: $(synctex_dir)/$@
+ cat $(synctex_dir)/$@ >$@
+synctex-xe.c: xetexd.h $(synctex_dir)/synctex.c synctex-xetex.h
+ sed s/TEX-OR-MF-OR-MP/xetex/ $(synctex_dir)/synctex.c >$@
+xetexd.h-with_synctex = if test -z "`grep __SyncTeX__ xetexd.h`";\
+ then\
+ $(synctex_common_texd);\
+ sed -f synctex_sed_command.txt xetexd.h > synctex_xetexd.h;\
+ mv synctex_xetexd.h xetexd.h;\
+ if test -z "`grep __SyncTeX__ xetexd.h`";\
+ then\
+ echo "warning: SyncTeX activation FAILED";\
+ exit 1;\
+ fi;\
+ echo "warning: SyncTeX is enabled";\
+ fi
+xetexd.h-without_synctex = echo "warning: SyncTeX is NOT enabled"
+
diff --git a/Build/source/texk/web2c/tiedir/tie.test b/Build/source/texk/web2c/tiedir/tie.test
new file mode 100755
index 00000000000..7f25fdc4e64
--- /dev/null
+++ b/Build/source/texk/web2c/tiedir/tie.test
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+TEXMFCNF=$srcdir/../kpathsea WEBINPUTS=$srcdir/tiedir \
+ ./tie -c tie.outc tie.tie tie.cf1 tie.cf2 tie.cf3 || exit 1
+
+diff tie.outc $srcdir/tiedir/tie.chf.gen || exit 1
+
+TEXMFCNF=$srcdir/../kpathsea WEBINPUTS=$srcdir/tiedir \
+ ./tie -m tie.outm tie.tie tie.cf1 tie.cf2 tie.cf3 || exit 1
+
+diff tie.outm $srcdir/tiedir/tie.master.gen || exit 1
+
diff --git a/Build/source/texk/web2c/web2c/native/config.h b/Build/source/texk/web2c/web2c/native/config.h
new file mode 100644
index 00000000000..c9b4d5dbc4d
--- /dev/null
+++ b/Build/source/texk/web2c/web2c/native/config.h
@@ -0,0 +1,119 @@
+/* config.h: All .c files include this first.
+
+Copyright (C) 1995, 1996, 2006, 2007 Karl Berry.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, see <http://www.gnu.org/licenses/. */
+
+#ifndef WEB2C_CONFIG_H
+#define WEB2C_CONFIG_H
+
+#if defined (TEX_DLL) && (defined (WIN32) || defined (__CYGWIN__))
+#ifdef MAKE_TEX_DLL
+#define TEXDLL __declspec (dllexport)
+#else /* ! MAKE_TEX_DLL */
+#define TEXDLL __declspec (dllimport)
+#endif
+#else /* ! (TEX_DLL && (WIN32 || __CYGWIN__)) */
+#define TEXDLL
+#endif
+
+/* The stuff from the path searching library. */
+#include <kpathsea/config.h>
+#include <kpathsea/c-auto.h>
+#include <kpathsea/c-vararg.h>
+
+/* How to open a binary file. */
+#include <kpathsea/c-fopen.h>
+
+/* The smallest signed type: use `signed char' if ANSI C, `short' if
+ char is unsigned, otherwise `char'. */
+#ifndef SCHAR_TYPE
+#if __STDC__
+#define SCHAR_TYPE signed char
+#else /* not __STDC */
+#ifdef __CHAR_UNSIGNED__
+#define SCHAR_TYPE short
+#else
+#define SCHAR_TYPE char
+#endif
+#endif /* not __STDC__ */
+#endif /* not SCHAR_TYPE */
+typedef SCHAR_TYPE schar;
+
+/* The type `integer' must be a signed integer capable of holding at
+ least the range of numbers (-2^31)..(2^31-1). If your compiler goes
+ to great lengths to make programs fail, you might have to change this
+ definition. If this changes, you may have to modify
+ web2c/fixwrites.c, since it generates code to do integer output using
+ "%ld", and casts all integral values to be printed to `long'.
+
+ If you define your own INTEGER_TYPE, you have to define your own
+ INTEGER_MAX and INTEGER_MIN, too. */
+#ifndef INTEGER_TYPE
+
+#if SIZEOF_LONG > 4 && !defined (NO_DUMP_SHARE)
+/* If we have 64-bit longs and want to share format files (with 32-bit
+ machines), use `int'. */
+#define INTEGER_IS_INT
+#endif
+
+#ifdef INTEGER_IS_INT
+#define INTEGER_TYPE int
+#define INTEGER_MAX INT_MAX
+#define INTEGER_MIN INT_MIN
+#else
+#define INTEGER_TYPE long
+#define INTEGER_MAX LONG_MAX
+#define INTEGER_MIN LONG_MIN
+#endif /* not INTEGER_IS_INT */
+
+#endif /* not INTEGER_TYPE */
+
+typedef INTEGER_TYPE integer;
+
+/* We need a type that's at least off_t wide */
+typedef off_t longinteger;
+
+
+/* I don't want to write a configure test for remove when all Unix
+ machines have unlink. But, for the sake of non-Unix machines that
+ support ANSI C... */
+#if !defined (unix) && !defined (__unix__) && defined (__STDC__) && !defined (unlink)
+#define unlink remove
+#endif
+
+/* Window support on the Amiga is just for the Amiga. */
+#ifdef AMIGA
+#define AMIGAWIN
+#endif
+
+/* Window support for WIN32 machines. */
+#ifdef WIN32
+#define WIN32WIN
+#endif
+
+/* strtol.c */
+#ifndef HAVE_STRTOL
+extern long strtol P3H(const char *, char **, int);
+#endif
+
+/* From uexit.c. This is here because the lib/ and web2c/ routines
+ themselves can use it, but they don't need cpascal.h. */
+extern void uexit P1H(int status);
+
+/* usage.c */
+extern void usage P1H(const_string progname);
+extern void usagehelp P2H(const_string *message, const_string bug_email);
+
+#endif /* not WEB2C_CONFIG_H */
diff --git a/Build/source/texk/web2c/web2c/native/kpathsea/c-auto.in b/Build/source/texk/web2c/web2c/native/kpathsea/c-auto.in
new file mode 100644
index 00000000000..85a564101fd
--- /dev/null
+++ b/Build/source/texk/web2c/web2c/native/kpathsea/c-auto.in
@@ -0,0 +1,181 @@
+/* native/kpathsea/c-auto.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if the `closedir' function returns void instead of `int'. */
+#undef CLOSEDIR_VOID
+
+/* Define to 1 if you have the <assert.h> header file. */
+#undef HAVE_ASSERT_H
+
+/* Define to 1 if you have the `bcmp' function. */
+#undef HAVE_BCMP
+
+/* Define to 1 if you have the `bcopy' function. */
+#undef HAVE_BCOPY
+
+/* Define to 1 if you have the `bzero' function. */
+#undef HAVE_BZERO
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#undef HAVE_FSEEKO
+
+/* Define to 1 if you have the `getcwd' function. */
+#undef HAVE_GETCWD
+
+/* Define to 1 if you have the `getwd' function. */
+#undef HAVE_GETWD
+
+/* Define to 1 if you have the `index' function. */
+#undef HAVE_INDEX
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the `memcmp' function. */
+#undef HAVE_MEMCMP
+
+/* Define to 1 if you have the `memcpy' function. */
+#undef HAVE_MEMCPY
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you are using GNU libc or otherwise have global variables
+ `program_invocation_name' and `program_invocation_short_name'. */
+#undef HAVE_PROGRAM_INVOCATION_NAME
+
+/* Define to 1 if your compiler understands prototypes. */
+#undef HAVE_PROTOTYPES
+
+/* Define to 1 if you have the `putenv' function. */
+#undef HAVE_PUTENV
+
+/* Define to 1 if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
+/* Define to 1 if you have the `rindex' function. */
+#undef HAVE_RINDEX
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the `strerror' function. */
+#undef HAVE_STRERROR
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the `strstr' function. */
+#undef HAVE_STRSTR
+
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
+
+/* Define to 1 if `st_mtim' is member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_MTIM
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+ `char[]'. */
+#undef YYTEXT_POINTER
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
diff --git a/Build/source/texk/web2c/xetexdir/am/xetex.am b/Build/source/texk/web2c/xetexdir/am/xetex.am
new file mode 100644
index 00000000000..62aff84e37c
--- /dev/null
+++ b/Build/source/texk/web2c/xetexdir/am/xetex.am
@@ -0,0 +1,71 @@
+## texk/web2c/xetexdir/am/xetex.am: Makefile fragment for XeTeX.
+
+## XeTeX
+##
+EXTRA_DIST += \
+ xetexdir/FontTableCache.cpp \
+ xetexdir/FontTableCache.h \
+ xetexdir/MathTable.h \
+ xetexdir/XeTeXFontInst.cpp \
+ xetexdir/XeTeXFontInst.h \
+ xetexdir/XeTeXFontInst_FT2.cpp \
+ xetexdir/XeTeXFontInst_FT2.h \
+ xetexdir/XeTeXFontInst_Mac.cpp \
+ xetexdir/XeTeXFontInst_Mac.h \
+ xetexdir/XeTeXFontMgr.cpp \
+ xetexdir/XeTeXFontMgr.h \
+ xetexdir/XeTeXFontMgr_FC.cpp \
+ xetexdir/XeTeXFontMgr_FC.h \
+ xetexdir/XeTeXFontMgr_Mac.h \
+ xetexdir/XeTeXFontMgr_Mac.mm \
+ xetexdir/XeTeXGrLayout.cpp \
+ xetexdir/XeTeXGrLayout.h \
+ xetexdir/XeTeXLayoutInterface.cpp \
+ xetexdir/XeTeXLayoutInterface.h \
+ xetexdir/XeTeXOTLayoutEngine.cpp \
+ xetexdir/XeTeXOTLayoutEngine.h \
+ xetexdir/XeTeXOTMath.cpp \
+ xetexdir/XeTeXOTMath.h \
+ xetexdir/XeTeX_ext.c \
+ xetexdir/XeTeX_ext.h \
+ xetexdir/XeTeX_mac.c \
+ xetexdir/XeTeX_pic.c \
+ xetexdir/XeTeXswap.h \
+ xetexdir/appleGlyphNames.c \
+ xetexdir/bmpimage.c \
+ xetexdir/bmpimage.h \
+ xetexdir/cmaps.cpp \
+ xetexdir/cmaps.h \
+ xetexdir/jpegimage.c \
+ xetexdir/jpegimage.h \
+ xetexdir/mfileio.c \
+ xetexdir/mfileio.h \
+ xetexdir/numbers.c \
+ xetexdir/numbers.h \
+ xetexdir/pdfimage.cpp \
+ xetexdir/pdfimage.h \
+ xetexdir/pngimage.c \
+ xetexdir/pngimage.h \
+ xetexdir/pool2c.pl \
+ xetexdir/sfnt.h \
+ xetexdir/trans.c \
+ xetexdir/trans.h \
+ xetexdir/unicode-char-prep.pl \
+ xetexdir/xetex.ch \
+ xetexdir/xetex.defines \
+ xetexdir/xetex.h \
+ xetexdir/xetexextra.in
+
+## Not used
+##
+EXTRA_DIST += \
+ xetexdir/LICENSE.txt
+
+## Eventually delete these files
+##
+EXTRA_DIST += \
+ xetexdir/acx_pthread.m4 \
+ xetexdir/tests.ac \
+ xetexdir/withenable.ac \
+ xetexdir/xetex.mk
+
diff --git a/Build/source/texk/xdv2pdf/Makefile.in.orig b/Build/source/texk/xdv2pdf/Makefile.in.orig
new file mode 100644
index 00000000000..1b1183e6562
--- /dev/null
+++ b/Build/source/texk/xdv2pdf/Makefile.in.orig
@@ -0,0 +1,80 @@
+# @configure_input@
+
+kpse_include ../make/paths.mk
+kpse_include ../make/common.mk
+kpse_include ../make/programs.mk
+
+CXX = c++
+OBJC = cc
+CXXLD = $(CXX)
+cxx_link_command = $(CXXLD) -o $@ $(LDFLAGS)
+kpathsea_cxx_link = $(LIBTOOL) --mode=link $(cxx_link_command)
+
+ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir)
+ALL_OBJCFLAGS = @DEFS@ $(XXOBJCFLAGS) -I. -I$(srcdir)
+
+.SUFFIXES: .cpp .o .m
+.cpp.o:
+ $(CXX) $(ALL_CXXFLAGS) -c $<
+.m.o:
+ $(OBJC) $(ALL_OBJCFLAGS) -c $<
+
+FRAMEWORKS = \
+ -framework Carbon \
+ -framework QuickTime
+
+FRAMEWORKS_t1w = -framework Cocoa
+LIBS_t1w = # -lm
+
+program = xdv2pdf
+t1wrap = T1Wrap
+programs = $(program) $(t1wrap)
+default all: $(programs)
+
+objects=xdv2pdf_main.o xdv2pdf.o xdv2pdf_specials.o
+
+objects_t1w=T1Wrap.o SimplePSInterpreter.o
+
+$(objects): Makefile
+$(objects_t1m): Makefile
+
+$(program): $(objects) $(kpathsea) $(ALL_LIBS_DEP)
+ $(kpathsea_cxx_link) $(objects) $(FRAMEWORKS) $(LOADLIBES)
+
+$(t1wrap): $(objects_t1w)
+ $(kpathsea_cxx_link) $(objects_t1w) $(FRAMEWORKS_t1w) $(LOADLIBES)
+
+T1Wrap.o: $(srcdir)/T1Wrap.m
+ $(OBJC) $(ALL_OBJCFLAGS) -c $<
+
+SimplePSInterpreter.o: $(srcdir)/SimplePSInterpreter.m
+ $(OBJC) $(ALL_OBJCFLAGS) -c $<
+
+kpse_include ../make/tkpathsea.mk
+
+install: install-exec install-data
+uninstall: uninstall-exec uninstall-data
+
+distclean::
+ $(RM) c-auto.h
+
+install-exec:
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir)
+ $(INSTALL_LIBTOOL_PROG) $(program) $(bindir)
+ $(INSTALL) $(t1wrap) $(bindir)
+
+uninstall-exec:
+ cd $(bindir); rm -f $(programs)
+
+install-data:
+ $(SHELL) $(top_srcdir)/../mkinstalldirs $(man1dir)
+
+uninstall-data:
+
+kpse_include ../make/config.mk
+
+info dvi check:
+
+kpse_include ../make/clean.mk
+kpse_include ../make/rdepend.mk
+kpse_include depend.mk
diff --git a/Build/source/texk/xdv2pdf/ac/withenable.ac b/Build/source/texk/xdv2pdf/ac/withenable.ac
new file mode 100644
index 00000000000..5cf14d7e517
--- /dev/null
+++ b/Build/source/texk/xdv2pdf/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/xdv2pdf/ac/withenable.ac
+## configure options and TL libraries required for xdv2pdf
+KPSE_WITH_PROG([xdv2pdf], [kpathsea])
diff --git a/Build/source/texk/xdv2pdf/configure.in.orig b/Build/source/texk/xdv2pdf/configure.in.orig
new file mode 100644
index 00000000000..5e89a2cd668
--- /dev/null
+++ b/Build/source/texk/xdv2pdf/configure.in.orig
@@ -0,0 +1,66 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(xdv2pdf.cpp)
+
+define([_version_],"0.998")
+
+VERSION=_version_
+AC_SUBST(VERSION)
+AC_DEFINE(VERSION, _version_, [package version])
+AC_DEFINE(PACKAGE, "xdv2pdf", [package name])
+
+AC_CONFIG_HEADERS([c-auto.h:c-auto.in], [date >stamp-auto])
+
+dnl Disable maintainer portions of included makefile fragments
+MAINT='#'
+AC_SUBST(MAINT)
+
+dnl First, check if we're configuring on Mac OS X -- can't build elsewhere
+
+sinclude(../web2c/xetexdir/tests.ac)
+
+AC_HAS_CARBON
+if test "x$has_carbon" = xno; then
+ with_xdv2pdf=no
+ exit
+fi
+
+AC_HAS_QUICKTIME
+if test "x$has_quicktime" = xno; then
+ with_xdv2pdf=no
+ exit
+fi
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+
+AC_DEFINE([KPATHSEA], 1, [define if you have kpathsea])
+AC_DEFINE([HAVE_KPATHSEA], 1, [define if you have kpathsea])
+AC_DEFINE([HAVE_KPSE_FORMATS], 1, [define if kpathsea supports type1 and vf formats])
+
+TTF_OPT=''
+AC_SUBST(TTF_OPT)
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+
+AC_C_BIGENDIAN
+
+dnl Checks for library functions.
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS(strspn system)
+AC_CHECK_LIB(m, main)
+
+KPSE_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/Build/source/texk/xdvipdfmx/Makefile.in.orig b/Build/source/texk/xdvipdfmx/Makefile.in.orig
new file mode 100644
index 00000000000..5c9d9716c63
--- /dev/null
+++ b/Build/source/texk/xdvipdfmx/Makefile.in.orig
@@ -0,0 +1,660 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# SUBDIRS = data src
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
+ TODO compile config.guess config.sub depcomp install-sh \
+ ltmain.sh missing mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/cho-kpse.m4 \
+ $(top_srcdir)/m4/cho-libs.m4 $(top_srcdir)/m4/jfk-macos.m4 \
+ $(top_srcdir)/m4/maw-time.m4 \
+ $(top_srcdir)/../../libs/zlib/withenable.ac \
+ $(top_srcdir)/../../libs/zlib/zlib.ac \
+ $(top_srcdir)/../../libs/libpng/withenable.ac \
+ $(top_srcdir)/../../libs/libpng/libpng.ac \
+ $(top_srcdir)/../../libs/freetype2/withenable.ac \
+ $(top_srcdir)/../../libs/freetype2/freetype2.ac \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FREETYPE2CPPFLAGS = @FREETYPE2CPPFLAGS@
+FREETYPE2DEP = @FREETYPE2DEP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LDFREETYPE2 = @LDFREETYPE2@
+LDLIBPNG = @LDLIBPNG@
+LDZLIB = @LDZLIB@
+LIBOBJS = @LIBOBJS@
+LIBPNGCPPFLAGS = @LIBPNGCPPFLAGS@
+LIBPNGDEP = @LIBPNGDEP@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NMEDIT = @NMEDIT@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ZLIBCPPFLAGS = @ZLIBCPPFLAGS@
+ZLIBDEP = @ZLIBDEP@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+dvipdfmx_LDFLAGS = @dvipdfmx_LDFLAGS@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+xdvipdfmx_LDFLAGS = @xdvipdfmx_LDFLAGS@
+
+# skip the data subdir; we rely on dvipdfmx to provide those files
+SUBDIRS = src
+ACLOCAL_AMFLAGS = -I m4
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+ cd $(srcdir) && $(AUTOMAKE) --gnu \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d $(distdir) || mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-generic \
+ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
+ dist-gzip dist-lzma dist-shar dist-tarZ dist-zip distcheck \
+ distclean distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/texk/xdvipdfmx/ac/withenable.ac b/Build/source/texk/xdvipdfmx/ac/withenable.ac
new file mode 100644
index 00000000000..f7c6cb26807
--- /dev/null
+++ b/Build/source/texk/xdvipdfmx/ac/withenable.ac
@@ -0,0 +1,3 @@
+## texk/xdvipdfmx/ac/withenable.ac
+## configure options and TL libraries required for xdvipdfmx
+KPSE_WITH_PROG([xdvipdfmx], [kpathsea freetype2 libpng])
diff --git a/Build/source/texk/xdvipdfmx/configure.in.orig b/Build/source/texk/xdvipdfmx/configure.in.orig
new file mode 100644
index 00000000000..0f9f4a615bb
--- /dev/null
+++ b/Build/source/texk/xdvipdfmx/configure.in.orig
@@ -0,0 +1,181 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(src/dvipdfmx.c)
+AM_INIT_AUTOMAKE(xdvipdfmx, 0.7.3)
+AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE
+
+dnl Checks for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_PROG_LIBTOOL
+
+AC_SYS_LARGEFILE
+AC_FUNC_FSEEKO
+
+# Building inside teTeX or TeX Live?
+AC_ARG_ENABLE(tetex-build, [ --enable-tetex-build build as part of a teTeX installation])
+
+
+dnl Check for kpathsea library. (required)
+if test "x$enable_tetex_build" = xyes; then
+ # In teTeX and TeX Live, LDFLAGS is passed by texk/Makefile and
+ # reserved for the user. Therefore we need another variable for the
+ # loader flags to find the local kpathsea. We use xdvipdfmx_LDFLAGS
+ # since Automake already sets that up in the link command.
+ xdvipdfmx_LDFLAGS=
+ AC_SUBST(xdvipdfmx_LDFLAGS)
+
+ if test ! -d $srcdir/../../texk/kpathsea; then
+ AC_MSG_ERROR([
+=========================================
+
+You specified --enable-tetex-build, but I can't find the kpathsea
+directory. I expected it to be in $srcdir/../../texk/kpathsea.
+
+=========================================])
+ fi
+ CPPFLAGS="$CPPFLAGS -I\$(top_builddir)/../../texk -I\$(top_srcdir)/../../texk"
+ xdvipdfmx_LDFLAGS="-L\$(top_builddir)/../../texk/kpathsea/.libs"
+
+ AM_CONDITIONAL(TDS_VERSION_11, true)
+ AC_DEFINE([__TDS_VERSION__], 0x200406L)
+else
+ dnl Don't bother going further if we don't have kpse installed.
+ AC_ARG_WITH(kpathsea,
+ [ --with-kpathsea=DIR use kpathsea include/library files from DIR], [
+ if test -d "$withval"; then
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ fi
+ ], [
+ if test -d "$prefix"; then
+ CPPFLAGS="$CPPFLAGS -I$prefix/include"
+ LDFLAGS="$LDFLAGS -L$prefix/lib"
+ else
+ CPPFLAGS="$CPPFLAGS -I$ac_default_prefix/include"
+ LDFLAGS="$LDFLAGS -L$ac_default_prefix/lib"
+ fi
+ ])
+
+ AC_CHECK_LIB(kpathsea, kpse_find_file, [LIBS="-lkpathsea $LIBS"],
+ AC_MSG_ERROR([kpathsea library not found
+This version of xdvipdfmx requires the kpathsea library and its headers. If
+you know where it is you might try setting the LDFLAGS environment variable
+with -L pointing to the directory containing libkpathsea.a.
+ ])
+ )
+
+ dnl Check kpathsea support for required formats and funcs.
+ CHO_CHECK_KPSE_SUPPORT([xdvipdfmx])
+
+ dnl Check for TDS version kpathsea library supports.
+ CHO_CHECK_KPSE_TDS_VERSION
+
+ dnl Check for libfreetype, required for xdvipdfmx features
+ CHO_CHECK_LIBFREETYPE([xdvipdfmx])
+fi
+
+dnl Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS(unistd.h)
+AC_CHECK_HEADERS(stdint.h inttypes.h sys/types.h)
+
+dnl Checks for library functions.
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS(open close system getenv mkstemp basename)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+MAW_EXT_TIMEZONE
+MAW_TZ_HAS_TM_GMTOFF
+
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+AC_STRUCT_TIMEZONE
+AC_C_BIGENDIAN
+
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+
+
+dnl Check for additonal libraries.
+
+JFK_HAS_APP_SERVICES
+if test "x$have_app_services" = xno; then
+ CHO_HAS_LIBFONTCONFIG
+fi
+
+# check that it's valid to define XETEX and possibly XETEX_MAC
+if test "x$have_app_services" = xyes; then
+ AC_DEFINE([XETEX], [], [Define if part of a teTeX/TeX live build.])
+ AC_DEFINE([XETEX_MAC], [], [Define if part of a teTeX/TeX live build for Mac OS X.])
+elif test "x$have_libfontconfig" = xyes; then
+ AC_DEFINE([XETEX])
+else
+ AC_MSG_ERROR([fontconfig library or ApplicationServices framework not found.
+This version of xdvipdfmx requires either ApplicationServices (on Mac OS X)
+or the fontconfig library (on other platforms) to be available, otherwise it
+cannot support XeTeX output using standard system-installed fonts.
+ ])
+fi
+
+if test "x$enable_tetex_build" = xyes; then
+ # Get these common libraries from the sources, too.
+ # Seems like it would be simpler to treat kpathsea this way too, but
+ # we're just starting from what lcdf-typetools did.
+ sinclude(../../libs/zlib/withenable.ac)
+ sinclude(../../libs/zlib/zlib.ac)
+
+ sinclude(../../libs/libpng/withenable.ac)
+ sinclude(../../libs/libpng/libpng.ac)
+
+ sinclude(../../libs/freetype2/withenable.ac)
+ sinclude(../../libs/freetype2/freetype2.ac)
+
+ # yes, we have zlib and png.
+ AC_DEFINE(HAVE_ZLIB)
+ AC_DEFINE(HAVE_LIBPNG)
+ AC_DEFINE([HAVE_FREETYPE2], [], [Define if you have freetype2 and its headers])
+
+ # You must define HAVE_ZLIB_COMPRESS2 to enable '-z' option for controlling
+ # zlib compression level, but zlib.ac included above does not do this test.
+ # We assume zlib always has compress2() here although that's not always true.
+ AC_DEFINE([HAVE_ZLIB_COMPRESS2], 1)
+
+ # tetex/tex live build; this always has kpathsea, xbasename, etc.,
+ # as we're building from current sources. Do this stuff at the end so
+ # other configure tests don't try to link with kpathsea (which doesn't
+ # exist at configure time).
+ LIBS="-lkpathsea -lm $LIBS"
+ xdvipdfmx_LDFLAGS="$xdvipdfmx_LDFLAGS $FONTCONFIGLDFLAGS"
+ AC_SUBST(xdvipdfmx_LDFLAGS)
+ AC_MSG_NOTICE([tetex build enabled, LIBS now: $LIBS])
+else
+ CHO_HAS_LIBPAPER
+ CHO_HAS_ZLIB
+ CHO_HAS_LIBPNG
+
+dnl these variables are defined in the tetex case and used in src/Makefile.am.
+dnl just let them be empty.
+ AC_SUBST(LIBPNGCPPFLAGS)
+ AC_SUBST(LDLIBPNG)
+ AC_SUBST(LIBPNGDEP)
+ AC_SUBST(ZLIBCPPFLAGS)
+ AC_SUBST(LDZLIB)
+ AC_SUBST(ZLIBDEP)
+ AC_SUBST(FREETYPE2CPPFLAGS)
+ AC_SUBST(LDFREETYPE2)
+ AC_SUBST(FREETYPE2DEP)
+ AC_SUBST(dvipdfmx_LDFLAGS)
+ AC_SUBST(xdvipdfmx_LDFLAGS)
+fi
+
+AC_CONFIG_FILES([Makefile data/Makefile src/Makefile])
+AC_OUTPUT
+
diff --git a/Build/source/utils/README.orig b/Build/source/utils/README.orig
new file mode 100644
index 00000000000..8e82eccff53
--- /dev/null
+++ b/Build/source/utils/README.orig
@@ -0,0 +1,83 @@
+$Id$
+Copyright 2005, 2006, 2007, 2008, 2009 TeX Users Group.
+You may freely use, modify and/or distribute this file.
+
+Extra utilities we (optionally) compile for TeX Live.
+See comments in ../texk/README.
+
+dialog - seems to be a v1.0 in debian, asked te 5jun05; he said keep as-is
+ or else go through testing.
+ http://hightek.org/dialog/
+ http://packages.debian.org/cgi-bin/search_packages.pl?searchon=names&version=all&exact=1&keywords=dialog
+
+gzip - (old, not built) only here so we have the sources for the Windows
+ binaries we distribute.
+
+lzma 4.32.6 - ok 15may08
+ we do not compile/install in normal build, sources are here for installer;
+ see http://tug.org/texlive/build.html for info.
+ http://tukaani.org/lzma
+
+pdfopen 0.5 - ok 26nov06
+ (really xpdfopen)
+ http://tex.aanhet.net/pdfopen
+
+ps2eps 1.64 - ok 19feb08
+ http://www.ipv6.tm.uka.de/~bless/ps2eps
+
+psutils p17 - ok 25nov06
+ (Fabrice made small modifications for Windows, it seems)
+ http://www.ctan.org/support/psutils/
+
+t1utils 1.34 - checked 2mar08
+ http://www.lcdf.org/type/
+
+tpic2pdftex
+ http://www.ctan.org/graphics/tpic2pdftex
+
+vlna 1.2 - ok 26jun08
+ ftp://math.feld.cvut.cz/pub/olsak/vlna
+
+
+xindy 2.3 - ok 24mar08
+ (with numerous adaptations for TL by Vladimir)
+ http://www.ctan.org/indexing/xindy/
+
+After building clisp as described below, run the TL
+ Build --with-xindy --with-clisp=$clisp_builddir/clisp
+to include xindy in the build. It is disabled by default.
+
+Do NOT use nohup when building clisp; this may cause weird build
+problems. Regular redirections of stdout/stderr seem ok.
+
+mkdir clisp; cd clisp
+clisp_basedir=`pwd`
+clisp_toolsdir=$clisp_basedir/clisp-tools
+clisp_builddir=$clisp_basedir/clisp-build
+mkdir $clisp_toolsdir
+
+cd $clisp_basedir
+wget http://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.6.tar.gz
+gzip -dc libsigsegv-2.6.tar.gz | tar xf -
+cd libsigsegv-2.6
+./configure --prefix=$clisp_toolsdir && make && make check && make install
+
+cd $clisp_basedir
+wget http://www.haible.de/bruno/gnu/ffcall-1.10.tar.gz
+gzip -dc ffcall-1.10.tar.gz | tar xf -
+cd ffcall-1.10
+./configure --prefix=$clisp_toolsdir && make && make check && make install
+
+# you may need this hack on 64-bit systems
+# if clisp's configure will not find libsigsegv and/or libffcall:
+ln -s lib $clisp_toolsdir/lib64
+
+cd $clisp_basedir
+wget http://ftp.gnu.org/gnu/clisp/release/2.46/clisp-2.46.tar.gz
+gzip -dc clisp-2.46.tar.gz | tar xf -
+cd clisp-2.46
+./configure --with-ffcall --with-libffcall-prefix=$clisp_toolsdir \
+ --with-libsigsegv-prefix=$clisp_toolsdir --without-readline \
+ $clisp_builddir \
+&& cd $clisp_builddir \
+&& make
diff --git a/Build/source/utils/ac/withenable.ac b/Build/source/utils/ac/withenable.ac
new file mode 100644
index 00000000000..c9627fa6891
--- /dev/null
+++ b/Build/source/utils/ac/withenable.ac
@@ -0,0 +1 @@
+## utils/ac/withenable.ac
diff --git a/Build/source/utils/dialog/ac/withenable.ac b/Build/source/utils/dialog/ac/withenable.ac
new file mode 100644
index 00000000000..e0383ea4259
--- /dev/null
+++ b/Build/source/utils/dialog/ac/withenable.ac
@@ -0,0 +1,3 @@
+## utils/dialog/ac/withenable.ac
+## configure options and TL libraries required for dialog
+KPSE_WITH_PROG([dialog])
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/CHANGES b/Build/source/utils/dialog/dialog-1.1-20080819/CHANGES
new file mode 100644
index 00000000000..ac850ba7667
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/CHANGES
@@ -0,0 +1,1429 @@
+-- $Id: CHANGES,v 1.264 2008/08/19 23:36:46 tom Exp $
+-- Thomas E. Dickey <dickey@invisible-island.net>
+
+This version of dialog was originally from a Debian snapshot. I've done this
+to it:
+
+2008/08/19
+ + amend changes to quoting; by default, the checklist widget quotes its
+ output except when --separate-output is used (Debian #495600).
+ + add eo.po from
+ http://translationproject.org/latest/dialog/
+
+2008/07/27
+ + add pointer-check when closing piped input (cf: 2007/03/25)
+ + use here-documents rather than echo, when passing backslashes in
+ strings, to accommodate the Debian shell "dash" (Debian #489563).
+ + recode several ".po" files to UTF-8 for consistency.
+ + change --separator to be an alias for --output-separator, for
+ compatibility with Xdialog.
+ + add --output-separator option to allow scripts to change the output
+ separator from a newline (for --separate-output) or a space. This
+ applies to other widgets such as forms and editboxes which normally
+ use a newline.
+ + add --column-separator option, to tell where column-aligned data for
+ radio/checkboxes or menus should be split into columns (request by
+ Ben Dibbens).
+ + add id.po, ku.po, lt.po, nb.po and update ca.po, fr.po, gl.po, ja.po,
+ th.po from
+ http://translationproject.org/latest/dialog/
+ + add "--quoted" option, to quote values returned by formbox, etc.
+ + change names of EX/ES macros in dialog.1 to work around name-
+ pollution caused by changes in Debian #470729.
+
+2008/03/16
+ + modify dlg_mouse_wgetch() to loop only on errors that it detects,
+ rather than on errors forwarded from dlg_getc(), in case those are
+ due to a disconnected terminal (report by Anatoli Sakhnik).
+ + allow "default" color in dialogrc file (request by Dashing).
+ + fix an indexing error in formbox (Debian #469190, report by Dmitry
+ Gomerman, patch by Vladimir Mezentsev).
+ + add bindings for CTL/N, CTL/P to checklist, fselect and menubox
+ widgets (prompted by discussion with John Gatewood Ham).
+ + add be@latin.po, th.po and update zh_TW.po from
+ http://translationproject.org/latest/dialog/
+ > patches by Peter Astrand:
+ + modify dlg_auto_sizefile() to ensure the computed height and width
+ do not extend beyond the screen size.
+ + use unctrl() to make inputstr.c work with Solaris curses.
+ > patches by Yura Kalinichenko:
+ + extend pause widget to use ok/cancel buttons (the former giving the
+ same result as a timeout), rather than an exit-button.
+ + fix initialization parameter of inputbox for multibyte characters.
+
+2007/10/28
+ + improve layout of checklist.c, menubox.c, ensuring that the list fits
+ within the available space (report by Gordon Schumacher).
+ + undo removal of redundant chunk from checklist.c in 2007/02/27,
+ since some scripts depend on this (Debian #443077).
+ + update nl.po from
+ http://translationproject.org/latest/dialog/
+
+2007/09/30
+ + correct cursor position in editbox after deleting past left margin
+ (report by Joe McDonagh).
+ + add "--no-ok" option (patch by Klaus Knopper).
+ + modify "--file" option to allow it to read from sources other than
+ a regular file (patch by Pieter van Beek).
+ + improved hi.po (Hindi) (from Klaus Knopper).
+ + fix masking of attributes in dlg_draw_shadow() which lost
+ line-drawing bit (report by David Everly).
+ + fix editbox widget to handle zero-length files (report by Joe
+ McDonagh).
+ + update "po" files eu.po ga.po it.po ms.po sv.po vi.po wa.po zh_CN.po
+ from
+ http://translationproject.org/latest/dialog/
+
+2007/07/04
+ + revise the resizable shadows so textbox's search dialog has text
+ visible in the shadow again.
+ + improve the prefixing of autoconf-related symbols in the installed
+ header files, taking into account symbols which are not mentioned in
+ dlg_config.h
+ + add a check when ERR returned from wgetch() to ensure that the
+ input/output streams are still valid. If that happens, force
+ ESC to be returned, quitting dialog (report by Reiner Huober).
+ + add extern "C" declarations to dlg_keys.h so the corresponding
+ function declarations are exported to C++ as C symbols.
+ + updated config.guess, config.sub
+
+2007/06/04
+ + fix a memory leak in editbox.c
+ + revise change from 2007/02/27 which moved the logic for trimming
+ option text out of the loop because that moved it before
+ initialization of the "--trim" option. Put it back in the loop, but
+ limit the tokens which are trimmed to cover only those for the
+ current widget. Also ensure that all tokens for a widget are
+ trimmed, rather than only the first, which is usually text (report by
+ Lai Zit Seng).
+ + add _FILE_OFFSET_BITS definition in CF_LARGEFILE configure macro.
+
+2007/05/28
+ + revise changes needed to make textbox's searchbox handle ncurses
+ resizing events, e.g., by handling the ERR in that code rather than
+ in dlg_getc() (Debian #423732).
+
+2007/05/14
+ + supply a repaint_text() call in tailbox.c which was bypassed because
+ dlg_getc() now retries on ERR (Debian #423732, cf: 2007/02/27).
+ + modify dlg_getc() to fix regression in 2007/02/27 for use of
+ timeouts, broken by fixes to allow resizing of textbox (patch by
+ Arnaud Fontaine, Debian #418905).
+ + modify dlg_getc() to fix regression in use of TAB for traversal of
+ tailboxbg widgets due to changes for user-definable key bindings
+ (Debian #418917, cf: 2005/12/07).
+
+2007/04/09
+ + add case in dlg_getc() to handle tab for traversing between widgets
+ as in the samples/tailboxbg1 script. Normally the key binding
+ overrides, except for the special case where multiple widgets are
+ available.
+ + add configure --with-libtool-opts, which passes its value to the
+ library creation and linkage passes, e.g.,
+ --with-libtool-opts=-static
+ to force the result to be static libraries (prompted by a related
+ request by Santiago Vila).
+ > several fixes based on Coverity scan:
+ + fix memory leak in timebox, calendar widgets if the widget cannot
+ be created.
+ + fix memory leak in dlg_key.c if a user binding's storage cannot
+ be allocated.
+ + fix improperly delinked entry in dlg_del_window().
+
+2007/03/25
+ + improve mkdirs.sh to ignore error from mkdir if the target directory
+ happens to already exist (suggested by Harald van Dijk).
+ + amend documentation for --gauge to reflect longstanding quirk which
+ allows it to read percentage from the first line after an "XXX"
+ (Debian #415596).
+ + fix makefile dependency so "configure && make install-lib" works.
+ + fix resizing of msgbox; the message was not repainted (Debian
+ #415022, patch by Brian Rolfe).
+ + fix typo in makefile LIB_OBJECT symbol from 2007/02/27 changes.
+ + improve CF_MBSTATE_T by including stdio.h, needed on Tru64 to make
+ the test-compile work.
+ + change makefile to install dialog.3 as part of install-lib rather
+ than install-man (report by Thomas Klausner).
+ + use $(INSTALL_SCRIPT) for installing dialog-config (report by
+ Santiago Vila).
+
+2007/02/27
+ + add dialog-config script, which provides applications with compile-
+ and link-information for using the dialog library.
+ + move calls to dlg_trim_string() out of loop in dialog.c, so each
+ string is trimmed once (report by Ivanov Makcim).
+ + modify textbox.c to allow resizing while the search box is presented.
+ This relies on bug-fix in ncurses 5.6 20070224.
+ + use dgettext() rather than gettext() to allow libdialog to use the
+ messages installed for dialog (patch by Vajna Miklos).
+ + modify inputbox to position the cursor initially at the end of any
+ initial-text (request by Klaus Knopper).
+ + add configure --with-valgrind for testing.
+ + add --trace option, for debugging.
+ + add --ascii-lines and --no-lines options to control the way the
+ line-drawing characters are rendered (request by Klaus Knopper).
+ + add --keep-tite option, to override suppression of smcup/rmcup
+ (termcap ti/te) strings which would switch to xterm's alternate
+ screen (Debian #380665).
+ + modify fselect/dselect to use space-character as a completion
+ operator like tab in shells (patch by Yoram Bar Haim).
+ + remove a redundant chunk from checklist.c which reported status a
+ second time if the help-button was pressed but no item-help option
+ was in effect (Andre C Barros).
+ + fix return-status from "dialog --pause" (Debian #409254).
+ + add --mixedform and --mixedgauge dialogs based on patch from
+ Kiran Cherupally.
+ + add some notes on compatibility to the manpage.
+ + add editbox dialog (compatible with Xdialog, Debian #368478).
+ + add dselect dialog (compatible with Xdialog).
+ + remove an incorrect initialization of .text_flen from 2005/12/07
+ changes, which made all fields in a form editable (Debian #404045).
+ + report error and exit if a filename given for the --file option
+ cannot be opened (report by "Dog Walker").
+ + make --program-prefix, etc., work in configure script, e.g., to make
+ program install as "cdialog". This does not alter the library name.
+ + add install-bin, install-man (and uninstall) rules to makefile.
+ + updates for configure script macros (originally vile, lynx, xterm):
+ AM_PATH_PROG_WITH_TEST, AM_WITH_NLS, CF_CURSES_CPPFLAGS,
+ CF_CURSES_LIBS, CF_INCLUDE_DIRS, CF_LARGEFILE, CF_MAKEFLAGS,
+ CF_PATH_SYNTAX, CF_SUBDIR_PATH, CF_SUBST, CF_WITH_DBMALLOC,
+ CF_WITH_DMALLOC, CF_WITH_LIBTOOL and CF_XOPEN_SOURCE.
+ + updated config.guess, config.sub
+ > adapted fixes from SuSE package (Werner Fink):
+ + add some limit-checks in dlg_draw_shadow().
+ + make shadows resizable, using new dlg_move_window() in msgbox.c
+ and yesno.c
+ + add dialog_state.input, use this in end_dialog() to decide whether
+ to close pipe inputs and call _exit(), or simply call exit().
+ + modify dlg_ctl_size() to check if the reason for failure is because
+ shadows were used; retry in that case without shadows.
+ + add signal catcher for SIGSEGV.
+
+2006/02/21
+ + fix logic in split-out dlg_menu() to separate inputmenu and menu
+ handling (report by Auke Kok).
+
+2006/01/26
+ + fix fselect.c to compile properly with Intel compiler and largefile
+ option.
+ + improve configure script checks for curses headers to work around
+ breakage in some packages, e.g., cygwin.
+ + amend correction to menubox, fixes normal menus (Debian #349969).
+
+2006/01/19
+ + completed dialog.3 manpage
+ + modify configure script option --with-gauge to cover all flavors of
+ the gauge (gauge, pause, progressbox).
+ + add progressbox widget, a hybrid of gauge and tailbox (Reznic Valery).
+ + fix a comparison in checklist.c to avoid unneeded arrows when the
+ list happens to fit in the window (patch by Peter Postma).
+ + correct wrapping computation in print_line() from 2005/11/07 changes
+ (report by Barry Kauler).
+ + update sv.po (comments only).
+ http://www.iro.umontreal.ca/translation/maint/dialog/
+ + correct logic that passes the callback for menubox to do inputmenu
+ operations from 2005/12/7 changes (report by Reznic Valery).
+
+2006/01/01
+ + add a null-pointer check in dlg_register_buttons(), needed for the
+ tailboxbg (Debian #345524).
+ + fix a few memory leaks reported by valgrind.
+
+2005/12/19
+ + correct return-values of new functions dlg_default_listitem() and
+ dlg_default_formitem() (Debian #344002).
+ + add Swedish translation (Debian #343303, by Daniel Nylander)
+ + begin function-summaries in dialog.3
+ + update config.guess, config.sub
+
+2005/12/07
+ + change license to LGPL.
+ + change naming convention in dlg_colors.h to make it easier to read,
+ and incidentally remove the last chunk of code preventing relicense.
+ + add --passwordform (request by Reznic Valery).
+ + modify pause.c, msgbox.c to work with --help-button.
+ + modify formbox.c, inputbox.c, textbox.c, yesno.c to work with extra
+ button (adapted from Reznic Valery patch).
+ + modify dlg_exit_label(), dlg_yes_labels() and dlg_ok_label() to allow
+ help-button (prompted by Reznic Valery patch).
+ + add zh_CN.po file from
+ http://www.iro.umontreal.ca/translation/maint/dialog/
+ + provide alternate interfaces for dialog_checklist(), dialog_menu()
+ and dialog_form(): dlg_checklist(), dlg_menu() and dlg_form()
+ (discussion with Michael Gebetsroither).
+ + add/use dlg_result_key() to allow binding function keys to the
+ buttons.
+ + implement user-definable key bindings in the rc-file.
+ + modify inline cases for KEY_xxx values to use binding tables in new
+ module dlg_keys.c
+ + add several DIALOG_STATE items to the rc file: aspect,
+ separate_widget, tab_len and visit_links
+ + add a tab-adjustment to dlg_print_text() to improve solution from
+ 2005/10/30, e.g., in the samples/form* scripts.
+ + fix an off-by-one which made mouse-selection not work for menu items
+ past the first page (GenToo #112024, patch by Harald van Dijk).
+
+2005/11/07
+ + extend dlg_add_result() to allow caller to pass a null pointer
+ for dialog_vars.input_result (Debian #336986).
+ + correct length used for text portion of radio/checkboxes (report by
+ Valentin Stoykov).
+ + modify msgbox, textbox and center_label() to work properly for
+ LANG=bg_BG.utf8 examples by Valentin Stoykov.
+ + modify use of freopen() to work with opaque FILE type on DragonFly
+ (report by Jeremy C Reed).
+ + modify print_line() to compute columns, use that for the call to
+ dlg_print_line(). Fix a few places where strlen() was used instead
+ of dlg_count_columns() (reports by Valentin Stoykov).
+
+2005/10/30
+ + reviewed changes since beginning development in 1999, decided that
+ there are no appreciable portions of original code remaining.
+ Marked sources to correspond.
+ + improve cache performance for inputstr.c using tsearch() rather than
+ a linked-list search (Debian #294853).
+ + remove a special case for darwin in CF_XOPEN_SOURCE configure macro.
+ + add ms.po file from
+ http://www.iro.umontreal.ca/translation/maint/dialog/
+ + remove an assignment that caused the cursor to appear initially on a
+ form field rather than button (Debian #333506).
+ + modify buttons.c to count columns rather than bytes, fixing case
+ where buttons were laid out incorrectly (report by Valentin Stoykov).
+ + change dlg_print_text() to count columns rather than bytes, fixing
+ case where fewer columns were displayed in menu than expected
+ (report by Valentin Stoykov).
+
+2005/10/05
+ + improve fix for dlg_does_output(), eliminating redundant leading
+ separator.
+ + fill background color for item-help text (report by Peter Postma).
+ + correct interaction between --separate-output and --output-separator
+ broken in 2005/09/11 fix for Debian #326918 (Debian #331440).
+ + update config.guess, config.sub
+
+2005/09/11
+ + undo doubled adjustment for left/right margins when wrapping text
+ for msgbox, gauge and pause (report by Xyba).
+ + correct position of scrolled text in formbox broken by 2004/12/19
+ changes (report by Konrad Jelen).
+ + call dlg_does_output() from dlg_add_result(), ensuring that
+ separators are used when combining widgets such as formbox (report by
+ John Suykerbuyk).
+ + fix marker in textbox.c to make it disappear at the top of the file
+ (report by Patrick J. Volkerding).
+ + fix marker shown in arrows.c for checklists, etc., which was "(+)"
+ where it should have been "(-)" (report/patch by Patrick J.
+ Volkerding).
+ + fix --input-fd (changes in glibc since 2003 made dialog hang on exit
+ due to the way dialog updated stdin).
+ + restore default value (a tab) for --separator or --separate-widget
+ lost in 2003/11/26 changes (Debian #326918).
+ + make several widgets handle SIGWINCH (calendar, checklist, formbox,
+ fselect, inputbox, menubox, pause, tailbox, textbox, timebox). Only
+ msgbox and yesno had been done before. Note that some still have
+ fixed geometry requirements, so they cannot be shrunk below a given
+ threshold. Also, these changes do not address traversal, e.g., for
+ tailboxbg.
+ + make gauge widget handle SIGWINCH with ncurses (Debian #305705).
+ + add configure option to control whether largefile support is
+ compiled-in (Debian #298882).
+ + update eu.po (Debian #312622, patch by Piarres Egana).
+ + add/update po files from
+ http://www.iro.umontreal.ca/translation/maint/dialog/
+ fi.po, rw.po, sr.po, tr.po, zh_TW.po
+ + fixes for configure script:
+ + improve script for determining gcc version
+ + improve checks for Intel compiler and related warning options
+ + improve checks for defining _XOPEN_SOURCE (or alternatives) and
+ _POSIX_C_SOURCE
+ + update config.guess, config.sub
+
+2005/03/06
+ + add/update po files from
+ http://www.iro.umontreal.ca/translation/maint/dialog/
+ ga.po, it.po
+ + revert last change for da.po; it was from an older version (report by
+ Morten Brix Pedersen).
+
+2005/02/06
+ + modify makefile.in so --disable-echo applies to libtool builds.
+ + corrected malloc size used for editable fields in formbox widget to
+ match the function which updates the corresponding buffer.
+ + modify formbox widget's use of flen to allow negative values to be
+ used to limit the length of the displayed field.
+ + improve description in manpage of output from formbox widget
+ (Debian #292418).
+ + modify formbox widget to allow fields with flen==0 to display
+ (Debian #292417).
+ + improved configure macros CF_POSIX_C_SOURCE and CF_XOPEN_SOURCE, to
+ avoid redefinition warnings on cygwin.
+ + fix a typo in inputmenu-stdout found via "sh -n" (report by Steve
+ Grubb).
+ + add/update po files from
+ http://www.iro.umontreal.ca/translation/maint/dialog/
+ ca.po, da.po, hu.po, nl.po, rm.po, ro.po, vi.po
+
+2005/01/16
+ + add --args option to help with debugging scripts.
+ + adapted some new po files from Debian package for whiptail: ar.po,
+ bg.po, gl.po, hi.po, hr.po, mg.po, mk.po, ro.po, sq.po and zh_TW.po
+ + update da.po (Morten Brix Pedersen).
+ + add configure check for Intel 8.0 compiler, to set appropriate
+ warning options.
+ + update config.guess, config.sub
+
+2004/12/22
+ + correct a typo in 2004/12/19 changes which caused width of multibyte
+ characters to be incorrectly computed in some locales.
+ + modify --version and --help options to write consistently to the
+ standard output (report by Santiago Vila).
+ + modify tailboxbg by resetting tty modes at the point where it forks a
+ process to update the screen, rather than waiting until that process
+ exits. This improves user feedback by making it apparent that dialog
+ is no longer processing input after that point (Redhat Bugzilla
+ #142538).
+ + minor updates to some .po files using Babel Fish, comparing with lynx.
+ + update es.po (Santiago Vila).
+ + work around bug in NetBSD 1.6 curses which seems to be confused by
+ reusing color pairs with different video attributes. The problem
+ does not appear in NetBSD 2.0 curses (but its headers do not provide
+ version info, so color-caching is not available for that
+ configuration).
+ + modify pause and gauge widgets to ensure that reverse-video progress
+ bar is visible when the background is reversed, e.g., using the
+ default non-color attributes.
+ + use chtype rather than attr_t, to build with old Solaris curses,
+ used in save/restore operation from 2004/09/20.
+
+2004/12/19
+ + add pause-widget (patch by Yura Kalinichenko).
+ + modify exit-code returned on selecting the "Help"-button when the
+ --item-help option is given. Previously this returned the same code
+ as "OK", since it combines output for "OK" with the help status. It
+ now returns the help-code, but this can be overridden by setting the
+ environment variable $DIALOG_ITEM_HELP (reports by Erika Pacholleck
+ and Sebastian Muesch).
+ + modify formbox widget so input-length is not limited to field-length
+ (report by David Liebermann).
+ + localize the label on the search box for textbox widget (report by
+ Erika Pacholleck).
+ + correct usage message detail for fselect, which listed an extra
+ parameter (Debian #284008).
+ + add include for <sys/select.h> in ui_getc.c to build with QNX 4.25
+ using Watcom 10.6 (patch by Len Meakin).
+ + modify behavior when no locale (or POSIX locale) is set to allow
+ legacy interpretation of Latin-1 character set (Debian #284795).
+
+2004/11/18
+ + correct computation of column width for menubox/checkbox tags, for
+ multicolumn characters, e.g., the menubox-utf8 example.
+ + correct calls to wbkgdset(), which set the background attribute but
+ not the corresponding character (ncurses uses blank if none is given).
+ + improve configure script check for _XOPEN_SOURCE and _POSIX_C_SOURCE.
+ + improved limit-computation in show_message() to allow for scrolling
+ very long messages.
+ + adjust scrolling logic in msgbox to account for the one-line offset
+ used by the logic which wraps text in a box, thus avoiding leaving
+ an extra blank line (report by Maxim Sobolev).
+
+2004/09/20
+ + add samples/whiptail.rc
+ + add samples/dialog.py (noting that a later version of this exists
+ as pythondialog, but this is relatively self-contained). Modified
+ the script to accept the $DIALOG environment variable like the other
+ sample scripts, to specify the path of the program to use.
+ + modify the install rule for header-files so the autoconf names in
+ dlg_config.h (and corresponding usage in dialog.h, etc), are altered
+ from "HAVE_xxx" to "DLG_HAVE_xxx", etc.
+ + add a check for getenv("HOME") in rc.c
+ + add a call to end_dialog() in signal_handler for tailboxbg (from
+ patch by Werner Fink).
+ + correct initialization in checklist and radiobox for --default-item,
+ scrolling as needed.
+ + modify --visit-items option so that it puts the cursor initially on
+ the list (in menubox, checklist and radiobox), accepts abbreviations
+ for the buttons when the cursor is on the button-row, and otherwise
+ (when --visit-items is given) abbreviations apply only to the list
+ (report by Erika Pacholleck).
+ + modify a few widgets (inputbox, textbox, yesno) to beep on unexpected
+ input.
+ + modify some msgbox widget to accept abbreviations of its button
+ label, for consistency with other widgets (request by Erika
+ Pacholleck).
+ + corrected logic of dlg_char_to_button(), making it check only the
+ first uppercase letter in each button label rather than all uppercase
+ letters (report by Erika Pacholleck, cf: 2003/09/10).
+ + improved description of --clear and --keep-window options (adapted
+ from Erika Pacholleck).
+ + move discussion of --beep and --beep-signal options to Obsolete
+ Options section of manpage, remove these from the help-message
+ (report by Erika Pacholleck).
+ + bracket extern's in dialog.h with C++ extern "C" declaration, in case
+ the library is used from a C++ application.
+ + modify inputmenu examples to allow ESC to cancel the script.
+ + modify inputmenu widget to cancel edit on a TAB or ESC.
+ + modify inputmenu widget to use the same color scheme for the editable
+ text as the inputbox widget.
+ + modify samples/killall to work around differences in "cut" versions.
+ + use the color-caching from the \Z logic when loading the ".rc" file,
+ thereby reducing the number of color pairs required, and making it
+ less likely that deriving color pairs for drawing arrows on a given
+ background will run out of colors.
+ + save/restore window attributes in dlg_draw_arrows() and similar
+ functions, to allow widgets to draw arrows using the widget's
+ background rather than a common/fixed value (request by Erika
+ Pacholleck).
+ + modify textbox widget so the down-arrow will be hidden when at the
+ end of the file. (Modifying the up-arrow to be hidden is harder -
+ will do this when implementing scrollbars).
+ + correct off-by-one in fselect.c which left down-arrows showing at
+ the bottom of directory- and file-lists (report by Erika Pacholleck).
+ + improve display of percentages by omitting blanks where lines should
+ be shown.
+ + modify logic for \Z escapes to make those that set video attributes
+ not clear the colors (report by Erika Pacholleck).
+ + modify logic for \Z escapes to allow foreground and background
+ colors to be the same, provided that bold attribute is set.
+ Also improved the logic for choosing a background color when the
+ foreground and background are the same (report by Erika Pacholleck).
+ + update configure script macro CF_XOPEN_SOURCE, ensuring that the
+ _POSIX_C_SOURCE value is defined with a specific value (bug report
+ originally for lynx).
+ + fix configure script so that po/makefile is generated properly when
+ the configure --srcdir --enable-nls options are used.
+ + modify makefile.in to allow build/install from another directory,
+ i.e., using configure --srcdir (patch by Mike Castle).
+ + updated da.po (Debian #262587, Morten Brix Pedersen).
+ + modify some sample scripts to avoid using grave quotes nested within
+ double quotes with multiple file redirection, which does not work
+ with Solaris /bin/sh (report/analysis by Eric Haller).
+ + check for end of string immediately after a \Z escape to avoid
+ displaying the null terminator as a ^@ (report by Erika Pacholleck).
+ > patches by Erika Pacholleck:
+ + modify calendar.c, fselect.c and timebox.c to use color scheme like
+ other lists, using menubox colors rather than dialog colors.
+ + correct charset for po/de.po, translate messages for "Help" and
+ "Rename".
+ + omit parentheses around percentage in textbox.c
+ + correct a few mismatched attributes, e.g., searchbox_attr in textbox.c,
+ percentage in msgbox.c,
+
+
+2004/07/31
+ + add test scripts to cover zero-width column case.
+ + remove limit checks from checklist.c and menubox.c (cf: 2004/07/28),
+ since some scripts use zero-width columns (Debian #262411 and report
+ by Kyle Sallee).
+
+2004/07/29
+ + modify msgbox.c to only reserve space for percentage shown as part
+ of scrollable text for the msgbox widget. This makes infobox look
+ as it did before 2004/06/06 changes (report by Vinesh Christopher)
+
+2004/07/28
+ + remove redundant calls to wtimeout() from widgets since wtimeout()
+ is properly called from ui_getc() where it is controlled by the
+ --timeout option (bug report by juanjo).
+ + add limit checks in checklist.c and menubox.c for very narrow screens
+ (prompted by Steve Grubb patch).
+ + initialize step in dlg_draw_buttons() in case it is used to draw
+ a vertical list of buttons (prompted by Steve Grubb patch).
+ > fixes by Steve Grubb:
+ + correct logic in checklist.c (cf: 2003/11/26 changes) which turned
+ quoting on unnecessarily for radiobox, breaking some old scripts.
+ + increase size of array in dlg_ok_labels() to avoid overrun if extra
+ and help buttons are used (cf: 2002/06/12 changes).
+ + initialize fkey variable in menubox.c and textbox.c (cf: 2003/07/12).
+
+2004/07/21 - release 1.0
+ + minor updates for configure script, i.e., CF_XOPEN_SOURCE,
+ CF_NCURSES_LIBS macros.
+ + update config.guess, config.sub
+ + add nl.po (Jacques Weewer).
+
+2004/06/06
+ + add --visit-items option, which allows the user to tab to the item
+ list in the checklist/radiobox and menubox widgets (request by
+ Ari Moisio).
+ + use wide-character line-drawing for up/down arrows when configured
+ for wide-characters, gives better results with uxterm.
+ + limit the number of times a --file option can be used, to prevent
+ runaway recursion if a --file option is embedded within a file which
+ is included.
+ + improve discussion of wrapping in the manpage (Debian #251937).
+ + modify msgbox to allow it to scroll vertically like textbox (Debian
+ #233276). This only works with ncurses.
+ + implement $DIALOGVARS environment variable to apply common options to
+ dialog_vars when it is reset before processing other common options.
+ + add --single-quoted option to control whether output is double-quoted
+ with '"' or single-quoted with single-quotes.
+ + revert the default quoting behavior of checklists to use
+ double-quotes (report by Mark K Post regarding Slackware scripts).
+ + add eu.po (Basque) (Piarres Beobide Egaa).
+ + add ca.po (Catalan) (Jordi Mallach).
+
+2004/04/21
+ + add a call to flushinp() to init_dialog(), to discard any typeahead
+ before dialog is invoked (Debian #244746).
+ + correct dlg_match_char() function, which was broken during rewrite
+ to support wide-characters (Debian #244777).
+ + improved ru.po, uses UTF-8 charset (Leonid Kanter, Redhat Bugzilla
+ #119200).
+ + correct position of shadow drawn for dialogs, which appeared to work
+ for most versions of curses (other than NetBSD) but would have been
+ visible for certain color schemes (discussion with Julian Coleman).
+ + correct loop-exit in longest_word() (Tomas Heredia, forwarded by
+ Santiago Vila).
+ + add cy.po (Welsh) (Dafydd Harries).
+
+2004/03/16
+ + modify quoting of results to use single-quote rather than double
+ quote, and ensure that results containing a quote or backslash
+ character are escaped (report by Florent Rougon)
+ + remove an incorrect comparison from checklist which made cursor
+ stick on the last line, from 2004/03/01 changes.
+
+2004/03/14
+ + add a dependency to install library if "--with-libtool" is used.
+ + add manpage for the library.
+ + add "--file"
+ + modify formbox.c to support "--help-status" like menubox.
+ + modify checklist.c to add item name to the "HELP" string when
+ "--help-button" is used and no --item-help option is given (Debian
+ #236841, report/patch by Jorg Sommer).
+ + rename colors.h to dlg_colors.h, install that when the library is
+ installed.
+ + add copyright notice to usage ("--help") message.
+ + correct a missing bounds check for mouse-clicks in menubox (prompted
+ by Debian #233044).
+ + updated several configure-script macros: AM_GNU_GETTEXT,
+ AM_WITH_NLS, CF_OUR_MESSAGES, CF_PROG_EXT, CF_WITH_DBMALLOC,
+ CF_WITH_DMALLOC, CF_WITH_LIBTOOL, CF_XOPEN_SOURCE.
+
+2004/03/01
+ + improve layout of calendar widget to allow for very long button
+ labels (report by Santiago Vila).
+ + correct logic for $DIALOG_TTY, broken in 2003/11/30. The environment
+ variable must evaluate to a nonzero integer (report by Florent
+ Rougon).
+ + document interaction between "--default-no" and "--no-cancel" options
+ in manpage (Debian #223488).
+ + change configure script to use autoconf 2.52+patch, to work around
+ issues with Estonian locale (report by Seemant Kulleen).
+ + add uk.po (Ukrainian) (Debian #232441).
+ + make --default-item apply to checklist widget (Debian #225255).
+ + correct a missing check for --item-help when --help-status was given
+ for checklist (Debian #232921).
+ + correct a missing bounds check for mouse-clicks in checklist (Debian
+ #233044).
+ + update config.guess, config.sub
+
+2003/12/07
+ + correct infinite loop in yesno widget when "--defaultno" option is
+ combined with "--no-cancel" (Debian #223077).
+
+2003/11/30
+ + suppress double-quotes added for "--help-status" option if the
+ string does not contain any special characters.
+
+2003/11/26
+ + add samples/sourcemage.rc, for comparison with slackware.rc
+ + add "--insecure" option (request by Sean Mathews (DrWho@f34r.com)).
+ + make "--defaultno" option apply to widgets which use OK/Cancel
+ buttons as well (Debian #209030).
+ + improve documentation of exit-codes for each widget in the manpage
+ (Debian #217926).
+ + add option "--keep-window" to suppress repainting after completing
+ each widget (request by Ingo van Lil).
+ + add options "--yes-label" and "--no-label" to allow override of the
+ "Yes" and "No" strings (request by Christoph Zwerschke).
+ + add option "--help-status" to allow script to restore a checklist
+ or radiolist after processing an item-help string (Debian #209031).
+ + modify width-calculation for non-formatted text to ensure it is
+ wide enough for the longest word in the text (patch by Andrew Gaul).
+ + modify dlg_index_columns() to count a newline as a single cell rather
+ than 2 for the normal curses case. This fixes an off-by-one for
+ the text-justification, shown in screen 2 of msgbox1 sample script.
+ + fix dlg_char_to_button(); 2003/09/10 changes made it incorrectly
+ ignore case of the labels.
+ + change calendar's use of arrow keys so they are (as before 2002/06/22)
+ interpreted within the day-grid as movement within that grid (request
+ by David Anders).
+ + correct missing initialization of last_getc variable in dlg_getc()
+ (report/analysis by Victor Wodecki).
+ + modify main program to make
+ dialog --no-shadow --print-maxsize
+ work. Normally dialog prints the screen size after subtracting the
+ area reserved for shadows, but some applications may need the actual
+ screen size (Debian #213424).
+ + several related changes (Debian #213425):
+ + separate the examples using "--stdout" and "--output-fd" from the
+ normal usage examples.
+ + add "--input-fd" option, provide a sample of its use.
+ + modify init_dialog() to use initscr() unless a "--stdout" option
+ was used. Some scripts relied on the coincidence that redirecting
+ standard output from dialog would "work". Before this change
+ init_dialog() assumed that redirected standard output was
+ synonymous with "--stdout" option (not the intended behavior).
+ + modify command-line parsing to look for "--stdout" and "--stderr"
+ options first, allowing only one.
+ + add a check for an environment variable $DIALOG_TTY which provides
+ the older behavior, i.e., try to open the terminal directly if
+ stdout is redirected.
+ + interface changes, to make libdialog simpler to use:
+ + rename all of the internal functions to begin with "dlg_", but
+ provide compatibility with older names if the application defines
+ __DIALOG_OLD_NAMES__.
+ + add dialog_version() function, and corresponding DIALOG_VERSION and
+ DIALOG_PATCHDATE definitions to dlg_config.h
+ + eliminate remaining global variables such as screen_initialized in
+ favor of dialog_state and dialog_vars.
+ + move some data such as dialog_vars.output to dialog_state, since
+ they are normally not reset between widgets.
+ + change interfaces of dialog_yesno() and dialog_checklist() to use
+ dialog_state.defaultno and dialog_vars.separate_output, making it
+ simpler and more consistent.
+ + improve configure script and related definitions:
+ + add "--with-libtool" option to provide shared library support by
+ libtool.
+ + rename generated "config.h" to "dlg_config.h", so it can be
+ installed without naming conflict. Added "dlg_config.h" to
+ install-lib rule.
+ + modify configure script and makefile to use EXEEXT and OBJEXT.
+ + add "--enable-widec" option to control whether wide-curses features
+ are compiled-in, rather than check for the existence of those in
+ the curses library. This allows building with HPUX curses, which
+ has abandoned legacy features while not quite supporting X/Open
+ curses.
+ + add configure check for getbegx(), etc., which are not provided on
+ all platforms.
+ + update config.guess, config.sub
+
+2003/10/02
+ + update hu.po (Arpad Biro).
+ + revert part of the 2003/08/18 change to "--stdout" option. Using
+ stderr for screen output does not work well on several platforms
+ since stdout's settings are affected (report by Kent Robotti).
+
+2003/09/24
+ + modify tailbox to allow it to display files with arbitrarily long
+ lines.
+ + fix an infinite loop in tailbox, broken when making interface changes
+ to dlg_getc() (report by Ingo van Lil).
+ + amend fix for "--and-widget" to not treat "---" as an option (report
+ by Kent Robotti).
+ + updated es.po (Santiago Vila).
+
+2003/09/10
+ + correct "RENAMED" result from inputmenu widget, which did not reset
+ the result buffer, and did not account for scroll-offset (Debian
+ #209336).
+ + modify button, menu and checklist logic that matches a character to
+ the beginning of a text field to support wide-characters (completes
+ Debian #195674).
+ + modify configure script to not use "head -1".
+
+2003/08/30
+ + modify searchbox popup in textbox widget so one can simply press
+ return on an empty input to cancel the popup.
+ + modify error reporting to avoid clearing screen if a problem is
+ found in the ".rc" file.
+ + add color/attribute combinations for form widget (based on patch by
+ Reznic Valery).
+ + combine rc-file colors, attribute- and color-tables to obtain a
+ single table for color values, which requires less work to add new
+ entries.
+ + modify fselect widget to make back-tab work again, since it was
+ broken by the rewrite of dlg_edit_string().
+ + modify howmany_tags() so it will quit searching when it finds any
+ option, not only "--and-widget" (Debian #206636).
+ + correct call to dlg_print_text() in print_line(), which did not
+ account for hidden characters (report/patch by David Poole).
+ + modify print_button() to display properly if locale defines ok/cancel
+ or yes/no buttons that contain multibyte characters.
+
+2003/08/20
+ + correct an indexing error when deleting from the end of a line using
+ KEY_DC; it happened to work on Linux because malloc() clears memory
+ like calloc().
+ + add '\r' to case statement where '\n' is translated to KEY_ENTER to
+ work around defect in NetBSD curses.
+ + modify configure check for getparyx(), etc., which are implemented
+ by NetBSD curses as functions rather than macros.
+ + correct configure check for term.h, which may be <ncursesw/term.h>
+ if ncursesw development headers are installed, but not ncurses
+ development headers. Or they may not coincide (Debian #206287).
+
+2003/08/18
+ + modify checklist.c and menubox.c to display tags properly if they
+ contain wide-characters.
+ + better solution for initializing curses when "--stdout" option is
+ used, e.g., use stderr for the output if it is a tty. Also correct
+ the error handling, so dialog exits with an error if it cannot
+ find a way to do output (Debian #205509).
+ + modify sample scripts to use consistent definition of $DIALOG
+ (Debian #205508).
+ + add UTF-8 examples inputbox6-utf8, inputbox6-utf8 (from Tomohiro
+ Kubota, Debian #195674).
+ + modify print_line() to work with wide-characters, e.g., so it handles
+ wrapping for double-width characters.
+ + cache results from multibyte character indices, speeds up cursor
+ movement.
+ + modify form widget to support scrolling and mouse-selection.
+ + add form widget (based on patch by Reznic Valery).
+ + correct mouse-handling for inputmenu widget.
+ + corrections to menu.c: location of clearing operation, and height of
+ rows in code for older ncurses versions (patch by Reznic Valery).
+ + improve logic that compensates for xterm's alternate-screen by
+ cancelling the rmcup/smcup strings after the rmcup has been issued.
+ That ensures that dialog will not clear the screen on exit (report
+ by Javier Kohen).
+ + modify initialization between widgets to retain the values for the
+ --aspect, --separate-widget and --tab-len options.
+ + add --separator as an alias for --separate-widget (compatible with
+ Xdialog).
+ + correct handling of Xdialog's --icon and --wmclass options, whose
+ parameter was not ignored.
+ + correct logic for --separate-widget so its string is written before
+ each output, rather than only for --and-widget option (report by
+ Javier Kohen).
+ + improve limit-check in center_label() for buttons.c (report by Tor
+ Vidar Havstad).
+ + correct layout of --menu widget, which reduced display width due to
+ logic for --inputmenu being applied whether or not that configuration
+ was used (reports by Javier Kohen, Dimitar Zhekov and MAL
+ <mal@komcept.com>). Fixes Debian #201215.
+ + modify gauge widget to support --begin option (Hans-Joachim Baader).
+ + updated pl.po (Jaroslaw Swierczynski).
+ + hide cursor while painting gauge.
+ + add auto-sizing logic to gauge widget (reports by Javier Kohen and
+ Robert Schubert).
+
+2003/07/20
+ + rewrote inputstr.c, allowing it to enter and display wide-characters.
+ Some nonprinting characters such as control/B can be edited as well.
+ + modify timebox to allow user to type numbers into the fields.
+ + change interfaces of dlg_getc(), mouse_wgetch(), etc., to add
+ parameter that returns whether the result is really a function-key.
+ This is needed to work with wide-character curses.
+ + correct computation of week-number in calendar widget (report by
+ Heiner Lamann).
+ + updated configure script macros:
+ + suppress -Winline with gcc 3.3, since it is broken.
+ + fix caching bug in CF_UTF8_LIB
+ + improved script for CF_BUNDLED_INTL.
+ + update config.guess, config.sub
+
+2003/03/08
+ + add null-pointer checks to some malloc calls which were overlooked.
+ + correct logic in dlg_add_result(), which did not copy content of
+ non-allocated buffer to the first allocation (report by Daniel
+ Dupont).
+
+2003/03/02
+ + correct an uninitialized value in dlg_add_result() (Debian #182683).
+
+2003/01/30
+ + corrected print_line(), which subtracted the margin twice from the
+ right-limit, making a string wrap unnecessarily (Debian #168823).
+ + correct initial limit-check for arrows in checklist.c, which used
+ the wrong variable, showing the bottom arrow when it should not
+ (Debian #168823).
+ + modify driver to always call show_result(), to simplify updates.
+ + fix several memory leaks, important if dialog is run with a large
+ number of widgets (report by albert.veli@telia.com forwarded by
+ Santiago Vila).
+ + check if the screen output is actually to the terminal before trying
+ to suppress xterm's alternate screen mode (see 2000/01/18) (report by
+ David Oliveira).
+ + use dialog_vars.input_result consistently to return the text which is
+ printed after a widget completes. In many cases, dialog now
+ allocates enough space to hold the text, rather than use a fixed
+ buffer. The checklist widget was writing directly to the output to
+ avoid limits of the fixed buffer.
+ + modify dialog.c to also write dialog_vars.input_result if the
+ Help-button was pressed (request by Amon Ott).
+ + add hu.po (Arpad Biro).
+ + update fr.po, pt.po, pt_BR.po to add strings for "Help" button (patch
+ by Frederic L W Meunier).
+ + fix off-by-one error in menu.c, checklist.c (reported by
+ Tomasz Wasiak 2002/09/15 and others:
+ Andrew Gaul 2002/11/12,
+ Tobias C Rittweiler 2002/11/19,
+ Arpad Biro 2003/01/21).
+ + updated configure script, improving checks for ncurses in various
+ locations, updated NLS script to match lynx. Added --with-curses-dir
+ option.
+ > Tobias C Rittweiler:
+ + make ifdef in mousewget.c consistent with usage in dialog.h
+ + use beep() rather than flash() in dlg_edit_string(), for consistency
+ with the other functions.
+ + change order of buttons so extra button falls between Ok/Cancel.
+ + fix so "dialog --print-maxsize" exits from curses.
+ + add --inputmenu option.
+
+2002/08/14
+ + modify checklist.c and menubox.c to treat the extra button like the
+ "Ok" button by making dialog print the chosen items (request by
+ Tobias C Rittweiler).
+ + add examples checklist6 and menubox6 to illustrate the --colors
+ option.
+ + implement -colors option, which allows one to highlight words in the
+ titles and most text areas with color or video attributes (adapted
+ from patch by Tobias C Rittweiler).
+ + add examples inputbox4, inputbox5 to illustrate how to use the
+ --output-fd option, and how to use dialog without any temporary
+ file at all.
+ + add --output-fd option (Debian #153984).
+ + documented vi-style keys for calendar, textbox widgets in manpage.
+
+2002/06/22
+ + improve mouse handling, e.g., for up/down scrolling in calendar,
+ checklist, etc.
+ + add --extra-button and --extra-label options (adapted from patch
+ by Tobias C Rittweiler).
+ + correct displayed cursor position in inputbox when returning to the
+ input area after traversing the buttons with tabs, etc.
+ + add left/right arrows for traversal in calendar and timebox dialogs.
+ + implement two new functions dlg_next_ok_buttonindex() and
+ dlg_prev_ok_buttonindex(), using these to hide details about the
+ traversal over buttons in several widgets.
+ + modify checklist.c and menubox.c to verify if both --help-button and
+ --item-help are specified before assuming that selecting the help
+ button should cause the "HELP {item-help}" message to be printed
+ (reported by Marcel Ritter).
+ + modify init_dialog() to work around HP's broken tty driver (report by
+ John Mudd). Specifically, the problem is that when opening /dev/tty
+ directly (to support the --stdout option), the terminal does not
+ change to raw mode. The workaround opens /dev/tty only as needed;
+ the --stdout option does not work on HPUX but otherwise dialog works.
+ + updated el.po (patch by kromJx <kromJx@crosswinds.net>).
+
+2002/05/19
+ + add --no-collapse option to allow one to retain tabs and repeated
+ blanks in a message box (request by Roberto Simoni).
+ + use DLG_EXIT_ESC constant rather than -1's in several places. This
+ has the effect of changing some exit-with-error cases to denote that
+ the exit was because ESC was pressed (patch by Diego Alvarez,
+ forward by Santiago Vila).
+ + bump package version to 0.9b (with patch-date, as usual).
+ + add --exit-label option (request by Roberto Simoni).
+ + updated de.po to correct translation for "Cancel" (from Michael
+ Piefel, Debian #146402).
+ + use definitions from autoconf macro AC_HEADER_TIME to ensure that
+ time() is properly prototyped.
+ + update pl.po, adding translation for "Help" (patch by Jaroslaw
+ Swierczynski <swiergot@hacking.pl>).
+ + update COPYING file, to reflect address change of FSF (reported by
+ Santiago Vila).
+ + update some configuration script macros: CF_CHECK_CACHE,
+ CF_CURSES_CPPFLAGS, CF_HEADER_PATH and CF_MAKEFLAGS.
+ + correct misuse of "$with_XXX" variables in the configure script,
+ which prevented configuration against curses library as opposed to
+ ncurses.
+ + update config.guess, config.sub
+
+2002/03/09 (a)
+ + modify geometry of samples/fselect scripts to allow them to run in
+ a 24x80 screen (report/patch by Santiago Vila).
+ + correct exit-code for menubox.c when Cancel is pressed. This was
+ unintentionally altered when adding --help-button (reported by
+ Patrick J Volkerding)
+
+2002/03/09
+ + add --timeout option, which forces the program to exit with an error
+ if no user response is given within the specified number of seconds
+ (request by <andrew@argoncorp.com>).
+ + modify calendar widget to allow day/month/year values to default to
+ the current date (request by <Ron.Perrella@bellsouth.com>).
+ + modify display of buttons in checklist.c and menubox.c to handle the
+ case where the button label is empty (Debian #134388).
+ + extended logic for ok/cancel/help to make this work with checklist
+ widget.
+ + revert pt_BT.po, apply changes to pt.po (report by Frederic L W
+ Meunier).
+ > several changes from Stanislav Ievlev:
+ + add options --help-button and --help-label to make menubox display a
+ third button which can be used to return an exit code causing the
+ calling script to show extended help information.
+ + use home/end keys in input string-editing, e.g., inputbox.
+ + add option --max-input to limit length of string returned by inputbox
+ and other widgets which allow the user to edit a string.
+
+2001/12/02
+ + add --ok-label and --cancel-label options (request by Kyle Sallee).
+ + correct usage message for --fselect option (reported by Patrick J
+ Volkerding).
+ + add samples/debian.rc, for comparison with slackware.rc
+ + corrected samples/slackware.rc, which was just the compiled-in
+ default values (patch by Patrick J Volkerding).
+ + modify search rule for rc-file to add a global rc file /etc/dialogrc
+ (patch by Patrick J Volkerding).
+ + updated pt_BR.po with modified entries for fselect.c (Frederic L W
+ Meunier).
+ + add pl.po (Swiergot <swiergot@l02.ids.czest.pl>).
+
+2001/11/11
+ + modify command-line parsing to allow a "--" argument to act as an
+ escape, so the next argument is not recognized as an option if it
+ begins with "--". This is apparently one of popt's undocumented
+ features, upon which some Debian scripts depend (Debian #116642).
+ + add da.po (Morten Brix Pedersen <morten@wtf.dk>).
+ + add an install-strip rule to makefile, changing the normal install
+ rule to not strip the installed executable (based on discussion with
+ Santiago Vila).
+ + initialize my_output variable if user cannot open /dev/tty, e.g., if
+ su'd to another user (patch by Richard Braakman (<dark@ssh.com>), Debian
+ #117177).
+ + add configure option --with-ncursesw, to allow configure/build with
+ wide-character version of ncurses.
+
+2001/10/14
+ + add option --ignore, to make dialog be ignore options that it does
+ not recognize.
+ + add option --trim, to trim literal newlines and repeated spaces from
+ text that will be displayed. Add samples/msgbox2, which is the
+ same as msgbox1, but using --trim (cf: change for Debian #102942).
+ + minor correction to attributes for buttons.c to use active_attr on
+ the right-side of a button.
+ + add a sample dialog rc-file slackware.rc based on diffs in hdasetup
+ package at
+ http://ftp1.sourceforge.net/pub/mirrors/slackware/slackware/source/a/hdsetup/
+ (discussion with Frederic L W Meunier).
+ + modify dialog.pl to avoid using a statically-named tempfile, allowing
+ multiple processes to use this script (patch by James Ranson
+ (<euclid80@yahoo.com>), Debian #110609).
+ + correct fprintf() call in j_menu() function, i.e., "--menu" option,
+ which did not guard against expanding '%' embedded in the parameters
+ (Stavros Chatzistefanidis <sxatz@yahoo.com>).
+ + add et.po (Ivar Smolin <okul@trenet.ee>).
+ + update fr.po (Frederic L W Meunier).
+ + modify to allow scripts to alter the exit codes, mainly to
+ distinguish ESC and ERROR exits. This is done by setting a shell
+ variable such as DIALOG_ESC to a new value (request by Petr Vandrovec
+ (<vandrove@vc.cvut.cz>), Debian #99264)
+
+2001/08/27
+ + use VPATH in makefile to support build with configure --srcdir, if
+ the make program supports that. Note that samples/install/makefile
+ is not generated, due to awkward limitation of autoconf script
+ (reported by Frederic L W Meunier <0@pervalidus.net>).
+ + add po/pt_BR.po (Frederic L W Meunier <0@pervalidus.net>).
+ + correct sense of --enable/--disable shown in configure --help (report
+ by Frederic L W Meunier <0@pervalidus.net>).
+ + correct logic for --clear option, broken in 2000/07/02 (fixes Debian
+ #110254).
+
+2001/08/11
+ + porting fixes to work on AIX: flush output to work around bug in
+ curses library, use ./killall in scripts to avoid conflict with
+ AIX program by that name.
+ + modify dlg_trim_string() to retain literal newlines if the string
+ does not contain "\\n" strings, and to retain leading blanks on the
+ resulting lines, for compatibility with older scripts (Debian
+ #102942).
+ + add charset specification to cs.po
+ + change dates in CHANGES to consistent format, add el.po for Greek
+ (patch by kromJx <kromJx@crosswinds.net>).
+ + eliminate static globals (bss, data) from modules rc, tailbox,
+ textbox using better parameter-passing convention, and const.
+ + cleanup temporary files in a few of the sample scripts.
+ + rewrote tailboxbg using select() rather than fork(), thereby
+ eliminating lock-files. Only one process should be trying to display
+ on the screen at any given time.
+ + add error check to ensure that numeric parameters are really numbers.
+ + correct off-by-one in error messages reporting too-few or too-many
+ tokens for a given option (reported by George Mirchev).
+ + fix typo in manpage, "textboxbg" where "tailboxbg" was meant
+ (reported by George Mirchev <la@mail.techno-link.com>).
+ + use DLG_EXIT_xxx symbols consistently for all exit codes.
+ + updated es.po (patch by Santiago Vila).
+ + updates for some configure script macros from lynx: CF_MAKEFLAGS,
+ CF_NCURSES_VERSION, CF_PROG_EXT.
+ + fixes to compile if <term.h> is included, e.g., when building with
+ AIX curses (report by Suzi Dowson <Suzi.Dowson@capgemini.co.uk>).
+
+2001/05/27
+ + updated dialog.pot
+ + modify fselect.c to work with autosize, i.e., given height and width
+ zero (report by Martin Povolny).
+ + add a null-pointer check in justify_text(), needed by fselect.c
+ + add several more options which dialog can safely ignore, from
+ Xdialog 2.0.2
+ + refinements for configure macros checking for $CPPFLAGS, from lynx.
+ + update config.guess, config.sub to match autoconf 2.50
+ > Martin Povolny <martin@solnet.cz>:
+ + add cs.po
+ + use nl_langinfo() to customize names for day-of-week, and month
+
+2001/05/11
+ > Vincent Stemen <dialog@AdvancedResearch.org>:
+ Fixed dialog.c to not pass menu items through dlg_trim_string().
+ Stripping extra spaces out of the menu items broke some of my
+ scripts by altering the string that it compared to know which menu
+ item was selected. There should be no need to do justification on
+ the menu items, which are always one line, anyway.
+
+2001/04/29
+ > Vincent Stemen <dialog@AdvancedResearch.org>:
+ + rewrote the text justification code to be able to have preformatted
+ text in the prompts with extra spaces like the older versions of
+ dialog. If there are "\n" strings in the text, then extra spaces are
+ preserved. Lines are always wrapped on word boundaries.
+ + fixed --cr-wrap to break lines on '\n' (newline) characters and not
+ add an extra line at the top and bottom of the text. It now works
+ as the manual says it should.
+ + it is no longer necessary to use "\n\" at the end of lines to escape
+ the '\n' character. "\n" now works. However, the old way, "\n\"
+ still works.
+ + the fixes involved the following changes:
+ - rewrote dlg_trim_string() to recognize preformatted text (know
+ when not to strip extra spaces) and to pay attention to --cr-wrap.
+ - rewrote justify_text() which now calls a new function in util.c,
+ print_line(), to print each line and end it on a word boundary.
+ - modified real_auto_size() to call a new function
+ auto_size_preformated() to calculate the box size for preformatted
+ text.
+ - removed skip_blanks() and skip_text() since they are not used by
+ the new justify_text().
+ - modified dialog.c to not call dlg_trim_string() on title strings
+ so that titles retain their spaces.
+ + modified the following demo files in the sample directory:
+ - inputbox
+ changed all "\n\" strings to "\n" to demonstrate the extra
+ backslash is no longer needed.
+ - inputbox1
+ removed all the "\n\" strings from the end of the lines to
+ properly demonstrate --cr-wrap.
+ - msgbox1
+ this sample was using "--aspect 9 --cr-wrap". Rewrote it to
+ properly demonstrate --aspect. 9 is already dialog's default
+ aspect ratio. It now creates several dialogs in sequence,
+ demonstrating aspect ratios of 9, 12 and 6 and properly
+ demonstrates --cr-wrap.
+ + made the following changes to the manual (dialog.1).
+ - rewrote the description of --aspect to be more understandable.
+ - rewrote the description of --cr-wrap to be more correct and more
+ detailed. It did say, "Otherwise, the text for each dialog will
+ display on a single line.", which is not correct. It wraps the
+ text to fit in the box.
+ > T.Dickey:
+ + use logic from menubox dialog in checklist to handle autosizing when
+ list height is given as zero (fixes problem reported by Eric Veltman
+ <eveltman@baan.nl>).
+ + modify checklist and menubox dialogs to check for too-wide data, and
+ truncate one or both of the name and text fields to fit (also
+ reported by Eric Veltman).
+ + corrected a few items from Vincent's patch:
+ - use C89-style comments rather than C++
+ - restore logic in justify_text() which checks for win==0, needed to
+ work with standard curses implementations other than ncurses.
+ The first call on justify_text() passes a null pointer as a flag
+ to indicate that checking should be done, but no screen updates.
+ - avoid modifying the buffer in decode_percent(), otherwise a message
+ containing a space or newline would be truncated at the whitespace.
+ - modify dlg_button_x_step() and dlg_button_layout() slightly to
+ work with altered print_autowrap(), etc.
+ + fixes to build/work with SunOS 4.x 5lib curses
+
+2001/04/15
+ + fix a memory leak in mouse_region().
+ + simplify handling of optional parameters with new functions
+ optional_str() and optional_num().
+ + add calendar and timebox dialogs (compatible with Xdialog).
+ + correct typo in fallback definition for getparyx, and remove void
+ cast for mouse_open and mouse_close which prevented build with
+ Sun's Solaris compiler.
+ + rename --enable-lxdialog configure option to --enable-Xdialog
+ + modify CF_NCURSES_CPPFLAGS macro to match more variations of ncurses
+ header files.
+ + update config.guess, config.sub
+ + modify some configure script macros to avoid problems with buggy
+ autoconf 2.49c which breaks changequote().
+
+2001/01/15
+ + small fix to revised real_auto_size() and justify_text() to avoid
+ adding origin to box-width, which broke samples/wheel.
+ + apply 1999/12/25 tempfile change to wheel and copismall samples.
+ + add sample script for tailboxbg.
+ + revised lock-file management to better ensure that locks are actually
+ created by the tailbox subprocess(es).
+ + correct hardcoded signal 15 in tailbox to SIGHUP to match
+ documentation. Signal 15 is usually SIGTERM, which cannot be caught.
+ + correct off-by-one comparison of return-value for arg_rest() which
+ made
+ dialog --gauge test 10 50
+ dump core because it expected a 4th parameter (fixes Debian #80641).
+ + resync config.sub, config.guess from
+ http://subversions.gnu.org/cgi-bin/cvsweb/config/ (which finally have
+ cases for OS/2 EMX), minor tweaks to related configure script macros.
+
+2000/12/17
+ + restore treatment of predefined height/width in real_auto_size()
+ which was lost in 2000/12/12 rewrite (report by Raphael Halimi
+ <raphaelh@easynet.fr>).
+ + updates for configure script macros AM_PATH_PROG_WITH_TEST,
+ CF_CURSES_LIBS, CF_LIB_PREFIX, CF_PROG_EXT for $PATHSEP and $CFLAGS
+ fixes.
+
+2000/12/13
+ + correct change for create_lock(), which resulted in an infinite loop
+ (patch by Chris Butler, <chrisb@debian.org>).
+
+2000/12/12
+ + rewrote print_autowrap() and real_auto_size() to share common code
+ justify_text(), which now does text flow even when the string
+ contains newlines (fixes Debian #77199).
+ + improve create_lock() function using open() with O_EXCL rather than
+ fopen() (patch by Matt Kraai (<kraai@debian.org>), Debian #78951).
+ + correct description of --fselect in man page (patch by Tomas Pospisek
+ (<tpo@spin.ch>), Debian #77200).
+ + add --no-cancel as alias for --nocancel for compatibility with
+ Xdialog (report by Luis E Limon <luisl@abriasoft.com>).
+
+2000/10/27
+ + some lint fixes using lclint (mostly void-casts, but some
+ sign-extension fixes e.g., for ctype.h macros, and loop in
+ dlg_char_to_button()).
+ + modified to build/run on OS/2 EMX with ncurses.
+ + minor changes to po/*.po (trim trailing blanks, provide explicit
+ translation for "OK"), to work with Solaris gettext.
+ + modified to allow this to build with archaic version (1.8.6)
+ of ncurses on FreeBSD 3.1 (does not run).
+ + update config.guess, config.sub from subversions.gnu.org
+
+2000/10/17
+ + use new function sub_window() to check success/failure of calls to
+ subwin(), printing an error message if it fails (fixes Debian #74903).
+ + use combination of isatty/ttyname to look for workable tty device
+ on systems which have no /dev/tty, e.g., BeOS.
+
+2000/10/08
+ + change exiterr() to use stdarg.h, make some messages easier to
+ understand.
+ + add dialog_clear()
+ + make samples/install/setup build.
+ + implemented mouse support for buttons, e.g., in yesno dialog using
+ ncurses (the gpm support no longer works, but is useful for reference)
+ + add a configure check for chtype.
+ + updates for configure script macros (CF_BUNDLED_INTL, CF_CURSES_LIBS,
+ CF_GCC_ATTRIBUTES, CF_GCC_WARNINGS, CF_INCLUDE_DIRS), and scripts
+ config.guess, config.sub
+ + cleanup of item-help change, integrate with checklist and radiobox.
+ + add ja.po, from Hirofumi Takeda <takepin@turbolinux.co.jp>.
+ > patch by Marco Mariani <marcom@sferacarta.com>
+ + add --item-help option, which makes menubox data interpreted as
+ 3 columns rather than 2. The third column is displayed on the
+ last line of the screen as a help/status message for the currently
+ selected item.
+ + add it.po, pt.po
+ + change TAG_KEY_HL to FALSE, making unselected items in checklist
+ easier to read on Linux console.
+
+2000/07/30
+ + change real_auto_size() to allow it to be used for dialogs that have
+ no prompt, e.g., fselect. Also, rather than requiring both height
+ and width to be given as -1 for maximizing the dialog, allow either
+ alone.
+ + increase minimum height needed for autosized yesno dialog.
+ + add --version as an alias for --print-version.
+ + fix for build on Solaris without NLS (cannot redefine 'gettext()').
+ + add fselect dialog (compatible with Xdialog).
+ + add --enable-lxdialog configure option.
+ + use new configure macro CF_ARG_MSG_ENABLE to show progress with
+ enable/disable switches.
+
+2000/07/02
+ + implement --stdout and --stderr options as in Xdialog.
+ + move logic that translates "\\n" into '\n' into main program to
+ simplify logic that formats text.
+ + make ifdef's for rc-file not specific to ncurses.
+ + correct logic making percent parameter of gauge optional.
+
+2000/06/29
+ + add alternate test-script for gauge, adapted from Xdialog.
+ + modify gauge to make optional a percentage which was read at the
+ beginning of the XXX-delimited message text, since clones of dialog
+ are written to assume this is text. If the line is not a simple
+ integer, dialog will treat it as text.
+ + make the percent parameter of gauge optional, as in Xdialog.
+ + undo one use of CharOf() in guage.c, an error.
+ + fix configure macro AM_WITH_NLS to refrain from attempting to make a
+ symbolic link into/libintl.h if we are not using the bundled intl
+ directory from gettext (reported by Julian Coleman
+ <J.D.Coleman@newcastle.ac.uk>).
+ + add ru.po, from Michael Sobolev <mss@transas.com>
+ + updates for config.guess, config.sub from tin.
+ + updates for configure script macros: CF_MATH_LIB (improperly nested
+ brackets/parenthesis) and CF_XOPEN_CURSES (make include of
+ <*curses.h> depend on configure tests).
+
+2000/04/25
+ + repaint screen when a control/L is pressed.
+ + apply CharOf() macro to avoid sign-extension on calls to waddch(),
+ fixes a problem with accented characters (reported by Santiago Vila).
+ + add es.po, from Santiago Vila <sanvila@unex.es>
+
+2000/04/23
+ + modified to use gettext (configure option --enable-nls). This uses
+ gettext 0.10.35, which must be previously installed. (It can also
+ use an included intl library, but I consider that to be a waste of
+ disk space).
+ + remove code in checklist/radiobox, menubox that try to use
+ abbreviations for the OK/Cancel buttons since those conflict with the
+ check for abbreviations in list entries, which are more useful.
+ + moved padding of button labels out of string literals, into the
+ logic of dlg_draw_buttons().
+ + resync/update with configure macros CF_CURSES_LIBS, CF_FIND_LIBRARY,
+ CF_HEADER_PATH, CF_LIBRARY_PATH and CF_NCURSES_LIBS, as well as
+ mkdirs.sh and config.guess.
+
+2000/02/22
+ + add --default-item option, for menubox to set the default selection
+ (fixes Debian #49796).
+ + add sample scripts for --nocancel and --fb options with inputbox.
+ + modify inputbox* sample scripts to show application errors, if any.
+ + add --nocancel option, and ignore --noitem, --fb, --fullbutton, to
+ make this compatible with whiptail scripts. (whiptail does not
+ handle many dialog scripts however).
+ + modify checklist/radiobox to handle home, end, nextpage, prevpage
+ keys, as well as make the abbreviation search work for the whole
+ list, not only the current page.
+ + treat KEY_LL the same as KEY_END in checklist and textbox.
+ + add logic for KEY_BTAB.
+ + use new function dlg_draw_buttons() to better manage the layout of
+ yes/no/ok/cancel buttons.
+ + another pass of cleanup of dialog.c, makes it use a single table for
+ lookup of option names and help-message. Eliminated numerous
+ adjustments to 'offset' variable.
+ + on initialization, check if standard input is from a terminal. If
+ not, open /dev/tty (fixes Debian #57771)
+
+2000/02/05
+ + implement inline editing in textbox.c search dialog.
+ + revise inputbox.c, allowing inline editing with arrow-keys. removed
+ redundant logic in that module.
+ + correct a typo that prevented rc-file configuration from building.
+ + correct ifdef's to compile/run if the curses implementation does not
+ support color.
+
+2000/01/23
+ + improve test-case for gauge.
+ + change gauge.c to show progress in reverse-video, add a check for
+ end-of-file in the loop for reading new messages.
+ + use curses whline() function to simplify print_arrows() logic in
+ checklist.c and menubox.c
+ + use curses beep() function rather than hardcoded strings.
+ + correct several compiler warnings for gcc -pedantic (mismatch of
+ const, signed/unsigned).
+ + modify exiterr() to avoid possible expansion of '%'.
+ + change CF_MATH_LIB configure macro to allow specifying a particular
+ test-function. For dialog, this should be sqrt(). The macro was
+ originally written for ncurses, which needs sin(). However, that is
+ a builtin function on the m68k port (reported by Roman Hodek
+ <Roman.Hodek@informatik.uni-erlangen.de>, this fixes Debian #55553).
+
+2000/01/18
+ + update manpage (Debian #25648).
+ + modify configure test for math library to avoid using a constant
+ parameter to the test function, lest gcc optimize the call away
+ (fixes Debian #55553).
+ + restructure help-message so actual problem is indicated. The original
+ help-message is shown if no parameters are given, or if the --help
+ option is specified alone.
+ + suppress xterm's alternate screen mode by sending an exit_ca_mode
+ after initscr if the terminal looks like xterm, e.g., has key_mouse
+ defined, and has private-mode escapes in both enter_ca_mode and
+ exit_ca_mode (fixes Debian #55181).
+ + change yellow lettering on white to blue on white, since it offers
+ better contrast (fixes Debian #51196).
+ + use napms() rather than sleep().
+ + some cleanup/simplification of main program. Indent'd dialog.c and
+ util.c
+ + eliminate several places where repeated options are treated as
+ an error, since they are really executed once anyway.
+
+2000/01/15
+ + remove pre-autoconf Makefile
+ + remove sleep's from a few of the sample scripts, which left users
+ thinking that dialog was slow to complete an action.
+ + rewrote infobox sample script, using dialog's --sleep option and
+ a loop in the script.
+ + change 'ch' variable in tailbox.c to an integer, because it is
+ compared against EOF (fixes Debian #53157).
+ + corrected mandir variable in makefile.in (reported by Santiago Vila).
+ + small changes to sample scripts, from Debian: rename "guage" script
+ to "gauge", change path to copy of GPL used in textbox.
+ + add uninstall rule to makefile.in, fixed some dependencies so
+ "make install" works without first doing "make all".
+
+1999/12/25
+ + use more portable scheme for tempfile generation in samples.
+ + add a configure script, prefer to not use the original Makefile
+ because it works only with GNU make.
+ + correct prototype of 'main()', which misused const.
+ + modify guage.c to use fgets() rather than gets().
+ + merge changes from Debian package maintainer
+ Santiago Vila <sanvila@ctv.es>:
+
+ 1999/10/07
+ + add a password dialog box.
+ + implement "--defaultno" option to specify if the default for
+ the yes/no box is "No".
+ 1999/03/10
+ + modify input.c to clear the input field to the right of the
+ given string (unclear: this seems redundant, since the
+ dialog is drawn in a new window).
+ 1998/12/08
+ + check for list_height less than one in checklist.c
+ 1998/10/21
+ + use function wscrl() in preference to scroll() in checklist.c
+ and menubox.c (unclear: in ncurses, scroll() is a macro that
+ uses wscrl()).
+ + remove the "-I/usr/include/ncurses" option from Makefile
+ since Debian does not install ncurses' header files into
+ that directory.
+ 1998/09/12
+ + simplify menubox.c using new functions print_arrows() and
+ print_items().
+ + add logic to handle KEY_NPAGE and KEY_PPAGE.
+ + change sample scripts to use Debian tempfile utility rather
+ than putting files into /tmp.
+ + change sample scripts to use 'dialog' from user's path rather
+ than in the parent directory as in the build directory.
+ + use the system copy of GPL rather than that in the build
+ directory as an example for the textbox script.
+
+1999/11/27
+ + fix some gcc warnings about ambiguous use of "else"
+
+1999/05/01
+ + cleaned up some of the redundant code with new functions:
+ box_x_ordinate
+ box_y_ordinate
+ draw_title
+ draw_bottom_box
+ new_window
+
+ + modified msgbox.c and yesno.c to work with the KEY_RESIZE sigwinch
+ handling in ncurses 4.2
+
+ + corrected spelling of "gauge"
+
+The relevant portions of the Debian change log for the original version
+(dialog-0.9a-12) are abstracted here, omitting details of their packaging:
+
+1998/05/24
+
+ + Replaced guage.c by the one in dialog 0.6z, which is known to work.
+ Fixes Bug #18284: unstable dialog.
+
+1997/12/16
+
+ + dialog.c: dialog_input_result printed with "%s" format. This was
+ Bug #9913, fixed by Bill Mitchell, but the change was lost.
+ + Pristine source, .depend is not removed in clean target. Instead, it
+ is made zero lenght (otherwise it would not work *without* fakeroot).
+ + Added '^U' support in input box (Bug #9915, patch by joey@debian.org).
+ + Wrote patch to fix core-dumping problem (Bug #13170). Sven Rudolph
+ <sr1@inf.tu-dresden.de>:
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/COPYING b/Build/source/utils/dialog/dialog-1.1-20080819/COPYING
new file mode 100644
index 00000000000..8add30ad590
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/COPYING
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/README b/Build/source/utils/dialog/dialog-1.1-20080819/README
new file mode 100644
index 00000000000..b2c9b8595db
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/README
@@ -0,0 +1,61 @@
+-(1999-12-25)-------------------------------------------------------------------
+This version of dialog, formerly known as cdialog is based on the Debian
+package for dialog 0.9a (see CHANGES for recent modifications)
+- T.Dickey <dickey@invisible-island.net>
+
+-(1996-01-15)-------------------------------------------------------------------
+I have uploaded cdialog-0.9a.tar.gz to sunsite. It should be moved
+to pub/Linux/utils/shell, I think.
+
+Starting point for cdialog v.0.9a was dialog-0.6c. Many new features
+like as Resolution-independence, Auto-sizing, Maximizing, more widget
+on the same screen (multi-widget), etc. were added. New widget are
+tailbox and tailbox-in-background. Here are the options:
+
+ Usage: dialog <Common options> <Box options>
+ { --and-widget <Common options> <Box options> }
+
+ Common options: <Global options>
+ [--backtitle <backtitle>] [--sleep <secs>] [--beep] [--beep-after]
+ [--clear] [--begin <y> <x>] [--aspect <ratio>] [--print-size]
+ [--print-maxsize] [--size-err] [--separate-output] [--cr-wrap]
+ [--tab-len <n>] [--tab-correct] [--print-version] [--no-kill]
+ [--title <title>]
+
+ Global options: [--shadow] [--no-shadow] [--separate-widget "<str>"]
+
+At the moment, mouse support with libgpm can't be added because it
+does't implement the wtimeout() function of ncurses. Wtimeout() is
+needed to have more widgets (es.tailbox) cooperating on the same
+screen... I don't know if with newer versions of libgpm it's possible.
+
+I have no more time to write docs for this new version...Is there
+anyone, that looking at the code, can do it??? Ouch! :-)
+Don't flame me!
+
+For the future, if any volunteer want, the way to evolve cdialog is to
+1) make a daemon for a better support of multi-tasking or implementing
+ multithreading.
+2) add an option that could permit to read commands (--options) from a
+ file, like as in a normal programming language, but maintaining
+ compatiblity with older version of dialog.
+
+I no longer could maintain cdialog...
+Executable and library name of cdialog are the same of dialog, for
+compatiblity.
+
+I think that only one directive should be follow: don't use a resource
+like stdin, stdout when you'll write new options for cdialog; these
+resources have to be shared from all widgets on the command line.
+Guage uses stdin :-/ so that can't be mixed for example with an inputbox,
+but it was made before of multi-widget. However this is not a big problem!
+
+THERE ARE NO *KNOWN* BUGS. If anyone has much time and can find the way
+to add wtimeout() support to libgpm, also mouse could be supported.
+
+Please use ncurses-1.9.4 or newer.
+
+| __ | demarco_p@abramo.it:~$ make Linux | more > UserFriendly;
+| /__) | /~~ _ _ _ _ /~\ _ / . _ |
+|/ ako | (___ (_) | ) ) (-' (__/ | ) /__ | | ) (_| >< . coordinator.
+
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/VERSION b/Build/source/utils/dialog/dialog-1.1-20080819/VERSION
new file mode 100644
index 00000000000..c4117690435
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/VERSION
@@ -0,0 +1 @@
+6:5:0 1.1 20080819
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/arrows.c b/Build/source/utils/dialog/dialog-1.1-20080819/arrows.c
new file mode 100644
index 00000000000..910e2c07155
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/arrows.c
@@ -0,0 +1,111 @@
+/*
+ * $Id: arrows.c,v 1.19 2007/02/19 01:22:19 tom Exp $
+ *
+ * arrows.c -- draw arrows to indicate end-of-range for lists
+ *
+ * Copyright 2000-2006,2007 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+
+#ifdef USE_WIDE_CURSES
+#define add_acs(win, code) wadd_wch(win, W ## code)
+#else
+#define add_acs(win, code) waddch(win, dlg_boxchar(code))
+#endif
+
+#ifdef HAVE_COLOR
+static chtype
+merge_colors(chtype foreground, chtype background)
+{
+ chtype result = foreground;
+ if ((foreground & A_COLOR) != (background & A_COLOR)) {
+ short fg_f, bg_f;
+ short fg_b, bg_b;
+ if (pair_content(PAIR_NUMBER(foreground), &fg_f, &bg_f) != ERR
+ && pair_content(PAIR_NUMBER(background), &fg_b, &bg_b) != ERR) {
+ result &= ~A_COLOR;
+ result |= dlg_color_pair(fg_f, bg_b);
+ }
+ }
+ return result;
+}
+#else
+#define merge_colors(f,b) (f)
+#endif
+
+void
+dlg_draw_arrows2(WINDOW *dialog,
+ int top_arrow,
+ int bottom_arrow,
+ int x,
+ int top,
+ int bottom,
+ chtype attr,
+ chtype borderattr)
+{
+ chtype save = getattrs(dialog);
+ int cur_x, cur_y;
+
+ getyx(dialog, cur_y, cur_x);
+
+ (void) wmove(dialog, top, x);
+ if (top_arrow) {
+ wattrset(dialog, merge_colors(uarrow_attr, attr));
+ (void) add_acs(dialog, ACS_UARROW);
+ (void) waddstr(dialog, "(-)");
+ } else {
+ wattrset(dialog, attr);
+ (void) whline(dialog, dlg_boxchar(ACS_HLINE), 4);
+ }
+ mouse_mkbutton(top, x - 1, 6, KEY_PPAGE);
+
+ (void) wmove(dialog, bottom, x);
+ if (bottom_arrow) {
+ wattrset(dialog, merge_colors(darrow_attr, attr));
+ (void) add_acs(dialog, ACS_DARROW);
+ (void) waddstr(dialog, "(+)");
+ } else {
+ wattrset(dialog, borderattr);
+ (void) whline(dialog, dlg_boxchar(ACS_HLINE), 4);
+ }
+ mouse_mkbutton(bottom, x - 1, 6, KEY_NPAGE);
+
+ (void) wmove(dialog, cur_y, cur_x);
+ wrefresh(dialog);
+
+ wattrset(dialog, save);
+}
+
+void
+dlg_draw_arrows(WINDOW *dialog,
+ int top_arrow,
+ int bottom_arrow,
+ int x,
+ int top,
+ int bottom)
+{
+ dlg_draw_arrows2(dialog,
+ top_arrow,
+ bottom_arrow,
+ x,
+ top,
+ bottom,
+ menubox_attr,
+ menubox_border_attr);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/buttons.c b/Build/source/utils/dialog/dialog-1.1-20080819/buttons.c
new file mode 100644
index 00000000000..14a02e5d5b5
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/buttons.c
@@ -0,0 +1,655 @@
+/*
+ * $Id: buttons.c,v 1.77 2007/09/30 00:18:57 tom Exp $
+ *
+ * buttons.c -- draw buttons, e.g., OK/Cancel
+ *
+ * Copyright 2000-2006,2007 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#ifdef NEED_WCHAR_H
+#include <wchar.h>
+#endif
+
+#define MIN_BUTTON (dialog_state.visit_items ? -1 : 0)
+
+static void
+center_label(char *buffer, int longest, const char *label)
+{
+ int len = dlg_count_columns(label);
+ int left = 0, right = 0;
+
+ *buffer = 0;
+ if (len < longest) {
+ left = (longest - len) / 2;
+ right = (longest - len - left);
+ if (left > 0)
+ sprintf(buffer, "%*s", left, " ");
+ }
+ strcat(buffer, label);
+ if (right > 0)
+ sprintf(buffer + strlen(buffer), "%*s", right, " ");
+}
+
+/*
+ * Parse a multibyte character out of the string, set it past the parsed
+ * character.
+ */
+static int
+string_to_char(const char **stringp)
+{
+ int result;
+#ifdef USE_WIDE_CURSES
+ const char *string = *stringp;
+ int have = strlen(string);
+ int check;
+ int len;
+ wchar_t cmp2[2];
+ mbstate_t state;
+
+ memset(&state, 0, sizeof(state));
+ len = mbrlen(string, have, &state);
+ if (len > 0 && len <= have) {
+ memset(&state, 0, sizeof(state));
+ memset(cmp2, 0, sizeof(cmp2));
+ check = mbrtowc(cmp2, string, len, &state);
+ if (check <= 0)
+ cmp2[0] = 0;
+ *stringp += len;
+ } else {
+ cmp2[0] = UCH(*string);
+ *stringp += 1;
+ }
+ result = cmp2[0];
+#else
+ const char *string = *stringp;
+ result = UCH(*string);
+ *stringp += 1;
+#endif
+ return result;
+}
+
+/*
+ * Print a button
+ */
+static void
+print_button(WINDOW *win, char *label, int y, int x, int selected)
+{
+ int i;
+ int state = 0;
+ const int *indx = dlg_index_wchars(label);
+ int limit = dlg_count_wchars(label);
+ chtype key_attr = (selected
+ ? button_key_active_attr
+ : button_key_inactive_attr);
+ chtype label_attr = (selected
+ ? button_label_active_attr
+ : button_label_inactive_attr);
+
+ (void) wmove(win, y, x);
+ wattrset(win, selected
+ ? button_active_attr
+ : button_inactive_attr);
+ (void) waddstr(win, "<");
+ wattrset(win, label_attr);
+ for (i = 0; i < limit; ++i) {
+ int first = indx[i];
+ int last = indx[i + 1];
+
+ switch (state) {
+ case 0:
+#ifdef USE_WIDE_CURSES
+ if ((last - first) != 1) {
+ const char *temp = (label + first);
+ int cmp = string_to_char(&temp);
+ if (dlg_isupper(cmp)) {
+ wattrset(win, key_attr);
+ state = 1;
+ }
+ break;
+ }
+#endif
+ if (dlg_isupper(UCH(label[first]))) {
+ wattrset(win, key_attr);
+ state = 1;
+ }
+ break;
+ case 1:
+ wattrset(win, label_attr);
+ state = 2;
+ break;
+ }
+ waddnstr(win, label + first, last - first);
+ }
+ wattrset(win, selected
+ ? button_active_attr
+ : button_inactive_attr);
+ (void) waddstr(win, ">");
+ (void) wmove(win, y, x + strspn(label, " ") + 1);
+}
+
+/*
+ * Count the buttons in the list.
+ */
+int
+dlg_button_count(const char **labels)
+{
+ int result = 0;
+ while (*labels++ != 0)
+ ++result;
+ return result;
+}
+
+/*
+ * Compute the size of the button array in columns. Return the total number of
+ * columns in *length, and the longest button's columns in *longest
+ */
+void
+dlg_button_sizes(const char **labels,
+ int vertical,
+ int *longest,
+ int *length)
+{
+ int n;
+
+ *length = 0;
+ *longest = 0;
+ for (n = 0; labels[n] != 0; n++) {
+ if (vertical) {
+ *length += 1;
+ *longest = 1;
+ } else {
+ int len = dlg_count_columns(labels[n]);
+ if (len > *longest)
+ *longest = len;
+ *length += len;
+ }
+ }
+ /*
+ * If we can, make all of the buttons the same size. This is only optional
+ * for buttons laid out horizontally.
+ */
+ if (*longest < 6 - (*longest & 1))
+ *longest = 6 - (*longest & 1);
+ if (!vertical)
+ *length = *longest * n;
+}
+
+/*
+ * Compute the size of the button array.
+ */
+int
+dlg_button_x_step(const char **labels, int limit, int *gap, int *margin, int *step)
+{
+ int count = dlg_button_count(labels);
+ int longest;
+ int length;
+ int unused;
+ int used;
+
+ if (count == 0)
+ return 0;
+ dlg_button_sizes(labels, FALSE, &longest, &length);
+ used = (length + (count * 2));
+ unused = limit - used;
+
+ if ((*gap = unused / (count + 3)) <= 0) {
+ if ((*gap = unused / (count + 1)) <= 0)
+ *gap = 1;
+ *margin = *gap;
+ } else {
+ *margin = *gap * 2;
+ }
+ *step = *gap + (used + count - 1) / count;
+ return (*gap > 0) && (unused >= 0);
+}
+
+/*
+ * Make sure there is enough space for the buttons
+ */
+void
+dlg_button_layout(const char **labels, int *limit)
+{
+ int width = 1;
+ int gap, margin, step;
+
+ while (!dlg_button_x_step(labels, width, &gap, &margin, &step))
+ ++width;
+ width += (4 * MARGIN);
+ if (width > COLS)
+ width = COLS;
+ if (width > *limit)
+ *limit = width;
+}
+
+/*
+ * Print a list of buttons at the given position.
+ */
+void
+dlg_draw_buttons(WINDOW *win,
+ int y, int x,
+ const char **labels,
+ int selected,
+ int vertical,
+ int limit)
+{
+ chtype save = getattrs(win);
+ int n;
+ int step = 0;
+ int length;
+ int longest;
+ int final_x;
+ int final_y;
+ int gap;
+ int margin;
+ unsigned need;
+ char *buffer;
+
+ dlg_mouse_setbase(getbegx(win), getbegy(win));
+
+ getyx(win, final_y, final_x);
+
+ dlg_button_sizes(labels, vertical, &longest, &length);
+
+ if (vertical) {
+ y += 1;
+ step = 1;
+ } else {
+ dlg_button_x_step(labels, limit, &gap, &margin, &step);
+ x += margin;
+ }
+
+ /*
+ * Allocate a buffer big enough for any label.
+ */
+ need = longest;
+ for (n = 0; labels[n] != 0; ++n) {
+ need += strlen(labels[n]) + 1;
+ }
+ buffer = dlg_malloc(char, need);
+ assert_ptr(buffer, "dlg_draw_buttons");
+
+ /*
+ * Draw the labels.
+ */
+ for (n = 0; labels[n] != 0; n++) {
+ center_label(buffer, longest, labels[n]);
+ mouse_mkbutton(y, x, dlg_count_columns(buffer), n);
+ print_button(win, buffer, y, x,
+ (selected == n) || (n == 0 && selected < 0));
+ if (selected == n)
+ getyx(win, final_y, final_x);
+
+ if (vertical) {
+ if ((y += step) > limit)
+ break;
+ } else {
+ if ((x += step) > limit)
+ break;
+ }
+ }
+ (void) wmove(win, final_y, final_x);
+ wrefresh(win);
+ free(buffer);
+ wattrset(win, save);
+}
+
+/*
+ * Match a given character against the beginning of the string, ignoring case
+ * of the given character. The matching string must begin with an uppercase
+ * character.
+ */
+int
+dlg_match_char(int ch, const char *string)
+{
+ if (string != 0) {
+ int cmp2 = string_to_char(&string);
+#ifdef USE_WIDE_CURSES
+ wint_t cmp1 = dlg_toupper(ch);
+ if (cmp2 != 0 && (wchar_t) cmp1 == (wchar_t) dlg_toupper(cmp2)) {
+ return TRUE;
+ }
+#else
+ if (ch > 0 && ch < 256) {
+ if (dlg_toupper(ch) == dlg_toupper(cmp2))
+ return TRUE;
+ }
+#endif
+ }
+ return FALSE;
+}
+
+/*
+ * Find the first uppercase character in the label, which we may use for an
+ * abbreviation.
+ */
+int
+dlg_button_to_char(const char *label)
+{
+ int cmp = -1;
+
+ while (*label != 0) {
+ cmp = string_to_char(&label);
+ if (dlg_isupper(cmp)) {
+ break;
+ }
+ }
+ return cmp;
+}
+
+/*
+ * Given a list of button labels, and a character which may be the abbreviation
+ * for one, find it, if it exists. An abbreviation will be the first character
+ * which happens to be capitalized in the label.
+ */
+int
+dlg_char_to_button(int ch, const char **labels)
+{
+ if (labels != 0) {
+ int j;
+
+ ch = dlg_toupper(dlg_last_getc());
+ for (j = 0; labels[j] != 0; ++j) {
+ int cmp = dlg_button_to_char(labels[j]);
+ if (ch == cmp) {
+ dlg_flush_getc();
+ return j;
+ }
+ }
+ }
+ return DLG_EXIT_UNKNOWN;
+}
+
+static const char *
+my_yes_label(void)
+{
+ return (dialog_vars.yes_label != NULL)
+ ? dialog_vars.yes_label
+ : _("Yes");
+}
+
+static const char *
+my_no_label(void)
+{
+ return (dialog_vars.no_label != NULL)
+ ? dialog_vars.no_label
+ : _("No");
+}
+
+static const char *
+my_ok_label(void)
+{
+ return (dialog_vars.ok_label != NULL)
+ ? dialog_vars.ok_label
+ : _("OK");
+}
+
+static const char *
+my_cancel_label(void)
+{
+ return (dialog_vars.cancel_label != NULL)
+ ? dialog_vars.cancel_label
+ : _("Cancel");
+}
+
+static const char *
+my_exit_label(void)
+{
+ return (dialog_vars.exit_label != NULL)
+ ? dialog_vars.exit_label
+ : _("EXIT");
+}
+
+static const char *
+my_extra_label(void)
+{
+ return (dialog_vars.extra_label != NULL)
+ ? dialog_vars.extra_label
+ : _("Extra");
+}
+
+static const char *
+my_help_label(void)
+{
+ return (dialog_vars.help_label != NULL)
+ ? dialog_vars.help_label
+ : _("Help");
+}
+
+/*
+ * Return a list of button labels.
+ */
+const char **
+dlg_exit_label(void)
+{
+ const char **result;
+
+ if (dialog_vars.extra_button) {
+ result = dlg_ok_labels();
+ } else {
+ static const char *labels[3];
+ int n = 0;
+
+ labels[n++] = my_exit_label();
+ if (dialog_vars.help_button)
+ labels[n++] = my_help_label();
+ labels[n] = 0;
+
+ result = labels;
+ }
+ return result;
+}
+
+/*
+ * Map the given button index for dlg_exit_label() into our exit-code.
+ */
+int
+dlg_exit_buttoncode(int button)
+{
+ int result = DLG_EXIT_ERROR;
+
+ if (dialog_vars.extra_button) {
+ result = dlg_ok_buttoncode(button);
+ } else if (button == 0) {
+ result = DLG_EXIT_OK;
+ } else if (button == 1 && dialog_vars.help_button) {
+ result = DLG_EXIT_HELP;
+ }
+ return result;
+}
+
+const char **
+dlg_ok_label(void)
+{
+ static const char *labels[3];
+ int n = 0;
+
+ labels[n++] = my_ok_label();
+ if (dialog_vars.help_button)
+ labels[n++] = my_help_label();
+ labels[n] = 0;
+ return labels;
+}
+
+/*
+ * Return a list of button labels for the OK/Cancel group.
+ */
+const char **
+dlg_ok_labels(void)
+{
+ static const char *labels[5];
+ int n = 0;
+
+ if (!dialog_vars.nook)
+ labels[n++] = my_ok_label();
+ if (dialog_vars.extra_button)
+ labels[n++] = my_extra_label();
+ if (!dialog_vars.nocancel)
+ labels[n++] = my_cancel_label();
+ if (dialog_vars.help_button)
+ labels[n++] = my_help_label();
+ labels[n] = 0;
+ return labels;
+}
+
+/*
+ * Map the given button index for dlg_ok_labels() into our exit-code
+ */
+int
+dlg_ok_buttoncode(int button)
+{
+ int result = DLG_EXIT_ERROR;
+ int n = 1;
+
+ if (!dialog_vars.nook && button <= 0) {
+ result = DLG_EXIT_OK;
+ } else if (dialog_vars.extra_button && (button == n++)) {
+ result = DLG_EXIT_EXTRA;
+ } else if (!dialog_vars.nocancel && (button == n++)) {
+ result = DLG_EXIT_CANCEL;
+ } else if (dialog_vars.help_button && (button == n)) {
+ result = DLG_EXIT_HELP;
+ }
+ return result;
+}
+
+/*
+ * Given that we're using dlg_ok_labels() to list buttons, find the next index
+ * in the list of buttons. The 'extra' parameter if negative provides a way to
+ * enumerate extra active areas on the widget.
+ */
+int
+dlg_next_ok_buttonindex(int current, int extra)
+{
+ int result = current + 1;
+
+ if (current >= 0
+ && dlg_ok_buttoncode(result) < 0)
+ result = extra;
+ return result;
+}
+
+/*
+ * Similarly, find the previous button index.
+ */
+int
+dlg_prev_ok_buttonindex(int current, int extra)
+{
+ int result = current - 1;
+
+ if (result < extra) {
+ for (result = 0; dlg_ok_buttoncode(result + 1) >= 0; ++result) {
+ ;
+ }
+ }
+ return result;
+}
+
+/*
+ * Find the button-index for the "OK" or "Cancel" button, according to
+ * whether --defaultno is given. If --nocancel was given, we always return
+ * the index for "OK".
+ */
+int
+dlg_defaultno_button(void)
+{
+ int result = 0;
+
+ if (dialog_vars.defaultno && !dialog_vars.nocancel) {
+ while (dlg_ok_buttoncode(result) != DLG_EXIT_CANCEL)
+ ++result;
+ }
+ return result;
+}
+
+/*
+ * Return a list of buttons for Yes/No labels.
+ */
+const char **
+dlg_yes_labels(void)
+{
+ const char **result;
+
+ if (dialog_vars.extra_button) {
+ result = dlg_ok_labels();
+ } else {
+ static const char *labels[4];
+ int n = 0;
+
+ labels[n++] = my_yes_label();
+ labels[n++] = my_no_label();
+ if (dialog_vars.help_button)
+ labels[n++] = my_help_label();
+ labels[n] = 0;
+
+ result = labels;
+ }
+
+ return result;
+}
+
+/*
+ * Map the given button index for dlg_yes_labels() into our exit-code.
+ */
+int
+dlg_yes_buttoncode(int button)
+{
+ int result = DLG_EXIT_ERROR;
+
+ if (dialog_vars.extra_button) {
+ result = dlg_ok_buttoncode(button);
+ } else if (button == 0) {
+ result = DLG_EXIT_OK;
+ } else if (button == 1) {
+ result = DLG_EXIT_CANCEL;
+ } else if (button == 2 && dialog_vars.help_button) {
+ result = DLG_EXIT_HELP;
+ }
+
+ return result;
+}
+
+/*
+ * Return the next index in labels[];
+ */
+int
+dlg_next_button(const char **labels, int button)
+{
+ if (labels[button + 1] != 0)
+ ++button;
+ else
+ button = MIN_BUTTON;
+ return button;
+}
+
+/*
+ * Return the previous index in labels[];
+ */
+int
+dlg_prev_button(const char **labels, int button)
+{
+ if (button > MIN_BUTTON)
+ --button;
+ else {
+ while (labels[button + 1] != 0)
+ ++button;
+ }
+ return button;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/calendar.c b/Build/source/utils/dialog/dialog-1.1-20080819/calendar.c
new file mode 100644
index 00000000000..3e311dce98a
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/calendar.c
@@ -0,0 +1,645 @@
+/*
+ * $Id: calendar.c,v 1.54 2008/06/21 12:36:41 tom Exp $
+ *
+ * calendar.c -- implements the calendar box
+ *
+ * Copyright 2001-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#include <time.h>
+
+#define ONE_DAY (60 * 60 * 24)
+
+#define MON_WIDE 4 /* width of a month-name */
+#define DAY_HIGH 6 /* maximum lines in day-grid */
+#define DAY_WIDE (8 * MON_WIDE) /* width of the day-grid */
+#define HDR_HIGH 1 /* height of cells with month/year */
+#define BTN_HIGH 1 /* height of button-row excluding margin */
+
+/* two more lines: titles for day-of-week and month/year boxes */
+#define MIN_HIGH (DAY_HIGH + 2 + HDR_HIGH + BTN_HIGH + (7 * MARGIN))
+#define MIN_WIDE (DAY_WIDE + (4 * MARGIN))
+
+typedef enum {
+ sMONTH = -3
+ ,sYEAR = -2
+ ,sDAY = -1
+} STATES;
+
+struct _box;
+
+typedef int (*BOX_DRAW) (struct _box *, struct tm *);
+
+typedef struct _box {
+ WINDOW *parent;
+ WINDOW *window;
+ int x;
+ int y;
+ int width;
+ int height;
+ BOX_DRAW box_draw;
+} BOX;
+
+static int
+days_in_month(struct tm *current, int offset /* -1, 0, 1 */ )
+{
+ static const int nominal[] =
+ {
+ 31, 28, 31, 30, 31, 30,
+ 31, 31, 30, 31, 30, 31
+ };
+ int year = current->tm_year;
+ int month = current->tm_mon + offset;
+ int result;
+
+ while (month < 0) {
+ month += 12;
+ year -= 1;
+ }
+ while (month >= 12) {
+ month -= 12;
+ year += 1;
+ }
+ result = nominal[month];
+ if (month == 1)
+ result += ((year % 4) == 0);
+ return result;
+}
+
+static int
+days_in_year(struct tm *current, int offset /* -1, 0, 1 */ )
+{
+ int year = current->tm_year + 1900 + offset;
+
+ return ((year % 4) == 0) ? 366 : 365;
+}
+
+static int
+day_cell_number(struct tm *current)
+{
+ int cell;
+ cell = current->tm_mday - ((6 + current->tm_mday - current->tm_wday) % 7);
+ if ((current->tm_mday - 1) % 7 != current->tm_wday)
+ cell += 6;
+ else
+ cell--;
+ return cell;
+}
+
+static int
+next_or_previous(int key, int two_d)
+{
+ int result = 0;
+
+ switch (key) {
+ case DLGK_GRID_UP:
+ result = two_d ? -7 : -1;
+ break;
+ case DLGK_GRID_LEFT:
+ result = -1;
+ break;
+ case DLGK_GRID_DOWN:
+ result = two_d ? 7 : 1;
+ break;
+ case DLGK_GRID_RIGHT:
+ result = 1;
+ break;
+ default:
+ beep();
+ break;
+ }
+ return result;
+}
+
+/*
+ * Draw the day-of-month selection box
+ */
+static int
+draw_day(BOX * data, struct tm *current)
+{
+#ifdef ENABLE_NLS
+ char *of_week[] =
+ {
+ nl_langinfo(ABDAY_1),
+ nl_langinfo(ABDAY_2),
+ nl_langinfo(ABDAY_3),
+ nl_langinfo(ABDAY_4),
+ nl_langinfo(ABDAY_5),
+ nl_langinfo(ABDAY_6),
+ nl_langinfo(ABDAY_7)
+ };
+#else
+ static const char *const of_week[] =
+ {
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday"
+ };
+#endif
+ int cell_wide = MON_WIDE;
+ int y, x, this_x = 0;
+ int save_y = 0, save_x = 0;
+ int day = current->tm_mday;
+ int mday;
+ int week;
+ int last = days_in_month(current, 0);
+ int prev = days_in_month(current, -1);
+
+ werase(data->window);
+ dlg_draw_box(data->parent,
+ data->y - MARGIN, data->x - MARGIN,
+ data->height + (2 * MARGIN), data->width + (2 * MARGIN),
+ menubox_border_attr, menubox_attr); /* border of daybox */
+
+ wattrset(data->window, menubox_attr); /* daynames headline */
+ for (x = 0; x < 7; x++) {
+ mvwprintw(data->window,
+ 0, (x + 1) * cell_wide, "%*.*s ",
+ cell_wide - 1,
+ cell_wide - 1,
+ of_week[x]);
+ }
+
+ mday = ((6 + current->tm_mday - current->tm_wday) % 7) - 7;
+ if (mday <= -7)
+ mday += 7;
+ /* mday is now in the range -6 to 0. */
+ week = (current->tm_yday + 6 + mday - current->tm_mday) / 7;
+
+ for (y = 1; mday < last; y++) {
+ wattrset(data->window, menubox_attr); /* weeknumbers headline */
+ mvwprintw(data->window,
+ y, 0,
+ "%*d ",
+ cell_wide - 1,
+ ++week);
+ for (x = 0; x < 7; x++) {
+ this_x = 1 + (x + 1) * cell_wide;
+ ++mday;
+ if (wmove(data->window, y, this_x) == ERR)
+ continue;
+ wattrset(data->window, item_attr); /* not selected days */
+ if (mday == day) {
+ wattrset(data->window, item_selected_attr); /* selected day */
+ save_y = y;
+ save_x = this_x;
+ }
+ if (mday > 0) {
+ if (mday <= last) {
+ wprintw(data->window, "%*d", cell_wide - 2, mday);
+ } else if (mday == day) {
+ wprintw(data->window, "%*d", cell_wide - 2, mday - last);
+ }
+ } else if (mday == day) {
+ wprintw(data->window, "%*d", cell_wide - 2, mday + prev);
+ }
+ }
+ wmove(data->window, save_y, save_x);
+ }
+ dlg_draw_arrows(data->parent, TRUE, TRUE,
+ data->x + ARROWS_COL,
+ data->y - 1,
+ data->y + data->height);
+
+ return 0;
+}
+
+/*
+ * Draw the month-of-year selection box
+ */
+static int
+draw_month(BOX * data, struct tm *current)
+{
+#ifdef ENABLE_NLS
+ char *months[] =
+ {
+ nl_langinfo(MON_1),
+ nl_langinfo(MON_2),
+ nl_langinfo(MON_3),
+ nl_langinfo(MON_4),
+ nl_langinfo(MON_5),
+ nl_langinfo(MON_6),
+ nl_langinfo(MON_7),
+ nl_langinfo(MON_8),
+ nl_langinfo(MON_9),
+ nl_langinfo(MON_10),
+ nl_langinfo(MON_11),
+ nl_langinfo(MON_12)
+ };
+#else
+ static const char *const months[] =
+ {
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"
+ };
+#endif
+ int month;
+
+ month = current->tm_mon + 1;
+
+ wattrset(data->parent, dialog_attr); /* Headline "Month" */
+ (void) mvwprintw(data->parent, data->y - 2, data->x - 1, _("Month"));
+ dlg_draw_box(data->parent,
+ data->y - 1, data->x - 1,
+ data->height + 2, data->width + 2,
+ menubox_border_attr, menubox_attr); /* borders of monthbox */
+ wattrset(data->window, item_attr); /* color the month selection */
+ mvwprintw(data->window, 0, 0, "%s", months[month - 1]);
+ wmove(data->window, 0, 0);
+ return 0;
+}
+
+/*
+ * Draw the year selection box
+ */
+static int
+draw_year(BOX * data, struct tm *current)
+{
+ int year = current->tm_year + 1900;
+
+ wattrset(data->parent, dialog_attr); /* Headline "Year" */
+ (void) mvwprintw(data->parent, data->y - 2, data->x - 1, _("Year"));
+ dlg_draw_box(data->parent,
+ data->y - 1, data->x - 1,
+ data->height + 2, data->width + 2,
+ menubox_border_attr, menubox_attr); /* borders of yearbox */
+ wattrset(data->window, item_attr); /* color the year selection */
+ mvwprintw(data->window, 0, 0, "%4d", year);
+ wmove(data->window, 0, 0);
+ return 0;
+}
+
+static int
+init_object(BOX * data,
+ WINDOW *parent,
+ int x, int y,
+ int width, int height,
+ BOX_DRAW box_draw,
+ int code)
+{
+ data->parent = parent;
+ data->x = x;
+ data->y = y;
+ data->width = width;
+ data->height = height;
+ data->box_draw = box_draw;
+
+ data->window = derwin(data->parent,
+ data->height, data->width,
+ data->y, data->x);
+ if (data->window == 0)
+ return -1;
+ (void) keypad(data->window, TRUE);
+
+ dlg_mouse_setbase(getbegx(parent), getbegy(parent));
+ if (code == 'D') {
+ dlg_mouse_mkbigregion(y + 1, x + MON_WIDE, height - 1, width - MON_WIDE,
+ KEY_MAX, 1, MON_WIDE, 3);
+ } else {
+ dlg_mouse_mkregion(y, x, height, width, code);
+ }
+
+ return 0;
+}
+
+static int
+CleanupResult(int code, WINDOW *dialog, char *prompt, DIALOG_VARS * save_vars)
+{
+ if (dialog != 0)
+ dlg_del_window(dialog);
+ dlg_mouse_free_regions();
+ if (prompt != 0)
+ free(prompt);
+ dlg_restore_vars(save_vars);
+
+ return code;
+}
+
+#define DrawObject(data) (data)->box_draw(data, &current)
+
+/*
+ * Display a dialog box for entering a date
+ */
+int
+dialog_calendar(const char *title,
+ const char *subtitle,
+ int height,
+ int width,
+ int day,
+ int month,
+ int year)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, 'j' ),
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, KEY_NPAGE ),
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, DLGK_MOUSE(KEY_NPAGE) ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, 'h' ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, CHR_BACKSPACE ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, CHR_PREVIOUS ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, KEY_LEFT ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, 'l' ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, CHR_NEXT ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, KEY_NEXT ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, 'k' ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, KEY_PPAGE ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, KEY_PREVIOUS ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, DLGK_MOUSE(KEY_PPAGE) ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+ BOX dy_box, mn_box, yr_box;
+ int fkey;
+ int key = 0;
+ int key2;
+ int step;
+ int button;
+ int result = DLG_EXIT_UNKNOWN;
+ WINDOW *dialog;
+ time_t now_time = time((time_t *) 0);
+ struct tm current;
+ int state = dlg_defaultno_button();
+ const char **buttons = dlg_ok_labels();
+ char *prompt = dlg_strclone(subtitle);
+ int longest;
+ int mincols;
+ char buffer[MAX_LEN];
+ DIALOG_VARS save_vars;
+
+ dlg_save_vars(&save_vars);
+ dialog_vars.separate_output = TRUE;
+
+ dlg_does_output();
+
+ now_time = time((time_t *) 0);
+ current = *localtime(&now_time);
+ if (day < 0)
+ day = current.tm_mday;
+ if (month < 0)
+ month = current.tm_mon + 1;
+ if (year < 0)
+ year = current.tm_year + 1900;
+
+ /* compute a struct tm that matches the day/month/year parameters */
+ if (((year -= 1900) > 0) && (year < 200)) {
+ /* ugly, but I'd like to run this on older machines w/o mktime -TD */
+ for (;;) {
+ if (year > current.tm_year) {
+ now_time += ONE_DAY * days_in_year(&current, 0);
+ } else if (year < current.tm_year) {
+ now_time -= ONE_DAY * days_in_year(&current, -1);
+ } else if (month > current.tm_mon + 1) {
+ now_time += ONE_DAY * days_in_month(&current, 0);
+ } else if (month < current.tm_mon + 1) {
+ now_time -= ONE_DAY * days_in_month(&current, -1);
+ } else if (day > current.tm_mday) {
+ now_time += ONE_DAY;
+ } else if (day < current.tm_mday) {
+ now_time -= ONE_DAY;
+ } else {
+ break;
+ }
+ current = *localtime(&now_time);
+ }
+ }
+
+ dlg_button_sizes(buttons, FALSE, &longest, &mincols);
+ mincols += (0 * MARGIN) + (dlg_button_count(buttons) * 3) - 1;
+ if (mincols < MIN_WIDE)
+ mincols = MIN_WIDE;
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+
+ dlg_auto_size(title, prompt, &height, &width, 0, mincols);
+ height += MIN_HIGH - 1;
+ if (width < MIN_WIDE)
+ width = MIN_WIDE;
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ dialog = dlg_new_window(height, width,
+ dlg_box_y_ordinate(height),
+ dlg_box_x_ordinate(width));
+ dlg_register_window(dialog, "calendar", binding);
+ dlg_register_buttons(dialog, "calendar", buttons);
+
+ /* mainbox */
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr); /* text mainbox */
+ dlg_print_autowrap(dialog, prompt, height, width);
+
+ /* compute positions of day, month and year boxes */
+ memset(&dy_box, 0, sizeof(dy_box));
+ memset(&mn_box, 0, sizeof(mn_box));
+ memset(&yr_box, 0, sizeof(yr_box));
+
+ if (init_object(&dy_box,
+ dialog,
+ (width - DAY_WIDE) / 2,
+ 1 + (height - (DAY_HIGH + BTN_HIGH + (5 * MARGIN))),
+ DAY_WIDE,
+ DAY_HIGH + 1,
+ draw_day,
+ 'D') < 0
+ || DrawObject(&dy_box) < 0) {
+ return CleanupResult(DLG_EXIT_ERROR, dialog, prompt, &save_vars);
+ }
+
+ if (init_object(&mn_box,
+ dialog,
+ dy_box.x,
+ dy_box.y - (HDR_HIGH + 2 * MARGIN),
+ (DAY_WIDE / 2) - MARGIN,
+ HDR_HIGH,
+ draw_month,
+ 'M') < 0
+ || DrawObject(&mn_box) < 0) {
+ return CleanupResult(DLG_EXIT_ERROR, dialog, prompt, &save_vars);
+ }
+
+ if (init_object(&yr_box,
+ dialog,
+ dy_box.x + mn_box.width + 2,
+ mn_box.y,
+ mn_box.width,
+ mn_box.height,
+ draw_year,
+ 'Y') < 0
+ || DrawObject(&yr_box) < 0) {
+ return CleanupResult(DLG_EXIT_ERROR, dialog, prompt, &save_vars);
+ }
+
+ while (result == DLG_EXIT_UNKNOWN) {
+ BOX *obj = (state == sDAY ? &dy_box
+ : (state == sMONTH ? &mn_box :
+ (state == sYEAR ? &yr_box : 0)));
+
+ button = (state < 0) ? 0 : state;
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
+ if (obj != 0)
+ dlg_set_focus(dialog, obj->window);
+
+ key = dlg_mouse_wgetch(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+
+ if (fkey && (key >= DLGK_MOUSE(KEY_MIN) && key <= DLGK_MOUSE(KEY_MAX))) {
+ key = dlg_lookup_key(dialog, key - M_EVENT, &fkey);
+ }
+
+ if ((key2 = dlg_char_to_button(key, buttons)) >= 0) {
+ result = key2;
+ } else if (fkey) {
+ /* handle function-keys */
+ switch (key) {
+ case DLGK_MOUSE('D'):
+ state = sDAY;
+ break;
+ case DLGK_MOUSE('M'):
+ state = sMONTH;
+ break;
+ case DLGK_MOUSE('Y'):
+ state = sYEAR;
+ break;
+ case DLGK_ENTER:
+ result = dlg_ok_buttoncode(button);
+ break;
+ case DLGK_FIELD_PREV:
+ state = dlg_prev_ok_buttonindex(state, sMONTH);
+ break;
+ case DLGK_FIELD_NEXT:
+ state = dlg_next_ok_buttonindex(state, sMONTH);
+ break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ /* reset data */
+ height = old_height;
+ width = old_width;
+ /* repaint */
+ dlg_clear();
+ dlg_del_window(dialog);
+ refresh();
+ dlg_mouse_free_regions();
+ goto retry;
+#endif
+ default:
+ step = 0;
+ key2 = -1;
+ if (is_DLGK_MOUSE(key)) {
+ if ((key2 = dlg_ok_buttoncode(key - M_EVENT)) >= 0) {
+ result = key2;
+ break;
+ } else if (key >= DLGK_MOUSE(KEY_MAX)) {
+ state = sDAY;
+ obj = &dy_box;
+ key2 = 1;
+ step = (key
+ - DLGK_MOUSE(KEY_MAX)
+ - day_cell_number(&current));
+ }
+ }
+ if (obj != 0) {
+ if (key2 < 0)
+ step = next_or_previous(key, (obj == &dy_box));
+ if (step != 0) {
+ struct tm old = current;
+
+ /* see comment regarding mktime -TD */
+ if (obj == &dy_box) {
+ now_time += ONE_DAY * step;
+ } else if (obj == &mn_box) {
+ if (step > 0)
+ now_time += ONE_DAY *
+ days_in_month(&current, 0);
+ else
+ now_time -= ONE_DAY *
+ days_in_month(&current, -1);
+ } else if (obj == &yr_box) {
+ if (step > 0)
+ now_time += (ONE_DAY
+ * days_in_year(&current, 0));
+ else
+ now_time -= (ONE_DAY
+ * days_in_year(&current, -1));
+ }
+
+ current = *localtime(&now_time);
+
+ if (obj != &dy_box
+ && (current.tm_mday != old.tm_mday
+ || current.tm_mon != old.tm_mon
+ || current.tm_year != old.tm_year))
+ DrawObject(&dy_box);
+ if (obj != &mn_box && current.tm_mon != old.tm_mon)
+ DrawObject(&mn_box);
+ if (obj != &yr_box && current.tm_year != old.tm_year)
+ DrawObject(&yr_box);
+ (void) DrawObject(obj);
+ }
+ } else if (state >= 0) {
+ if (next_or_previous(key, FALSE) < 0)
+ state = dlg_prev_ok_buttonindex(state, sMONTH);
+ else if (next_or_previous(key, FALSE) > 0)
+ state = dlg_next_ok_buttonindex(state, sMONTH);
+ }
+ break;
+ }
+ }
+ }
+
+ sprintf(buffer, "%02d/%02d/%0d",
+ current.tm_mday, current.tm_mon + 1, current.tm_year + 1900);
+ dlg_add_result(buffer);
+ dlg_add_separator();
+
+ return CleanupResult(result, dialog, prompt, &save_vars);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/checklist.c b/Build/source/utils/dialog/dialog-1.1-20080819/checklist.c
new file mode 100644
index 00000000000..8189cd6fc55
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/checklist.c
@@ -0,0 +1,704 @@
+/*
+ * $Id: checklist.c,v 1.119 2008/06/20 20:58:21 tom Exp $
+ *
+ * checklist.c -- implements the checklist box
+ *
+ * Copyright 2000-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors:
+ * Savio Lam (lam836@cs.cuhk.hk)
+ * Stuart Herbert - S.Herbert@sheffield.ac.uk: radiolist extension
+ * Alessandro Rubini - rubini@ipvvis.unipv.it: merged the two
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+static int list_width, check_x, item_x, checkflag;
+
+#define MIN_HIGH (1 + (5 * MARGIN))
+
+#define LLEN(n) ((n) * CHECKBOX_TAGS)
+#define ItemData(i) &items[LLEN(i)]
+#define ItemName(i) items[LLEN(i)]
+#define ItemText(i) items[LLEN(i) + 1]
+#define ItemStatus(i) items[LLEN(i) + 2]
+#define ItemHelp(i) items[LLEN(i) + 3]
+
+static void
+print_arrows(WINDOW *win,
+ int box_x,
+ int box_y,
+ int scrollamt,
+ int choice,
+ int item_no,
+ int list_height)
+{
+ dlg_draw_arrows2(win, scrollamt,
+ scrollamt + choice < item_no,
+ box_x + check_x + ARROWS_COL,
+ box_y,
+ box_y + list_height + 1,
+ menubox_attr,
+ menubox_border_attr);
+}
+
+/*
+ * Print list item. The 'selected' parameter is true if 'choice' is the
+ * current item. That one is colored differently from the other items.
+ */
+static void
+print_item(WINDOW *win,
+ DIALOG_LISTITEM * item,
+ const char *states,
+ int choice,
+ int selected)
+{
+ chtype save = getattrs(win);
+ int i;
+ chtype attr = A_NORMAL;
+ const int *cols;
+ const int *indx;
+ int limit;
+
+ /* Clear 'residue' of last item */
+ wattrset(win, menubox_attr);
+ (void) wmove(win, choice, 0);
+ for (i = 0; i < list_width; i++)
+ (void) waddch(win, ' ');
+
+ (void) wmove(win, choice, check_x);
+ wattrset(win, selected ? check_selected_attr : check_attr);
+ (void) wprintw(win,
+ (checkflag == FLAG_CHECK) ? "[%c]" : "(%c)",
+ states[item->state]);
+ wattrset(win, menubox_attr);
+ (void) waddch(win, ' ');
+
+ if (strlen(item->name) != 0) {
+
+ indx = dlg_index_wchars(item->name);
+
+ wattrset(win, selected ? tag_key_selected_attr : tag_key_attr);
+ (void) waddnstr(win, item->name, indx[1]);
+
+ if ((int) strlen(item->name) > indx[1]) {
+ limit = dlg_limit_columns(item->name, (item_x - check_x - 6), 1);
+ if (limit > 1) {
+ wattrset(win, selected ? tag_selected_attr : tag_attr);
+ (void) waddnstr(win,
+ item->name + indx[1],
+ indx[limit] - indx[1]);
+ }
+ }
+ }
+
+ if (strlen(item->text) != 0) {
+ cols = dlg_index_columns(item->text);
+ limit = dlg_limit_columns(item->text, (getmaxx(win) - item_x + 1), 0);
+
+ if (limit > 0) {
+ (void) wmove(win, choice, item_x);
+ wattrset(win, selected ? item_selected_attr : item_attr);
+ dlg_print_text(win, item->text, cols[limit], &attr);
+ }
+ }
+
+ if (selected) {
+ dlg_item_help(item->help);
+ }
+ wattrset(win, save);
+}
+
+/*
+ * This is an alternate interface to 'checklist' which allows the application
+ * to read the list item states back directly without putting them in the
+ * output buffer. It also provides for more than two states over which the
+ * check/radio box can display.
+ */
+int
+dlg_checklist(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int list_height,
+ int item_no,
+ DIALOG_LISTITEM * items,
+ const char *states,
+ int flag,
+ int *current_item)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ),
+ DLG_KEYS_DATA( DLGK_ITEM_FIRST, KEY_HOME ),
+ DLG_KEYS_DATA( DLGK_ITEM_LAST, KEY_END ),
+ DLG_KEYS_DATA( DLGK_ITEM_LAST, KEY_LL ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, '+' ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, CHR_NEXT ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, '-' ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, CHR_PREVIOUS ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, DLGK_MOUSE(KEY_NPAGE) ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, DLGK_MOUSE(KEY_PPAGE) ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+ int i, j, key2, found, x, y, cur_x, cur_y, box_x, box_y;
+ int key = 0, fkey;
+ int button = dialog_state.visit_items ? -1 : dlg_defaultno_button();
+ int choice = dlg_default_listitem(items);
+ int scrollamt = 0;
+ int max_choice;
+ int was_mouse;
+ int use_height;
+ int use_width, name_width, text_width;
+ int result = DLG_EXIT_UNKNOWN;
+ int num_states;
+ WINDOW *dialog, *list;
+ char *prompt = dlg_strclone(cprompt);
+ const char **buttons = dlg_ok_labels();
+
+ dlg_does_output();
+ dlg_tab_correct_str(prompt);
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+
+ use_height = list_height;
+ if (use_height == 0) {
+ use_width = dlg_calc_list_width(item_no, items) + 10;
+ /* calculate height without items (4) */
+ dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MAX(26, use_width));
+ dlg_calc_listh(&height, &use_height, item_no);
+ } else {
+ dlg_auto_size(title, prompt, &height, &width, MIN_HIGH + use_height, 26);
+ }
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ /* we need at least two states */
+ if (states == 0 || strlen(states) < 2)
+ states = " *";
+ num_states = strlen(states);
+
+ checkflag = flag;
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+ dialog = dlg_new_window(height, width, y, x);
+ dlg_register_window(dialog, "checklist", binding);
+ dlg_register_buttons(dialog, "checklist", buttons);
+
+ dlg_mouse_setbase(x, y);
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+ dlg_print_autowrap(dialog, prompt, height, width);
+
+ list_width = width - 6;
+ getyx(dialog, cur_y, cur_x);
+ box_y = cur_y + 1;
+ box_x = (width - list_width) / 2 - 1;
+
+ /*
+ * After displaying the prompt, we know how much space we really have.
+ * Limit the list to avoid overwriting the ok-button.
+ */
+ if (use_height + MIN_HIGH > height - cur_y)
+ use_height = height - MIN_HIGH - cur_y;
+ if (use_height <= 0)
+ use_height = 1;
+
+ max_choice = MIN(use_height, item_no);
+
+ /* create new window for the list */
+ list = dlg_sub_window(dialog, use_height, list_width,
+ y + box_y + 1, x + box_x + 1);
+
+ /* draw a box around the list items */
+ dlg_draw_box(dialog, box_y, box_x,
+ use_height + 2 * MARGIN,
+ list_width + 2 * MARGIN,
+ menubox_border_attr, menubox_attr);
+
+ text_width = 0;
+ name_width = 0;
+ /* Find length of longest item to center checklist */
+ for (i = 0; i < item_no; i++) {
+ text_width = MAX(text_width, dlg_count_columns(items[i].text));
+ name_width = MAX(name_width, dlg_count_columns(items[i].name));
+ }
+
+ /* If the name+text is wider than the list is allowed, then truncate
+ * one or both of them. If the name is no wider than 1/4 of the list,
+ * leave it intact.
+ */
+ use_width = (list_width - 6);
+ if (text_width + name_width > use_width) {
+ int need = (int) (0.25 * use_width);
+ if (name_width > need) {
+ int want = (int) (use_width * ((double) name_width) /
+ (text_width + name_width));
+ name_width = (want > need) ? want : need;
+ }
+ text_width = use_width - name_width;
+ }
+
+ check_x = (use_width - (text_width + name_width)) / 2;
+ item_x = name_width + check_x + 6;
+
+ /* ensure we are scrolled to show the current choice */
+ if (choice >= (max_choice + scrollamt)) {
+ scrollamt = choice - max_choice + 1;
+ choice = max_choice - 1;
+ }
+ /* Print the list */
+ for (i = 0; i < max_choice; i++)
+ print_item(list,
+ &items[i + scrollamt],
+ states,
+ i, i == choice);
+ (void) wnoutrefresh(list);
+
+ /* register the new window, along with its borders */
+ dlg_mouse_mkbigregion(box_y + 1, box_x, use_height, list_width + 2,
+ KEY_MAX, 1, 1, 1 /* by lines */ );
+
+ print_arrows(dialog,
+ box_x, box_y,
+ scrollamt, max_choice, item_no, use_height);
+
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
+
+ while (result == DLG_EXIT_UNKNOWN) {
+ if (button < 0) /* --visit-items */
+ wmove(dialog, box_y + choice + 1, box_x + check_x + 2);
+
+ key = dlg_mouse_wgetch(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+
+ was_mouse = (fkey && is_DLGK_MOUSE(key));
+ if (was_mouse)
+ key -= M_EVENT;
+
+ if (was_mouse && (key >= KEY_MAX)) {
+ getyx(dialog, cur_y, cur_x);
+ i = (key - KEY_MAX);
+ if (i < max_choice) {
+ /* De-highlight current item */
+ print_item(list,
+ &items[scrollamt + choice],
+ states,
+ choice, FALSE);
+ /* Highlight new item */
+ choice = (key - KEY_MAX);
+ print_item(list,
+ &items[scrollamt + choice],
+ states,
+ choice, TRUE);
+ (void) wnoutrefresh(list);
+ (void) wmove(dialog, cur_y, cur_x);
+
+ key = ' '; /* force the selected item to toggle */
+ } else {
+ beep();
+ continue;
+ }
+ fkey = FALSE;
+ } else if (was_mouse && key >= KEY_MIN) {
+ key = dlg_lookup_key(dialog, key, &fkey);
+ }
+
+ /*
+ * A space toggles the item status. We handle either a checklist
+ * (any number of items can be selected) or radio list (zero or one
+ * items can be selected).
+ */
+ if (key == ' ') {
+ int current = scrollamt + choice;
+ int next = items[current].state + 1;
+
+ if (next >= num_states)
+ next = 0;
+
+ getyx(dialog, cur_y, cur_x);
+ if (flag == FLAG_CHECK) { /* checklist? */
+ items[current].state = next;
+ print_item(list,
+ &items[scrollamt + choice],
+ states,
+ choice, TRUE);
+ } else { /* radiolist */
+ for (i = 0; i < item_no; i++) {
+ if (i != current) {
+ items[i].state = 0;
+ }
+ }
+ if (items[current].state) {
+ items[current].state = next ? next : 1;
+ print_item(list,
+ &items[current],
+ states,
+ choice, TRUE);
+ } else {
+ items[current].state = 1;
+ for (i = 0; i < max_choice; i++)
+ print_item(list,
+ &items[scrollamt + i],
+ states,
+ i, i == choice);
+ }
+ }
+ (void) wnoutrefresh(list);
+ (void) wmove(dialog, cur_y, cur_x);
+ wrefresh(dialog);
+ continue; /* wait for another key press */
+ }
+
+ /*
+ * Check if key pressed matches first character of any item tag in
+ * list. If there is more than one match, we will cycle through
+ * each one as the same key is pressed repeatedly.
+ */
+ found = FALSE;
+ if (!fkey) {
+ if (button < 0 || !dialog_state.visit_items) {
+ for (j = scrollamt + choice + 1; j < item_no; j++) {
+ if (dlg_match_char(dlg_last_getc(), items[j].name)) {
+ found = TRUE;
+ i = j - scrollamt;
+ break;
+ }
+ }
+ if (!found) {
+ for (j = 0; j <= scrollamt + choice; j++) {
+ if (dlg_match_char(dlg_last_getc(), items[j].name)) {
+ found = TRUE;
+ i = j - scrollamt;
+ break;
+ }
+ }
+ }
+ if (found)
+ dlg_flush_getc();
+ } else if ((j = dlg_char_to_button(key, buttons)) >= 0) {
+ button = j;
+ ungetch('\n');
+ continue;
+ }
+ }
+
+ /*
+ * A single digit (1-9) positions the selection to that line in the
+ * current screen.
+ */
+ if (!found
+ && (key <= '9')
+ && (key > '0')
+ && (key - '1' < max_choice)) {
+ found = TRUE;
+ i = key - '1';
+ }
+
+ if (!found) {
+ if (fkey) {
+ found = TRUE;
+ switch (key) {
+ case DLGK_ITEM_FIRST:
+ i = -scrollamt;
+ break;
+ case DLGK_ITEM_LAST:
+ i = item_no - 1 - scrollamt;
+ break;
+ case DLGK_PAGE_PREV:
+ if (choice)
+ i = 0;
+ else if (scrollamt != 0)
+ i = -MIN(scrollamt, max_choice);
+ else
+ continue;
+ break;
+ case DLGK_PAGE_NEXT:
+ i = MIN(choice + max_choice, item_no - scrollamt - 1);
+ break;
+ case DLGK_ITEM_PREV:
+ i = choice - 1;
+ if (choice == 0 && scrollamt == 0)
+ continue;
+ break;
+ case DLGK_ITEM_NEXT:
+ i = choice + 1;
+ if (scrollamt + choice >= item_no - 1)
+ continue;
+ break;
+ default:
+ found = FALSE;
+ break;
+ }
+ }
+ }
+
+ if (found) {
+ if (i != choice) {
+ getyx(dialog, cur_y, cur_x);
+ if (i < 0 || i >= max_choice) {
+#if defined(NCURSES_VERSION_MAJOR) && NCURSES_VERSION_MAJOR < 5
+ /*
+ * Using wscrl to assist ncurses scrolling is not needed
+ * in version 5.x
+ */
+ if (i == -1) {
+ if (use_height > 1) {
+ /* De-highlight current first item */
+ print_item(list,
+ &items[scrollamt],
+ states,
+ 0, FALSE);
+ scrollok(list, TRUE);
+ wscrl(list, -1);
+ scrollok(list, FALSE);
+ }
+ scrollamt--;
+ print_item(list,
+ &items[scrollamt],
+ states,
+ 0, TRUE);
+ } else if (i == max_choice) {
+ if (use_height > 1) {
+ /* De-highlight current last item before scrolling up */
+ print_item(list,
+ &items[scrollamt + max_choice - 1],
+ states,
+ max_choice - 1, FALSE);
+ scrollok(list, TRUE);
+ wscrl(list, 1);
+ scrollok(list, FALSE);
+ }
+ scrollamt++;
+ print_item(list,
+ &items[scrollamt + max_choice - 1],
+ states,
+ max_choice - 1, TRUE);
+ } else
+#endif
+ {
+ if (i < 0) {
+ scrollamt += i;
+ choice = 0;
+ } else {
+ choice = max_choice - 1;
+ scrollamt += (i - max_choice + 1);
+ }
+ for (i = 0; i < max_choice; i++) {
+ print_item(list,
+ &items[scrollamt + i],
+ states,
+ i, i == choice);
+ }
+ }
+ (void) wnoutrefresh(list);
+ print_arrows(dialog,
+ box_x, box_y,
+ scrollamt, max_choice, item_no, use_height);
+ } else {
+ /* De-highlight current item */
+ print_item(list,
+ &items[scrollamt + choice],
+ states,
+ choice, FALSE);
+ /* Highlight new item */
+ choice = i;
+ print_item(list,
+ &items[scrollamt + choice],
+ states,
+ choice, TRUE);
+ (void) wnoutrefresh(list);
+ (void) wmove(dialog, cur_y, cur_x);
+ wrefresh(dialog);
+ }
+ }
+ continue; /* wait for another key press */
+ }
+
+ if (fkey) {
+ switch (key) {
+ case DLGK_ENTER:
+ result = dlg_ok_buttoncode(button);
+ break;
+ case DLGK_FIELD_PREV:
+ button = dlg_prev_button(buttons, button);
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_FIELD_NEXT:
+ button = dlg_next_button(buttons, button);
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
+ FALSE, width);
+ break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ /* reset data */
+ height = old_height;
+ width = old_width;
+ /* repaint */
+ dlg_clear();
+ dlg_del_window(dialog);
+ refresh();
+ dlg_mouse_free_regions();
+ goto retry;
+#endif
+ default:
+ if (was_mouse) {
+ if ((key2 = dlg_ok_buttoncode(key)) >= 0) {
+ result = key2;
+ break;
+ }
+ beep();
+ }
+ }
+ } else {
+ beep();
+ }
+ }
+
+ dlg_del_window(dialog);
+ dlg_mouse_free_regions();
+ free(prompt);
+ *current_item = (scrollamt + choice);
+ return result;
+}
+
+/*
+ * Display a dialog box with a list of options that can be turned on or off
+ * The `flag' parameter is used to select between radiolist and checklist.
+ */
+int
+dialog_checklist(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int list_height,
+ int item_no,
+ char **items,
+ int flag)
+{
+ int result;
+ int i;
+ DIALOG_LISTITEM *listitems;
+ bool separate_output = ((flag == FLAG_CHECK)
+ && (dialog_vars.separate_output));
+ bool show_status = FALSE;
+ int current = 0;
+
+ listitems = dlg_calloc(DIALOG_LISTITEM, item_no + 1);
+ assert_ptr(listitems, "dialog_checklist");
+
+ for (i = 0; i < item_no; ++i) {
+ listitems[i].name = ItemName(i);
+ listitems[i].text = ItemText(i);
+ listitems[i].help = ((dialog_vars.item_help)
+ ? ItemHelp(i)
+ : dlg_strempty());
+ listitems[i].state = !dlg_strcmp(ItemStatus(i), "on");
+ }
+ dlg_align_columns(&listitems[0].text, sizeof(DIALOG_LISTITEM), item_no);
+
+ result = dlg_checklist(title,
+ cprompt,
+ height,
+ width,
+ list_height,
+ item_no,
+ listitems,
+ NULL,
+ flag,
+ &current);
+
+ switch (result) {
+ case DLG_EXIT_OK: /* FALLTHRU */
+ case DLG_EXIT_EXTRA:
+ show_status = TRUE;
+ break;
+ case DLG_EXIT_HELP:
+ dlg_add_result("HELP ");
+ show_status = dialog_vars.help_status;
+ if (USE_ITEM_HELP(listitems[current].help)) {
+ if (show_status) {
+ if (separate_output) {
+ dlg_add_string(listitems[current].help);
+ dlg_add_separator();
+ } else {
+ dlg_add_quoted(listitems[current].help);
+ }
+ } else {
+ dlg_add_string(listitems[current].help);
+ }
+ result = DLG_EXIT_ITEM_HELP;
+ } else {
+ if (show_status) {
+ if (separate_output) {
+ dlg_add_string(listitems[current].name);
+ dlg_add_separator();
+ } else {
+ dlg_add_quoted(listitems[current].name);
+ }
+ } else {
+ dlg_add_string(listitems[current].name);
+ }
+ }
+ break;
+ }
+
+ if (show_status) {
+ for (i = 0; i < item_no; i++) {
+ if (listitems[i].state) {
+ if (separate_output) {
+ dlg_add_string(listitems[i].name);
+ dlg_add_separator();
+ } else {
+ if (dlg_need_separator())
+ dlg_add_separator();
+ dlg_add_string(listitems[i].name);
+ }
+ }
+ }
+ }
+
+ dlg_free_columns(&listitems[0].text, sizeof(DIALOG_LISTITEM), item_no);
+ free(listitems);
+ return result;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/columns.c b/Build/source/utils/dialog/dialog-1.1-20080819/columns.c
new file mode 100644
index 00000000000..11ca65a1526
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/columns.c
@@ -0,0 +1,174 @@
+/*
+ * $Id: columns.c,v 1.4 2008/06/21 12:27:35 tom Exp $
+ *
+ * columns.c -- implements column-alignment
+ *
+ * Copyright 2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+
+#define each(row, data) \
+ row = 0, data = target; \
+ row < num_rows - 1; \
+ ++row, data = next_row(data, per_row)
+
+static char *
+column_separator(void)
+{
+ char *result = 0;
+
+ if ((result = dialog_vars.column_separator) != 0) {
+ if (*result == '\0')
+ result = 0;
+ }
+ return result;
+}
+
+static char **
+next_row(char **target, int per_row)
+{
+ char *result = (char *) target;
+ result += per_row;
+ return (char **) result;
+}
+
+static char *
+next_col(char *source, unsigned offset)
+{
+ char *mark = column_separator();
+ char *result = source + offset;
+ if (offset)
+ result += strlen(mark);
+ return strstr(result, mark);
+}
+
+/*
+ * Parse the source string, storing the offsets and widths of each column in
+ * the corresponding arrays. Return the number of columns.
+ */
+static unsigned
+split_row(char *source, unsigned *offsets, unsigned *widths)
+{
+ int mark = strlen(column_separator());
+ char *next = 0;
+ unsigned result = 0;
+ unsigned offset = 0;
+
+ do {
+ if (result) {
+ offset = mark + next - source;
+ widths[result - 1] = offset - offsets[result - 1] - mark;
+ }
+ offsets[result] = offset;
+ ++result;
+ } while ((next = next_col(source, offset)) != 0);
+
+ offset = strlen(source);
+ widths[result - 1] = offset - offsets[result - 1];
+
+ return result;
+}
+
+/*
+ * The caller passes a pointer to a struct or array containing pointers
+ * to strings that we may want to copy and reformat according to the column
+ * separator.
+ */
+void
+dlg_align_columns(char **target, int per_row, int num_rows)
+{
+ int row;
+
+ if (column_separator()) {
+ char **value;
+ unsigned numcols = 1;
+ unsigned maxcols = 0;
+ unsigned *widths;
+ unsigned *offsets;
+ unsigned *maxwidth;
+ unsigned realwidth;
+ unsigned n;
+
+ /* first allocate arrays for workspace */
+ for (each(row, value)) {
+ unsigned len = strlen(*value);
+ if (maxcols < len)
+ maxcols = len;
+ }
+ ++maxcols;
+ widths = dlg_calloc(unsigned, maxcols);
+ offsets = dlg_calloc(unsigned, maxcols);
+ maxwidth = dlg_calloc(unsigned, maxcols);
+
+ assert_ptr(widths, "dlg_align_columns");
+ assert_ptr(offsets, "dlg_align_columns");
+ assert_ptr(maxwidth, "dlg_align_columns");
+
+ /* now, determine the number of columns and the column-widths */
+ for (each(row, value)) {
+ unsigned cols = split_row(*value, offsets, widths);
+ if (numcols < cols)
+ numcols = cols;
+ for (n = 0; n < cols; ++n) {
+ if (maxwidth[n] < widths[n])
+ maxwidth[n] = widths[n];
+ }
+ }
+ realwidth = numcols - 1;
+ for (n = 0; n < numcols; ++n) {
+ realwidth += maxwidth[n];
+ }
+
+ /* finally, construct reformatted strings */
+ for (each(row, value)) {
+ unsigned cols = split_row(*value, offsets, widths);
+ unsigned offset = 0;
+ char *text = dlg_malloc(char, realwidth + 1);
+
+ assert_ptr(text, "dlg_align_columns");
+
+ memset(text, ' ', realwidth);
+ for (n = 0; n < cols; ++n) {
+ memcpy(text + offset, *value + offsets[n], widths[n]);
+ offset += maxwidth[n] + 1;
+ }
+ *value = text;
+ }
+
+ free(widths);
+ free(offsets);
+ free(maxwidth);
+ }
+}
+
+/*
+ * Free temporary storage used while making column-aligned data.
+ */
+void
+dlg_free_columns(char **target, int per_row, int num_rows)
+{
+ int row;
+ char **value;
+
+ if (column_separator()) {
+ for (each(row, value)) {
+ free(*value);
+ }
+ }
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/config.guess b/Build/source/utils/dialog/dialog-1.1-20080819/config.guess
new file mode 100755
index 00000000000..951383e3554
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/config.guess
@@ -0,0 +1,1516 @@
+#! /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-05-17'
+
+# 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.*:* | ix86xen: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:
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/config.hin b/Build/source/utils/dialog/dialog-1.1-20080819/config.hin
new file mode 100644
index 00000000000..e8fc0a919ee
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/config.hin
@@ -0,0 +1,4 @@
+/*
+ * The configure script expands this as a set of definitions
+ */
+@DEFS@
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/config.sub b/Build/source/utils/dialog/dialog-1.1-20080819/config.sub
new file mode 100755
index 00000000000..1761d8bdf63
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/config.sub
@@ -0,0 +1,1626 @@
+#! /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:
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/configure b/Build/source/utils/dialog/dialog-1.1-20080819/configure
new file mode 100755
index 00000000000..cb2232192bb
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/configure
@@ -0,0 +1,11878 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by Autoconf 2.52.20061216.
+#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Name of the executable.
+as_me=`echo "$0" |sed 's,.*[\\/],,'`
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+# NLS nuisances.
+$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
+$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
+$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
+$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
+$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
+$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
+$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
+$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+cross_compiling=no
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+ac_unique_file="dialog.h"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: should be removed in autoconf 3.0.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<EOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+EOF
+
+ cat <<EOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+EOF
+
+ cat <<\EOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST build programs to run on HOST [BUILD]
+EOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\EOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+
+ --disable-echo display "compiling" commands
+ --disable-largefile omit support for large files
+ --with-warnings test: turn on gcc warnings
+ --with-libiconv-prefix=DIR
+ search for libiconv in DIR/include and DIR/lib
+ --enable-nls use Native Language Support
+ --with-included-gettext use the GNU gettext library included here
+ --disable-included-msgs use included messages, for i18n support
+ --with-dmalloc test: use Gray Watson's dmalloc library
+ --with-dbmalloc test: use Conor Cahill's dbmalloc library
+ --with-purify test: use Purify
+ --with-valgrind test: use valgrind
+ --with-no-leaks test: free permanent memory, analyze leaks
+ --disable-trace do not support --trace option
+ --with-libtool generate libraries with libtool
+ --with-libtool-opts=XXX specify additional libtool options
+ --with-ncurses compile/link with ncurses library
+ --with-ncursesw compile/link with wide-char ncurses library
+ --with-curses-dir=DIR directory in which (n)curses is installed
+ --disable-extras do not include extra dialogs
+ --disable-rc-file do not include config-file support
+ --disable-Xdialog do not include Xdialog-style dialogs
+ --disable-form do not include the form dialog
+ --disable-gauge do not include the gauge dialogs
+ --disable-tailbox do not include the tailbox dialog
+ --disable-mixedform do not include the mixedform dialog
+ --disable-mixedgauge do not include the mixedgauge dialog
+ --enable-widec enable wide-curses features
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+EOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
+ cd $ac_subdir
+ # A "../" for each directory in /$ac_subdir.
+ ac_dots=`echo $ac_subdir |
+ sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
+
+ case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_sub_srcdir=$srcdir ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_sub_srcdir=$srcdir/$ac_subdir ;;
+ *) # Relative path.
+ ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
+ esac
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_sub_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_sub_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_sub_srcdir/configure; then
+ echo
+ $SHELL $ac_sub_srcdir/configure --help=recursive
+ elif test -f $ac_sub_srcdir/configure.ac ||
+ test -f $ac_sub_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\EOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+EOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<EOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.52.20061216. Invocation command line was
+
+ $ $0 $@
+
+EOF
+{
+cat <<_ASUNAME
+## ---------- ##
+## Platform. ##
+## ---------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+PATH = $PATH
+
+_ASUNAME
+} >&5
+
+cat >&5 <<EOF
+## ------------ ##
+## Core tests. ##
+## ------------ ##
+
+EOF
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell meta-characters.
+ac_configure_args=
+ac_sep=
+for ac_arg
+do
+ case $ac_arg in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ ac_sep=" " ;;
+ *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
+ ac_sep=" " ;;
+ esac
+ # Get rid of the leading space.
+done
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ echo >&5
+ echo "## ----------------- ##" >&5
+ echo "## Cache variables. ##" >&5
+ echo "## ----------------- ##" >&5
+ echo >&5
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} >&5
+ sed "/^$/d" confdefs.h >conftest.log
+ if test -s conftest.log; then
+ echo >&5
+ echo "## ------------ ##" >&5
+ echo "## confdefs.h. ##" >&5
+ echo "## ------------ ##" >&5
+ echo >&5
+ cat conftest.log >&5
+ fi
+ (echo; echo) >&5
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal" >&5
+ echo "$as_me: exit $exit_status" >&5
+ rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:901: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ cat "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:912: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:920: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:936: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:940: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:946: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:948: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:950: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status. It doesn't matter if
+ # we pass some twice (in addition to the command line arguments).
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
+ ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:969: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:971: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+echo "#! $SHELL" >conftest.sh
+echo "exit 0" >>conftest.sh
+chmod +x conftest.sh
+if { (echo "$as_me:992: PATH=\".;.\"; conftest.sh") >&5
+ (PATH=".;."; conftest.sh) 2>&5
+ ac_status=$?
+ echo "$as_me:995: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ ac_path_separator=';'
+else
+ ac_path_separator=:
+fi
+PATH_SEPARATOR="$ac_path_separator"
+rm -f conftest.sh
+
+ac_config_headers="$ac_config_headers dlg_config.h:config.hin"
+
+if test -f $srcdir/VERSION ; then
+ echo "$as_me:1007: checking for package version" >&5
+echo $ECHO_N "checking for package version... $ECHO_C" >&6
+
+ # if there are not enough fields, cut returns the last one...
+ cf_field1=`sed -e '2,$d' $srcdir/VERSION|cut -f1`
+ cf_field2=`sed -e '2,$d' $srcdir/VERSION|cut -f2`
+ cf_field3=`sed -e '2,$d' $srcdir/VERSION|cut -f3`
+
+ # this is how CF_BUNDLED_INTL uses $VERSION:
+ VERSION="$cf_field1"
+
+ VERSION_MAJOR=`echo "$cf_field2" | sed -e 's/\..*//'`
+ test -z "$VERSION_MAJOR" && { { echo "$as_me:1019: error: missing major-version" >&5
+echo "$as_me: error: missing major-version" >&2;}
+ { (exit 1); exit 1; }; }
+
+ VERSION_MINOR=`echo "$cf_field2" | sed -e 's/^[^.]*\.//' -e 's/-.*//'`
+ test -z "$VERSION_MINOR" && { { echo "$as_me:1024: error: missing minor-version" >&5
+echo "$as_me: error: missing minor-version" >&2;}
+ { (exit 1); exit 1; }; }
+
+ echo "$as_me:1028: result: ${VERSION_MAJOR}.${VERSION_MINOR}" >&5
+echo "${ECHO_T}${VERSION_MAJOR}.${VERSION_MINOR}" >&6
+
+ echo "$as_me:1031: checking for package patch date" >&5
+echo $ECHO_N "checking for package patch date... $ECHO_C" >&6
+ VERSION_PATCH=`echo "$cf_field3" | sed -e 's/^[^-]*-//'`
+ case .$VERSION_PATCH in
+ .)
+ { { echo "$as_me:1036: error: missing patch-date $VERSION_PATCH" >&5
+echo "$as_me: error: missing patch-date $VERSION_PATCH" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ .[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9])
+ ;;
+ *)
+ { { echo "$as_me:1043: error: illegal patch-date $VERSION_PATCH" >&5
+echo "$as_me: error: illegal patch-date $VERSION_PATCH" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+ echo "$as_me:1048: result: $VERSION_PATCH" >&5
+echo "${ECHO_T}$VERSION_PATCH" >&6
+else
+ { { echo "$as_me:1051: error: did not find $srcdir/VERSION" >&5
+echo "$as_me: error: did not find $srcdir/VERSION" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# show the actual data that we have for versions:
+test -n "$verbose" && echo " VERSION $VERSION" 1>&6
+
+test -n "$verbose" && echo " VERSION_MAJOR $VERSION_MAJOR" 1>&6
+
+test -n "$verbose" && echo " VERSION_MINOR $VERSION_MINOR" 1>&6
+
+test -n "$verbose" && echo " VERSION_PATCH $VERSION_PATCH" 1>&6
+
+ PACKAGE=dialog
+ cat >>confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cf_PACKAGE=`echo "$PACKAGE" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+ cat >>confdefs.h <<EOF
+#define ${cf_PACKAGE}_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}"
+EOF
+
+ cat >>confdefs.h <<EOF
+#define ${cf_PACKAGE}_PATCHDATE ${VERSION_PATCH}
+EOF
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+DESTDIR=
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:1104: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="${ac_tool_prefix}gcc"
+echo "$as_me:1119: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:1127: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:1130: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:1139: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="gcc"
+echo "$as_me:1154: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:1162: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:1165: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:1178: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="${ac_tool_prefix}cc"
+echo "$as_me:1193: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:1201: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:1204: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:1213: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="cc"
+echo "$as_me:1228: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:1236: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:1239: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:1252: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+fi
+ac_cv_prog_CC="cc"
+echo "$as_me:1272: found $ac_dir/$ac_word" >&5
+break
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ set dummy "$ac_dir/$ac_word" ${1+"$@"}
+ shift
+ ac_cv_prog_CC="$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:1294: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:1297: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:1308: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+echo "$as_me:1323: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:1331: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:1334: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:1347: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC="$ac_prog"
+echo "$as_me:1362: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:1370: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:1373: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+test -z "$CC" && { { echo "$as_me:1385: error: no acceptable cc found in \$PATH" >&5
+echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:1390:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:1393: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:1396: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:1398: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:1401: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:1403: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:1406: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 1410 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:1426: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:1429: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:1432: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+for ac_file in `ls a.exe conftest.exe 2>/dev/null;
+ ls a.out conftest 2>/dev/null;
+ ls a.* conftest.* 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+ a.out ) # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:1455: error: C compiler cannot create executables" >&5
+echo "$as_me: error: C compiler cannot create executables" >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:1461: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:1466: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:1472: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:1475: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:1482: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:1490: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:1497: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:1499: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:1502: checking for executable suffix" >&5
+echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
+if { (eval echo "$as_me:1504: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:1507: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:1523: error: cannot compute EXEEXT: cannot compile and link" >&5
+echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:1529: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:1535: checking for object suffix" >&5
+echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1541 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:1553: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:1556: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:1568: error: cannot compute OBJEXT: cannot compile" >&5
+echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:1575: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:1579: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1585 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1600: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:1603: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:1606: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:1609: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:1621: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:1627: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1633 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1645: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:1648: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:1651: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:1654: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:1664: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1691: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:1694: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:1697: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:1700: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ ''\
+ '#include <stdlib.h>' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1712 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1725: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:1728: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:1731: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:1734: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1744 "configure"
+#include "confdefs.h"
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1756: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:1759: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:1762: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:1765: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+echo "$as_me:1799: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1820 "configure"
+#include "confdefs.h"
+#include <assert.h>
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:1825: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:1831: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1854 "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:1858: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:1864: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:1901: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1911 "configure"
+#include "confdefs.h"
+#include <assert.h>
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:1916: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:1922: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line 1945 "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:1949: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:1955: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:1983: error: C preprocessor \"$CPP\" fails sanity check" >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_main_return=return
+
+if test $ac_cv_c_compiler_gnu = yes; then
+ echo "$as_me:1996: checking whether $CC needs -traditional" >&5
+echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
+if test "${ac_cv_prog_gcc_traditional+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2003 "configure"
+#include "confdefs.h"
+#include <sgtty.h>
+int Autoconf = TIOCGETP;
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "$ac_pattern" >/dev/null 2>&1; then
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2018 "configure"
+#include "confdefs.h"
+#include <termio.h>
+int Autoconf = TCGETA;
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "$ac_pattern" >/dev/null 2>&1; then
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+echo "$as_me:2031: result: $ac_cv_prog_gcc_traditional" >&5
+echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+echo "$as_me:2038: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:2058: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:2062: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:2070: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+echo "$as_me:2085: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:2093: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:2096: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:2105: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_RANLIB="ranlib"
+echo "$as_me:2120: found $ac_dir/$ac_word" >&5
+break
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:2129: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:2132: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:2158: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:2178: checking for a BSD compatible install" >&5
+echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ for ac_dir in $PATH; do
+ IFS=$ac_save_IFS
+ # Account for people who put trailing slashes in PATH elements.
+ case $ac_dir/ in
+ / | ./ | .// | /cC/* \
+ | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
+ | /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ if $as_executable_p "$ac_dir/$ac_prog"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$ac_dir/$ac_prog -c"
+ break 2
+ fi
+ fi
+ done
+ ;;
+ esac
+ done
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:2227: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:2241: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_AR="${ac_tool_prefix}ar"
+echo "$as_me:2256: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ echo "$as_me:2264: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+ echo "$as_me:2267: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:2276: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_AR="ar"
+echo "$as_me:2291: found $ac_dir/$ac_word" >&5
+break
+done
+
+ test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ echo "$as_me:2300: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+ echo "$as_me:2303: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ AR=$ac_ct_AR
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+echo "$as_me:2312: checking for POSIXized ISC" >&5
+echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6
+if test -d /etc/conf/kconfig.d &&
+ grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+then
+ echo "$as_me:2317: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ ISC=yes # If later tests want to check for ISC.
+
+cat >>confdefs.h <<\EOF
+#define _POSIX_SOURCE 1
+EOF
+
+ if test "$GCC" = yes; then
+ CC="$CC -posix"
+ else
+ CC="$CC -Xp"
+ fi
+else
+ echo "$as_me:2331: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ISC=
+fi
+
+echo "$as_me:2336: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line 2344 "configure"
+#include "confdefs.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2393: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2396: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2399: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2402: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:2419: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:2422: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+echo "$as_me:2427: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2433 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *ccp;
+ char **p;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ ccp = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ }
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2491: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2494: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2497: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2500: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_const=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_c_const=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:2510: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
+if test $ac_cv_c_const = no; then
+
+cat >>confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+echo "$as_me:2520: checking for makeflags variable" >&5
+echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
+if test "${cf_cv_makeflags+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cf_cv_makeflags=''
+ for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
+ do
+ cat >cf_makeflags.tmp <<CF_EOF
+SHELL = /bin/sh
+all :
+ @ echo '.$cf_option'
+CF_EOF
+ cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ ]*$,,'`
+ case "$cf_result" in
+ .*k)
+ cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
+ case "$cf_result" in
+ .*CC=*) cf_cv_makeflags=
+ ;;
+ *) cf_cv_makeflags=$cf_option
+ ;;
+ esac
+ break
+ ;;
+ .-) ;;
+ *) echo "given option \"$cf_option\", no match \"$cf_result\""
+ ;;
+ esac
+ done
+ rm -f cf_makeflags.tmp
+
+fi
+echo "$as_me:2554: result: $cf_cv_makeflags" >&5
+echo "${ECHO_T}$cf_cv_makeflags" >&6
+
+echo "$as_me:2557: checking if filesystem supports mixed-case filenames" >&5
+echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
+if test "${cf_cv_mixedcase+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+if test "$cross_compiling" = yes ; then
+ case $target_alias in #(vi
+ *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+ cf_cv_mixedcase=no
+ ;;
+ *)
+ cf_cv_mixedcase=yes
+ ;;
+ esac
+else
+ rm -f conftest CONFTEST
+ echo test >conftest
+ if test -f CONFTEST ; then
+ cf_cv_mixedcase=no
+ else
+ cf_cv_mixedcase=yes
+ fi
+ rm -f conftest CONFTEST
+fi
+
+fi
+echo "$as_me:2584: result: $cf_cv_mixedcase" >&5
+echo "${ECHO_T}$cf_cv_mixedcase" >&6
+test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
+#define MIXEDCASE_FILENAMES 1
+EOF
+
+# Extract the first word of "ctags", so it can be a program name with args.
+set dummy ctags; ac_word=$2
+echo "$as_me:2592: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$MAKE_LOWER_TAGS"; then
+ ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_MAKE_LOWER_TAGS="yes"
+echo "$as_me:2607: found $ac_dir/$ac_word" >&5
+break
+done
+
+ test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
+fi
+fi
+MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
+if test -n "$MAKE_LOWER_TAGS"; then
+ echo "$as_me:2616: result: $MAKE_LOWER_TAGS" >&5
+echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
+else
+ echo "$as_me:2619: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test "$cf_cv_mixedcase" = yes ; then
+ # Extract the first word of "etags", so it can be a program name with args.
+set dummy etags; ac_word=$2
+echo "$as_me:2626: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$MAKE_UPPER_TAGS"; then
+ ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_MAKE_UPPER_TAGS="yes"
+echo "$as_me:2641: found $ac_dir/$ac_word" >&5
+break
+done
+
+ test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
+fi
+fi
+MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
+if test -n "$MAKE_UPPER_TAGS"; then
+ echo "$as_me:2650: result: $MAKE_UPPER_TAGS" >&5
+echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
+else
+ echo "$as_me:2653: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+else
+ MAKE_UPPER_TAGS=no
+fi
+
+if test "$MAKE_UPPER_TAGS" = yes ; then
+ MAKE_UPPER_TAGS=
+else
+ MAKE_UPPER_TAGS="#"
+fi
+
+if test "$MAKE_LOWER_TAGS" = yes ; then
+ MAKE_LOWER_TAGS=
+else
+ MAKE_LOWER_TAGS="#"
+fi
+
+echo "$as_me:2673: checking if you want to see long compiling messages" >&5
+echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
+
+# Check whether --enable-echo or --disable-echo was given.
+if test "${enable_echo+set}" = set; then
+ enableval="$enable_echo"
+ test "$enableval" != no && enableval=yes
+ if test "$enableval" != "yes" ; then
+
+ ECHO_LT='--silent'
+ ECHO_LD='@echo linking $@;'
+ RULE_CC=' @echo compiling $<'
+ SHOW_CC=' @echo compiling $@'
+ ECHO_CC='@'
+
+ else
+
+ ECHO_LT=''
+ ECHO_LD=''
+ RULE_CC='# compiling'
+ SHOW_CC='# compiling'
+ ECHO_CC=''
+
+ fi
+else
+ enableval=yes
+
+ ECHO_LT=''
+ ECHO_LD=''
+ RULE_CC='# compiling'
+ SHOW_CC='# compiling'
+ ECHO_CC=''
+
+fi;
+echo "$as_me:2707: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:2712: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:2716: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:2725: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:2729: error: $ac_config_sub $ac_cv_build_alias failed." >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:2734: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
+ echo "$as_me:2742: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:2751: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:2756: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+ system_name="$host_os"
+else
+ system_name="`(uname -s -r) 2>/dev/null`"
+ if test -z "$system_name" ; then
+ system_name="`(hostname) 2>/dev/null`"
+ fi
+fi
+test -n "$system_name" && cat >>confdefs.h <<EOF
+#define SYSTEM_NAME "$system_name"
+EOF
+
+if test "${cf_cv_system_name+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cf_cv_system_name="$system_name"
+fi
+
+test -z "$system_name" && system_name="$cf_cv_system_name"
+test -n "$cf_cv_system_name" && echo "$as_me:2781: result: Configuring for $cf_cv_system_name" >&5
+echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
+
+if test ".$system_name" != ".$cf_cv_system_name" ; then
+ echo "$as_me:2785: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
+echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
+ { { echo "$as_me:2787: error: \"Please remove config.cache and try again.\"" >&5
+echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+case $cf_cv_system_name in
+os2*)
+ CFLAGS="$CFLAGS -Zmt"
+ CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
+ CXXFLAGS="$CXXFLAGS -Zmt"
+ # autoconf's macro sets -Zexe and suffix both, which conflict:w
+ LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
+ ac_cv_exeext=.exe
+ ;;
+esac
+
+PROG_EXT="$EXEEXT"
+
+test -n "$PROG_EXT" && cat >>confdefs.h <<EOF
+#define PROG_EXT "$PROG_EXT"
+EOF
+
+ case $cf_cv_system_name in
+ OS/2*) LIB_PREFIX='' ;;
+ os2*) LIB_PREFIX='' ;;
+ *) LIB_PREFIX='lib' ;;
+ esac
+
+echo "$as_me:2815: checking if $CC -U and -D options work together" >&5
+echo $ECHO_N "checking if $CC -U and -D options work together... $ECHO_C" >&6
+if test "${cf_cv_cc_u_d_options+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2824 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+#ifndef U_D_OPTIONS
+make an undefined-error
+#endif
+#ifdef D_U_OPTIONS
+make a defined-error
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2843: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2846: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2849: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2852: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cf_cv_cc_u_d_options=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cf_cv_cc_u_d_options=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$cf_save_CPPFLAGS"
+
+fi
+echo "$as_me:2866: result: $cf_cv_cc_u_d_options" >&5
+echo "${ECHO_T}$cf_cv_cc_u_d_options" >&6
+
+cf_XOPEN_SOURCE=500
+cf_POSIX_C_SOURCE=199506L
+
+case $host_os in #(vi
+aix[45]*) #(vi
+ CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
+ ;;
+freebsd*) #(vi
+ # 5.x headers associate
+ # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
+ # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
+ cf_POSIX_C_SOURCE=200112L
+ cf_XOPEN_SOURCE=600
+ CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+ ;;
+hpux*) #(vi
+ CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE"
+ ;;
+irix[56].*) #(vi
+ CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
+ ;;
+linux*|gnu*|k*bsd*-gnu) #(vi
+
+echo "$as_me:2892: checking if we must define _GNU_SOURCE" >&5
+echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_gnu_source+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 2899 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2914: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2917: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2920: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2923: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_gnu_source=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 2932 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2947: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:2950: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:2953: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:2956: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_gnu_source=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_gnu_source=yes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$cf_save"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:2971: result: $cf_cv_gnu_source" >&5
+echo "${ECHO_T}$cf_cv_gnu_source" >&6
+test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+
+ ;;
+mirbsd*) #(vi
+ # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h>
+ ;;
+netbsd*) #(vi
+ # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
+ ;;
+openbsd*) #(vi
+ # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
+ ;;
+osf[45]*) #(vi
+ CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE"
+ ;;
+nto-qnx*) #(vi
+ CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE"
+ ;;
+sco*) #(vi
+ # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
+ ;;
+solaris*) #(vi
+ CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
+ ;;
+*)
+ echo "$as_me:2998: checking if we should define _XOPEN_SOURCE" >&5
+echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_xopen_source+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3005 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3020: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3023: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3026: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3029: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_xopen_source=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3038 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3053: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3056: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3059: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3062: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_xopen_source=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xopen_source=$cf_XOPEN_SOURCE
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS="$cf_save"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3077: result: $cf_cv_xopen_source" >&5
+echo "${ECHO_T}$cf_cv_xopen_source" >&6
+ if test "$cf_cv_xopen_source" != no ; then
+
+# remove _XOPEN_SOURCE symbol from $CFLAGS
+CFLAGS=`echo "$CFLAGS" | \
+ sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'`
+
+# remove _XOPEN_SOURCE symbol from $CPPFLAGS
+CPPFLAGS=`echo "$CPPFLAGS" | \
+ sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'`
+
+ test "$cf_cv_cc_u_d_options" = yes && \
+ CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE"
+ CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source"
+ fi
+
+cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
+
+cf_save_CFLAGS="$CFLAGS"
+cf_save_CPPFLAGS="$CPPFLAGS"
+
+# remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS
+cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
+ sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'`
+
+# remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS
+cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
+ sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \
+ -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'`
+
+echo "$as_me:3111: checking if we should define _POSIX_C_SOURCE" >&5
+echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
+if test "${cf_cv_posix_c_source+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+echo "(line 3117) testing if the symbol is already defined go no further ..." 1>&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3120 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3135: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3138: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3141: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3144: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_posix_c_source=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_want_posix_source=no
+ case .$cf_POSIX_C_SOURCE in #(vi
+ .[12]??*) #(vi
+ cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+ ;;
+ .2) #(vi
+ cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
+ cf_want_posix_source=yes
+ ;;
+ .*)
+ cf_want_posix_source=yes
+ ;;
+ esac
+ if test "$cf_want_posix_source" = yes ; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3165 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifdef _POSIX_SOURCE
+make an error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3180: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3183: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3186: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3189: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
+
+echo "(line 3200) testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+
+ CFLAGS="$cf_trim_CFLAGS"
+ CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+
+echo "(line 3205) testing if the second compile does not leave our definition intact error ..." 1>&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3208 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3223: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3226: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3229: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3232: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$cf_save_CFLAGS"
+ CPPFLAGS="$cf_save_CPPFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3248: result: $cf_cv_posix_c_source" >&5
+echo "${ECHO_T}$cf_cv_posix_c_source" >&6
+
+if test "$cf_cv_posix_c_source" != no ; then
+ CFLAGS="$cf_trim_CFLAGS"
+ CPPFLAGS="$cf_trim_CPPFLAGS"
+ if test "$cf_cv_cc_u_d_options" = yes ; then
+ cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \
+ sed -e 's/-D/-U/g' -e 's/=[^ ]*//g'`
+ CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source"
+ fi
+ CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source"
+fi
+
+ ;;
+esac
+
+# Check whether --enable-largefile or --disable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+ enableval="$enable_largefile"
+
+fi;
+if test "$enable_largefile" != no; then
+
+ echo "$as_me:3272: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_sys_largefile_CC=no
+ if test "$GCC" != yes; then
+ ac_save_CC=$CC
+ while :; do
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3284 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3304: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3307: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3310: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3313: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+ CC="$CC -n32"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3323: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3326: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3329: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3332: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_largefile_CC=' -n32'; break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+ break
+ done
+ CC=$ac_save_CC
+ rm -f conftest.$ac_ext
+ fi
+fi
+echo "$as_me:3346: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+ if test "$ac_cv_sys_largefile_CC" != no; then
+ CC=$CC$ac_cv_sys_largefile_CC
+ fi
+
+ echo "$as_me:3352: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ while :; do
+ ac_cv_sys_file_offset_bits=no
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3360 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3380: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3383: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3386: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3389: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3398 "configure"
+#include "confdefs.h"
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3419: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3422: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3425: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3428: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_file_offset_bits=64; break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ break
+done
+fi
+echo "$as_me:3439: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
+if test "$ac_cv_sys_file_offset_bits" != no; then
+
+cat >>confdefs.h <<EOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+EOF
+
+fi
+rm -f conftest*
+ echo "$as_me:3449: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_large_files+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ while :; do
+ ac_cv_sys_large_files=no
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3457 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3477: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3480: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3483: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3486: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3495 "configure"
+#include "confdefs.h"
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1];
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3516: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3519: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3522: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3525: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_large_files=1; break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ break
+done
+fi
+echo "$as_me:3536: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6
+if test "$ac_cv_sys_large_files" != no; then
+
+cat >>confdefs.h <<EOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+EOF
+
+fi
+rm -f conftest*
+fi
+
+ if test "$enable_largefile" != no ; then
+ echo "$as_me:3549: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_largefile_source+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ while :; do
+ ac_cv_sys_largefile_source=no
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3557 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+return !fseeko;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3569: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3572: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3575: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3578: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3587 "configure"
+#include "confdefs.h"
+#define _LARGEFILE_SOURCE 1
+#include <stdio.h>
+int
+main ()
+{
+return !fseeko;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3600: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3603: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3606: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3609: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_sys_largefile_source=1; break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ break
+done
+fi
+echo "$as_me:3620: result: $ac_cv_sys_largefile_source" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
+if test "$ac_cv_sys_largefile_source" != no; then
+
+cat >>confdefs.h <<EOF
+#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
+EOF
+
+fi
+rm -f conftest*
+
+# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
+# in glibc 2.1.3, but that breaks too many other things.
+# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
+echo "$as_me:3634: checking for fseeko" >&5
+echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
+if test "${ac_cv_func_fseeko+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3640 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+return fseeko && fseeko (stdin, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:3652: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:3655: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:3658: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3661: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_fseeko=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_fseeko=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:3671: result: $ac_cv_func_fseeko" >&5
+echo "${ECHO_T}$ac_cv_func_fseeko" >&6
+if test $ac_cv_func_fseeko = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_FSEEKO 1
+EOF
+
+fi
+
+ # Normally we would collect these definitions in the config.h,
+ # but (like _XOPEN_SOURCE), some environments rely on having these
+ # defined before any of the system headers are included. Another
+ # case comes up with C++, e.g., on AIX the compiler compiles the
+ # header files by themselves before looking at the body files it is
+ # told to compile. For ncurses, those header files do not include
+ # the config.h
+ test "$ac_cv_sys_large_files" != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
+ test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
+ test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
+
+ echo "$as_me:3692: checking whether to use struct dirent64" >&5
+echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
+if test "${cf_cv_struct_dirent64+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3699 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <dirent.h>
+
+int
+main ()
+{
+
+ /* if transitional largefile support is setup, this is true */
+ extern struct dirent64 * readdir(DIR *);
+ struct dirent64 *x = readdir((DIR *)0);
+ struct dirent *y = readdir((DIR *)0);
+ int z = x - y;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3720: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3723: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3726: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3729: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_struct_dirent64=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_struct_dirent64=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3740: result: $cf_cv_struct_dirent64" >&5
+echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
+ test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF
+#define HAVE_STRUCT_DIRENT64 1
+EOF
+
+ fi
+
+GCC_VERSION=none
+if test "$GCC" = yes ; then
+ echo "$as_me:3750: checking version of $CC" >&5
+echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
+ GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
+ test -z "$GCC_VERSION" && GCC_VERSION=unknown
+ echo "$as_me:3754: result: $GCC_VERSION" >&5
+echo "${ECHO_T}$GCC_VERSION" >&6
+fi
+
+if ( test "$GCC" = yes || test "$GXX" = yes )
+then
+echo "$as_me:3760: checking if you want to check for gcc warnings" >&5
+echo $ECHO_N "checking if you want to check for gcc warnings... $ECHO_C" >&6
+
+# Check whether --with-warnings or --without-warnings was given.
+if test "${with_warnings+set}" = set; then
+ withval="$with_warnings"
+ cf_opt_with_warnings=$withval
+else
+ cf_opt_with_warnings=no
+fi;
+echo "$as_me:3770: result: $cf_opt_with_warnings" >&5
+echo "${ECHO_T}$cf_opt_with_warnings" >&6
+if test "$cf_opt_with_warnings" != no ; then
+
+if test "$GCC" = yes
+then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+EOF
+if test "$GCC" = yes
+then
+ { echo "$as_me:3792: checking for $CC __attribute__ directives..." >&5
+echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
+cat > conftest.$ac_ext <<EOF
+#line 3795 "configure"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var) /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
+EOF
+ for cf_attribute in scanf printf unused noreturn
+ do
+
+cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+ cf_directive="__attribute__(($cf_attribute))"
+ echo "checking for $CC $cf_directive" 1>&5
+ case $cf_attribute in
+ scanf|printf)
+ cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+ ;;
+ *)
+ cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE $cf_directive
+EOF
+ ;;
+ esac
+ if { (eval echo "$as_me:3833: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3836: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ test -n "$verbose" && echo "$as_me:3838: result: ... $cf_attribute" >&5
+echo "${ECHO_T}... $cf_attribute" >&6
+ cat conftest.h >>confdefs.h
+ fi
+ done
+else
+ fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
+
+INTEL_COMPILER=no
+
+if test "$GCC" = yes ; then
+ case $host_os in
+ linux*|gnu*)
+ echo "$as_me:3854: checking if this is really Intel C compiler" >&5
+echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
+ cf_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -no-gcc"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 3859 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3876: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3879: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:3882: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:3885: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ INTEL_COMPILER=yes
+cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$cf_save_CFLAGS"
+ echo "$as_me:3896: result: $INTEL_COMPILER" >&5
+echo "${ECHO_T}$INTEL_COMPILER" >&6
+ ;;
+ esac
+fi
+
+cat > conftest.$ac_ext <<EOF
+#line 3903 "configure"
+int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
+EOF
+
+if test "$INTEL_COMPILER" = yes
+then
+# The "-wdXXX" options suppress warnings:
+# remark #1419: external declaration in primary source file
+# remark #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
+# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
+# remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
+# remark #193: zero used for undefined preprocessing identifier
+# remark #593: variable "curs_sb_left_arrow" was set but never used
+# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
+# remark #869: parameter "tw" was never referenced
+# remark #981: operands are evaluated in unspecified order
+# warning #269: invalid format string conversion
+
+ { echo "$as_me:3921: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
+ cf_save_CFLAGS="$CFLAGS"
+ EXTRA_CFLAGS="-Wall"
+ for cf_opt in \
+ wd1419 \
+ wd1682 \
+ wd1683 \
+ wd1684 \
+ wd193 \
+ wd279 \
+ wd593 \
+ wd810 \
+ wd869 \
+ wd981
+ do
+ CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+ if { (eval echo "$as_me:3938: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3941: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ test -n "$verbose" && echo "$as_me:3943: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+ fi
+ done
+ CFLAGS="$cf_save_CFLAGS"
+
+elif test "$GCC" = yes
+then
+ { echo "$as_me:3952: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
+ cf_save_CFLAGS="$CFLAGS"
+ EXTRA_CFLAGS="-W -Wall"
+ cf_warn_CONST=""
+ test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
+ for cf_opt in \
+ Wbad-function-cast \
+ Wcast-align \
+ Wcast-qual \
+ Winline \
+ Wmissing-declarations \
+ Wmissing-prototypes \
+ Wnested-externs \
+ Wpointer-arith \
+ Wshadow \
+ Wstrict-prototypes \
+ Wundef $cf_warn_CONST
+ do
+ CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+ if { (eval echo "$as_me:3972: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:3975: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ test -n "$verbose" && echo "$as_me:3977: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
+ case $cf_opt in #(vi
+ Wcast-qual) #(vi
+ CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
+ ;;
+ Winline) #(vi
+ case $GCC_VERSION in
+ 3.3*)
+ test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6
+
+ continue;;
+ esac
+ ;;
+ esac
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
+ fi
+ done
+ CFLAGS="$cf_save_CFLAGS"
+fi
+rm -f conftest*
+
+fi
+fi
+
+EXTRAOBJS=""
+echo "$as_me:4003: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4009 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+_ACEOF
+if { (eval echo "$as_me:4017: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:4023: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4045 "configure"
+#include "confdefs.h"
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4063 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4084 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ $ac_main_return(2);
+ $ac_main_return (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:4110: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:4113: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:4115: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4118: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:4131: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo "$as_me:4141: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4149 "configure"
+#include "confdefs.h"
+#ifndef __cplusplus
+static $ac_kw int static_foo () {return 0; }
+$ac_kw int foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4158: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:4161: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:4164: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4167: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:4178: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ no)
+cat >>confdefs.h <<\EOF
+#define inline
+EOF
+ ;;
+ *) cat >>confdefs.h <<EOF
+#define inline $ac_cv_c_inline
+EOF
+ ;;
+esac
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:4199: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4205 "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4211: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:4214: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:4217: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4220: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:4230: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+echo "$as_me:4240: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6
+if test "${ac_cv_type_off_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4246 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+if ((off_t *) 0)
+ return 0;
+if (sizeof (off_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4261: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:4264: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:4267: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4270: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_off_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_off_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:4280: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6
+if test $ac_cv_type_off_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<EOF
+#define off_t long
+EOF
+
+fi
+
+echo "$as_me:4292: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4298 "configure"
+#include "confdefs.h"
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+ return 0;
+if (sizeof (size_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4313: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:4316: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:4319: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4322: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_size_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_size_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:4332: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<EOF
+#define size_t unsigned
+EOF
+
+fi
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+echo "$as_me:4346: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+if test "${ac_cv_working_alloca_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4352 "configure"
+#include "confdefs.h"
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4364: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:4367: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:4370: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4373: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_working_alloca_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_working_alloca_h=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:4383: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+if test $ac_cv_working_alloca_h = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_ALLOCA_H 1
+EOF
+
+fi
+
+echo "$as_me:4393: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+if test "${ac_cv_func_alloca_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4399 "configure"
+#include "confdefs.h"
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+# endif
+# endif
+# endif
+# endif
+#endif
+
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4431: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:4434: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:4437: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4440: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_alloca_works=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_alloca_works=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:4450: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
+
+if test $ac_cv_func_alloca_works = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_ALLOCA 1
+EOF
+
+else
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=alloca.$ac_objext
+
+cat >>confdefs.h <<\EOF
+#define C_ALLOCA 1
+EOF
+
+echo "$as_me:4471: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+if test "${ac_cv_os_cray+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4477 "configure"
+#include "confdefs.h"
+#if defined(CRAY) && ! defined(CRAY2)
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "webecray" >/dev/null 2>&1; then
+ ac_cv_os_cray=yes
+else
+ ac_cv_os_cray=no
+fi
+rm -f conftest*
+
+fi
+echo "$as_me:4495: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6
+if test $ac_cv_os_cray = yes; then
+ for ac_func in _getb67 GETB67 getb67; do
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:4500: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4506 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4537: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:4540: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:4543: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4546: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:4556: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+
+cat >>confdefs.h <<EOF
+#define CRAY_STACKSEG_END $ac_func
+EOF
+
+ break
+fi
+
+ done
+fi
+
+echo "$as_me:4570: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+if test "${ac_cv_c_stack_direction+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_c_stack_direction=0
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4579 "configure"
+#include "confdefs.h"
+int
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+
+int
+main ()
+{
+ $ac_main_return (find_stack_direction () < 0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:4602: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:4605: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:4607: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4610: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_stack_direction=1
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_c_stack_direction=-1
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:4622: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
+
+cat >>confdefs.h <<EOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+EOF
+
+fi
+
+for ac_header in stdlib.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:4634: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4640 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:4644: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:4650: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:4669: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+for ac_func in getpagesize
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:4682: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4688 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4719: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:4722: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:4725: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4728: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:4738: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+echo "$as_me:4748: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then
+ ac_cv_func_mmap_fixed_mapped=no
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4757 "configure"
+#include "confdefs.h"
+$ac_includes_default
+/* Thanks to Mike Haertel and Jim Avera for this test.
+ Here is a matrix of mmap possibilities:
+ mmap private not fixed
+ mmap private fixed at somewhere currently unmapped
+ mmap private fixed at somewhere already mapped
+ mmap shared not fixed
+ mmap shared fixed at somewhere currently unmapped
+ mmap shared fixed at somewhere already mapped
+ For private mappings, we should verify that changes cannot be read()
+ back from the file, nor mmap's back from the file at a different
+ address. (There have been systems where private was not correctly
+ implemented like the infamous i386 svr4.0, and systems where the
+ VM page cache was not coherent with the file system buffer cache
+ like early versions of FreeBSD and possibly contemporary NetBSD.)
+ For shared mappings, we should conversely verify that changes get
+ propogated back to all the places they're supposed to be.
+
+ Grep wants private fixed already mapped.
+ The main things grep needs to know about mmap are:
+ * does it exist and is it safe to write into the mmap'd area
+ * how to use it (BSD variants) */
+
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#if !STDC_HEADERS && !HAVE_STDLIB_H
+char *malloc ();
+#endif
+
+/* This mess was copied from the GNU getpagesize.h. */
+#if !HAVE_GETPAGESIZE
+/* Assume that all systems that can run configure have sys/param.h. */
+# if !HAVE_SYS_PARAM_H
+# define HAVE_SYS_PARAM_H 1
+# endif
+
+# ifdef _SC_PAGESIZE
+# define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+# if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# ifdef EXEC_PAGESIZE
+# define getpagesize() EXEC_PAGESIZE
+# else /* no EXEC_PAGESIZE */
+# ifdef NBPG
+# define getpagesize() NBPG * CLSIZE
+# ifndef CLSIZE
+# define CLSIZE 1
+# endif /* no CLSIZE */
+# else /* no NBPG */
+# ifdef NBPC
+# define getpagesize() NBPC
+# else /* no NBPC */
+# ifdef PAGESIZE
+# define getpagesize() PAGESIZE
+# endif /* PAGESIZE */
+# endif /* no NBPC */
+# endif /* no NBPG */
+# endif /* no EXEC_PAGESIZE */
+# else /* no HAVE_SYS_PARAM_H */
+# define getpagesize() 8192 /* punt totally */
+# endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+int
+main ()
+{
+ char *data, *data2, *data3;
+ int i, pagesize;
+ int fd;
+
+ pagesize = getpagesize ();
+
+ /* First, make a file with some known garbage in it. */
+ data = (char *) malloc (pagesize);
+ if (!data)
+ $ac_main_return (1);
+ for (i = 0; i < pagesize; ++i)
+ *(data + i) = rand ();
+ umask (0);
+ fd = creat ("conftest.mmap", 0600);
+ if (fd < 0)
+ $ac_main_return (1);
+ if (write (fd, data, pagesize) != pagesize)
+ $ac_main_return (1);
+ close (fd);
+
+ /* Next, try to mmap the file at a fixed address which already has
+ something else allocated at it. If we can, also make sure that
+ we see the same garbage. */
+ fd = open ("conftest.mmap", O_RDWR);
+ if (fd < 0)
+ $ac_main_return (1);
+ data2 = (char *) malloc (2 * pagesize);
+ if (!data2)
+ $ac_main_return (1);
+ data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
+ if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_FIXED, fd, 0L))
+ $ac_main_return (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data2 + i))
+ $ac_main_return (1);
+
+ /* Finally, make sure that changes to the mapped area do not
+ percolate back to the file as seen by read(). (This is a bug on
+ some variants of i386 svr4.0.) */
+ for (i = 0; i < pagesize; ++i)
+ *(data2 + i) = *(data2 + i) + 1;
+ data3 = (char *) malloc (pagesize);
+ if (!data3)
+ $ac_main_return (1);
+ if (read (fd, data3, pagesize) != pagesize)
+ $ac_main_return (1);
+ for (i = 0; i < pagesize; ++i)
+ if (*(data + i) != *(data3 + i))
+ $ac_main_return (1);
+ close (fd);
+ $ac_main_return (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:4884: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:4887: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:4889: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:4892: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_mmap_fixed_mapped=yes
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:4904: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_MMAP 1
+EOF
+
+fi
+rm -f conftest.mmap
+
+ echo "$as_me:4915: checking whether we are using the GNU C Library 2.1 or newer" >&5
+echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6
+if test "${ac_cv_gnu_library_2_1+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4921 "configure"
+#include "confdefs.h"
+
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+ Lucky GNU user
+ #endif
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "Lucky GNU user" >/dev/null 2>&1; then
+ ac_cv_gnu_library_2_1=yes
+else
+ ac_cv_gnu_library_2_1=no
+fi
+rm -f conftest*
+
+fi
+echo "$as_me:4941: result: $ac_cv_gnu_library_2_1" >&5
+echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6
+
+ GLIBC21="$ac_cv_gnu_library_2_1"
+
+ case $cf_cv_system_name in
+ os2*) PATHSEP=';' ;;
+ *) PATHSEP=':' ;;
+ esac
+
+cf_makefile=makefile
+
+test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
+
+# Allow override of "config.h" definition:
+: ${CONFIG_H=config.h}
+
+if test -z "$VERSION" ; then
+if test -f $srcdir/VERSION ; then
+ VERSION=`sed -e '2,$d' $srcdir/VERSION|cut -f1`
+else
+ VERSION=unknown
+fi
+fi
+
+for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
+stdlib.h string.h unistd.h sys/param.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:4970: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 4976 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:4980: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:4986: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:5005: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+for ac_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \
+getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
+strdup strtoul tsearch __argz_count __argz_stringify __argz_next
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:5020: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5026 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5057: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:5060: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:5063: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5066: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:5076: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+# Check whether --with-libiconv-prefix or --without-libiconv-prefix was given.
+if test "${with_libiconv_prefix+set}" = set; then
+ withval="$with_libiconv_prefix"
+
+ for dir in `echo "$withval" | tr : ' '`; do
+ if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
+ if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
+ done
+
+fi;
+
+ echo "$as_me:5097: checking for iconv" >&5
+echo $ECHO_N "checking for iconv... $ECHO_C" >&6
+if test "${am_cv_func_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ am_cv_func_iconv="no, consider installing GNU libiconv"
+ am_cv_lib_iconv=no
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5106 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <iconv.h>
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5121: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:5124: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:5127: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5130: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_func_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ if test "$am_cv_func_iconv" != yes; then
+ am_save_LIBS="$LIBS"
+ LIBS="$LIBS -liconv"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5142 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <iconv.h>
+int
+main ()
+{
+iconv_t cd = iconv_open("","");
+ iconv(cd,NULL,NULL,NULL,NULL);
+ iconv_close(cd);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5157: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:5160: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:5163: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5166: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_lib_iconv=yes
+ am_cv_func_iconv=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ LIBS="$am_save_LIBS"
+ fi
+
+fi
+echo "$as_me:5179: result: $am_cv_func_iconv" >&5
+echo "${ECHO_T}$am_cv_func_iconv" >&6
+ if test "$am_cv_func_iconv" = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_ICONV 1
+EOF
+
+ echo "$as_me:5187: checking for iconv declaration" >&5
+echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6
+ if test "${am_cv_proto_iconv+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5194 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:5218: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:5221: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:5224: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5227: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_proto_iconv_arg1=""
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+am_cv_proto_iconv_arg1="const"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
+fi
+
+ am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
+ echo "$as_me:5240: result: ${ac_t:-
+ }$am_cv_proto_iconv" >&5
+echo "${ECHO_T}${ac_t:-
+ }$am_cv_proto_iconv" >&6
+
+cat >>confdefs.h <<EOF
+#define ICONV_CONST $am_cv_proto_iconv_arg1
+EOF
+
+ fi
+ LIBICONV=
+ if test "$am_cv_lib_iconv" = yes; then
+ LIBICONV="-liconv"
+ fi
+
+ echo "$as_me:5255: checking for nl_langinfo and CODESET" >&5
+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
+if test "${am_cv_langinfo_codeset+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5261 "configure"
+#include "confdefs.h"
+#include <langinfo.h>
+int
+main ()
+{
+char* cs = nl_langinfo(CODESET);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5273: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:5276: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:5279: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5282: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_langinfo_codeset=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+am_cv_langinfo_codeset=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:5293: result: $am_cv_langinfo_codeset" >&5
+echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
+ if test $am_cv_langinfo_codeset = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_LANGINFO_CODESET 1
+EOF
+
+ fi
+
+ if test $ac_cv_header_locale_h = yes; then
+ echo "$as_me:5304: checking for LC_MESSAGES" >&5
+echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6
+if test "${am_cv_val_LC_MESSAGES+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5310 "configure"
+#include "confdefs.h"
+#include <locale.h>
+int
+main ()
+{
+return LC_MESSAGES
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5322: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:5325: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:5328: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5331: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_val_LC_MESSAGES=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+am_cv_val_LC_MESSAGES=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:5341: result: $am_cv_val_LC_MESSAGES" >&5
+echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6
+ if test $am_cv_val_LC_MESSAGES = yes; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_LC_MESSAGES 1
+EOF
+
+ fi
+ fi
+ echo "$as_me:5351: checking whether NLS is requested" >&5
+echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6
+
+# Check whether --enable-nls or --disable-nls was given.
+if test "${enable_nls+set}" = set; then
+ enableval="$enable_nls"
+ USE_NLS=$enableval
+else
+ USE_NLS=no
+fi;
+ echo "$as_me:5361: result: $USE_NLS" >&5
+echo "${ECHO_T}$USE_NLS" >&6
+
+ BUILD_INCLUDED_LIBINTL=no
+ USE_INCLUDED_LIBINTL=no
+ INTLLIBS=
+
+ if test "$USE_NLS" = "yes"; then
+
+cat >>confdefs.h <<\EOF
+#define ENABLE_NLS 1
+EOF
+
+ echo "$as_me:5374: checking whether included gettext is requested" >&5
+echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6
+
+# Check whether --with-included-gettext or --without-included-gettext was given.
+if test "${with_included_gettext+set}" = set; then
+ withval="$with_included_gettext"
+ nls_cv_force_use_gnu_gettext=$withval
+else
+ nls_cv_force_use_gnu_gettext=no
+fi;
+ echo "$as_me:5384: result: $nls_cv_force_use_gnu_gettext" >&5
+echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ CATOBJEXT=NONE
+
+echo "$as_me:5391: checking for libintl.h" >&5
+echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6
+if test "${ac_cv_header_libintl_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5397 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+_ACEOF
+if { (eval echo "$as_me:5401: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:5407: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_cv_header_libintl_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_header_libintl_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:5426: result: $ac_cv_header_libintl_h" >&5
+echo "${ECHO_T}$ac_cv_header_libintl_h" >&6
+if test $ac_cv_header_libintl_h = yes; then
+ cf_find_header=yes
+else
+
+ cf_find_header=no
+cf_search=""
+
+test -d "$HOME" && {
+ test -n "$verbose" && echo " ... testing include-directories under $HOME"
+ test -d "$HOME/include" && cf_search="$cf_search $HOME/include"
+ test -d "$HOME/include/gettext" && cf_search="$cf_search $HOME/include/gettext"
+ test -d "$HOME/include/gettext/include" && cf_search="$cf_search $HOME/include/gettext/include"
+}
+
+# For other stuff under the home directory, it should be sufficient to put
+# a symbolic link for $HOME/gettext to the actual package location:
+test -d "$HOME/gettext" && {
+ test -n "$verbose" && echo " ... testing include-directories under $HOME/gettext"
+ test -d "$HOME/gettext/include" && cf_search="$cf_search $HOME/gettext/include"
+ test -d "$HOME/gettext/include/gettext" && cf_search="$cf_search $HOME/gettext/include/gettext"
+}
+
+test "$prefix" != /usr/local && \
+test -d /usr/local && {
+ test -n "$verbose" && echo " ... testing include-directories under /usr/local"
+ test -d /usr/local/include && cf_search="$cf_search /usr/local/include"
+ test -d /usr/local/include/gettext && cf_search="$cf_search /usr/local/include/gettext"
+ test -d /usr/local/include/gettext/include && cf_search="$cf_search /usr/local/include/gettext/include"
+ test -d /usr/local/gettext/include && cf_search="$cf_search /usr/local/gettext/include"
+ test -d /usr/local/gettext/include/gettext && cf_search="$cf_search /usr/local/gettext/include/gettext"
+}
+
+test "$prefix" != NONE && \
+test -d $prefix && {
+ test -n "$verbose" && echo " ... testing include-directories under $prefix"
+ test -d $prefix/include && cf_search="$cf_search $prefix/include"
+ test -d $prefix/include/gettext && cf_search="$cf_search $prefix/include/gettext"
+ test -d $prefix/include/gettext/include && cf_search="$cf_search $prefix/include/gettext/include"
+ test -d $prefix/gettext/include && cf_search="$cf_search $prefix/gettext/include"
+ test -d $prefix/gettext/include/gettext && cf_search="$cf_search $prefix/gettext/include/gettext"
+}
+
+test "$prefix" != /opt && \
+test -d /opt && {
+ test -n "$verbose" && echo " ... testing include-directories under /opt"
+ test -d /opt/include && cf_search="$cf_search /opt/include"
+ test -d /opt/include/gettext && cf_search="$cf_search /opt/include/gettext"
+ test -d /opt/include/gettext/include && cf_search="$cf_search /opt/include/gettext/include"
+ test -d /opt/gettext/include && cf_search="$cf_search /opt/gettext/include"
+ test -d /opt/gettext/include/gettext && cf_search="$cf_search /opt/gettext/include/gettext"
+}
+
+test "$prefix" != /usr && \
+test -d /usr && {
+ test -n "$verbose" && echo " ... testing include-directories under /usr"
+ test -d /usr/include && cf_search="$cf_search /usr/include"
+ test -d /usr/include/gettext && cf_search="$cf_search /usr/include/gettext"
+ test -d /usr/include/gettext/include && cf_search="$cf_search /usr/include/gettext/include"
+ test -d /usr/gettext/include && cf_search="$cf_search /usr/gettext/include"
+}
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+ test -d $includedir && cf_search="$cf_search $includedir"
+ test -d $includedir/gettext && cf_search="$cf_search $includedir/gettext"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+ test -d $oldincludedir && cf_search="$cf_search $oldincludedir"
+ test -d $oldincludedir/gettext && cf_search="$cf_search $oldincludedir/gettext"
+}
+
+for cf_incdir in $cf_search
+do
+ if test -f $cf_incdir/libintl.h ; then
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -I$cf_incdir
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+ test -n "$verbose" && echo " ... found in $cf_incdir" 1>&6
+
+ cf_find_header=yes
+ break
+ fi
+ test -n "$verbose" && echo " ... tested $cf_incdir" 1>&6
+
+done
+
+fi
+
+if test "$cf_find_header" = yes ; then
+cat >>confdefs.h <<\EOF
+#define HAVE_LIBINTL_H 1
+EOF
+
+ echo "$as_me:5591: checking for GNU gettext in libc" >&5
+echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6
+if test "${gt_cv_func_gnugettext1_libc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5597 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+extern int _nl_msg_cat_cntr;
+int
+main ()
+{
+bindtextdomain ("", "");
+return (int) gettext ("") + _nl_msg_cat_cntr
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5611: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:5614: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:5617: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5620: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ gt_cv_func_gnugettext1_libc=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+gt_cv_func_gnugettext1_libc=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:5630: result: $gt_cv_func_gnugettext1_libc" >&5
+echo "${ECHO_T}$gt_cv_func_gnugettext1_libc" >&6
+
+ if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 5636 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+extern int _nl_msg_cat_cntr;
+int
+main ()
+{
+bindtextdomain ("", "");
+return (int) gettext ("") + _nl_msg_cat_cntr
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5650: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:5653: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:5656: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5659: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_find_linkage=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cf_find_linkage=no
+cf_search=""
+
+test -d "$HOME" && {
+ test -n "$verbose" && echo " ... testing lib-directories under $HOME"
+ test -d "$HOME/lib" && cf_search="$cf_search $HOME/lib"
+ test -d "$HOME/lib/intl" && cf_search="$cf_search $HOME/lib/intl"
+ test -d "$HOME/lib/intl/lib" && cf_search="$cf_search $HOME/lib/intl/lib"
+}
+
+# For other stuff under the home directory, it should be sufficient to put
+# a symbolic link for $HOME/intl to the actual package location:
+test -d "$HOME/intl" && {
+ test -n "$verbose" && echo " ... testing lib-directories under $HOME/intl"
+ test -d "$HOME/intl/lib" && cf_search="$cf_search $HOME/intl/lib"
+ test -d "$HOME/intl/lib/intl" && cf_search="$cf_search $HOME/intl/lib/intl"
+}
+
+test "$prefix" != /usr/local && \
+test -d /usr/local && {
+ test -n "$verbose" && echo " ... testing lib-directories under /usr/local"
+ test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib"
+ test -d /usr/local/lib/intl && cf_search="$cf_search /usr/local/lib/intl"
+ test -d /usr/local/lib/intl/lib && cf_search="$cf_search /usr/local/lib/intl/lib"
+ test -d /usr/local/intl/lib && cf_search="$cf_search /usr/local/intl/lib"
+ test -d /usr/local/intl/lib/intl && cf_search="$cf_search /usr/local/intl/lib/intl"
+}
+
+test "$prefix" != NONE && \
+test -d $prefix && {
+ test -n "$verbose" && echo " ... testing lib-directories under $prefix"
+ test -d $prefix/lib && cf_search="$cf_search $prefix/lib"
+ test -d $prefix/lib/intl && cf_search="$cf_search $prefix/lib/intl"
+ test -d $prefix/lib/intl/lib && cf_search="$cf_search $prefix/lib/intl/lib"
+ test -d $prefix/intl/lib && cf_search="$cf_search $prefix/intl/lib"
+ test -d $prefix/intl/lib/intl && cf_search="$cf_search $prefix/intl/lib/intl"
+}
+
+test "$prefix" != /opt && \
+test -d /opt && {
+ test -n "$verbose" && echo " ... testing lib-directories under /opt"
+ test -d /opt/lib && cf_search="$cf_search /opt/lib"
+ test -d /opt/lib/intl && cf_search="$cf_search /opt/lib/intl"
+ test -d /opt/lib/intl/lib && cf_search="$cf_search /opt/lib/intl/lib"
+ test -d /opt/intl/lib && cf_search="$cf_search /opt/intl/lib"
+ test -d /opt/intl/lib/intl && cf_search="$cf_search /opt/intl/lib/intl"
+}
+
+test "$prefix" != /usr && \
+test -d /usr && {
+ test -n "$verbose" && echo " ... testing lib-directories under /usr"
+ test -d /usr/lib && cf_search="$cf_search /usr/lib"
+ test -d /usr/lib/intl && cf_search="$cf_search /usr/lib/intl"
+ test -d /usr/lib/intl/lib && cf_search="$cf_search /usr/lib/intl/lib"
+ test -d /usr/intl/lib && cf_search="$cf_search /usr/intl/lib"
+}
+
+cf_save_LIBS="$LIBS"
+cf_save_LDFLAGS="$LDFLAGS"
+for cf_libdir in $cf_search
+do
+ if test -d $cf_libdir ; then
+ LIBS="-lintl $cf_save_LIBS"
+ LDFLAGS="$cf_save_LDFLAGS -L$cf_libdir"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5731 "configure"
+#include "confdefs.h"
+#include <libintl.h>
+extern int _nl_msg_cat_cntr;
+int
+main ()
+{
+bindtextdomain ("", "");
+return (int) gettext ("") + _nl_msg_cat_cntr
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5745: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:5748: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:5751: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5754: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ test -n "$verbose" && echo " ... found in $cf_libdir" 1>&6
+
+ cf_find_linkage=yes
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ LIBS="$cf_save_LIBS"
+ LDFLAGS="$cf_save_LDFLAGS"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+ test -n "$verbose" && echo " ... tested $cf_libdir" 1>&6
+
+done
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+if test "$cf_find_linkage" = yes ; then
+gt_cv_func_gnugettext1_libintl=yes
+else
+gt_cv_func_gnugettext1_libintl=no
+fi
+
+ fi
+
+ if test "$gt_cv_func_gnugettext1_libc" = "yes" \
+ || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \
+ && test "$PACKAGE" != gettext; }; then
+
+cat >>confdefs.h <<\EOF
+#define HAVE_GETTEXT 1
+EOF
+
+ if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then
+ INTLLIBS="-lintl $LIBICONV"
+ fi
+
+ gt_save_LIBS="$LIBS"
+ LIBS="$LIBS $INTLLIBS"
+
+for ac_func in dcgettext
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:5803: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 5809 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5840: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:5843: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:5846: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:5849: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:5859: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+ LIBS="$gt_save_LIBS"
+
+ # Extract the first word of "msgfmt", so it can be a program name with args.
+
+set dummy msgfmt; ac_word=$2
+echo "$as_me:5874: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$MSGFMT" in
+ [\\/]*|?:[\\/]*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ if test -n "$PATH_SEPARATOR"; then PATHSEP="$PATH_SEPARATOR"; fi
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word$ac_exeext; then
+ if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exeext"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+ echo "$as_me:5902: result: $MSGFMT" >&5
+echo "${ECHO_T}$MSGFMT" >&6
+else
+ echo "$as_me:5905: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+echo "$as_me:5911: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $GMSGFMT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ if $as_executable_p "$ac_dir/$ac_word"; then
+ ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+ echo "$as_me:5928: found $ac_dir/$ac_word" >&5
+ break
+fi
+done
+
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT=$ac_cv_path_GMSGFMT
+
+if test -n "$GMSGFMT"; then
+ echo "$as_me:5940: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6
+else
+ echo "$as_me:5943: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ # Extract the first word of "xgettext", so it can be a program name with args.
+
+set dummy xgettext; ac_word=$2
+echo "$as_me:5950: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XGETTEXT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$XGETTEXT" in
+ [\\/]*|?:[\\/]*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ if test -n "$PATH_SEPARATOR"; then PATHSEP="$PATH_SEPARATOR"; fi
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word$ac_exeext; then
+ if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exeext"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+ echo "$as_me:5978: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6
+else
+ echo "$as_me:5981: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CATOBJEXT=.gmo
+ fi
+
+fi
+
+ if test "$CATOBJEXT" = "NONE"; then
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ if test ! -d $srcdir/intl ; then
+ { { echo "$as_me:5997: error: no NLS library is packaged with this application" >&5
+echo "$as_me: error: no NLS library is packaged with this application" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ INTLOBJS="\$(GETTOBJS)"
+ # Extract the first word of "msgfmt", so it can be a program name with args.
+
+set dummy msgfmt; ac_word=$2
+echo "$as_me:6005: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_MSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$MSGFMT" in
+ [\\/]*|?:[\\/]*)
+ ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ if test -n "$PATH_SEPARATOR"; then PATHSEP="$PATH_SEPARATOR"; fi
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word$ac_exeext; then
+ if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then
+ ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exeext"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+ ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+ echo "$as_me:6033: result: $MSGFMT" >&5
+echo "${ECHO_T}$MSGFMT" >&6
+else
+ echo "$as_me:6036: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+echo "$as_me:6042: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GMSGFMT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $GMSGFMT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ if $as_executable_p "$ac_dir/$ac_word"; then
+ ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+ echo "$as_me:6059: found $ac_dir/$ac_word" >&5
+ break
+fi
+done
+
+ test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+ ;;
+esac
+fi
+GMSGFMT=$ac_cv_path_GMSGFMT
+
+if test -n "$GMSGFMT"; then
+ echo "$as_me:6071: result: $GMSGFMT" >&5
+echo "${ECHO_T}$GMSGFMT" >&6
+else
+ echo "$as_me:6074: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ # Extract the first word of "xgettext", so it can be a program name with args.
+
+set dummy xgettext; ac_word=$2
+echo "$as_me:6081: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XGETTEXT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case "$XGETTEXT" in
+ [\\/]*|?:[\\/]*)
+ ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+ ;;
+ *)
+ if test -n "$PATH_SEPARATOR"; then PATHSEP="$PATH_SEPARATOR"; fi
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}"
+ for ac_dir in $PATH; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word$ac_exeext; then
+ if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then
+ ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exeext"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+ test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+ ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+ echo "$as_me:6109: result: $XGETTEXT" >&5
+echo "${ECHO_T}$XGETTEXT" >&6
+else
+ echo "$as_me:6112: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ BUILD_INCLUDED_LIBINTL=yes
+ USE_INCLUDED_LIBINTL=yes
+ CATOBJEXT=.gmo
+ INTLLIBS="\$(top_builddir)/intl/libintl.a $LIBICONV"
+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+ fi
+
+ if test "$GMSGFMT" != ":"; then
+ if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
+ : ;
+ else
+ echo "$as_me:6127: result: found msgfmt program is not GNU msgfmt; ignore it" >&5
+echo "${ECHO_T}found msgfmt program is not GNU msgfmt; ignore it" >&6
+ GMSGFMT=":"
+ fi
+ fi
+
+ if test "$XGETTEXT" != ":"; then
+ if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
+ : ;
+ else
+ echo "$as_me:6137: result: found xgettext program is not GNU xgettext; ignore it" >&5
+echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6
+ XGETTEXT=":"
+ fi
+ fi
+
+ POSUB=po
+ fi
+
+ ac_config_commands="$ac_config_commands default-1"
+
+ if test "$PACKAGE" = gettext; then
+ BUILD_INCLUDED_LIBINTL=yes
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ for ac_prog in bison
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:6157: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_INTLBISON+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$INTLBISON"; then
+ ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test.
+else
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_INTLBISON="$ac_prog"
+echo "$as_me:6172: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+INTLBISON=$ac_cv_prog_INTLBISON
+if test -n "$INTLBISON"; then
+ echo "$as_me:6180: result: $INTLBISON" >&5
+echo "${ECHO_T}$INTLBISON" >&6
+else
+ echo "$as_me:6183: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$INTLBISON" && break
+done
+
+ if test -z "$INTLBISON"; then
+ ac_verc_fail=yes
+ else
+ echo "$as_me:6193: checking version of bison" >&5
+echo $ECHO_N "checking version of bison... $ECHO_C" >&6
+ ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+ 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+ esac
+ echo "$as_me:6202: result: $ac_prog_version" >&5
+echo "${ECHO_T}$ac_prog_version" >&6
+ fi
+ if test $ac_verc_fail = yes; then
+ INTLBISON=:
+ fi
+ fi
+
+ for lang in $ALL_LINGUAS; do
+ GMOFILES="$GMOFILES $lang.gmo"
+ POFILES="$POFILES $lang.po"
+ done
+
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+
+ DATADIRNAME=share
+
+ INSTOBJEXT=.mo
+
+ GENCAT=gencat
+
+ if test "x$CATOBJEXT" != "x"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ echo "$as_me:6228: checking for catalogs to be installed" >&5
+echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6
+ NEW_LINGUAS=
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ NEW_LINGUAS="$NEW_LINGUAS $presentlang"
+ fi
+ done
+ LINGUAS=$NEW_LINGUAS
+ echo "$as_me:6248: result: $LINGUAS" >&5
+echo "${ECHO_T}$LINGUAS" >&6
+ fi
+
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ MKINSTALLDIRS=
+ if test -n "$ac_aux_dir"; then
+ MKINSTALLDIRS="$ac_aux_dir/mkdirs.sh"
+ fi
+ if test -z "$MKINSTALLDIRS"; then
+ MKINSTALLDIRS="\$(top_srcdir)/mkdirs.sh"
+ fi
+ if test -n "$GNUSYSTEM_AUX_DIR" ; then
+ if test -e "${GNUSYSTEM_AUX_DIR}/mkinstalldirs"; then
+ MKINSTALLDIRS="${GNUSYSTEM_AUX_DIR}/mkinstalldirs"
+ fi
+ fi
+
+ INTL_LIBTOOL_SUFFIX_PREFIX=
+
+INTLDIR_MAKE=
+MSG_DIR_MAKE=
+SUB_MAKEFILE=
+
+cf_makefile=makefile
+
+use_our_messages=no
+if test "$USE_NLS" = yes ; then
+if test -d $srcdir/po ; then
+echo "$as_me:6281: checking if we should use included message-library" >&5
+echo $ECHO_N "checking if we should use included message-library... $ECHO_C" >&6
+
+# Check whether --enable-included-msgs or --disable-included-msgs was given.
+if test "${enable_included_msgs+set}" = set; then
+ enableval="$enable_included_msgs"
+ use_our_messages=$enableval
+else
+ use_our_messages=yes
+fi;
+fi
+echo "$as_me:6292: result: $use_our_messages" >&5
+echo "${ECHO_T}$use_our_messages" >&6
+fi
+
+MSG_DIR_MAKE="#"
+if test "$use_our_messages" = yes
+then
+ SUB_MAKEFILE="$SUB_MAKEFILE po/$cf_makefile.in:$srcdir/po/$cf_makefile.inn"
+ MSG_DIR_MAKE=
+fi
+
+if test "$USE_INCLUDED_LIBINTL" = yes ; then
+ if test "$nls_cv_force_use_gnu_gettext" = yes ; then
+ :
+ elif test "$nls_cv_use_gnu_gettext" = yes ; then
+ :
+ else
+ INTLDIR_MAKE="#"
+ fi
+ if test -z "$INTLDIR_MAKE"; then
+ cat >>confdefs.h <<\EOF
+#define HAVE_LIBGETTEXT_H 1
+EOF
+
+ for cf_makefile in \
+ $srcdir/intl/Makefile.in \
+ $srcdir/intl/makefile.in
+ do
+ if test -f "$cf_makefile" ; then
+ SUB_MAKEFILE="$SUB_MAKEFILE `echo \"${cf_makefile}\"|sed -e 's,^'$srcdir/',,' -e 's/\.in$//'`:${cf_makefile}"
+ break
+ fi
+ done
+ fi
+else
+ INTLDIR_MAKE="#"
+ if test "$USE_NLS" = yes ; then
+
+for ac_header in libintl.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:6333: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 6339 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:6343: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:6349: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:6368: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+ fi
+fi
+
+if test -z "$INTLDIR_MAKE" ; then
+ CPPFLAGS="-I../intl $CPPFLAGS"
+fi
+
+if test "$BUILD_INCLUDED_LIBINTL" = yes ; then
+ GT_YES="#"
+ GT_NO=
+else
+ GT_YES=
+ GT_NO="#"
+fi
+
+if test "$USE_INCLUDED_LIBINTL" = yes ; then
+ if test "$nls_cv_force_use_gnu_gettext" = yes ; then
+ cat >>confdefs.h <<\EOF
+#define HAVE_GETTEXT 1
+EOF
+
+ elif test "$nls_cv_use_gnu_gettext" = yes ; then
+ cat >>confdefs.h <<\EOF
+#define HAVE_GETTEXT 1
+EOF
+
+ fi
+ if test -n "$nls_cv_header_intl" ; then
+ cat >>confdefs.h <<\EOF
+#define HAVE_LIBINTL_H 1
+EOF
+
+ fi
+fi
+
+echo "$as_me:6413: checking if -lm needed for math functions" >&5
+echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
+if test "${cf_cv_need_libm+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 6420 "configure"
+#include "confdefs.h"
+
+ #include <stdio.h>
+ #include <math.h>
+
+int
+main ()
+{
+double x = rand(); printf("result = %g\n", sqrt(x))
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6435: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:6438: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:6441: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:6444: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_need_libm=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_need_libm=yes
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:6454: result: $cf_cv_need_libm" >&5
+echo "${ECHO_T}$cf_cv_need_libm" >&6
+if test "$cf_cv_need_libm" = yes
+then
+
+ LIBS="$LIBS -lm"
+
+fi
+
+echo "$as_me:6463: checking if you want to use dmalloc for testing" >&5
+echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
+
+# Check whether --with-dmalloc or --without-dmalloc was given.
+if test "${with_dmalloc+set}" = set; then
+ withval="$with_dmalloc"
+ cat >>confdefs.h <<\EOF
+#define USE_DMALLOC 1
+EOF
+
+ : ${with_cflags:=-g}
+ : ${with_no_leaks:=yes}
+ with_dmalloc=yes
+else
+ with_dmalloc=
+fi;
+echo "$as_me:6479: result: ${with_dmalloc:-no}" >&5
+echo "${ECHO_T}${with_dmalloc:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+ case .$CFLAGS in #(vi
+ .*-g*) #(vi
+ ;;
+ *)
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -g
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+ ;;
+ esac
+ ;;
+esac
+
+if test "$with_dmalloc" = yes ; then
+ echo "$as_me:6563: checking for dmalloc.h" >&5
+echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
+if test "${ac_cv_header_dmalloc_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 6569 "configure"
+#include "confdefs.h"
+#include <dmalloc.h>
+_ACEOF
+if { (eval echo "$as_me:6573: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:6579: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_cv_header_dmalloc_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_header_dmalloc_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:6598: result: $ac_cv_header_dmalloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
+if test $ac_cv_header_dmalloc_h = yes; then
+
+echo "$as_me:6602: checking for dmalloc_debug in -ldmalloc" >&5
+echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
+if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldmalloc $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 6610 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dmalloc_debug ();
+int
+main ()
+{
+dmalloc_debug ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6629: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:6632: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:6635: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:6638: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dmalloc_dmalloc_debug=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dmalloc_dmalloc_debug=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:6649: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
+echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
+if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
+ cat >>confdefs.h <<EOF
+#define HAVE_LIBDMALLOC 1
+EOF
+
+ LIBS="-ldmalloc $LIBS"
+
+fi
+
+fi
+
+fi
+
+echo "$as_me:6664: checking if you want to use dbmalloc for testing" >&5
+echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
+
+# Check whether --with-dbmalloc or --without-dbmalloc was given.
+if test "${with_dbmalloc+set}" = set; then
+ withval="$with_dbmalloc"
+ cat >>confdefs.h <<\EOF
+#define USE_DBMALLOC 1
+EOF
+
+ : ${with_cflags:=-g}
+ : ${with_no_leaks:=yes}
+ with_dbmalloc=yes
+else
+ with_dbmalloc=
+fi;
+echo "$as_me:6680: result: ${with_dbmalloc:-no}" >&5
+echo "${ECHO_T}${with_dbmalloc:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+ case .$CFLAGS in #(vi
+ .*-g*) #(vi
+ ;;
+ *)
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -g
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+ ;;
+ esac
+ ;;
+esac
+
+if test "$with_dbmalloc" = yes ; then
+ echo "$as_me:6764: checking for dbmalloc.h" >&5
+echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
+if test "${ac_cv_header_dbmalloc_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 6770 "configure"
+#include "confdefs.h"
+#include <dbmalloc.h>
+_ACEOF
+if { (eval echo "$as_me:6774: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:6780: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_cv_header_dbmalloc_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_header_dbmalloc_h=no
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:6799: result: $ac_cv_header_dbmalloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
+if test $ac_cv_header_dbmalloc_h = yes; then
+
+echo "$as_me:6803: checking for debug_malloc in -ldbmalloc" >&5
+echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
+if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldbmalloc $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 6811 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char debug_malloc ();
+int
+main ()
+{
+debug_malloc ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:6830: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:6833: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:6836: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:6839: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dbmalloc_debug_malloc=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dbmalloc_debug_malloc=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:6850: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
+echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
+if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
+ cat >>confdefs.h <<EOF
+#define HAVE_LIBDBMALLOC 1
+EOF
+
+ LIBS="-ldbmalloc $LIBS"
+
+fi
+
+fi
+
+fi
+
+echo "$as_me:6865: checking if you want to use purify for testing" >&5
+echo $ECHO_N "checking if you want to use purify for testing... $ECHO_C" >&6
+
+# Check whether --with-purify or --without-purify was given.
+if test "${with_purify+set}" = set; then
+ withval="$with_purify"
+ cat >>confdefs.h <<\EOF
+#define USE_PURIFY 1
+EOF
+
+ : ${with_cflags:=-g}
+ : ${with_no_leaks:=yes}
+ with_purify=yes
+else
+ with_purify=
+fi;
+echo "$as_me:6881: result: ${with_purify:-no}" >&5
+echo "${ECHO_T}${with_purify:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+ case .$CFLAGS in #(vi
+ .*-g*) #(vi
+ ;;
+ *)
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -g
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+ ;;
+ esac
+ ;;
+esac
+
+echo "$as_me:6964: checking if you want to use valgrind for testing" >&5
+echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
+
+# Check whether --with-valgrind or --without-valgrind was given.
+if test "${with_valgrind+set}" = set; then
+ withval="$with_valgrind"
+ cat >>confdefs.h <<\EOF
+#define USE_VALGRIND 1
+EOF
+
+ : ${with_cflags:=-g}
+ : ${with_no_leaks:=yes}
+ with_valgrind=yes
+else
+ with_valgrind=
+fi;
+echo "$as_me:6980: result: ${with_valgrind:-no}" >&5
+echo "${ECHO_T}${with_valgrind:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+ case .$CFLAGS in #(vi
+ .*-g*) #(vi
+ ;;
+ *)
+
+cf_fix_cppflags=no
+cf_new_cflags=
+cf_new_cppflags=
+cf_new_extra_cppflags=
+
+for cf_add_cflags in -g
+do
+case $cf_fix_cppflags in
+no)
+ case $cf_add_cflags in #(vi
+ -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+ case $cf_add_cflags in
+ -D*)
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+
+ test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=yes
+
+ if test $cf_fix_cppflags = yes ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ elif test "${cf_tst_cflags}" = "\"'" ; then
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+ continue
+ fi
+ ;;
+ esac
+ case "$CPPFLAGS" in
+ *$cf_add_cflags) #(vi
+ ;;
+ *) #(vi
+ cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+ *)
+ cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+ ;;
+ esac
+ ;;
+yes)
+ cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+
+ cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+ test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+ && test -z "${cf_tst_cflags}" \
+ && cf_fix_cppflags=no
+ ;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+ CFLAGS="$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+ CPPFLAGS="$cf_new_cppflags $CPPFLAGS"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+ EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+ ;;
+ esac
+ ;;
+esac
+
+echo "$as_me:7063: checking if you want to perform memory-leak testing" >&5
+echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
+
+# Check whether --with-no-leaks or --without-no-leaks was given.
+if test "${with_no_leaks+set}" = set; then
+ withval="$with_no_leaks"
+ cat >>confdefs.h <<\EOF
+#define NO_LEAKS 1
+EOF
+
+ cf_doalloc=".${with_dmalloc}${with_dbmalloc}${with_purify}${with_valgrind}"
+ case ${cf_doalloc} in #(vi
+ *yes*) ;;
+ *) cat >>confdefs.h <<\EOF
+#define DOALLOC 10000
+EOF
+ ;;
+ esac
+ with_no_leaks=yes
+else
+ with_no_leaks=
+fi;
+echo "$as_me:7085: result: $with_no_leaks" >&5
+echo "${ECHO_T}$with_no_leaks" >&6
+
+echo "$as_me:7088: checking if you want --trace option" >&5
+echo $ECHO_N "checking if you want --trace option... $ECHO_C" >&6
+
+# Check whether --enable-trace or --disable-trace was given.
+if test "${enable_trace+set}" = set; then
+ enableval="$enable_trace"
+
+else
+ enableval=yes
+fi;
+echo "$as_me:7098: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+if test "$enableval" != no ; then
+EXTRAOBJS="$EXTRAOBJS trace\$o"
+ cat >>confdefs.h <<\EOF
+#define HAVE_DLG_TRACE 1
+EOF
+
+else
+ :
+fi
+
+LIBTOOL_MAKE="#"
+
+LIBTOOL=
+
+# common library maintenance symbols that are convenient for libtool scripts:
+LIB_CREATE='${AR} -cr'
+LIB_OBJECT='${OBJECTS}'
+LIB_SUFFIX=.a
+LIB_PREP="$RANLIB"
+
+# symbols used to prop libtool up to enable it to determine what it should be
+# doing:
+LIB_CLEAN=
+LIB_COMPILE=
+LIB_LINK='${CC}'
+LIB_INSTALL=
+LIB_UNINSTALL=
+
+echo "$as_me:7128: checking if you want to build libraries with libtool" >&5
+echo $ECHO_N "checking if you want to build libraries with libtool... $ECHO_C" >&6
+
+# Check whether --with-libtool or --without-libtool was given.
+if test "${with_libtool+set}" = set; then
+ withval="$with_libtool"
+ with_libtool=$withval
+else
+ with_libtool=no
+fi;
+echo "$as_me:7138: result: $with_libtool" >&5
+echo "${ECHO_T}$with_libtool" >&6
+if test "$with_libtool" != "no"; then
+
+ if test "$with_libtool" != "yes" ; then
+
+if test "x$prefix" != xNONE; then
+ cf_path_syntax="$prefix"
+else
+ cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$with_libtool" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+ ;;
+..|./*|.\\*) #(vi
+ ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+ ;;
+.\${*prefix}*) #(vi
+ eval with_libtool="$with_libtool"
+ case ".$with_libtool" in #(vi
+ .NONE/*)
+ with_libtool=`echo $with_libtool | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+ esac
+ ;; #(vi
+.no|.NONE/*)
+ with_libtool=`echo $with_libtool | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+*)
+ { { echo "$as_me:7169: error: expected a pathname, not \"$with_libtool\"" >&5
+echo "$as_me: error: expected a pathname, not \"$with_libtool\"" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
+
+ LIBTOOL=$with_libtool
+ else
+ # Extract the first word of "libtool", so it can be a program name with args.
+set dummy libtool; ac_word=$2
+echo "$as_me:7179: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_LIBTOOL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $LIBTOOL in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_LIBTOOL="$LIBTOOL" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ if $as_executable_p "$ac_dir/$ac_word"; then
+ ac_cv_path_LIBTOOL="$ac_dir/$ac_word"
+ echo "$as_me:7196: found $ac_dir/$ac_word" >&5
+ break
+fi
+done
+
+ ;;
+esac
+fi
+LIBTOOL=$ac_cv_path_LIBTOOL
+
+if test -n "$LIBTOOL"; then
+ echo "$as_me:7207: result: $LIBTOOL" >&5
+echo "${ECHO_T}$LIBTOOL" >&6
+else
+ echo "$as_me:7210: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ fi
+ if test -z "$LIBTOOL" ; then
+ { { echo "$as_me:7216: error: Cannot find libtool" >&5
+echo "$as_me: error: Cannot find libtool" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o'
+ LIB_OBJECT='${OBJECTS:.o=.lo}'
+ LIB_SUFFIX=.la
+ LIB_CLEAN='${LIBTOOL} --mode=clean'
+ LIB_COMPILE='${LIBTOOL} --mode=compile'
+ LIB_LINK='${LIBTOOL} --mode=link ${CC} ${LIBTOOL_OPTS}'
+ LIB_INSTALL='${LIBTOOL} --mode=install'
+ LIB_UNINSTALL='${LIBTOOL} --mode=uninstall'
+ LIB_PREP=:
+
+ # Show the version of libtool
+ echo "$as_me:7231: checking version of libtool" >&5
+echo $ECHO_N "checking version of libtool... $ECHO_C" >&6
+
+ # Save the version in a cache variable - this is not entirely a good
+ # thing, but the version string from libtool is very ugly, and for
+ # bug reports it might be useful to have the original string.
+ cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([^)]*)//g' -e 's/^[^1-9]*//' -e 's/[^0-9.].*//'`
+ echo "$as_me:7238: result: $cf_cv_libtool_version" >&5
+echo "${ECHO_T}$cf_cv_libtool_version" >&6
+ if test -z "$cf_cv_libtool_version" ; then
+ { { echo "$as_me:7241: error: This is not GNU libtool" >&5
+echo "$as_me: error: This is not GNU libtool" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ # special hack to add --tag option for C++ compiler
+ case $cf_cv_libtool_version in
+ 1.[5-9]*|[2-9]*)
+ LIBTOOL_CXX="$LIBTOOL --tag=CXX"
+ ;;
+ *)
+ LIBTOOL_CXX="$LIBTOOL"
+ ;;
+ esac
+else
+ LIBTOOL=""
+ LIBTOOL_CXX=""
+fi
+
+test -z "$LIBTOOL" && ECHO_LT=
+
+if test "$with_libtool" = "yes" ; then
+ OBJEXT="lo"
+ LIBTOOL_MAKE=
+
+echo "$as_me:7266: checking for additional libtool options" >&5
+echo $ECHO_N "checking for additional libtool options... $ECHO_C" >&6
+
+# Check whether --with-libtool-opts or --without-libtool-opts was given.
+if test "${with_libtool_opts+set}" = set; then
+ withval="$with_libtool_opts"
+ with_libtool_opts=$withval
+else
+ with_libtool_opts=no
+fi;
+echo "$as_me:7276: result: $with_libtool_opts" >&5
+echo "${ECHO_T}$with_libtool_opts" >&6
+
+case .$with_libtool_opts in
+.yes|.no|.)
+ ;;
+*)
+ LIBTOOL_OPTS=$with_libtool_opts
+ ;;
+esac
+
+fi
+
+use_ncurses=no
+
+# Check whether --with-ncurses or --without-ncurses was given.
+if test "${with_ncurses+set}" = set; then
+ withval="$with_ncurses"
+ use_ncurses=ncurses
+fi;
+
+# Check whether --with-ncursesw or --without-ncursesw was given.
+if test "${with_ncursesw+set}" = set; then
+ withval="$with_ncursesw"
+ use_ncurses=ncursesw
+fi;
+if test $use_ncurses != no ; then
+ cf_wide_curses=yes
+ if test $use_ncurses = ncursesw ; then
+
+echo "$as_me:7306: checking for multibyte character support" >&5
+echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
+if test "${cf_cv_utf8_lib+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cf_save_LIBS="$LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 7314 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+int
+main ()
+{
+putwc(0,0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7327: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:7330: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:7333: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7336: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_utf8_lib=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+LIBS="-lutf8 $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 7344 "configure"
+#include "confdefs.h"
+
+#include <libutf8.h>
+int
+main ()
+{
+putwc(0,0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:7357: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:7360: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:7363: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7366: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_utf8_lib=add-on
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_utf8_lib=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ LIBS="$cf_save_LIBS"
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:7380: result: $cf_cv_utf8_lib" >&5
+echo "${ECHO_T}$cf_cv_utf8_lib" >&6
+
+# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
+# ncurses/ncursesw:
+if test "$cf_cv_utf8_lib" = "add-on" ; then
+ cat >>confdefs.h <<\EOF
+#define HAVE_LIBUTF8_H 1
+EOF
+
+ LIBS="-lutf8 $LIBS"
+fi
+
+ fi
+
+# Check whether --with-curses-dir or --without-curses-dir was given.
+if test "${with_curses_dir+set}" = set; then
+ withval="$with_curses_dir"
+
+if test "x$prefix" != xNONE; then
+ cf_path_syntax="$prefix"
+else
+ cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".$withval" in #(vi
+.\$\(*\)*|.\'*\'*) #(vi
+ ;;
+..|./*|.\\*) #(vi
+ ;;
+.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
+ ;;
+.\${*prefix}*) #(vi
+ eval withval="$withval"
+ case ".$withval" in #(vi
+ .NONE/*)
+ withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+ esac
+ ;; #(vi
+.no|.NONE/*)
+ withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
+ ;;
+*)
+ { { echo "$as_me:7424: error: expected a pathname, not \"$withval\"" >&5
+echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+esac
+
+ cf_cv_curses_dir=$withval
+else
+ cf_cv_curses_dir=no
+fi;
+
+cf_ncuconfig_root=$use_ncurses
+
+echo "Looking for ${cf_ncuconfig_root}-config"
+for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:7442: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $NCURSES_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+ IFS=$ac_save_IFS
+ test -z "$ac_dir" && ac_dir=.
+ if $as_executable_p "$ac_dir/$ac_word"; then
+ ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
+ echo "$as_me:7459: found $ac_dir/$ac_word" >&5
+ break
+fi
+done
+
+ ;;
+esac
+fi
+NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
+
+if test -n "$NCURSES_CONFIG"; then
+ echo "$as_me:7470: result: $NCURSES_CONFIG" >&5
+echo "${ECHO_T}$NCURSES_CONFIG" >&6
+else
+ echo "$as_me:7473: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$NCURSES_CONFIG" && break
+done
+test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
+
+if test "$NCURSES_CONFIG" != none ; then
+
+cf_cv_ncurses_header=curses.h
+
+CPPFLAGS="`$NCURSES_CONFIG --cflags` $CPPFLAGS"
+LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+else
+
+cf_ncuhdr_root=$use_ncurses
+
+test -n "$cf_cv_curses_dir" && \
+test "$cf_cv_curses_dir" != "no" && \
+CPPFLAGS="-I$cf_cv_curses_dir/include -I$cf_cv_curses_dir/include/$cf_ncuhdr_root $CPPFLAGS"
+
+echo "$as_me:7508: checking for $cf_ncuhdr_root header in include-path" >&5
+echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
+if test "${cf_cv_ncurses_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
+ ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
+ for cf_header in $cf_header_list
+ do
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 7520 "configure"
+#include "confdefs.h"
+
+#include <$cf_header>
+int
+main ()
+{
+
+#ifdef NCURSES_VERSION
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+ make an error
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7544: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:7547: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:7550: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7553: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_ncurses_h=$cf_header
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_h=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+ test "$cf_cv_ncurses_h" != no && break
+ done
+
+fi
+echo "$as_me:7568: result: $cf_cv_ncurses_h" >&5
+echo "${ECHO_T}$cf_cv_ncurses_h" >&6
+
+if test "$cf_cv_ncurses_h" != no ; then
+ cf_cv_ncurses_header=$cf_cv_ncurses_h
+else
+
+echo "$as_me:7575: checking for $cf_ncuhdr_root include-path" >&5
+echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
+if test "${cf_cv_ncurses_h2+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ test -n "$verbose" && echo
+ cf_search=""
+
+test -d "$HOME" && {
+ test -n "$verbose" && echo " ... testing include-directories under $HOME"
+ test -d "$HOME/include" && cf_search="$cf_search $HOME/include"
+ test -d "$HOME/include/$cf_ncuhdr_root" && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
+ test -d "$HOME/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
+}
+
+# For other stuff under the home directory, it should be sufficient to put
+# a symbolic link for $HOME/$cf_ncuhdr_root to the actual package location:
+test -d "$HOME/$cf_ncuhdr_root" && {
+ test -n "$verbose" && echo " ... testing include-directories under $HOME/$cf_ncuhdr_root"
+ test -d "$HOME/$cf_ncuhdr_root/include" && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
+ test -d "$HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != /usr/local && \
+test -d /usr/local && {
+ test -n "$verbose" && echo " ... testing include-directories under /usr/local"
+ test -d /usr/local/include && cf_search="$cf_search /usr/local/include"
+ test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
+ test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
+ test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
+ test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != NONE && \
+test -d $prefix && {
+ test -n "$verbose" && echo " ... testing include-directories under $prefix"
+ test -d $prefix/include && cf_search="$cf_search $prefix/include"
+ test -d $prefix/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
+ test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
+ test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
+ test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != /opt && \
+test -d /opt && {
+ test -n "$verbose" && echo " ... testing include-directories under /opt"
+ test -d /opt/include && cf_search="$cf_search /opt/include"
+ test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
+ test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
+ test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
+ test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
+}
+
+test "$prefix" != /usr && \
+test -d /usr && {
+ test -n "$verbose" && echo " ... testing include-directories under /usr"
+ test -d /usr/include && cf_search="$cf_search /usr/include"
+ test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
+ test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
+ test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
+}
+
+test "$includedir" != NONE && \
+test "$includedir" != "/usr/include" && \
+test -d "$includedir" && {
+ test -d $includedir && cf_search="$cf_search $includedir"
+ test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
+}
+
+test "$oldincludedir" != NONE && \
+test "$oldincludedir" != "/usr/include" && \
+test -d "$oldincludedir" && {
+ test -d $oldincludedir && cf_search="$cf_search $oldincludedir"
+ test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
+}
+
+ test -n "$verbose" && echo search path $cf_search
+ cf_save2_CPPFLAGS="$CPPFLAGS"
+ for cf_incdir in $cf_search
+ do
+
+for cf_add_incdir in $cf_incdir
+do
+ while true
+ do
+ case $cf_add_incdir in
+ /usr/include) # (vi
+ ;;
+ /usr/local/include) # (vi
+ if test "$GCC" = yes
+ then
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 7670 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7682: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:7685: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:7688: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7691: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+CPPFLAGS="$cf_save_CPPFLAGS"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
+ ;;
+ *) # (vi
+ CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+ ;;
+ esac
+ cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+ test "$cf_top_incdir" = "$cf_add_incdir" && break
+ cf_add_incdir="$cf_top_incdir"
+ done
+done
+
+ for cf_header in \
+ ncurses.h \
+ curses.h
+ do
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 7718 "configure"
+#include "confdefs.h"
+
+#include <$cf_header>
+int
+main ()
+{
+
+#ifdef NCURSES_VERSION
+
+printf("%s\n", NCURSES_VERSION);
+#else
+#ifdef __NCURSES_H
+printf("old\n");
+#else
+ make an error
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7742: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:7745: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:7748: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7751: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_ncurses_h2=$cf_header
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_ncurses_h2=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+ if test "$cf_cv_ncurses_h2" != no ; then
+ cf_cv_ncurses_h2=$cf_incdir/$cf_header
+ test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6
+ break
+ fi
+ test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6
+ done
+ CPPFLAGS="$cf_save2_CPPFLAGS"
+ test "$cf_cv_ncurses_h2" != no && break
+ done
+ test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7772: error: not found" >&5
+echo "$as_me: error: not found" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:7777: result: $cf_cv_ncurses_h2" >&5
+echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
+
+ cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
+ cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
+ if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
+ cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
+ fi
+
+for cf_add_incdir in $cf_1st_incdir
+do
+ while true
+ do
+ case $cf_add_incdir in
+ /usr/include) # (vi
+ ;;
+ /usr/local/include) # (vi
+ if test "$GCC" = yes
+ then
+ cf_save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 7799 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+int
+main ()
+{
+printf("Hello")
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7811: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:7814: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:7817: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7820: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+CPPFLAGS="$cf_save_CPPFLAGS"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ fi
+ ;;
+ *) # (vi
+ CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
+ ;;
+ esac
+ cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
+ test "$cf_top_incdir" = "$cf_add_incdir" && break
+ cf_add_incdir="$cf_top_incdir"
+ done
+done
+
+fi
+
+# Set definitions to allow ifdef'ing for ncurses.h
+
+case $cf_cv_ncurses_header in # (vi
+*ncurses.h)
+ cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_H 1
+EOF
+
+ ;;
+esac
+
+case $cf_cv_ncurses_header in # (vi
+ncurses/curses.h|ncurses/ncurses.h)
+ cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_NCURSES_H 1
+EOF
+
+ ;;
+ncursesw/curses.h|ncursesw/ncurses.h)
+ cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_NCURSES_H 1
+EOF
+
+ ;;
+esac
+
+echo "$as_me:7869: checking for terminfo header" >&5
+echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+case ${cf_cv_ncurses_header} in #(vi
+*/ncurses.h|*/ncursesw.h) #(vi
+ cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
+ ;;
+*)
+ cf_term_header=term.h
+ ;;
+esac
+
+for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 7887 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <${cf_cv_ncurses_header-curses.h}>
+#include <$cf_test>
+
+int
+main ()
+{
+int x = auto_left_margin
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:7902: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:7905: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:7908: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7911: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cf_cv_term_header="$cf_test"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cf_cv_term_header=unknown
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ test "$cf_cv_term_header" != unknown && break
+done
+
+fi
+echo "$as_me:7927: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
+
+# Set definitions to allow ifdef'ing to accommodate subdirectories
+
+case $cf_cv_term_header in # (vi
+*term.h)
+ cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
+
+ ;;
+esac
+
+case $cf_cv_term_header in # (vi
+ncurses/term.h) #(vi
+ cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
+
+ ;;
+ncursesw/term.h)
+ cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+ ;;
+esac
+
+# some applications need this, but should check for NCURSES_VERSION
+cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+echo "$as_me:7961: checking for ncurses version" >&5
+echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
+if test "${cf_cv_ncurses_version+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cf_cv_ncurses_version=no
+ cf_tempfile=out$$
+ rm -f $cf_tempfile
+ if test "$cross_compiling" = yes; then
+
+ # This will not work if the preprocessor splits the line after the
+ # Autoconf token. The 'unproto' program does that.
+ cat > conftest.$ac_ext <<EOF
+#include <${cf_cv_ncurses_header-curses.h}>
+#undef Autoconf
+#ifdef NCURSES_VERSION
+Autoconf NCURSES_VERSION
+#else
+#ifdef __NCURSES_H
+Autoconf "old"
+#endif
+;
+#endif
+EOF
+ cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
+ { (eval echo "$as_me:7987: \"$cf_try\"") >&5
+ (eval $cf_try) 2>&5
+ ac_status=$?
+ echo "$as_me:7990: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ if test -f conftest.out ; then
+ cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
+ test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
+ rm -f conftest.out
+ fi
+
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 8000 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header-curses.h}>
+#include <stdio.h>
+int main()
+{
+ FILE *fp = fopen("$cf_tempfile", "w");
+#ifdef NCURSES_VERSION
+# ifdef NCURSES_VERSION_PATCH
+ fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
+# else
+ fprintf(fp, "%s\n", NCURSES_VERSION);
+# endif
+#else
+# ifdef __NCURSES_H
+ fprintf(fp, "old\n");
+# else
+ make an error
+# endif
+#endif
+ ${cf_cv_main_return-return}(0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:8025: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8028: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:8030: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8033: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cf_cv_ncurses_version=`cat $cf_tempfile`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+ rm -f $cf_tempfile
+
+fi
+echo "$as_me:8047: result: $cf_cv_ncurses_version" >&5
+echo "${ECHO_T}$cf_cv_ncurses_version" >&6
+test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+cf_nculib_root=$use_ncurses
+ # This works, except for the special case where we find gpm, but
+ # ncurses is in a nonstandard location via $LIBS, and we really want
+ # to link gpm.
+cf_ncurses_LIBS=""
+cf_ncurses_SAVE="$LIBS"
+echo "$as_me:8059: checking for Gpm_Open in -lgpm" >&5
+echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
+if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgpm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8067 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char Gpm_Open ();
+int
+main ()
+{
+Gpm_Open ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8086: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8089: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8092: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8095: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_gpm_Gpm_Open=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gpm_Gpm_Open=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:8106: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
+if test $ac_cv_lib_gpm_Gpm_Open = yes; then
+ echo "$as_me:8109: checking for initscr in -lgpm" >&5
+echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
+if test "${ac_cv_lib_gpm_initscr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgpm $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8117 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char initscr ();
+int
+main ()
+{
+initscr ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8136: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8139: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8142: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8145: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_gpm_initscr=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_gpm_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:8156: result: $ac_cv_lib_gpm_initscr" >&5
+echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
+if test $ac_cv_lib_gpm_initscr = yes; then
+ LIBS="$cf_ncurses_SAVE"
+else
+ cf_ncurses_LIBS="-lgpm"
+fi
+
+fi
+
+case $host_os in #(vi
+freebsd*)
+ # This is only necessary if you are linking against an obsolete
+ # version of ncurses (but it should do no harm, since it's static).
+ if test "$cf_nculib_root" = ncurses ; then
+ echo "$as_me:8171: checking for tgoto in -lmytinfo" >&5
+echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
+if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmytinfo $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8179 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char tgoto ();
+int
+main ()
+{
+tgoto ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8198: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8201: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8204: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8207: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_mytinfo_tgoto=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_mytinfo_tgoto=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:8218: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
+if test $ac_cv_lib_mytinfo_tgoto = yes; then
+ cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
+fi
+
+ fi
+ ;;
+esac
+
+LIBS="$cf_ncurses_LIBS $LIBS"
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+ LIBS="-L$cf_cv_curses_dir/lib -l$cf_nculib_root $LIBS"
+else
+
+ eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
+ cf_libdir=""
+ echo "$as_me:8237: checking for initscr" >&5
+echo $ECHO_N "checking for initscr... $ECHO_C" >&6
+if test "${ac_cv_func_initscr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 8243 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char initscr (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char initscr ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_initscr) || defined (__stub___initscr)
+choke me
+#else
+f = initscr;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8274: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8277: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8280: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8283: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_initscr=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:8293: result: $ac_cv_func_initscr" >&5
+echo "${ECHO_T}$ac_cv_func_initscr" >&6
+if test $ac_cv_func_initscr = yes; then
+ eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+else
+
+ cf_save_LIBS="$LIBS"
+ echo "$as_me:8300: checking for initscr in -l$cf_nculib_root" >&5
+echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
+ LIBS="-l$cf_nculib_root $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 8304 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+initscr()
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8316: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8319: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8322: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8325: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:8327: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:8334: result: no" >&5
+echo "${ECHO_T}no" >&6
+ cf_search=""
+
+test -d "$HOME" && {
+ test -n "$verbose" && echo " ... testing lib-directories under $HOME"
+ test -d "$HOME/lib" && cf_search="$cf_search $HOME/lib"
+ test -d "$HOME/lib/$cf_nculib_root" && cf_search="$cf_search $HOME/lib/$cf_nculib_root"
+ test -d "$HOME/lib/$cf_nculib_root/lib" && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
+}
+
+# For other stuff under the home directory, it should be sufficient to put
+# a symbolic link for $HOME/$cf_nculib_root to the actual package location:
+test -d "$HOME/$cf_nculib_root" && {
+ test -n "$verbose" && echo " ... testing lib-directories under $HOME/$cf_nculib_root"
+ test -d "$HOME/$cf_nculib_root/lib" && cf_search="$cf_search $HOME/$cf_nculib_root/lib"
+ test -d "$HOME/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != /usr/local && \
+test -d /usr/local && {
+ test -n "$verbose" && echo " ... testing lib-directories under /usr/local"
+ test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib"
+ test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
+ test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
+ test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
+ test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != NONE && \
+test -d $prefix && {
+ test -n "$verbose" && echo " ... testing lib-directories under $prefix"
+ test -d $prefix/lib && cf_search="$cf_search $prefix/lib"
+ test -d $prefix/lib/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root"
+ test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
+ test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib"
+ test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != /opt && \
+test -d /opt && {
+ test -n "$verbose" && echo " ... testing lib-directories under /opt"
+ test -d /opt/lib && cf_search="$cf_search /opt/lib"
+ test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root"
+ test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
+ test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib"
+ test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
+}
+
+test "$prefix" != /usr && \
+test -d /usr && {
+ test -n "$verbose" && echo " ... testing lib-directories under /usr"
+ test -d /usr/lib && cf_search="$cf_search /usr/lib"
+ test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root"
+ test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
+ test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib"
+}
+
+ for cf_libdir in $cf_search
+ do
+ echo "$as_me:8394: checking for -l$cf_nculib_root in $cf_libdir" >&5
+echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
+ LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 8398 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+initscr()
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8410: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8413: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8416: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8419: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:8421: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:8428: result: no" >&5
+echo "${ECHO_T}no" >&6
+ LIBS="$cf_save_LIBS"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+
+eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
+
+if test $cf_found_library = no ; then
+ { { echo "$as_me:8443: error: Cannot link $cf_nculib_root library" >&5
+echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+
+if test -n "$cf_ncurses_LIBS" ; then
+ echo "$as_me:8451: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
+ cf_ncurses_SAVE="$LIBS"
+ for p in $cf_ncurses_LIBS ; do
+ q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
+ if test "$q" != "$LIBS" ; then
+ LIBS="$q"
+ fi
+ done
+ cat >conftest.$ac_ext <<_ACEOF
+#line 8461 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8473: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8476: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8479: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8482: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:8484: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+echo "$as_me:8489: result: no" >&5
+echo "${ECHO_T}no" >&6
+ LIBS="$cf_ncurses_SAVE"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+
+cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+cat >>confdefs.h <<EOF
+#define $cf_nculib_ROOT 1
+EOF
+
+fi
+
+else
+ cf_wide_curses=no
+
+echo "$as_me:8507: checking for extra include directories" >&5
+echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
+if test "${cf_cv_curses_incdir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_curses_incdir=no
+case $host_os in #(vi
+hpux10.*) #(vi
+ test -d /usr/include/curses_colr && \
+ cf_cv_curses_incdir="-I/usr/include/curses_colr"
+ ;;
+sunos3*|sunos4*)
+ test -d /usr/5lib && \
+ test -d /usr/5include && \
+ cf_cv_curses_incdir="-I/usr/5include"
+ ;;
+esac
+
+fi
+echo "$as_me:8527: result: $cf_cv_curses_incdir" >&5
+echo "${ECHO_T}$cf_cv_curses_incdir" >&6
+test "$cf_cv_curses_incdir" != no && CPPFLAGS="$cf_cv_curses_incdir $CPPFLAGS"
+
+echo "$as_me:8531: checking if we have identified curses headers" >&5
+echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
+if test "${cf_cv_ncurses_header+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_ncurses_header=none
+for cf_header in \
+ curses.h \
+ ncurses.h \
+ ncurses/curses.h \
+ ncurses/ncurses.h
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 8545 "configure"
+#include "confdefs.h"
+#include <${cf_header}>
+int
+main ()
+{
+initscr(); tgoto("?", 0,0)
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8557: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:8560: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:8563: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8566: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_ncurses_header=$cf_header; break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:8577: result: $cf_cv_ncurses_header" >&5
+echo "${ECHO_T}$cf_cv_ncurses_header" >&6
+
+if test "$cf_cv_ncurses_header" = none ; then
+ { { echo "$as_me:8581: error: No curses header-files found" >&5
+echo "$as_me: error: No curses header-files found" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
+
+for ac_header in $cf_cv_ncurses_header
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:8591: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 8597 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:8601: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:8607: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:8626: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+echo "$as_me:8636: checking for terminfo header" >&5
+echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+case ${cf_cv_ncurses_header} in #(vi
+*/ncurses.h|*/ncursesw.h) #(vi
+ cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
+ ;;
+*)
+ cf_term_header=term.h
+ ;;
+esac
+
+for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
+do
+cat >conftest.$ac_ext <<_ACEOF
+#line 8654 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+#include <${cf_cv_ncurses_header-curses.h}>
+#include <$cf_test>
+
+int
+main ()
+{
+int x = auto_left_margin
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:8669: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:8672: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:8675: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8678: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cf_cv_term_header="$cf_test"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cf_cv_term_header=unknown
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ test "$cf_cv_term_header" != unknown && break
+done
+
+fi
+echo "$as_me:8694: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
+
+# Set definitions to allow ifdef'ing to accommodate subdirectories
+
+case $cf_cv_term_header in # (vi
+*term.h)
+ cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
+
+ ;;
+esac
+
+case $cf_cv_term_header in # (vi
+ncurses/term.h) #(vi
+ cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
+
+ ;;
+ncursesw/term.h)
+ cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+ ;;
+esac
+
+echo "$as_me:8723: checking for ncurses version" >&5
+echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
+if test "${cf_cv_ncurses_version+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cf_cv_ncurses_version=no
+ cf_tempfile=out$$
+ rm -f $cf_tempfile
+ if test "$cross_compiling" = yes; then
+
+ # This will not work if the preprocessor splits the line after the
+ # Autoconf token. The 'unproto' program does that.
+ cat > conftest.$ac_ext <<EOF
+#include <${cf_cv_ncurses_header-curses.h}>
+#undef Autoconf
+#ifdef NCURSES_VERSION
+Autoconf NCURSES_VERSION
+#else
+#ifdef __NCURSES_H
+Autoconf "old"
+#endif
+;
+#endif
+EOF
+ cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
+ { (eval echo "$as_me:8749: \"$cf_try\"") >&5
+ (eval $cf_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8752: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ if test -f conftest.out ; then
+ cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
+ test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
+ rm -f conftest.out
+ fi
+
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 8762 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header-curses.h}>
+#include <stdio.h>
+int main()
+{
+ FILE *fp = fopen("$cf_tempfile", "w");
+#ifdef NCURSES_VERSION
+# ifdef NCURSES_VERSION_PATCH
+ fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
+# else
+ fprintf(fp, "%s\n", NCURSES_VERSION);
+# endif
+#else
+# ifdef __NCURSES_H
+ fprintf(fp, "old\n");
+# else
+ make an error
+# endif
+#endif
+ ${cf_cv_main_return-return}(0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:8787: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8790: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:8792: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8795: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ cf_cv_ncurses_version=`cat $cf_tempfile`
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+ rm -f $cf_tempfile
+
+fi
+echo "$as_me:8809: result: $cf_cv_ncurses_version" >&5
+echo "${ECHO_T}$cf_cv_ncurses_version" >&6
+test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
+#define NCURSES 1
+EOF
+
+echo "$as_me:8815: checking if we have identified curses libraries" >&5
+echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line 8818 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+initscr(); tgoto("?", 0,0)
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8830: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8833: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8836: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8839: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_result=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+echo "$as_me:8848: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+
+if test "$cf_result" = no ; then
+case $host_os in #(vi
+freebsd*) #(vi
+ echo "$as_me:8854: checking for tgoto in -lmytinfo" >&5
+echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
+if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmytinfo $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8862 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char tgoto ();
+int
+main ()
+{
+tgoto ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8881: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8884: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8887: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8890: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_mytinfo_tgoto=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_mytinfo_tgoto=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:8901: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
+if test $ac_cv_lib_mytinfo_tgoto = yes; then
+ LIBS="-lmytinfo $LIBS"
+fi
+
+ ;;
+hpux10.*) #(vi
+ echo "$as_me:8909: checking for initscr in -lcur_colr" >&5
+echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
+if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcur_colr $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8917 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char initscr ();
+int
+main ()
+{
+initscr ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8936: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8939: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8942: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:8945: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_cur_colr_initscr=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_cur_colr_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:8956: result: $ac_cv_lib_cur_colr_initscr" >&5
+echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
+if test $ac_cv_lib_cur_colr_initscr = yes; then
+
+ LIBS="-lcur_colr $LIBS"
+ ac_cv_func_initscr=yes
+
+else
+
+ echo "$as_me:8965: checking for initscr in -lHcurses" >&5
+echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
+if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lHcurses $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 8973 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char initscr ();
+int
+main ()
+{
+initscr ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:8992: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:8995: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:8998: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9001: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_Hcurses_initscr=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_Hcurses_initscr=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9012: result: $ac_cv_lib_Hcurses_initscr" >&5
+echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
+if test $ac_cv_lib_Hcurses_initscr = yes; then
+
+ # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
+ LIBS="-lHcurses $LIBS"
+ CPPFLAGS="-D__HP_CURSES -D_HP_CURSES $CPPFLAGS"
+ ac_cv_func_initscr=yes
+
+fi
+
+fi
+
+ ;;
+linux*) # Suse Linux does not follow /usr/lib convention
+ LIBS="$LIBS -L/lib"
+ ;;
+sunos3*|sunos4*)
+ test -d /usr/5lib && \
+ LIBS="$LIBS -L/usr/5lib -lcurses -ltermcap"
+ ac_cv_func_initscr=yes
+ ;;
+esac
+
+if test ".$ac_cv_func_initscr" != .yes ; then
+ cf_save_LIBS="$LIBS"
+ cf_term_lib=""
+ cf_curs_lib=""
+
+ if test ".${cf_cv_ncurses_version-no}" != .no
+ then
+ cf_check_list="ncurses curses cursesX"
+ else
+ cf_check_list="cursesX curses ncurses"
+ fi
+
+ # Check for library containing tgoto. Do this before curses library
+ # because it may be needed to link the test-case for initscr.
+ echo "$as_me:9050: checking for tgoto" >&5
+echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
+if test "${ac_cv_func_tgoto+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9056 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char tgoto (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char tgoto ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_tgoto) || defined (__stub___tgoto)
+choke me
+#else
+f = tgoto;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9087: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:9090: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:9093: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9096: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_tgoto=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_tgoto=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:9106: result: $ac_cv_func_tgoto" >&5
+echo "${ECHO_T}$ac_cv_func_tgoto" >&6
+if test $ac_cv_func_tgoto = yes; then
+ cf_term_lib=predefined
+else
+
+ for cf_term_lib in $cf_check_list termcap termlib unknown
+ do
+ as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
+echo "$as_me:9115: checking for tgoto in -l$cf_term_lib" >&5
+echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$cf_term_lib $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9123 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char tgoto ();
+int
+main ()
+{
+tgoto ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9142: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:9145: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:9148: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9151: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9162: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ break
+fi
+
+ done
+
+fi
+
+ # Check for library containing initscr
+ test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
+ for cf_curs_lib in $cf_check_list xcurses jcurses unknown
+ do
+ as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
+echo "$as_me:9177: checking for initscr in -l$cf_curs_lib" >&5
+echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Lib+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$cf_curs_lib $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9185 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char initscr ();
+int
+main ()
+{
+initscr ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9204: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:9207: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:9210: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9213: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Lib=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9224: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ break
+fi
+
+ done
+ test $cf_curs_lib = unknown && { { echo "$as_me:9231: error: no curses library found" >&5
+echo "$as_me: error: no curses library found" >&2;}
+ { (exit 1); exit 1; }; }
+
+ LIBS="-l$cf_curs_lib $cf_save_LIBS"
+ if test "$cf_term_lib" = unknown ; then
+ echo "$as_me:9237: checking if we can link with $cf_curs_lib library" >&5
+echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9240 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+initscr()
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9252: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:9255: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:9258: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9261: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_result=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ echo "$as_me:9270: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+ test $cf_result = no && { { echo "$as_me:9272: error: Cannot link curses library" >&5
+echo "$as_me: error: Cannot link curses library" >&2;}
+ { (exit 1); exit 1; }; }
+ elif test "$cf_curs_lib" = "$cf_term_lib" ; then
+ :
+ elif test "$cf_term_lib" != predefined ; then
+ echo "$as_me:9278: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9281 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+initscr(); tgoto((char *)0, 0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9293: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:9296: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:9299: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9302: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_result=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9311 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+initscr()
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9323: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:9326: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:9329: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9332: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_result=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=error
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ echo "$as_me:9344: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+ fi
+fi
+fi
+
+fi
+
+cf_all_widgets=yes
+
+echo "$as_me:9354: checking if you want extra dialogs" >&5
+echo $ECHO_N "checking if you want extra dialogs... $ECHO_C" >&6
+
+# Check whether --enable-extras or --disable-extras was given.
+if test "${enable_extras+set}" = set; then
+ enableval="$enable_extras"
+
+else
+ enableval=yes
+fi;
+echo "$as_me:9364: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+if test "$enableval" != no ; then
+cf_all_widgets=yes
+else
+cf_all_widgets=no
+fi
+
+echo "$as_me:9372: checking if you want config-file support" >&5
+echo $ECHO_N "checking if you want config-file support... $ECHO_C" >&6
+
+# Check whether --enable-rc-file or --disable-rc-file was given.
+if test "${enable_rc_file+set}" = set; then
+ enableval="$enable_rc_file"
+
+else
+ enableval=$cf_all_widgets
+fi;
+echo "$as_me:9382: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+if test "$enableval" != no ; then
+EXTRAOBJS="$EXTRAOBJS rc\$o"
+ cat >>confdefs.h <<\EOF
+#define HAVE_RC_FILE 1
+EOF
+
+else
+ :
+fi
+
+echo "$as_me:9394: checking if you want Xdialog-style dialogs" >&5
+echo $ECHO_N "checking if you want Xdialog-style dialogs... $ECHO_C" >&6
+
+# Check whether --enable-Xdialog or --disable-Xdialog was given.
+if test "${enable_Xdialog+set}" = set; then
+ enableval="$enable_Xdialog"
+
+else
+ enableval=$cf_all_widgets
+fi;
+echo "$as_me:9404: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+if test "$enableval" != no ; then
+EXTRAOBJS="$EXTRAOBJS calendar\$o fselect\$o timebox\$o"
+ cat >>confdefs.h <<\EOF
+#define HAVE_XDIALOG 1
+EOF
+
+else
+ :
+fi
+
+echo "$as_me:9416: checking if you want the form dialog" >&5
+echo $ECHO_N "checking if you want the form dialog... $ECHO_C" >&6
+
+# Check whether --enable-form or --disable-form was given.
+if test "${enable_form+set}" = set; then
+ enableval="$enable_form"
+
+else
+ enableval=$cf_all_widgets
+fi;
+echo "$as_me:9426: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+if test "$enableval" != no ; then
+EXTRAOBJS="$EXTRAOBJS formbox\$o"
+ cat >>confdefs.h <<\EOF
+#define HAVE_DLG_FORMBOX 1
+EOF
+
+else
+ :
+fi
+
+echo "$as_me:9438: checking if you want the gauge dialog" >&5
+echo $ECHO_N "checking if you want the gauge dialog... $ECHO_C" >&6
+
+# Check whether --enable-gauge or --disable-gauge was given.
+if test "${enable_gauge+set}" = set; then
+ enableval="$enable_gauge"
+
+else
+ enableval=$cf_all_widgets
+fi;
+echo "$as_me:9448: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+if test "$enableval" != no ; then
+EXTRAOBJS="$EXTRAOBJS guage\$o pause\$o progressbox\$o"
+ cat >>confdefs.h <<\EOF
+#define HAVE_DLG_GAUGE 1
+EOF
+
+else
+ :
+fi
+
+echo "$as_me:9460: checking if you want the tailbox dialog" >&5
+echo $ECHO_N "checking if you want the tailbox dialog... $ECHO_C" >&6
+
+# Check whether --enable-tailbox or --disable-tailbox was given.
+if test "${enable_tailbox+set}" = set; then
+ enableval="$enable_tailbox"
+
+else
+ enableval=$cf_all_widgets
+fi;
+echo "$as_me:9470: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+if test "$enableval" != no ; then
+EXTRAOBJS="$EXTRAOBJS tailbox\$o"
+ cat >>confdefs.h <<\EOF
+#define HAVE_DLG_TAILBOX 1
+EOF
+
+else
+ :
+fi
+
+echo "$as_me:9482: checking if you want the mixedform dialog" >&5
+echo $ECHO_N "checking if you want the mixedform dialog... $ECHO_C" >&6
+
+# Check whether --enable-mixedform or --disable-mixedform was given.
+if test "${enable_mixedform+set}" = set; then
+ enableval="$enable_mixedform"
+
+else
+ enableval=$cf_all_widgets
+fi;
+echo "$as_me:9492: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+if test "$enableval" != no ; then
+EXTRAOBJS="$EXTRAOBJS mixedform\$o"
+ cat >>confdefs.h <<\EOF
+#define HAVE_DLG_MIXEDFORM 1
+EOF
+
+else
+ :
+fi
+
+echo "$as_me:9504: checking if you want the mixedgauge dialog" >&5
+echo $ECHO_N "checking if you want the mixedgauge dialog... $ECHO_C" >&6
+
+# Check whether --enable-mixedgauge or --disable-mixedgauge was given.
+if test "${enable_mixedgauge+set}" = set; then
+ enableval="$enable_mixedgauge"
+
+else
+ enableval=$cf_all_widgets
+fi;
+echo "$as_me:9514: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+if test "$enableval" != no ; then
+EXTRAOBJS="$EXTRAOBJS mixedgauge\$o"
+ cat >>confdefs.h <<\EOF
+#define HAVE_MIXEDGAUGE 1
+EOF
+
+else
+ :
+fi
+
+echo "$as_me:9526: checking if you want the wide-curses features" >&5
+echo $ECHO_N "checking if you want the wide-curses features... $ECHO_C" >&6
+
+# Check whether --enable-widec or --disable-widec was given.
+if test "${enable_widec+set}" = set; then
+ enableval="$enable_widec"
+
+else
+ enableval=$cf_wide_curses
+fi;
+echo "$as_me:9536: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+if test "$enableval" != no ; then
+cat >>confdefs.h <<\EOF
+#define USE_WIDE_CURSES 1
+EOF
+
+else
+ :
+fi
+
+echo "$as_me:9547: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9553 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+_ACEOF
+if { (eval echo "$as_me:9561: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:9567: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9589 "configure"
+#include "confdefs.h"
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9607 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9628 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ $ac_main_return(2);
+ $ac_main_return (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:9654: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:9657: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:9659: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9662: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_stdc=no
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:9675: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\EOF
+#define STDC_HEADERS 1
+EOF
+
+fi
+
+echo "$as_me:9685: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+if test "${ac_cv_header_time+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9691 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:9707: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:9710: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:9713: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9716: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_time=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_header_time=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:9726: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\EOF
+#define TIME_WITH_SYS_TIME 1
+EOF
+
+fi
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+echo "$as_me:9739: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9745 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:9760: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:9763: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:9766: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9769: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:9779: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+EOF
+
+ac_header_dirent=$ac_hdr; break
+fi
+
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ echo "$as_me:9792: checking for opendir in -ldir" >&5
+echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
+if test "${ac_cv_lib_dir_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldir $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9800 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9819: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:9822: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:9825: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9828: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dir_opendir=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dir_opendir=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9839: result: $ac_cv_lib_dir_opendir" >&5
+echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
+if test $ac_cv_lib_dir_opendir = yes; then
+ LIBS="$LIBS -ldir"
+fi
+
+else
+ echo "$as_me:9846: checking for opendir in -lx" >&5
+echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
+if test "${ac_cv_lib_x_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lx $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 9854 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:9873: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:9876: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:9879: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9882: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_x_opendir=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_x_opendir=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:9893: result: $ac_cv_lib_x_opendir" >&5
+echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
+if test $ac_cv_lib_x_opendir = yes; then
+ LIBS="$LIBS -lx"
+fi
+
+fi
+
+for ac_header in search.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:9904: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9910 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:9914: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:9920: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:9939: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+echo "$as_me:9949: checking for term.h" >&5
+echo $ECHO_N "checking for term.h... $ECHO_C" >&6
+if test "${cf_cv_term_header+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
+# for <term.h> if we do not find the variant.
+for cf_header in \
+ `echo ${cf_cv_ncurses_header-curses.h} | sed -e 's%/.*%/%'`term.h \
+ term.h
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line 9962 "configure"
+#include "confdefs.h"
+
+#include <${cf_cv_ncurses_header-curses.h}>
+#include <${cf_header}>
+int
+main ()
+{
+WINDOW *x
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:9976: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:9979: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:9982: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:9985: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_term_header=$cf_header
+ break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_term_header=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:9998: result: $cf_cv_term_header" >&5
+echo "${ECHO_T}$cf_cv_term_header" >&6
+
+case $cf_cv_term_header in #(vi
+term.h) #(vi
+ cat >>confdefs.h <<\EOF
+#define HAVE_TERM_H 1
+EOF
+
+ ;;
+ncurses/term.h)
+ cat >>confdefs.h <<\EOF
+#define HAVE_NCURSES_TERM_H 1
+EOF
+
+ ;;
+ncursesw/term.h)
+ cat >>confdefs.h <<\EOF
+#define HAVE_NCURSESW_TERM_H 1
+EOF
+
+ ;;
+esac
+
+echo "$as_me:10022: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+if test "${ac_cv_type_signal+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10028 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+# undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int
+main ()
+{
+int i;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10050: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:10053: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:10056: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10059: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_signal=void
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_type_signal=int
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:10069: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
+
+cat >>confdefs.h <<EOF
+#define RETSIGTYPE $ac_cv_type_signal
+EOF
+
+for ac_func in \
+_nc_free_and_exit \
+strcasecmp \
+tsearch \
+waitpid \
+
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:10084: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10090 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f = $ac_func;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10121: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:10124: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:10127: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10130: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10140: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+echo "$as_me:10150: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
+echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
+if test "${cf_cv_need_xopen_extension+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 10157 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+
+ long x = winnstr(stdscr, "", 0);
+ int x1, y1;
+ getbegyx(stdscr, y1, x1)
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10174: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:10177: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:10180: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10183: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_need_xopen_extension=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+#line 10190 "configure"
+#include "confdefs.h"
+
+#define _XOPEN_SOURCE_EXTENDED
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+
+ long x = winnstr(stdscr, "", 0);
+ int x1, y1;
+ getbegyx(stdscr, y1, x1)
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10208: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:10211: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:10214: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10217: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_need_xopen_extension=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_need_xopen_extension=unknown
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10229: result: $cf_cv_need_xopen_extension" >&5
+echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
+test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
+
+for cf_func in \
+flushinp \
+getbegx \
+getbegy \
+getbegyx \
+getcurx \
+getcury \
+getmaxx \
+getmaxy \
+getmaxyx \
+getparx \
+getpary \
+getparyx \
+use_default_colors \
+wget_wch \
+
+do
+
+cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+ echo "$as_me:10253: checking for ${cf_func}" >&5
+echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
+
+echo "(line 10256) testing ${cf_func} ..." 1>&5
+
+ if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ eval cf_result='$ac_cv_func_'$cf_func
+ if test ".$cf_result" != ".no"; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10265 "configure"
+#include "confdefs.h"
+
+#ifdef HAVE_XCURSES
+#include <xcurses.h>
+char * XCursesProgramName = "test";
+#else
+#include <${cf_cv_ncurses_header-curses.h}>
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#else
+#if defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#else
+#ifdef HAVE_TERM_H
+#include <term.h>
+#endif
+#endif
+#endif
+#endif
+int
+main ()
+{
+
+#ifndef ${cf_func}
+long foo = (long)(&${cf_func});
+${cf_cv_main_return-return}(foo == 0);
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10299: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:10302: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:10305: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10308: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_result=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_result=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ fi
+ eval 'cf_cv_func_'$cf_func'=$cf_result'
+
+fi
+
+ # use the computed/retrieved cache-value:
+ eval 'cf_result=$cf_cv_func_'$cf_func
+ echo "$as_me:10324: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+ if test $cf_result != no; then
+ cat >>confdefs.h <<EOF
+#define HAVE_${cf_tr_func} 1
+EOF
+
+ fi
+done
+
+echo "$as_me:10334: checking for start_color" >&5
+echo $ECHO_N "checking for start_color... $ECHO_C" >&6
+if test "${ac_cv_func_start_color+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10340 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char start_color (); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char start_color ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_start_color) || defined (__stub___start_color)
+choke me
+#else
+f = start_color;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10371: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:10374: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:10377: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10380: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_start_color=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_start_color=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:10390: result: $ac_cv_func_start_color" >&5
+echo "${ECHO_T}$ac_cv_func_start_color" >&6
+if test $ac_cv_func_start_color = yes; then
+ cat >>confdefs.h <<\EOF
+#define HAVE_COLOR 1
+EOF
+
+fi
+
+echo "$as_me:10399: checking for chtype typedef" >&5
+echo $ECHO_N "checking for chtype typedef... $ECHO_C" >&6
+if test "${cf_cv_chtype_decl+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10406 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+chtype foo
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10418: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:10421: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:10424: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10427: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_chtype_decl=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_chtype_decl=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:10437: result: $cf_cv_chtype_decl" >&5
+echo "${ECHO_T}$cf_cv_chtype_decl" >&6
+if test $cf_cv_chtype_decl = yes ; then
+ cat >>confdefs.h <<\EOF
+#define HAVE_TYPE_CHTYPE 1
+EOF
+
+ echo "$as_me:10444: checking if chtype is scalar or struct" >&5
+echo $ECHO_N "checking if chtype is scalar or struct... $ECHO_C" >&6
+if test "${cf_cv_chtype_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10451 "configure"
+#include "confdefs.h"
+#include <${cf_cv_ncurses_header-curses.h}>
+int
+main ()
+{
+chtype foo; long x = foo
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10463: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:10466: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:10469: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10472: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_chtype_type=scalar
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_chtype_type=struct
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:10482: result: $cf_cv_chtype_type" >&5
+echo "${ECHO_T}$cf_cv_chtype_type" >&6
+ if test $cf_cv_chtype_type = scalar ; then
+ cat >>confdefs.h <<\EOF
+#define TYPE_CHTYPE_IS_SCALAR 1
+EOF
+
+ fi
+fi
+
+for ac_header in sys/wait.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:10495: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10501 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:10505: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:10511: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:10530: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+cf_wait_headers="#include <sys/types.h>
+"
+if test $ac_cv_header_sys_wait_h = yes; then
+cf_wait_headers="$cf_wait_headers
+#include <sys/wait.h>
+"
+else
+
+for ac_header in wait.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:10551: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10557 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:10561: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:10567: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:10586: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+for ac_header in waitstatus.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:10599: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10605 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:10609: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ egrep -v '^ *\+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:10615: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:10634: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+if test $ac_cv_header_wait_h = yes; then
+cf_wait_headers="$cf_wait_headers
+#include <wait.h>
+"
+fi
+if test $ac_cv_header_waitstatus_h = yes; then
+cf_wait_headers="$cf_wait_headers
+#include <waitstatus.h>
+"
+fi
+fi
+
+echo "$as_me:10656: checking for union wait" >&5
+echo $ECHO_N "checking for union wait... $ECHO_C" >&6
+if test "${cf_cv_type_unionwait+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10663 "configure"
+#include "confdefs.h"
+$cf_wait_headers
+int
+main ()
+{
+int x;
+ int y = WEXITSTATUS(x);
+ int z = WTERMSIG(x);
+ wait(&x);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10679: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:10682: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:10685: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10688: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_type_unionwait=no
+ echo compiles ok w/o union wait 1>&5
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10698 "configure"
+#include "confdefs.h"
+$cf_wait_headers
+int
+main ()
+{
+union wait x;
+#ifdef WEXITSTATUS
+ int y = WEXITSTATUS(x);
+#endif
+#ifdef WTERMSIG
+ int z = WTERMSIG(x);
+#endif
+ wait(&x);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10718: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:10721: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:10724: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10727: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_type_unionwait=yes
+ echo compiles ok with union wait and possibly macros too 1>&5
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_type_unionwait=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+
+echo "$as_me:10742: result: $cf_cv_type_unionwait" >&5
+echo "${ECHO_T}$cf_cv_type_unionwait" >&6
+test $cf_cv_type_unionwait = yes && cat >>confdefs.h <<\EOF
+#define HAVE_TYPE_UNIONWAIT 1
+EOF
+
+if test $cf_cv_type_unionwait = yes; then
+
+ echo "$as_me:10750: checking if union wait can be used as wait-arg" >&5
+echo $ECHO_N "checking if union wait can be used as wait-arg... $ECHO_C" >&6
+ if test "${cf_cv_arg_union_wait+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10757 "configure"
+#include "confdefs.h"
+$cf_wait_headers
+int
+main ()
+{
+union wait x; wait(&x)
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10769: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:10772: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:10775: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10778: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_arg_union_wait=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_arg_union_wait=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ echo "$as_me:10790: result: $cf_cv_arg_union_wait" >&5
+echo "${ECHO_T}$cf_cv_arg_union_wait" >&6
+ test $cf_cv_arg_union_wait = yes && cat >>confdefs.h <<\EOF
+#define WAIT_USES_UNION 1
+EOF
+
+ echo "$as_me:10796: checking if union wait can be used as waitpid-arg" >&5
+echo $ECHO_N "checking if union wait can be used as waitpid-arg... $ECHO_C" >&6
+ if test "${cf_cv_arg_union_waitpid+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line 10803 "configure"
+#include "confdefs.h"
+$cf_wait_headers
+int
+main ()
+{
+union wait x; waitpid(0, &x, 0)
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10815: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:10818: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:10821: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10824: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_arg_union_waitpid=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_arg_union_waitpid=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+ echo "$as_me:10836: result: $cf_cv_arg_union_waitpid" >&5
+echo "${ECHO_T}$cf_cv_arg_union_waitpid" >&6
+ test $cf_cv_arg_union_waitpid = yes && cat >>confdefs.h <<\EOF
+#define WAITPID_USES_UNION 1
+EOF
+
+fi
+
+echo "$as_me:10844: checking if we must include wchar.h to declare mbstate_t" >&5
+echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
+if test "${cf_cv_mbstate_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 10851 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
+int
+main ()
+{
+mbstate_t state
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10868: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:10871: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:10874: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10877: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_mbstate_t=no
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cat >conftest.$ac_ext <<_ACEOF
+#line 10884 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <wchar.h>
+#ifdef HAVE_LIBUTF8_H
+#include <libutf8.h>
+#endif
+int
+main ()
+{
+mbstate_t value
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:10902: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:10905: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:10908: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10911: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cf_cv_mbstate_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_mbstate_t=unknown
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:10923: result: $cf_cv_mbstate_t" >&5
+echo "${ECHO_T}$cf_cv_mbstate_t" >&6
+
+if test "$cf_cv_mbstate_t" = yes ; then
+ cat >>confdefs.h <<\EOF
+#define NEED_WCHAR_H 1
+EOF
+
+fi
+
+if test "$cf_cv_mbstate_t" != unknown ; then
+ cat >>confdefs.h <<\EOF
+#define HAVE_MBSTATE_T 1
+EOF
+
+fi
+
+PACKAGE_PREFIX=DLG
+PACKAGE_CONFIG=dlg_config.h
+
+EXTRA_OUTPUT="$EXTRA_OUTPUT headers-sh:$srcdir/headers-sh.in"
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 10946 "configure"
+#include "confdefs.h"
+#include <locale.h>
+int
+main ()
+{
+setlocale(LC_ALL, "")
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:10958: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:10961: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:10964: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:10967: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cat >>confdefs.h <<\EOF
+#define HAVE_SETLOCALE 1
+EOF
+
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+ac_config_files="$ac_config_files dialog-config makefile $EXTRA_OUTPUT $SUB_MAKEFILE samples/install/makefile"
+ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overriden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if cmp -s $cache_file confcache; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:11060: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+ac_cs_invocation="\$0 \$@"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Name of the executable.
+as_me=`echo "$0" |sed 's,.*[\\/],,'`
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p="test -f"
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+# NLS nuisances.
+$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
+$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
+$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
+$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
+$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
+$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
+$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
+$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
+
+exec 6>&1
+
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\EOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.52.20061216,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ shift
+ set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
+ shift
+ ;;
+ -*);;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_need_defaults=false;;
+ esac
+
+ case $1 in
+ # Handling of the options.
+EOF
+cat >>$CONFIG_STATUS <<EOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
+ exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:11236: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ shift
+ CONFIG_FILES="$CONFIG_FILES $1"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $1"
+ ac_need_defaults=false;;
+
+ # This is an error.
+ -*) { { echo "$as_me:11255: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+exec 5>>config.log
+cat >&5 << _ACEOF
+
+## ----------------------- ##
+## Running config.status. ##
+## ----------------------- ##
+
+This file was extended by $as_me 2.52.20061216, executed with
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ > $ac_cs_invocation
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+
+_ACEOF
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+#
+# INIT-COMMANDS section.
+#
+
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "dialog-config" ) CONFIG_FILES="$CONFIG_FILES dialog-config" ;;
+ "makefile" ) CONFIG_FILES="$CONFIG_FILES makefile" ;;
+ "$EXTRA_OUTPUT" ) CONFIG_FILES="$CONFIG_FILES $EXTRA_OUTPUT" ;;
+ "$SUB_MAKEFILE" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILE" ;;
+ "samples/install/makefile" ) CONFIG_FILES="$CONFIG_FILES samples/install/makefile" ;;
+ "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+ "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ "dlg_config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS dlg_config.h:config.hin" ;;
+ *) { { echo "$as_me:11305: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=/tmp}
+{
+ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=$TMPDIR/cs$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+ { (exit 1); exit 1; }
+}
+
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@DEFS@,$DEFS,;t t
+s,@LIBS@,$LIBS,;t t
+s,@VERSION@,$VERSION,;t t
+s,@VERSION_MAJOR@,$VERSION_MAJOR,;t t
+s,@VERSION_MINOR@,$VERSION_MINOR,;t t
+s,@VERSION_PATCH@,$VERSION_PATCH,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@DESTDIR@,$DESTDIR,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@CPP@,$CPP,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
+s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
+s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
+s,@ECHO_LT@,$ECHO_LT,;t t
+s,@ECHO_LD@,$ECHO_LD,;t t
+s,@RULE_CC@,$RULE_CC,;t t
+s,@SHOW_CC@,$SHOW_CC,;t t
+s,@ECHO_CC@,$ECHO_CC,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@PROG_EXT@,$PROG_EXT,;t t
+s,@LIB_PREFIX@,$LIB_PREFIX,;t t
+s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
+s,@CONFIG_H@,$CONFIG_H,;t t
+s,@ALLOCA@,$ALLOCA,;t t
+s,@GLIBC21@,$GLIBC21,;t t
+s,@LIBICONV@,$LIBICONV,;t t
+s,@USE_NLS@,$USE_NLS,;t t
+s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
+s,@PATHSEP@,$PATHSEP,;t t
+s,@MSGFMT@,$MSGFMT,;t t
+s,@GMSGFMT@,$GMSGFMT,;t t
+s,@XGETTEXT@,$XGETTEXT,;t t
+s,@INTLBISON@,$INTLBISON,;t t
+s,@BUILD_INCLUDED_LIBINTL@,$BUILD_INCLUDED_LIBINTL,;t t
+s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t
+s,@CATALOGS@,$CATALOGS,;t t
+s,@CATOBJEXT@,$CATOBJEXT,;t t
+s,@GMOFILES@,$GMOFILES,;t t
+s,@INTLLIBS@,$INTLLIBS,;t t
+s,@INTLOBJS@,$INTLOBJS,;t t
+s,@POFILES@,$POFILES,;t t
+s,@POSUB@,$POSUB,;t t
+s,@DATADIRNAME@,$DATADIRNAME,;t t
+s,@INSTOBJEXT@,$INSTOBJEXT,;t t
+s,@GENCAT@,$GENCAT,;t t
+s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t
+s,@INTL_LIBTOOL_SUFFIX_PREFIX@,$INTL_LIBTOOL_SUFFIX_PREFIX,;t t
+s,@MSG_DIR_MAKE@,$MSG_DIR_MAKE,;t t
+s,@SUB_MAKEFILE@,$SUB_MAKEFILE,;t t
+s,@INTLDIR_MAKE@,$INTLDIR_MAKE,;t t
+s,@GT_YES@,$GT_YES,;t t
+s,@GT_NO@,$GT_NO,;t t
+s,@LINK_PREFIX@,$LINK_PREFIX,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@LIBTOOL_CXX@,$LIBTOOL_CXX,;t t
+s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
+s,@LIB_CREATE@,$LIB_CREATE,;t t
+s,@LIB_OBJECT@,$LIB_OBJECT,;t t
+s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
+s,@LIB_PREP@,$LIB_PREP,;t t
+s,@LIB_CLEAN@,$LIB_CLEAN,;t t
+s,@LIB_COMPILE@,$LIB_COMPILE,;t t
+s,@LIB_LINK@,$LIB_LINK,;t t
+s,@LIB_INSTALL@,$LIB_INSTALL,;t t
+s,@LIB_UNINSTALL@,$LIB_UNINSTALL,;t t
+s,@LIBTOOL_MAKE@,$LIBTOOL_MAKE,;t t
+s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
+s,@EXTRAOBJS@,$EXTRAOBJS,;t t
+s,@PACKAGE_PREFIX@,$PACKAGE_PREFIX,;t t
+s,@PACKAGE_CONFIG@,$PACKAGE_CONFIG,;t t
+CEOF
+
+EOF
+
+ cat >>$CONFIG_STATUS <<\EOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ { case "$ac_dir" in
+ [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+ *) as_incr_dir=.;;
+esac
+as_dummy="$ac_dir"
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+ case $as_mkdir_dir in
+ # Skip DOS drivespec
+ ?:) as_incr_dir=$as_mkdir_dir ;;
+ *)
+ as_incr_dir=$as_incr_dir/$as_mkdir_dir
+ test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+ ;;
+ esac
+done; }
+
+ ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case $srcdir in
+ .) ac_srcdir=.
+ if test -z "$ac_dots"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* )
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_dots$srcdir ;;
+ esac
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_dots$INSTALL ;;
+ esac
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:11590: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated automatically by config.status. */
+ configure_input="Generated automatically from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:11608: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:11621: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+EOF
+cat >>$CONFIG_STATUS <<EOF
+ sed "$ac_vpsub
+$extrasub
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_iB='\([ ]\),\1#\2define\3'
+ac_iC=' '
+ac_iD='\4,;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ test x"$ac_file" != x- && { echo "$as_me:11687: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:11698: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:11711: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+EOF
+
+# Transform confdefs.h into a list of #define's. We won't use it as a sed
+# script, but as data to insert where we see @DEFS@. We expect AC_SAVE_DEFS to
+# be either 'cat' or 'sort'.
+sort -u confdefs.h | uniq >conftest.vals
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+echo ' rm -f conftest.frag' >> $CONFIG_STATUS
+while grep . conftest.vals >/dev/null
+do
+ # Write chunks of a limited-size here document to conftest.frag.
+ echo ' cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
+ echo 'CEOF' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+# Run sed to substitute the contents of conftest.frag into $tmp/in at the
+# marker @DEFS@.
+echo ' cat >> conftest.edit <<CEOF
+/@DEFS@/r conftest.frag
+/@DEFS@/d
+CEOF
+sed -f conftest.edit $tmp/in > $tmp/out
+rm -f $tmp/in
+mv $tmp/out $tmp/in
+rm -f conftest.edit conftest.frag
+' >> $CONFIG_STATUS
+
+cat >>$CONFIG_STATUS <<\EOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated automatically by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated automatically by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
+ { echo "$as_me:11769: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ { case "$ac_dir" in
+ [\\/]* | ?:[\\/]* ) as_incr_dir=;;
+ *) as_incr_dir=.;;
+esac
+as_dummy="$ac_dir"
+for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
+ case $as_mkdir_dir in
+ # Skip DOS drivespec
+ ?:) as_incr_dir=$as_mkdir_dir ;;
+ *)
+ as_incr_dir=$as_incr_dir/$as_mkdir_dir
+ test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+ ;;
+ esac
+done; }
+
+ fi
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+done
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+
+ case $ac_dest in
+ default-1 ) for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.inn.
+ case "$ac_file" in */[Mm]akefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ ac_base=`basename $ac_file .in`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/$ac_base" || echo "creating $ac_dir/$ac_base"
+ sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/$ac_base.in" > "$ac_dir/$ac_base"
+ fi
+ ;;
+ esac
+ done ;;
+ esac
+done
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+
+{ (exit 0); exit 0; }
+EOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/configure.in b/Build/source/utils/dialog/dialog-1.1-20080819/configure.in
new file mode 100644
index 00000000000..ca25541d5c9
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/configure.in
@@ -0,0 +1,183 @@
+dnl $Id: configure.in,v 1.53 2008/03/16 18:46:34 tom Exp $
+dnl Process this file with autoconf to produce a configure script.
+dnl
+AC_PREREQ(2.13.20020210)
+AC_INIT(dialog.h)
+AC_CONFIG_HEADER(dlg_config.h:config.hin)
+
+CF_VERSION_INFO(dialog)
+AC_ARG_PROGRAM
+
+DESTDIR=
+AC_SUBST(DESTDIR)
+
+dnl
+dnl Checks for programs.
+dnl
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_GCC_TRADITIONAL
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
+AC_PROG_INSTALL
+
+dnl needed for CF_WITH_LIBTOOL
+AC_CHECK_TOOL(AR, ar, ar)
+
+AC_ISC_POSIX
+AC_C_CONST
+
+CF_MAKEFLAGS
+CF_MAKE_TAGS
+CF_DISABLE_ECHO
+CF_PROG_EXT
+CF_LIB_PREFIX
+CF_XOPEN_SOURCE
+CF_LARGEFILE
+
+CF_WITH_WARNINGS
+
+dnl
+dnl Checks for libraries.
+dnl
+EXTRAOBJS=""
+CF_BUNDLED_INTL(makefile,enable)
+CF_MATH_LIB(,sqrt(x))
+
+CF_WITH_NO_LEAKS
+
+CF_ARG_MSG_ENABLE([if you want --trace option],
+ trace,
+ [ --disable-trace do not support --trace option],
+ [EXTRAOBJS="$EXTRAOBJS trace\$o"
+ AC_DEFINE(HAVE_DLG_TRACE)],,yes)
+
+LIBTOOL_MAKE="#"
+CF_WITH_LIBTOOL
+if test "$with_libtool" = "yes" ; then
+ OBJEXT="lo"
+ LIBTOOL_MAKE=
+ CF_WITH_LIBTOOL_OPTS
+fi
+AC_SUBST(LIBTOOL_MAKE)
+
+use_ncurses=no
+AC_ARG_WITH(ncurses,
+ [ --with-ncurses compile/link with ncurses library],
+ [use_ncurses=ncurses])
+AC_ARG_WITH(ncursesw,
+ [ --with-ncursesw compile/link with wide-char ncurses library],
+ [use_ncurses=ncursesw])
+if test $use_ncurses != no ; then
+ cf_wide_curses=yes
+ if test $use_ncurses = ncursesw ; then
+ CF_UTF8_LIB
+ fi
+ CF_NCURSES_CONFIG($use_ncurses)
+else
+ cf_wide_curses=no
+ CF_CURSES_CONFIG
+fi
+
+cf_all_widgets=yes
+CF_ARG_MSG_ENABLE([if you want extra dialogs],
+ extras,
+ [ --disable-extras do not include extra dialogs],
+ [cf_all_widgets=yes],[cf_all_widgets=no],yes)
+
+CF_ARG_MSG_ENABLE([if you want config-file support],
+ rc-file,
+ [ --disable-rc-file do not include config-file support],
+ [EXTRAOBJS="$EXTRAOBJS rc\$o"
+ AC_DEFINE(HAVE_RC_FILE)],,$cf_all_widgets)
+
+CF_ARG_MSG_ENABLE([if you want Xdialog-style dialogs],
+ Xdialog,
+ [ --disable-Xdialog do not include Xdialog-style dialogs],
+ [EXTRAOBJS="$EXTRAOBJS calendar\$o fselect\$o timebox\$o"
+ AC_DEFINE(HAVE_XDIALOG)],,$cf_all_widgets)
+
+CF_ARG_MSG_ENABLE([if you want the form dialog],
+ form,
+ [ --disable-form do not include the form dialog],
+ [EXTRAOBJS="$EXTRAOBJS formbox\$o"
+ AC_DEFINE(HAVE_DLG_FORMBOX)],,$cf_all_widgets)
+
+CF_ARG_MSG_ENABLE([if you want the gauge dialog],
+ gauge,
+ [ --disable-gauge do not include the gauge dialogs],
+ [EXTRAOBJS="$EXTRAOBJS guage\$o pause\$o progressbox\$o"
+ AC_DEFINE(HAVE_DLG_GAUGE)],,$cf_all_widgets)
+
+CF_ARG_MSG_ENABLE([if you want the tailbox dialog],
+ tailbox,
+ [ --disable-tailbox do not include the tailbox dialog],
+ [EXTRAOBJS="$EXTRAOBJS tailbox\$o"
+ AC_DEFINE(HAVE_DLG_TAILBOX)],,$cf_all_widgets)
+
+CF_ARG_MSG_ENABLE([if you want the mixedform dialog],
+ mixedform,
+ [ --disable-mixedform do not include the mixedform dialog],
+ [EXTRAOBJS="$EXTRAOBJS mixedform\$o"
+ AC_DEFINE(HAVE_DLG_MIXEDFORM)],,$cf_all_widgets)
+
+CF_ARG_MSG_ENABLE([if you want the mixedgauge dialog],
+ mixedgauge,
+ [ --disable-mixedgauge do not include the mixedgauge dialog],
+ [EXTRAOBJS="$EXTRAOBJS mixedgauge\$o"
+ AC_DEFINE(HAVE_MIXEDGAUGE)],,$cf_all_widgets)
+
+CF_ARG_MSG_ENABLE([if you want the wide-curses features],
+ widec,
+ [ --enable-widec enable wide-curses features],
+ [AC_DEFINE(USE_WIDE_CURSES)],,$cf_wide_curses)
+
+AC_SUBST(EXTRAOBJS)
+
+dnl
+dnl Checks for header files.
+dnl
+AC_HEADER_STDC
+AC_HEADER_TIME
+AC_HEADER_DIRENT
+AC_CHECK_HEADERS(search.h unistd.h)
+CF_CURSES_TERM_H
+
+dnl
+dnl Checks for library functions.
+dnl
+AC_TYPE_SIGNAL
+AC_CHECK_FUNCS(\
+_nc_free_and_exit \
+strcasecmp \
+tsearch \
+waitpid \
+)
+
+CF_CURSES_FUNCS(\
+flushinp \
+getbegx \
+getbegy \
+getbegyx \
+getcurx \
+getcury \
+getmaxx \
+getmaxy \
+getmaxyx \
+getparx \
+getpary \
+getparyx \
+use_default_colors \
+wget_wch \
+)
+
+AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR)])
+CF_CURSES_CHTYPE
+CF_FUNC_WAIT
+CF_MBSTATE_T
+
+CF_HEADERS_SH(DLG,dlg_config.h)
+
+AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE)])
+
+AC_OUTPUT(dialog-config makefile $EXTRA_OUTPUT $SUB_MAKEFILE samples/install/makefile,,,sort -u)
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/dialog-config.in b/Build/source/utils/dialog/dialog-1.1-20080819/dialog-config.in
new file mode 100644
index 00000000000..39541c6fc24
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/dialog-config.in
@@ -0,0 +1,135 @@
+#!@SHELL@
+# $Id: dialog-config.in,v 1.3 2007/02/25 19:33:58 tom Exp $
+##############################################################################
+# Copyright (c) 2007 Thomas E. Dickey #
+# #
+# 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, distribute #
+# with modifications, 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 ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
+# DEALINGS IN THE SOFTWARE. #
+# #
+# Except as contained in this notice, the name(s) of the above copyright #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written #
+# authorization. #
+##############################################################################
+
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+
+bindir="@bindir@"
+libdir="@libdir@"
+datadir="@datadir@"
+mandir="@mandir@"
+
+THIS="dialog"
+
+test $# = 0 && exec @SHELL@ $0 --error
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*)
+ ARG=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
+ ;;
+ *)
+ ARG=
+ ;;
+ esac
+
+ case "$1" in
+ # basic configuration
+ --prefix=*)
+ prefix="$ARG"
+ test -z "$exec_prefix" && exec_prefix="$ARG"
+ ;;
+ --prefix)
+ echo "$prefix"
+ ;;
+ --exec-prefix=*)
+ exec_prefix="$ARG"
+ ;;
+ --exec-prefix)
+ echo "$exec_prefix"
+ ;;
+ # compile/link
+ --cflags)
+ INCS=
+ if test "${prefix}/include" != /usr/include ; then
+ INCS="-I${prefix}/include"
+ fi
+ sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
+ $INCS
+ENDECHO
+ ;;
+ --libs)
+ sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
+ -L${exec_prefix}/lib -l${THIS} @LIBS@
+ENDECHO
+ ;;
+ # identification
+ --version)
+ echo "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@"
+ ;;
+ --abi-version)
+ echo "@VERSION@" | sed -e 's/:/./g'
+ ;;
+ # locations
+ --bindir)
+ echo "${bindir}"
+ ;;
+ --datadir)
+ echo "${datadir}"
+ ;;
+ --libdir)
+ echo "${libdir}"
+ ;;
+ --mandir)
+ echo "${mandir}"
+ ;;
+ # general info
+ --help)
+ cat <<ENDHELP
+Usage: ${THIS}-config [options]
+
+Options:
+ --prefix echos the package-prefix of ${THIS}
+ --prefix=ARG sets the package-prefix of ${THIS}
+ --exec-prefix echos the executable-prefix of ${THIS}
+ --exec-prefix=ARG sets the executable-prefix of ${THIS}
+
+ --cflags echos the C compiler flags needed to compile with ${THIS}
+ --libs echos the libraries needed to link with ${THIS}
+
+ --version echos the release+patchdate version of ${THIS}
+ --abi-version echos the ABI version of ${THIS}
+
+ --bindir echos the directory containing ${THIS} programs
+ --datadir echos the directory containing ${THIS} data
+ --libdir echos the directory containing ${THIS} libraries
+ --mandir echos the directory containing ${THIS} manpages
+
+ --help prints this message
+ENDHELP
+ ;;
+ --error|*)
+ @SHELL@ $0 --help 1>&2
+ exit 1
+ ;;
+ esac
+ shift
+done
+# vile:shmode
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/dialog.1 b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.1
new file mode 100644
index 00000000000..c99e4fbd8ce
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.1
@@ -0,0 +1,1247 @@
+'\" t
+.\" $Id: dialog.1,v 1.115 2008/07/27 22:49:40 tom Exp $
+.\" Copyright 2005-2007,2008 Thomas E. Dickey
+.\"
+.\" This program is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU Lesser General Public License, version 2.1
+.\" as published by the Free Software Foundation.
+.\"
+.\" This program is distributed in the hope that it will be useful, but
+.\" WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+.\" Lesser General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Lesser General Public
+.\" License along with this program; if not, write to
+.\" Free Software Foundation, Inc.
+.\" 51 Franklin St., Fifth Floor
+.\" Boston, MA 02110, USA.
+.de ES
+.ne 8
+.IP
+..
+.de EX
+.RS +10
+.nf
+..
+.de EE
+.fi
+.RE
+..
+.
+.TH DIALOG 1 "" "$Date: 2008/07/27 22:49:40 $"
+.SH NAME
+dialog \- display dialog boxes from shell scripts
+.SH SYNOPSIS
+\fBdialog --clear\fP
+.br
+.BI "dialog --create-rc " file
+.br
+\fBdialog --print-maxsize\fP
+.br
+\fBdialog\fP
+\fIcommon-options\fP
+\fIbox-options\fP
+.SH DESCRIPTION
+\fBDialog\fP
+is a program that will let you to present a variety of questions or
+display messages using dialog boxes from a shell script.
+These types of dialog boxes are implemented
+(though not all are necessarily compiled into \fBdialog\fR):
+.RS
+.LP
+.nh
+.na
+.BR calendar ", "
+.BR checklist ", "
+.BR dselect ", "
+.BR editbox ", "
+.BR form ", "
+.BR fselect ", "
+.BR gauge ", "
+.BR infobox ", "
+.BR inputbox ", "
+.BR inputmenu ", "
+.BR menu ", "
+.BR mixedform ", "
+.BR mixedgauge ", "
+.BR msgbox " (message), "
+.BR passwordbox ", "
+.BR passwordform ", "
+.BR pause ", "
+.BR progressbox ", "
+.BR radiolist ", "
+.BR tailbox ", "
+.BR tailboxbg ", "
+.BR textbox ", "
+.BR timebox ", and "
+.BR yesno " (yes/no)."
+.ad
+.hy
+.RE
+.PP
+You can put more than one dialog box into a script:
+.TP 5
+-
+Use the "\fB--and-widget\fP" token to force Dialog to proceed to the next
+dialog unless you have pressed ESC to cancel, or
+.TP 5
+-
+Simply add the tokens for the next dialog box, making a chain.
+Dialog stops chaining when the return code from a dialog is nonzero,
+e.g., Cancel or No (see DIAGNOSTICS).
+.PP
+Some widgets, e.g., checklist, will write text to \fBdialog\fP's output.
+Normally that is the standard error, but there are options for
+changing this: "\fB--output-fd\fP", "\fB--stderr\fP" and "\fB--stdout\fP".
+No text is written if the Cancel button (or ESC) is pressed;
+\fBdialog\fP exits immediately in that case.
+.
+.\" ************************************************************************
+.SH OPTIONS
+All options begin with "\fB--\fP"
+(two ASCII hyphens,
+for the benefit of those using systems with deranged locale support).
+.PP
+A "\fB--\fP" by itself is used as an escape,
+i.e., the next token on the command-line is not treated as an option.
+.RS
+.B dialog --title -- --Not an option
+.RE
+.PP
+The "\fB--args\fP" option tells \fBdialog\fP to list the command-line
+parameters to the standard error.
+This is useful when debugging complex scripts using
+the "\fB--\fP" and "\fB--file\fP",
+since the command-line may be rewritten as these are expanded.
+.PP
+The "\fB--file\fP" option tells \fBdialog\fP to read parameters from
+the file named as its value.
+.RS
+.B dialog --file \fIparameterfile
+.RE
+Blanks not within double-quotes are discarded
+(use backslashes to quote single characters).
+The result is inserted into the command-line,
+replacing "\fB--file\fP" and its option value.
+Interpretation of the command-line resumes from that point.
+If \fIparameterfile\fP begins with "&", \fBdialog\fP
+interprets the following text as a file descriptor number
+rather than a filename.
+.
+.SS \fBCommon Options\fP
+.
+.IP "\fB--ascii-lines
+Rather than draw graphics lines around boxes,
+draw ASCII "+" and "-" in the same place.
+See also "\fB--no-lines\fR".
+.
+.IP "\fB--aspect \fIratio"
+This gives you some control over the box dimensions when using auto
+sizing (specifying 0 for height and width).
+It represents width / height.
+The default is 9, which means 9 characters wide to every 1 line high.
+.
+.IP "\fB--backtitle \fIbacktitle"
+Specifies a
+\fIbacktitle\fP
+string to be displayed on the backdrop, at the top of the screen.
+.
+.IP "\fB--begin \fIy x"
+Specify the position of the upper left corner of a dialog box on the screen.
+.
+.IP "\fB--cancel-label \fIstring"
+Override the label used for "Cancel" buttons.
+.
+.IP "\fB--clear"
+Clears the widget screen, keeping only the screen_color background.
+Use this when you combine widgets with "\fB--and-widget\fR" to erase the
+contents of a previous widget on the screen, so it won't be seen
+under the contents of a following widget.
+Understand this as the complement of "\fB--keep-window\fR".
+To compare the effects, use these:
+.
+.ES
+All three widgets visible, staircase effect, ordered 1,2,3:
+.EX
+dialog --begin 2 2 --yesno "" 0 0 \\
+ --and-widget --begin 4 4 --yesno "" 0 0 \\
+ --and-widget --begin 6 6 --yesno "" 0 0
+.EE
+.
+.ES
+Only the last widget is left visible:
+.EX
+dialog --clear --begin 2 2 --yesno "" 0 0 \\
+ --and-widget --clear --begin 4 4 --yesno "" 0 0 \\
+ --and-widget --begin 6 6 --yesno "" 0 0
+.EE
+.
+.ES
+All three widgets visible, staircase effect, ordered 3,2,1:
+.EX
+dialog --keep-window --begin 2 2 --yesno "" 0 0 \\
+ --and-widget --keep-window --begin 4 4 --yesno "" 0 0 \\
+ --and-widget --begin 6 6 --yesno "" 0 0
+.EE
+.
+.ES
+First and third widget visible, staircase effect, ordered 3,1:
+.EX
+dialog --keep-window --begin 2 2 --yesno "" 0 0 \\
+ --and-widget --clear --begin 4 4 --yesno "" 0 0 \\
+ --and-widget --begin 6 6 --yesno "" 0 0
+.EE
+.IP
+Note, if you want to restore original console colors and send your
+cursor home after the dialog program has exited, use the \fBclear\fR\ (1)
+command.
+.
+.IP "\fB--colors"
+Interpret embedded "\\Z" sequences in the dialog text
+by the following character,
+which tells \fBdialog\fP to set colors or video attributes:
+0 through 7 are the ANSI used in curses:
+black,
+red,
+green,
+yellow,
+blue,
+magenta,
+cyan and
+white respectively.
+Bold is set by 'b', reset by 'B'.
+Reverse is set by 'r', reset by 'R'.
+Underline is set by 'u', reset by 'U'.
+The settings are cumulative, e.g., "\\Zb\\Z1" makes the following text
+bold (perhaps bright) red.
+Restore normal settings with "\\Zn".
+.
+.IP "\fB--column-separator \fIstring"
+Tell \fBdialog\fP to split data for radio/checkboxes and menus on the
+occurrences of the given string, and to align the split data into columns.
+.
+.IP "\fB--cr-wrap"
+Interpret embedded newlines in the dialog text as a newline on the screen.
+Otherwise, \fBdialog\fR will only wrap lines where needed to fit inside the text box.
+Even though you can control line breaks with this,
+\fBdialog\fR will still wrap any lines that are too long for the width of the box.
+Without cr-wrap, the layout of your text may be formatted to look nice
+in the source code of your script without affecting the way it will
+look in the dialog.
+.IP
+See also the "\fB--no-collapse\fP" and "\fB--trim\fP" options.
+.
+.IP "\fB--create-rc \fIfile"
+When
+\fBdialog\fP
+supports run-time configuration,
+this can be used to dump a sample configuration file to the file specified
+by
+.IR file "."
+.
+.IP "\fB--defaultno"
+Make the default value of the
+\fByes/no\fP
+box a
+.BR No .
+Likewise, make the default button of widgets that provide "OK" and "Cancel"
+a \fBCancel\fP.
+If "\fB--nocancel\fP" or "\fB--visit-items\fP" are given
+those options overrides this,
+making the default button always "Yes" (internally the same as "OK").
+.
+.IP "\fB--default-item \fIstring"
+Set the default item in a checklist, form or menu box.
+Normally the first item in the box is the default.
+.
+.IP "\fB--exit-label \fIstring"
+Override the label used for "EXIT" buttons.
+.
+.IP "\fB--extra-button"
+Show an extra button, between "OK" and "Cancel" buttons.
+.
+.IP "\fB--extra-label \fIstring"
+Override the label used for "Extra" buttons.
+Note: for inputmenu widgets, this defaults to "Rename".
+.
+.IP "\fB--help"
+Prints the help message to \fBdialog\fP's output.
+The help message is printed if no options are given.
+.
+.IP "\fB--help-button"
+Show a help-button after "OK" and "Cancel" buttons,
+i.e., in checklist, radiolist and menu boxes.
+If "\fB--item-help\fR" is also given, on exit
+the return status will be the same as for the "OK" button,
+and the item-help text will be written to \fBdialog\fP's output after the token "HELP".
+Otherwise, the return status will indicate that the Help button was pressed,
+and no message printed.
+.
+.IP "\fB--help-label \fIstring"
+Override the label used for "Help" buttons.
+.
+.IP "\fB--help-status"
+If the help-button is selected,
+writes the checklist, radiolist or form information
+after the item-help "HELP" information.
+This can be used to reconstruct the state of a checklist after processing
+the help request.
+.
+.IP "\fB--ignore"
+Ignore options that \fBdialog\fP does not recognize.
+Some well-known ones such as "\fB--icon\fP" are ignored anyway,
+but this is a better choice for compatibility with other implementations.
+.
+.IP "\fB--input-fd \fIfd"
+Read keyboard input from the given file descriptor.
+Most \fBdialog\fR scripts read from the standard input,
+but the gauge widget reads a pipe (which is always standard input).
+Some configurations do not work properly when
+\fBdialog\fP tries to reopen the terminal.
+Use this option (with appropriate juggling of file-descriptors)
+if your script must work in that type of environment.
+.
+.IP "\fB--insecure"
+Makes the password widget friendlier but less secure,
+by echoing asterisks for each character.
+.
+.IP "\fB--item-help"
+Interpret the tags data for checklist, radiolist and menu boxes
+adding a column which is displayed in the bottom line of the
+screen, for the currently selected item.
+.
+.IP "\fB--keep-tite"
+Normally \fBdialog\fP checks to see if it is running in an \fBxterm\fP,
+and in that case tries to suppress the initialization strings that
+would make it switch to the alternate screen.
+Switching between the normal and alternate screens
+is visually distracting in a script which runs \fBdialog\fP
+several times.
+Use this option to allow \fBdialog\fP to use those initialization strings.
+.
+.IP "\fB--keep-window"
+Normally when \fBdialog\fR performs several \fBtailboxbg\fR widgets
+connected by "\fB--and-widget\fR",
+it clears the old widget from the screen by painting over it.
+Use this option to suppress that repainting.
+.IP
+At exit, \fBdialog\fR repaints all of the widgets which have been
+marked with "\fB--keep-window\fR", even if they are not \fBtailboxbg\fR widgets.
+That causes them to be repainted in reverse order.
+See the discussion of the "\fB--clear\fR" option for examples.
+.
+.IP "\fB--max-input \fIsize"
+Limit input strings to the given size.
+If not specified, the limit is 2048.
+.
+.IP "\fB--no-cancel"
+.IP "\fB--nocancel"
+Suppress the "Cancel" button in checklist, inputbox and menu box modes.
+A script can still test if the user pressed the ESC key to cancel to quit.
+.
+.IP "\fB--no-collapse"
+Normally \fBdialog\fR converts tabs to spaces and reduces multiple
+spaces to a single space for text which is displayed in a message boxes, etc.
+Use this option to disable that feature.
+Note that \fBdialog\fR will still wrap text,
+subject to the "\fB--cr-wrap\fR" and "\fB--trim\fR" options.
+.
+.IP "\fB--no-kill"
+Tells
+\fBdialog\fP
+to put the
+\fBtailboxbg\fP
+box in the background,
+printing its process id to \fBdialog\fP's output.
+SIGHUP is disabled for the background process.
+.
+.IP "\fB--no-label \fIstring"
+Override the label used for "No" buttons.
+.
+.IP "\fB--no-lines
+Rather than draw lines around boxes, draw spaces in the same place.
+See also "\fB--ascii-lines\fR".
+.
+.IP "\fB--no-ok"
+.IP "\fB--nook"
+Suppress the "OK" button in checklist, inputbox and menu box modes.
+A script can still test if the user pressed the "Enter" key to accept the data.
+.
+.
+.IP "\fB--no-shadow"
+Suppress shadows that would be drawn to the right and bottom of each dialog box.
+.
+.IP "\fB--ok-label \fIstring"
+Override the label used for "OK" buttons.
+.
+.IP "\fB--output-fd \fIfd"
+Direct output to the given file descriptor.
+Most \fBdialog\fR scripts write to the standard error,
+but error messages may also be written there, depending on your script.
+.
+.IP "\fB--separator \fIstring"
+.IP "\fB--output-separator\fIstring"
+Specify a string that will separate the output on \fBdialog\fP's output from
+checklists, rather than a newline (for --separate-output) or a space.
+This applies to other widgets such as forms and editboxes which normally
+use a newline.
+.
+.IP "\fB--print-maxsize"
+Print the maximum size of dialog boxes, i.e., the screen size,
+to \fBdialog\fP's output.
+This may be used alone, without other options.
+.
+.IP "\fB--print-size"
+Prints the size of each dialog box to \fBdialog\fP's output.
+.
+.IP "\fB--print-version"
+Prints \fBdialog\fR's version to \fBdialog\fP's output.
+This may be used alone, without other options.
+.
+.IP "\fB--separate-output"
+For checklist widgets, output result one line at a time, with no quoting.
+This facilitates parsing by another program.
+.
+.IP "\fB--separate-widget \fIstring"
+Specify a string that will separate the output on \fBdialog\fP's output from
+each widget.
+This is used to simplify parsing the result of a dialog with several widgets.
+If this option is not given,
+the default separator string is a tab character.
+.
+.IP "\fB--shadow"
+Draw a shadow to the right and bottom of each dialog box.
+.
+.IP "\fB--single-quoted"
+Use single-quoting as needed (and no quotes if unneeded) for the
+output of checklist's as well as the item-help text.
+If this option is not set, \fBdialog\fP uses double quotes around each item.
+That requires occasional use of backslashes to make the output useful in
+shell scripts.
+.
+.IP "\fB--size-err"
+Check the resulting size of a dialog box before trying to use it,
+printing the resulting size if it is larger than the screen.
+(This option is obsolete, since all new-window calls are checked).
+.
+.IP "\fB--sleep \fIsecs"
+Sleep (delay) for the given number of seconds after processing a dialog box.
+.
+.IP "\fB--stderr"
+Direct output to the standard error.
+This is the default, since curses normally writes screen updates to
+the standard output.
+.
+.IP "\fB--stdout"
+Direct output to the standard output.
+This option is provided for compatibility with Xdialog,
+however using it in portable scripts is not recommended,
+since curses normally writes its screen updates to the standard output.
+If you use this option, \fBdialog\fR attempts to reopen the terminal
+so it can write to the display.
+Depending on the platform and your environment, that may fail.
+.
+.IP "\fB--tab-correct"
+Convert each tab character to one or more spaces
+(for the \fBtextbox\fP widget; otherwise to a single space).
+Otherwise, tabs are rendered according to the curses library's interpretation.
+.
+.IP "\fB--tab-len \fIn"
+Specify the number of spaces that a tab character occupies if the
+"\fB--tab-correct\fP" option is given.
+The default is 8.
+This option is only effective for the \fBtextbox\fP widget.
+.
+.IP "\fB--timeout \fIsecs"
+Timeout (exit with error code)
+if no user response within the given number of seconds.
+This is overridden if the background "\fB--tailboxbg\fP is used.
+A timeout of zero seconds is ignored.
+.
+.IP "\fB--title \fItitle"
+Specifies a
+\fItitle\fP
+string to be displayed at the top of the dialog box.
+.
+.IP "\fB--trace \fIfilename"
+logs keystrokes to the given file.
+Use control/T to log a picture of the current dialog window.
+.
+.IP "\fB--trim"
+eliminate leading blanks,
+trim literal newlines and repeated blanks from message text.
+.
+.IP
+See also the "\fB--cr-wrap\fR" and "\fB--no-collapse\fR" options.
+.
+.IP "\fB--version"
+Same as "\fB--print-version\fP".
+.
+.IP "\fB--visit-items"
+Modify the tab-traversal of checklist, radiobox, menubox and inputmenu
+to include the list of items as one of the states.
+This is useful as a visual aid,
+i.e., the cursor position helps some users.
+.IP
+When this option is given, the cursor is initially placed on the list.
+Abbreviations (the first letter of the tag) apply to the list items.
+If you tab to the button row, abbreviations apply to the buttons.
+.
+.IP "\fB--yes-label \fIstring"
+Override the label used for "Yes" buttons.
+.
+.\" ************************************************************************
+.SS Box Options
+All dialog boxes have at least three parameters:
+.TP 5
+\fItext\fP
+the caption or contents of the box.
+.TP 5
+\fIheight\fP
+the height of the dialog box.
+.TP 5
+\fIwidth\fP
+the width of the dialog box.
+.PP
+Other parameters depend on the box type.
+.
+.
+.IP "\fB--calendar \fItext height width day month year"
+A \fBcalendar\fP box displays
+month, day and year in separately adjustable windows.
+If the values for day, month or year are missing or negative,
+the current date's corresponding values are used.
+You can increment or decrement any of those using the
+left-, up-, right- and down-arrows.
+Use vi-style h, j, k and l for moving around the array of days in a month.
+Use tab or backtab to move between windows.
+If the year is given as zero, the current date is used as an initial value.
+.IP
+On exit, the date is printed in the form day/month/year.
+.
+.
+.IP "\fB--checklist \fItext height width list-height \fR[ \fItag item status \fR] \fI..."
+A
+\fBchecklist\fP
+box is similar to a
+\fBmenu\fP
+box; there are
+multiple entries presented in the form of a menu.
+Instead of choosing
+one entry among the entries, each entry can be turned on or off by the user.
+The initial on/off state of each entry is specified by
+.IR status "."
+.IP
+On exit, a list of the \fItag\fP
+strings of those entries that are turned on
+will be printed on \fBdialog\fP's output.
+If the "\fB--separate-output\fP" option is not given,
+the strings will be quoted to make it simple for scripts to separate them.
+See the "\fB--single-quoted\fP" option, which modifies the quoting behavior.
+.
+.
+.IP "\fB--dselect \fIfilepath height width\fR"
+The directory-selection dialog displays a text-entry window in which you can type
+a directory, and above that a windows with directory names.
+.IP
+Here
+\fBfilepath\fP
+can be a filepath in which case the directory window
+will display the contents of the path and the text-entry window will contain
+the preselected directory.
+.IP
+Use tab or arrow keys to move between the windows.
+Within the directory window, use the up/down arrow keys
+to scroll the current selection.
+Use the space-bar to copy the current selection into the text-entry
+window.
+.IP
+Typing any printable characters switches focus to the text-entry window,
+entering that character as well as scrolling the directory
+window to the closest match.
+.IP
+Use a carriage return or the "OK" button to accept the current value
+in the text-entry window and exit.
+.IP
+On exit, the contents of the text-entry window are written to \fBdialog\fP's output.
+.
+.IP "\fB--editbox \fIfilepath height width\fR"
+The edit-box dialog displays a copy of the file.
+You may edit it using
+the \fIbackspace\fP, \fIdelete\fP and cursor keys
+to correct typing errors.
+It also recognizes pageup/pagedown.
+Unlike the \fB--inputbox\fP,
+you must tab to the "OK" or "Cancel" buttons to close the dialog.
+Pressing the "Enter" key within the box will split the corresponding line.
+.IP
+On exit, the contents of the edit window are written to \fBdialog\fP's output.
+.
+.nf
+.IP "\fB--form \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen \fR] \fI..."
+.fi
+The \fBform\fP dialog displays a form consisting of labels and fields,
+which are positioned on a scrollable window by coordinates given in the script.
+The field length \fIflen\fR and input-length \fIilen\fR tell how long
+the field can be.
+The former defines the length shown for a selected field,
+while the latter defines the permissible length of the data entered in the
+field.
+.RS
+.TP 3
+-
+If \fIflen\fR is zero, the corresponding field cannot be altered.
+and the contents of the field determine the displayed-length.
+.TP 3
+-
+If \fIflen\fR is negative, the corresponding field cannot be altered,
+and the negated value of \fIflen\fR is used as the displayed-length.
+.TP 3
+-
+If \fIilen\fR is zero, it is set to \fIflen\fR.
+.RE
+.IP
+Use up/down arrows (or control/N, control/P) to move between fields.
+Use tab to move between windows.
+.IP
+On exit, the contents of the form-fields are written to \fBdialog\fP's output,
+each field separated by a newline.
+The text used to fill non-editable fields
+(\fIflen\fR is zero or negative)
+is not written out.
+.
+.
+.IP "\fB--fselect \fIfilepath height width\fR"
+The \fBfselect\fP (file-selection) dialog displays a text-entry window in which you can type
+a filename (or directory), and above that two windows with directory
+names and filenames.
+.IP
+Here
+\fBfilepath\fP
+can be a filepath in which case the file and directory windows
+will display the contents of the path and the text-entry window will contain
+the preselected filename.
+.IP
+Use tab or arrow keys to move between the windows.
+Within the directory or filename windows, use the up/down arrow keys
+to scroll the current selection.
+Use the space-bar to copy the current selection into the text-entry
+window.
+.IP
+Typing any printable characters switches focus to the text-entry window,
+entering that character as well as scrolling the directory and filename
+windows to the closest match.
+.IP
+Typing the space character forces \fBdialog\fP to complete the current
+name (up to the point where there may be a match against more than one
+entry).
+.IP
+Use a carriage return or the "OK" button to accept the current value
+in the text-entry window and exit.
+.IP
+On exit, the contents of the text-entry window are written to \fBdialog\fP's output.
+.
+.
+.IP "\fB--gauge \fItext height width [percent]\fR"
+A
+\fBgauge\fP
+box displays a meter along the bottom of the box.
+The meter indicates the percentage.
+New percentages are read from
+standard input, one integer per line.
+The meter is updated
+to reflect each new percentage.
+If the standard input reads the string "XXX",
+then the first line following is taken as an integer percentage,
+then subsequent lines up to another "XXX" are used for a new prompt.
+The gauge exits when EOF is reached on the standard input.
+.IP
+The \fIpercent\fR value denotes the initial percentage shown in the meter.
+If not specified, it is zero.
+.IP
+On exit, no text is written to \fBdialog\fP's output.
+The widget accepts no input, so the exit status is always OK.
+.
+.
+.IP "\fB--infobox \fItext height width"
+An \fBinfo\fP box is basically a \fBmessage\fP box.
+However, in this case, \fBdialog\fP
+will exit immediately after displaying the message to the user.
+The screen is not cleared when \fBdialog\fP
+exits, so that the message will remain on the screen until the calling
+shell script clears it later.
+This is useful when you want to inform
+the user that some operations are carrying on that may require some
+time to finish.
+.IP
+On exit, no text is written to \fBdialog\fP's output.
+Only an "OK" button is provided for input,
+but an ESC exit status may be returned.
+.
+.
+.IP "\fB--inputbox \fItext height width [init]"
+An
+\fBinput\fP
+box is useful when you want to ask questions that
+require the user to input a string as the answer.
+If init is supplied
+it is used to initialize the input string.
+When entering the string,
+the \fIbackspace\fP, \fIdelete\fP and cursor keys
+can be used to correct typing errors.
+If the input string is longer than
+can fit in the dialog box, the input field will be scrolled.
+.IP
+On exit, the input string will be printed on \fBdialog\fP's output.
+.
+.
+.IP "\fB--inputmenu \fItext height width menu-height \fR[ \fItag item \fR] \fI..."
+An \fBinputmenu\fP box is very similar to an ordinary \fBmenu\fP box.
+There are only a few differences between them:
+.RS
+.TP 4
+1.
+The entries are not automatically centered but left adjusted.
+.TP
+2.
+An extra button (called \fIRename\fP) is implied to rename
+the current item when it is pressed.
+.TP
+3.
+It is possible to rename the current entry by pressing the
+\fIRename\fP
+button.
+Then \fBdialog\fP will write the following on \fBdialog\fP's output.
+.IP
+RENAMED <tag> <item>
+.RE
+.
+.
+.IP "\fB--menu \fItext height width menu-height \fR[ \fItag item \fR] \fI..."
+As its name suggests, a
+\fBmenu\fP
+box is a dialog box that can be used to present a list of choices in
+the form of a menu for the user to choose.
+Choices are displayed in the order given.
+Each menu entry consists of a \fItag\fP string and an \fIitem\fP string.
+The \fItag\fP
+gives the entry a name to distinguish it from the other entries in the
+menu.
+The \fIitem\fP is a short description of the option that the entry represents.
+The user can move between the menu entries by pressing the
+cursor keys, the first letter of the \fItag\fP
+as a hot-key, or the number keys
+.IR 1-9 ". There are"
+\fImenu-height\fP
+entries displayed in the menu at one time, but the menu will be
+scrolled if there are more entries than that.
+.IP
+On exit the \fItag\fP
+of the chosen menu entry will be printed on \fBdialog\fP's output.
+If the "\fB--help-button\fR" option is given, the corresponding help
+text will be printed if the user selects the help button.
+.
+.nf
+.IP "\fB--mixedform \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen itype \fR] \fI..."
+.fi
+The \fBmixedform\fP dialog displays a form consisting of labels and fields,
+much like the \fB--form\fP dialog.
+It differs by adding a field-type parameter to each field's description.
+Each bit in the type denotes an attribute of the field:
+.RS
+.TP 5
+1
+hidden, e.g., a password field.
+.TP 5
+2
+readonly, e.g., a label.
+.RE
+.
+.IP "\fB--mixedgauge \fItext height width percent \fR[ \fItag1 item1 \fR] \fI..."
+A
+\fBmixedgauge\fP
+box displays a meter along the bottom of the box.
+The meter indicates the percentage.
+.IP
+It also displays a list of the \fItag\fP- and \fIitem\fP-values at the
+top of the box.
+See dialog(3) for the tag values.
+.IP
+The \fItext\fP is shown as a caption between the list and meter.
+The \fIpercent\fR value denotes the initial percentage shown in the meter.
+.IP
+No provision is made for reading data from the standard input as \fB--gauge\fP
+does.
+.IP
+On exit, no text is written to \fBdialog\fP's output.
+The widget accepts no input, so the exit status is always OK.
+.
+.IP "\fB--msgbox \fItext height width"
+A \fBmessage\fP box is very similar to a \fByes/no\fP box.
+The only difference between a \fBmessage\fP box and a \fByes/no\fP
+box is that a \fBmessage\fP box has only a single \fBOK\fP button.
+You can use this dialog box to display any message you like.
+After reading the message, the user can press the \fIENTER\fP key so that
+\fBdialog\fP will exit and the calling shell script can continue its operation.
+.IP
+If the message is too large for the space,
+\fBdialog\fP may allow you to scroll it,
+provided that the underlying curses implementation is capable enough.
+In this case, a percentage is shown in the base of the widget.
+.IP
+On exit, no text is written to \fBdialog\fP's output.
+Only an "OK" button is provided for input,
+but an ESC exit status may be returned.
+.
+.IP "\fB\-\-pause \fItext height width seconds\fR"
+A
+\fBpause\fP
+box displays a meter along the bottom of the box.
+The meter indicates how many seconds remain until the end of the pause.
+The pause exits when timeout is reached
+or the user presses the OK button
+(status OK)
+or the user presses the CANCEL button
+or Esc key.
+.IP "\fB--passwordbox \fItext height width [init]"
+A \fBpassword\fP box is similar to an input box,
+except that the text the user enters is not displayed.
+This is useful when prompting for passwords or other
+sensitive information.
+Be aware that if anything is passed in "init", it
+will be visible in the system's process table to casual snoopers.
+Also, it
+is very confusing to the user to provide them with a default password they
+cannot see.
+For these reasons, using "init" is highly discouraged.
+See "\fB--insecure\fP" if you do not care about your password.
+.IP
+On exit, the input string will be printed on \fBdialog\fP's output.
+.
+.
+.nf
+.IP "\fB--passwordform \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen \fR] \fI..."
+.fi
+This is identical to \fB--form\fP except that all text fields are
+treated as \fBpassword\fP widgets rather than \fBinputbox\fP widgets.
+.
+.
+.IP "\fB--progressbox \fItext height width"
+.IP "\fB--progressbox \fIheight width"
+A \fBprogressbox\fP is similar to an \fBtailbox\fP,
+except that it will exit when it reaches the end of the file.
+If three parameters are given, it displays the text under the title,
+delineated from the scrolling file's contents.
+If only two parameters are given, this text is omitted.
+.
+.
+.IP "\fB--radiolist \fItext height width list-height \fR [ \fItag item status \fR] \fI..."
+A
+\fBradiolist\fP
+box is similar to a
+\fBmenu\fP
+box.
+The only difference is
+that you can indicate which entry is currently selected, by setting its
+.IR status " to " on "."
+.IP
+On exit, the name of the selected item is written to \fBdialog\fP's output.
+.
+.
+.IP "\fB--tailbox \fIfile height width"
+Display text from a file in a dialog box, as in a "tail -f" command.
+Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
+A '0' resets the scrolling.
+.IP
+On exit, no text is written to \fBdialog\fP's output.
+Only an "OK" button is provided for input,
+but an ESC exit status may be returned.
+.
+.
+.IP "\fB--tailboxbg \fIfile height width"
+Display text from a file in a dialog box as a background task,
+as in a "tail -f &" command.
+Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
+A '0' resets the scrolling.
+.IP
+Dialog treats the background task specially if there are other
+widgets (\fB--and-widget\fP) on the screen concurrently.
+Until those widgets are closed (e.g., an "OK"),
+\fBdialog\fP will perform all of the tailboxbg widgets in the same process,
+polling for updates.
+You may use a tab to traverse between the widgets on the screen,
+and close them individually, e.g., by pressing \fIENTER\fP.
+Once the non-tailboxbg widgets are closed, \fBdialog\fP forks a copy of itself
+into the background, and prints its process id if the "\fB--no-kill\fP" option
+is given.
+.IP
+On exit, no text is written to \fBdialog\fP's output.
+Only an "EXIT" button is provided for input,
+but an ESC exit status may be returned.
+.IP
+NOTE:
+Older versions of \fBdialog\fP forked immediately and attempted to
+update the screen individually.
+Besides being bad for performance,
+it was unworkable.
+Some older scripts may not work properly with the polled scheme.
+.
+.
+.IP "\fB--textbox \fIfile height width"
+A
+\fBtext\fP
+box lets you display the contents of a text file in a dialog box.
+It is like a simple text file viewer.
+The user can move through the file by using the
+cursor, page-up, page-down
+and \fIHOME/END\fR keys available on most keyboards.
+If the lines are too long to be displayed in the box,
+the \fILEFT/RIGHT\fP
+keys can be used to scroll the text region horizontally.
+You may also use vi-style keys h, j, k, l in place of the cursor keys,
+and B or N in place of the page-up and page-down keys.
+Scroll up/down using vi-style 'k' and 'j', or arrow-keys.
+Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
+A '0' resets the left/right scrolling.
+For more convenience,
+vi-style forward and backward searching functions are also provided.
+.IP
+On exit, no text is written to \fBdialog\fP's output.
+Only an "EXIT" button is provided for input,
+but an ESC exit status may be returned.
+.
+.
+.IP "\fB--timebox \fItext height [width hour minute second]"
+A dialog is displayed which allows you to select hour, minute and second.
+If the values for hour, minute or second are missing or negative,
+the current date's corresponding values are used.
+You can increment or decrement any of those using the
+left-, up-, right- and down-arrows.
+Use tab or backtab to move between windows.
+.IP
+On exit, the result is printed in the form hour:minute:second.
+.
+.
+.IP "\fB--yesno \fItext height width"
+A \fByes/no\fP dialog box of
+size \fIheight\fP rows by \fIwidth\fP columns will be displayed.
+The string specified by
+\fItext\fP
+is displayed inside the dialog box.
+If this string is too long to fit
+in one line, it will be automatically divided into multiple lines at
+appropriate places.
+The
+\fItext\fP
+string can also contain the sub-string
+.I
+"\en"
+or newline characters
+\fI`\en'\fP
+to control line breaking explicitly.
+This dialog box is useful for
+asking questions that require the user to answer either yes or no.
+The dialog box has a
+\fBYes\fP
+button and a
+\fBNo\fP
+button, in which the user can switch between by pressing the
+.IR TAB " key."
+.IP
+On exit, no text is written to \fBdialog\fP's output.
+In addition to the "Yes" and "No" exit codes (see DIAGNOSTICS)
+an ESC exit status may be returned.
+.IP
+The codes used for "Yes" and "No" match those used for "OK" and "Cancel",
+internally no distinction is made.
+.
+.\" ************************************************************************
+.SS "Obsolete Options"
+.\" from cdialog 0.9a (Pako)
+.IP "\fB--beep"
+This was used to tell the original cdialog that it should make a beep
+when the separate processes of the tailboxbg widget would repaint the screen.
+.
+.\" from cdialog 0.9a (Pako)
+.IP "\fB--beep-after"
+Beep after a user has completed a widget by pressing one of the buttons.
+.
+.\" ************************************************************************
+.SH "RUN-TIME CONFIGURATION"
+.TP 4
+1.
+Create a sample configuration file by typing:
+.LP
+.in +1i
+"dialog --create-rc <file>"
+.TP 4
+2.
+At start,
+\fBdialog\fP
+determines the settings to use as follows:
+.RS
+.TP 4
+a)
+if environment variable
+\fBDIALOGRC\fP
+is set, its value determines the name of the configuration file.
+.TP 4
+b)
+if the file in (a) is not found, use the file
+\fI$HOME/.dialogrc\fP
+as the configuration file.
+.TP 4
+c)
+if the file in (b) is not found, try using the GLOBALRC file determined at
+compile-time, i.e., \fI/etc/dialogrc\fP.
+.TP 4
+d)
+if the file in (c) is not found, use compiled in defaults.
+.RE
+.TP 4
+3.
+Edit the sample configuration file and copy it to some place that
+\fBdialog\fP
+can find, as stated in step 2 above.
+.
+.\" ************************************************************************
+.SH "KEY BINDINGS"
+You can override or add to key bindings in \fBdialog\fP
+by adding to the configuration file.
+\fBDialog\fP's \fBbindkey\fP command maps single keys to its internal coding.
+.EX
+bindkey \fIwidget\fP \fIcurses_key\fP \fIdialog_key\fP
+.EE
+The \fIwidget\fP name can be "*" (all widgets), or
+specific widgets such as \fBtextbox\fP.
+Specific widget bindings override the "*" bindings.
+User-defined bindings override the built-in bindings.
+.PP
+The \fIcurses_key\fP can be any of the names derived from
+\fBcurses.h\fP, e.g., "HELP" from "KEY_HELP".
+\fBDialog\fP also recognizes ANSI control characters such as "^A", "^?",
+as well as C1-controls such as "~A" and "~?".
+Finally, it allows any single character to be escaped with a backslash.
+.PP
+\fBDialog\fP's internal keycode names correspond to the
+\fBDLG_KEYS_ENUM\fP type in
+\fBdlg_keys.h\fP, e.g., "HELP" from "DLGK_HELP".
+.
+.\" ************************************************************************
+.SH ENVIRONMENT
+.TP 15
+\fBDIALOGOPTS\fP
+Define this variable to apply any of the common options to each widget.
+Most of the common options are reset before processing each widget.
+If you set the options in this environment variable,
+they are applied to \fBdialog\fP's state after the reset.
+As in the "\fB--file\fP" option,
+double-quotes and backslashes are interpreted.
+.IP
+The "\fB--file\fP" option is not considered a common option
+(so you cannot embed it within this environment variable).
+.TP 15
+\fBDIALOGRC\fP
+Define this variable if you want to specify the name of the configuration file
+to use.
+.TP 15
+\fBDIALOG_CANCEL\fP
+.TP 15
+\fBDIALOG_ERROR\fP
+.TP 15
+\fBDIALOG_ESC\fP
+.TP 15
+\fBDIALOG_EXTRA\fP
+.TP 15
+\fBDIALOG_HELP\fP
+.TP 15
+\fBDIALOG_ITEM_HELP\fP
+.TP 15
+\fBDIALOG_OK\fP
+Define any of these variables to change the exit code on
+Cancel (1),
+error (-1),
+ESC (255),
+Extra (3),
+Help (2),
+Help with --item-help (2),
+or OK (0).
+Normally shell scripts cannot distinguish between -1 and 255.
+.TP 15
+\fBDIALOG_TTY\fP
+Set this variable to "1" to provide compatibility with older versions
+of \fBdialog\fP which assumed that if the script redirects the standard output,
+that the "\fB--stdout\fP" option was given.
+.SH FILES
+.TP 20
+\fI$HOME/.dialogrc\fP
+default configuration file
+.SH EXAMPLES
+The \fBdialog\fP sources contain several samples
+of how to use the different box options and how they look.
+Just take a look into the directory \fBsamples/\fP of the source.
+.SH DIAGNOSTICS
+Exit status is subject to being overridden by environment variables.
+Normally they are:
+.TP 5
+0
+if
+.BR dialog " is exited by pressing the " Yes " or " OK
+button.
+.TP 5
+1
+if the
+.BR No " or " Cancel
+button is pressed.
+.TP 5
+2
+if the
+.BR Help
+button is pressed.
+.TP 5
+3
+if the
+.BR Extra
+button is pressed.
+.TP 5
+-1
+if errors occur inside \fBdialog\fP
+or \fBdialog\fP is exited by pressing the \fIESC\fP key.
+.
+.\" ************************************************************************
+.SH COMPATIBILITY
+You may want to write scripts which run with other \fBdialog\fP "clones".
+.SS ORIGINAL DIALOG
+First, there is the "original" \fBdialog\fP program to consider (versions
+0.3 to 0.9).
+It had some misspelled (or inconsistent) options.
+The \fBdialog\fP program maps those deprecated options to the preferred ones.
+They include:
+.RS
+.TS
+l l
+_ _
+l l.
+\fIOption\fR \fITreatment\fR
+\fB--beep-after\fP ignored
+\fB--guage\fP mapped to \fB--gauge\fP
+.TE
+.RE
+.SS XDIALOG
+Technically, "\fBXdialog\fP",
+this is an X application.
+With some care, it is possible to write useful scripts that work
+with both \fBXdialog\fP and \fBdialog\fP.
+.PP
+The \fBdialog\fP program ignores these options which are recognized
+by \fBXdialog\fP:
+.RS
+.TS
+l l
+_ _
+l l.
+\fIOption\fR \fITreatment\fR
+\fB--allow-close\fP ignored
+\fB--auto-placement\fP ignored
+\fB--fixed-font\fP ignored
+\fB--icon\fP ignored
+\fB--keep-colors\fP ignored
+\fB--no-close\fP ignored
+\fB--no-cr-wrap\fP ignored
+\fB--screen-center\fP ignored
+\fB--separator\fP mapped to \fB--separate-output\fP
+\fB--smooth\fP ignored
+\fB--under-mouse\fP ignored
+\fB--wmclass\fP ignored
+.TE
+.RE
+.PP
+\fBXdialog\fP's manpage has a section discussing its compatibility with \fBdialog\fP.
+.SS WHIPTAIL
+Then there is \fBwhiptail\fP.
+For practical purposes, it is maintained by Debian.
+Its documentation claims
+.RS
+.sp
+.nf
+whiptail(1) is a lightweight replacement for dialog(1),
+to provide dialog boxes for shell scripts. It is built on the
+newt windowing library rather than the ncurses library, allowing
+it to be smaller in embedded enviroments such as installers,
+rescue disks, etc.
+.sp
+whiptail is designed to be drop-in compatible with dialog, but
+has less features: some dialog boxes are not implemented, such
+as tailbox, timebox, calendarbox, etc.
+.fi
+.RE
+.PP
+Comparing actual sizes (Debian testing, 2007/1/10):
+The total of sizes for \fBwhiptail\fP, the newt, popt and slang libraries is 757kb.
+The comparable number for \fBdialog\fP (counting ncurses) is 520kb.
+Disregard the first paragraph.
+.PP
+The second paragraph is misleading, since \fBwhiptail\fP
+also does not work for common options of dialog, such as the gauge box.
+\fBwhiptail\fP is less compatible with \fBdialog\fP than the decade-old
+original dialog 0.4 program.
+.PP
+\fBwhiptail\fP's manpage borrows features from \fBdialog\fP, e.g.,
+\fB--default-item\fP, \fB--output-fd\fP,
+but oddly cites only \fBdialog\fP versions up to 0.4 as a source.
+That is, its manpage refers to features which
+were borrowed from more recent versions of \fBdialog\fP, e.g.,
+the \fB--gauge\fP and \fB--password\fP boxes,
+as well as options such as \fB-separate-output\fP.
+Somewhat humorously, one may note that the \fBpopt\fP feature
+(undocumented in its manpage)
+of using a "--" as an escape was documented in \fBdialog\fP's manpage about
+a year before it was mentioned in \fBwhiptail\fP's manpage.
+\fBwhiptail\fP's manpage incorrectly attributes that to \fBgetopt\fP
+(and is inaccurate anyway).
+.PP
+Debian uses \fBwhiptail\fP for the official \fBdialog\fP variation.
+.PP
+The \fBdialog\fP program ignores or maps these options which are recognized
+by \fBwhiptail\fP:
+.RS
+.TS
+l l
+_ _
+l l.
+\fIOption\fR \fITreatment\fR
+\fB--fb\fP ignored
+\fB--fullbutton\fP ignored
+\fB--nocancel\fP mapped to \fB--no-cancel\fP
+\fB--noitem\fP ignored
+.TE
+.RE
+.\" ************************************************************************
+.SH BUGS
+Perhaps.
+.SH AUTHOR
+.LP
+Thomas E. Dickey (updates for 0.9b and beyond)
+.SH CONTRIBUTORS
+Kiran Cherupally - the mixed form and mixed gauge widgets.
+.LP
+Tobias C. Rittweiler
+.LP
+Valery Reznic - the form and progressbox widgets.
+.LP
+Yura Kalinichenko adapted the gauge widget as "pause".
+.PP
+This is a rewrite (except as needed to provide compatibility)
+of the earlier version of \fBdialog 0.9a\fP,
+which lists as authors:
+.RS
+.LP
+Savio Lam - version 0.3, "dialog"
+.LP
+Stuart Herbert - patch for version 0.4
+.LP
+Marc Ewing - the gauge widget.
+.LP
+Pasquale De Marco "Pako" - version 0.9a, "cdialog"
+.RE
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/dialog.3 b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.3
new file mode 100644
index 00000000000..8c32322b959
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.3
@@ -0,0 +1,2617 @@
+.\" $Id: dialog.3,v 1.42 2008/07/28 00:01:05 tom Exp $
+.\" Copyright 2005-2007,2008 Thomas E. Dickey
+.\"
+.\" This program is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU Lesser General Public License, version 2.1
+.\" as published by the Free Software Foundation.
+.\"
+.\" This program is distributed in the hope that it will be useful, but
+.\" WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+.\" Lesser General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU Lesser General Public
+.\" License along with this program; if not, write to
+.\" Free Software Foundation, Inc.
+.\" 51 Franklin St., Fifth Floor
+.\" Boston, MA 02110, USA.
+.TH DIALOG 3 "" "$Date: 2008/07/28 00:01:05 $"
+.SH NAME
+dialog \- widgets and utilities for the dialog program
+.SH SYNOPSIS
+.B cc [ flag ... ] file ... -ldialog [ library ... ]
+
+.B #include <dialog.h>
+.PP
+\fBDialog\fP
+is a program that will let you to present a variety of questions or
+display messages using dialog boxes from a shell script.
+It is built from the \fBdialog\fP library,
+which consists of several widgets
+as well as utility functions that are used by the widgets
+or the main program.
+.
+.SH DESCRIPTION
+This manpage documents the features from \fI<dialog.h>\fP which
+are likely to be important to developers using the widgets directly.
+Some hints are also given for developing new widgets.
+.
+.\" ************************************************************************
+.SS DEFINITIONS
+Exit codes (passed back to the main program for its use)
+are defined with a "\fIDLG_EXIT_\fP prefix.
+The defined constants can be mapped using environment variables
+as described in \fBdialog\fP(1),
+e.g., \fIDLG_EXIT_OK\fP corresponds to \fI$DIALOG_OK\fP.
+.PP
+Useful character constants which correspond to user input
+are named with the "\fICHR_\fP" prefix, e.g.,
+\fICHR_BACKSPACE\fP.
+.PP
+Colors and video attributes are categorized and associated with
+settings in the configuration file
+(see the discussion of \fI$DIALOGRC\fP in \fBdialog\fP(1)).
+The \fIDIALOG_ATR(n)\fP macro is used for defining the references
+to the combined color and attribute table \fIdlg_color_table[]\fP.
+.PP
+The \fBdialog\fP application passes its command-line parameters
+to the widget functions. Some of those parameters are single values,
+but some of the widgets accept data as an array of values.
+Those include checklist/radiobox, menubox and formbox.
+When the \fB--item-help\fP option is given, an extra column
+of data is expected.
+The USE_ITEM_HELP(), CHECKBOX_TAGS, MENUBOX_TAGS and FORMBOX_TAGS
+macros are used to hide this difference from the calling application.
+.PP
+Most of the other definitions found in \fI<dialog.h>\fP
+are used for convenience in building the library or main program.
+These include definitions based on the generated \fI<dlg_config.h>\fP header.
+
+.\" ************************************************************************
+.SS DATA STRUCTURES
+All of the global data for the \fBdialog\fP library is stored in
+a few structures: \fIDIALOG_STATE\fP, \fIDIALOG_VARS\fP and \fIDIALOG_COLORS\fP.
+The corresponding \fIdialog_state\fP, \fIdialog_vars\fP and \fIdlg_color_table\fP
+global variables should be initialized to zeros,
+and then populated with the data to use.
+A few of these must be nonzero for the corresponding widgets to function.
+As as the case with function names,
+variables beginning with "\fIdialog_\fP"
+are designed for use by the calling application
+while variables beginning with "\fIdlg_\fP"
+are intended for lower levels, e.g., by the \fBdialog\fP library.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.all_windows
+This is a linked list of all windows created by the library.
+The \fBdlg_del_window\fP function uses this to locate windows which
+may be redrawn after deleting a window.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.aspect_ratio
+This corresponds to the command-line option "\fB--aspect-ratio\fP".
+The value gives the application
+some control over the box dimensions when using auto
+sizing (specifying 0 for height and width).
+It represents width / height.
+The default is 9, which means 9 characters wide to every 1 line high.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.getc_callbacks
+This is setup in \fIui_getc.c\fP to record windows which must be polled
+for input, e.g,. to handle the background tailbox widget.
+One window is designated as the foreground or control window.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.getc_redirect
+If the control window for \fIDIALOG_STATE.getc_callbacks\fP is
+closed, the list is transferred to this variable.
+Closing all windows causes the application to exit.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.output
+This is set in the \fBdialog\fP application to the stream on
+which the application and library functions may write text results.
+Normally that is the standard error,
+since the curses library prefers to write its data to the standard output.
+Some scripts, trading portability for convenience,
+prefer to write results to the standard output,
+e.g., by using the "\fB--stdout\fP" option.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.output_count
+This is incremented by \fIdlg_does_output\fP,
+which is called by each widget that writes text to the output.
+The \fBdialog\fP application uses that to decide if it should
+also write a separator, i.e.,
+\fIDIALOG_STATE.separate_str\fP,
+between calls to each widget.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.pipe_input
+This is set in \fIinit_dialog\fP to a stream which can be used by the
+\fBgauge\fP widget, which must be the application's standard input.
+The \fBdialog\fP application calls \fIinit_dialog\fP normally with
+\fIinput\fP set to the standard input, but optionally based on the
+"\fB--input-fd\fP" option.
+Since the application cannot read from
+a pipe (standard input) and at the same time read
+the curses input from the standard input,
+it must allow for reopening the latter from either
+a specific file descriptor,
+or directly from the terminal.
+The adjusted pipe stream value is stored in this variable.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.screen_initialized
+This is set in \fIinit_dialog\fP and
+reset in \fIend_dialog\fP.
+It is used to check if curses has been initialized,
+and if the \fIendwin\fP function must be called on exit.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.screen_output
+This is set in \fIinit_dialog\fP to the output stream used
+by the curses library.
+Normally that is the standard output,
+unless that happens to not be a terminal (and if \fIinit_dialog\fP can
+successfully open the terminal directly).
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.separate_str
+This corresponds to the command-line option "\fB--separate-widget\fP".
+The given string
+specifies a string that will separate the output on \fBdialog\fP's output from
+each widget.
+This is used to simplify parsing the result of a dialog with several widgets.
+If this option is not given,
+the default separator string is a tab character.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.tab_len
+This corresponds to the command-line option "\fB--tab-len\fP \fInumber\fP".
+Specify the number of spaces that a tab character occupies if the
+"\fB--tab-correct\fP"
+option is given.
+The default is 8.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.use_colors
+This is set in \fIinit_dialog\fP if the curses implementation supports color.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.use_shadow
+This corresponds to the command-line option "\fB--no-shadow\fP".
+This is set in \fIinit_dialog\fP if the curses implementation supports color.
+If true,
+suppress shadows that would be drawn to the right and bottom of each dialog box.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_STATE.visit_items
+This corresponds to the command-line option "\fB--visit-items\fP".
+.\" ---------------------------------------------------------------------------
+.PP
+The \fBdialog\fP application resets the \fIdialog_vars\fP data before
+accepting options to invoke each widget.
+Most of the \fIDIALOG_VARS\fP members are set directly from \fBdialog\fP's
+command-line options:
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.ascii_lines
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.backtitle
+This corresponds to the command-line option "\fB--backtitle\fP \fIbacktitle\fP".
+It specifies a
+\fIbacktitle\fP
+string to be displayed on the backdrop, at the top of the screen.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.beep_after_signal
+This corresponds to the command-line option "\fB--beep-after\fP".
+If true, beep after a user has completed a widget by pressing one of the buttons.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.beep_signal
+This corresponds to the command-line option "\fB--beep\fP".
+It is obsolete.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.begin_set
+This is true if the command-line option "\fB--begin y x\fP" was used.
+It specifies the position of the upper left corner of a dialog box on the screen.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.begin_x
+This corresponds to the \fIx\fP value from
+the command-line option "\fB--begin\fP \fIy x\fP" (second value).
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.begin_y
+This corresponds to the \fIy\fP value from
+the command-line option "\fB--begin\fP \fIy x\fP" (first value).
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.cancel_label
+This corresponds to the command-line option "\fB--cancel-label\fP \fIstring\fP".
+The given \fIstring\fP overrides the label used for "Cancel" buttons.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.cant_kill
+This corresponds to the command-line option "\fB--no-kill\fP".
+If true, this tells
+\fBdialog\fP
+to put the
+\fBtailboxbg\fP
+box in the background,
+printing its process id to \fBdialog\fP's output.
+SIGHUP is disabled for the background process.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.colors
+This corresponds to the command-line option "\fB--colors\fP".
+If true, interpret embedded "\\Z" sequences in the dialog text
+by the following character,
+which tells dialog to set colors or video attributes:
+0 through 7 are the ANSI codes used in curses:
+black,
+red,
+green,
+yellow,
+blue,
+magenta,
+cyan and
+white respectively.
+Bold is set by 'b', reset by 'B'.
+Reverse is set by 'r', reset by 'R'.
+Underline is set by 'u', reset by 'U'.
+The settings are cumulative, e.g., "\\Zb\\Z1" makes the following text
+bright red.
+Restore normal settings with "\\Zn".
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.column_separator
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.cr_wrap
+This corresponds to the command-line option "\fB--cr-wrap\fP".
+If true,
+interpret embedded newlines in the dialog text as a newline on the screen.
+Otherwise, \fBdialog\fR will only wrap lines where needed to fit inside the text box.
+Even though you can control line breaks with this,
+\fBdialog\fR will still wrap any lines that are too long for the width of the box.
+Without cr-wrap, the layout of your text may be formatted to look nice
+in the source code of your script without affecting the way it will
+look in the dialog.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.default_item
+This corresponds to the command-line option "\fB--default-item\fP \fIstring\fP".
+The given string is used as
+the default item in a checklist, form or menu box.
+Normally the first item in the box is the default.
+.IP \fIDIALOG_VARS.defaultno
+This corresponds to the command-line option "\fB--defaultno\fP".
+If true,
+make the default value of the
+\fByes/no\fP
+box a
+.BR No .
+Likewise, make the default button of widgets that provide "OK" and "Cancel"
+a \fBCancel\fP.
+If \fB--nocancel\fP was given that option overrides this,
+making the default button always "Yes" (internally the same as "OK").
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.dlg_clear_screen
+This corresponds to the command-line option "\fB--clear\fP".
+This option is implemented in the main program, not the library.
+If true,
+the screen will be cleared on exit.
+This may be used alone, without other options.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.exit_label
+This corresponds to the command-line option "\fB--exit-label string\fP".
+The given string overrides the label used for "EXIT" buttons.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.extra_button
+This corresponds to the command-line option "\fB--extra-button\fP".
+If true, some widgets show an extra button,
+between "OK" and "Cancel" buttons.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.extra_label
+This corresponds to the command-line option "\fB--extra-label\fP \fIstring\fP".
+The given string overrides the label used for "Extra" buttons.
+Note: for inputmenu widgets, this defaults to "Rename".
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.formitem_type
+This is set by the command-line option "\fB--passwordform\fP"
+to tell the form widget that its text fields should be treated like
+password widgets.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.help_button
+This corresponds to the command-line option "\fB--help-button\fP".
+If true, some widgets show a help-button after "OK" and "Cancel" buttons,
+i.e., in checklist, radiolist and menu boxes.
+If \fB--item-help\fR is also given, on exit
+the return status will be the same as for the "OK" button,
+and the item-help text will be written to \fBdialog\fP's output after the token "HELP".
+Otherwise, the return status will indicate that the Help button was pressed,
+and no message printed.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.help_label
+This corresponds to the command-line option "\fB--help-label\fP \fIstring\fP".
+The given string overrides the label used for "Help" buttons.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.help_status
+This corresponds to the command-line option "\fB--help-status\fP".
+If true, and the the help-button is selected,
+writes the checklist or radiolist information
+after the item-help "HELP" information.
+This can be used to reconstruct the state of a checklist after processing
+the help request.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.input_length
+This is nonzero if \fIDIALOG_VARS.input_result\fP is allocated,
+versus being a pointer to the user's local variables.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.input_menu
+This flag is set to denote whether the menubox widget
+implements a menu versus a inputmenu widget.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.input_result
+If \fIDIALOG_VARS.input_length\fP is zero,
+this is a pointer to user buffer (on the stack, or static).
+When \fIDIALOG_VARS.input_length\fP is nonzero,
+this is a dynamically-allocated buffer used by the widgets to return
+printable results to the calling application.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.insecure
+This corresponds to the command-line option "\fB--insecure\fP".
+If true, make the password widget friendlier but less secure,
+by echoing asterisks for each character.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.item_help
+This corresponds to the command-line option "\fB--item-help\fP".
+If true,
+interpret the tags data for checklist, radiolist and menu boxes
+adding a column whose text is displayed in the bottom line of the
+screen, for the currently selected item.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.keep_tite
+This is set by the command-line option "\fB--keep-tite\fP"
+to tell \fBdialog\fP to not attempt to cancel the terminal initialization
+(termcap \fIti\fP/\fIte\fP) sequences which correspond to xterm's alternate-screen
+switching.
+Normally \fBdialog\fP does this to avoid flickering when run several times
+in a script.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.keep_window
+This corresponds to the command-line option "\fB--keep-window\fP".
+If true, do not remove/repaint the window on exit.
+This is useful for keeping the window contents visible when several
+widgets are run in the same process.
+Note that curses will clear the screen when starting a new process.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.max_input
+This corresponds to the command-line option "\fB--max-input\fP \fIsize\fP".
+Limit input strings to the given size.
+If not specified, the limit is 2048.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.no_label
+This corresponds to the command-line option "\fB--no-label\fP \fIstring\fP".
+The given string overrides the label used for "No" buttons.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.no_lines
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.nocancel
+This corresponds to the command-line option "\fB--no-cancel\fP".
+If true,
+suppress the "Cancel" button in checklist, inputbox and menu box modes.
+A script can still test if the user pressed the ESC key to cancel to quit.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.nocollapse
+This corresponds to the command-line option "\fB--no-collapse\fP".
+Normally \fBdialog\fR converts tabs to spaces and reduces multiple
+spaces to a single space for text which is displayed in a message boxes, etc.
+It true, that feature is disabled.
+Note that \fBdialog\fR will still wrap text, subject to the \fB--cr-wrap\fR
+option.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.nook
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.ok_label
+This corresponds to the command-line option "\fB--ok-label\fP \fIstring\fP".
+The given string overrides the label used for "OK" buttons.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.print_siz
+This corresponds to the command-line option "\fB--print-size\fP".
+If true,
+each widget prints its size to \fBdialog\fP's output when it is invoked.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.quoted
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.separate_output
+This corresponds to the command-line option "\fB--separate-output\fP".
+If true,
+checklist widgets output result one line at a time, with no quoting.
+This facilitates parsing by another program.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.single_quoted
+This corresponds to the command-line option "\fB--single-quoted\fP".
+If true,
+Use single-quoting as needed (and no quotes if unneeded) for the
+output of checklist's as well as the item-help text.
+If this option is not set, \fBdialog\fP uses double quotes around each item.
+That requires occasional use of backslashes to make the output useful in
+shell scripts.
+.IP \fIDIALOG_VARS.size_err
+This corresponds to the command-line option "\fB--size-err\fP".
+If true,
+check the resulting size of a dialog box before trying to use it,
+printing the resulting size if it is larger than the screen.
+(This option is obsolete, since all new-window calls are checked).
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.sleep_secs
+This corresponds to the command-line option "\fB--sleep\fP \fIsecs\fP".
+This option is implemented in the main program, not the library.
+If nonzero, this is the number of seconds after to delay after processing a dialog box.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.tab_correct
+This corresponds to the command-line option "\fB--tab-correct\fP".
+If true, convert each tab character of the text to one or more spaces.
+Otherwise, tabs are rendered according to the curses library's interpretation.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.timeout_secs
+This corresponds to the command-line option "\fB--timeout\fP \fIsecs\fP".
+If nonzero, timeout input requests (exit with error code)
+if no user response within the given number of seconds.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.title
+This corresponds to the command-line option "\fB--title\fP \fItitle\fP".
+Specifies a
+\fItitle\fP
+string to be displayed at the top of the dialog box.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.trim_whitespace
+This corresponds to the command-line option "\fB--trim\fP".
+If true, eliminate leading blanks,
+trim literal newlines and repeated blanks from message text.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.visit_items
+This corresponds to the command-line option "\fB--visit-items\fP".
+Modify the tab-traversal of checklist, radiobox, menubox and inputmenu
+to include the list of items as one of the states.
+This is useful as a visual aid,
+i.e., the cursor position helps some users.
+.\" ---------------------------------------------------------------------------
+.IP \fIDIALOG_VARS.yes_label
+This corresponds to the command-line option "\fB--yes-label\fP \fIstring\fP".
+The given string overrides the label used for "Yes" buttons.
+.
+.\" ************************************************************************
+.\" ************************************************************************
+.SS WIDGETS
+Functions that implement major functionality for the command-line \fBdialog\fP
+program, e.g., widgets, have names beginning "\fIdialog_\fP".
+
+All dialog boxes have at least three parameters:
+.TP 5
+\fItitle\fP
+the caption for the box, shown on its top border.
+.TP 5
+\fIheight\fP
+the height of the dialog box.
+.TP 5
+\fIwidth\fP
+the width of the dialog box.
+.PP
+Other parameters depend on the box type.
+.
+.\" ************************************************************************
+.IP dialog_calendar
+implements the "\fB--calendar\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP subtitle
+is the prompt text shown within the widget.
+.IP height
+is the height excluding the fixed-height calendar grid.
+.IP width
+is the overall width of the box,
+which is adjusted up to the calendar grid's minimum width if needed.
+.IP day
+is the initial day of the week shown,
+counting zero as Sunday.
+If the value is negative,
+the current day of the week is used.
+.IP month
+is the initial month of the year shown,
+counting one as January.
+If the value is negative,
+the current month of the year is used.
+.IP year
+is the initial year shown.
+If the value is negative,
+the current year is used.
+.RE
+.\" ************************************************************************
+.IP dialog_checklist
+implements the "\fB--checklist\fP" and "\fB--radiolist\fP" options
+depending on the \fIflag\fP parameter.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP cprompt
+is the prompt text shown within the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is adjusted to use the available screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is adjusted to use the available screen size.
+.IP list_height
+is the minimum height to reserve for displaying the list.
+If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
+.IP item_no
+is the number of rows in \fIitems\fP.
+.IP items
+is an array of strings which is viewed either as a list of rows
+.RS
+\fItag item status \fR
+.RE
+.IP
+or
+.RS
+\fItag item status help\fR
+.RE
+.IP
+depending on whether \fIdialog_vars.item_help\fP is set.
+.IP flag
+is either \fIFLAG_CHECK\fP, for checklists,
+or \fIFLAG_RADIO\fP for radiolists.
+.RE
+.\" ************************************************************************
+.IP dialog_dselect
+implements the "\fB--dselect\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP path
+is the preselected value to show in the input-box,
+which is used also to set the directory- and file-windows.
+.IP height
+is the height excluding the minimum needed to show the dialog box framework.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.RE
+.\" ************************************************************************
+.IP dialog_editbox
+implements the "\fB--editbox\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP file
+is the name of the file from which to read.
+.IP height
+is the desired height of the box.
+If zero, the height is adjusted to use the available screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is adjusted to use the available screen size.
+.RE
+.\" ************************************************************************
+.IP dialog_form
+implements the "\fB--form\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP cprompt
+is the prompt text shown within the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is adjusted to use the available screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is adjusted to use the available screen size.
+.IP form_height
+is the minimum height to reserve for displaying the list.
+If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
+.IP item_no
+is the number of rows in \fIitems\fP.
+.IP items
+is an array of strings which is viewed either as a list of rows
+.RS
+\fIName NameY NameX Text TextY TextX FLen ILen\fR
+.RE
+.IP
+or
+.RS
+\fIName NameY NameX Text TextY TextX FLen ILen Help\fR
+.RE
+.IP
+depending on whether \fIdialog_vars.item_help\fP is set.
+.RE
+.\" ************************************************************************
+.IP dialog_fselect
+implements the "\fB--fselect\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP path
+is the preselected value to show in the input-box,
+which is used also to set the directory- and file-windows.
+.IP height
+is the height excluding the minimum needed to show the dialog box framework.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.RE
+.\" ************************************************************************
+.IP dialog_gauge
+implements the "\fB--gauge\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP cprompt
+is the prompt text shown within the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.IP percent
+is the percentage to show in the progress bar.
+.RE
+.\" ************************************************************************
+.IP dialog_inputbox
+implements the "\fB--inputbox\fP" or
+"\fB--password\fP" option, depending on the value of \fIpassword\fP.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP cprompt
+is the prompt text shown within the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.IP init
+is the initial value of the input box, whose length is taken into account
+when auto-sizing the width of the dialog box.
+.IP password
+if true, causes typed input to be echoed as asterisks.
+.RE
+.\" ************************************************************************
+.IP dialog_menu
+implements the "\fB--menu\fP" or "\fB--inputmenu\fP" option
+depending on whether \fIdialog_vars.input_menu\fP is set.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP cprompt
+is the prompt text shown within the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.IP menu_height
+is the minimum height to reserve for displaying the list.
+If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
+.IP item_no
+is the number of rows in \fIitems\fP.
+.IP items
+is an array of strings which is viewed either as a list of rows
+.RS
+\fItag item\fR
+.RE
+.IP
+or
+.RS
+\fItag item help\fR
+.RE
+.IP
+depending on whether \fIdialog_vars.item_help\fP is set.
+.RE
+.\" ************************************************************************
+.IP dialog_mixedform
+implements the "\fB--mixedform\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP cprompt
+is the prompt text shown within the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is adjusted to use the available screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is adjusted to use the available screen size.
+.IP form_height
+is the minimum height to reserve for displaying the list.
+If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
+.IP item_no
+is the number of rows in \fIitems\fP.
+.IP items
+is an array of strings which is viewed either as a list of rows
+.RS
+\fIName NameY NameX Text TextY TextX FLen ILen Ityp\fR
+.RE
+.IP
+or
+.RS
+\fIName NameY NameX Text TextY TextX FLen ILen Ityp Help\fR
+.RE
+.IP
+depending on whether \fIdialog_vars.item_help\fP is set.
+.RE
+.\" ************************************************************************
+.IP dialog_mixedgauge
+implements the "\fB--mixedgauge\fP" option
+.RS
+.IP title
+is the title on the top of the widget.
+.IP cprompt
+is the caption text shown within the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.IP percent
+is the percentage to show in the progress bar.
+.IP item_no
+is the number of rows in \fIitems\fP.
+.IP items
+is an array of strings which is viewed as a list of \fItag\fP and \fIitem\fP values.
+The \fItag\fP values are listed, one per row, in the list at the top of
+the widget.
+.IP
+The \fIitem\fP values are decoded: digits 0-9 are the following strings
+.RS
+.IP 0
+Succeeded
+.IP 1
+Failed
+.IP 2
+Passed
+.IP 3
+Completed
+.IP 4
+Checked
+.IP 5
+Done
+.IP 6
+Skipped
+.IP 7
+In Progress
+.IP 8
+(blank)
+.IP 9
+N/A
+.RE
+.IP
+A string with a leading "-" character is centered, marked with "%".
+For example, "-75" is displayed as "75%".
+Other strings are displayed as is.
+.RE
+.\" ************************************************************************
+.IP dialog_msgbox
+implements the "\fB--msgbox\fP" or "\fB--infobox\fP" option
+depending on whether \fIpauseopt\fP is set.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP cprompt
+is the prompt text shown within the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.IP pauseopt
+if true, an "OK" button will be shown,
+and the dialog will wait for it to complete.
+With an "OK" button, it is denoted a "msgbox",
+without an "OK" button, it is denoted an "infobox".
+.RE
+.\" ************************************************************************
+.IP dialog_pause
+implements the "\fB--pause\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.IP seconds
+is the timeout to use for the progress bar.
+.RE
+.\" ************************************************************************
+.IP dialog_progressbox
+implements the "\fB--progressbox\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP cprompt
+is the prompt text shown within the widget.
+If empty or null, no prompt is shown.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.RE
+.\" ************************************************************************
+.IP dialog_tailbox
+implements the "\fB--tailbox\fP" or "\fB--tailboxbg\fP" option
+depending on whether \fIbg_task\fP is set.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP file
+is the name of the file to display in the dialog.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.IP bg_task
+if true,
+the window is added to the callback list in \fIdialog_state\fP,
+and the application will poll for the window to be updated.
+Otherwise an "OK" button is added to the window,
+and it will be closed when the button is activated.
+.RE
+.\" ************************************************************************
+.IP dialog_textbox
+implements the "\fB--textbox\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP file
+is the name of the file to display in the dialog.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.RE
+.\" ************************************************************************
+.IP dialog_timebox
+implements the "\fB--timebox\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP subtitle
+is the prompt text shown within the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.IP hour
+is the initial hour shown.
+If the value is negative,
+the current hour is used.
+.IP minute
+is the initial minute shown.
+If the value is negative,
+the current minute is used.
+.IP second
+is the initial second shown.
+If the value is negative,
+the current second is used.
+.RE
+.\" ************************************************************************
+.IP dialog_yesno
+implements the "\fB--yesno\fP" option.
+.RS
+.IP title
+is the title on the top of the widget.
+.IP cprompt
+is the prompt text shown within the widget.
+.IP height
+is the desired height of the box.
+If zero, the height is based on the screen size.
+.IP width
+is the desired width of the box.
+If zero, the height is based on the screen size.
+.RE
+.
+.\" ************************************************************************
+.SS UTILITY FUNCTIONS
+Most functions that implement lower-level
+functionality for the command-line \fBdialog\fP
+program or widgets, have names beginning "\fIdlg_\fP".
+Bowing to longstanding usage, the functions that initialize the
+display and end it are named \fIinit_dialog\fP and \fIend_dialog\fP.
+.PP
+The only non-widget function whose name begins with "\fIdialog_\fP"
+is \fIdialog_version\fP, which returns the version number of the
+library as a string.
+.
+.PP
+Here is a brief summary of the utility functions and their parameters:
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_add_callback
+Add a callback, used to allow polling input from multiple tailbox
+widgets.
+.RS
+.TP 5
+.B DIALOG_CALLBACK *\fIp\fP
+contains the callback information.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_add_quoted
+Add a quoted string to the result buffer (see \fBdlg_add_result\fP).
+.RS
+.TP 5
+.B char * \fIstring
+is the string to add.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_add_result
+Add a quoted string to the result buffer \fBdialog_vars.input_result\fP.
+.RS
+.TP 5
+.B char * \fIstring
+is the string to add.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_add_separator
+Add an output-separator to the result buffer \fBdialog_vars.input_result\fP.
+If \fBdialog_vars.output_separator\fP is set, use that.
+Otherwise, if \fBdialog_vars.separate_output\fP is set, use newline.
+If neither is set, use a space.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_add_string
+Add a quoted or unquoted string to the result buffer
+(see \fBdlg_add_quoted\fP) and \fBdlg_add_result\fP),
+according to whether \fBdialog_vars.quoted\fP is true.
+.RS
+.TP 5
+.B char * \fIstring
+is the string to add.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_align_columns
+Copy and reformat an array of pointers to strings, aligning according to
+the column separator \fBdialog_vars.column_separator\fP.
+If no column separator is set, the array will be unmodified;
+otherwise it is copied and reformatted.
+.IP
+Caveat: This function is only implemented for 8-bit characters.
+.RS
+.TP 5
+.B char **\fItarget
+This is the array to reformat.
+It points to the first string to modify.
+.TP 5
+.B int \fIper_row
+This is the size of the struct for each row of the array.
+.TP 5
+.B int \fInum_rows
+This is the number of rows in the array.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_asciibox
+returns its parameter transformed to the
+corresponding "+" or "-", etc. for the line-drawing characters used in \fBdialog\fP.
+If the parameter is not a line-drawing or other special character such as ACS_DARROW, it returns 0.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_attr_clear
+Set window to the given attribute.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window to update.
+.TP 5
+.B int \fIheight
+is the number of rows to update.
+.TP 5
+.B int \fIwidth
+is the number of columns to update.
+.TP 5
+.B chtype \fIattr
+is the attribute, e.g., \fBA_BOLD\fP.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_auto_size
+Automatically size the window used for a widget.
+If the given height or width are zero,
+justify the \fIprompt\fP text and return the actual limits.
+.RS
+.TP 5
+.B const char * \fItitle
+is the title string to display at the top of the widget.
+.TP 5
+.B const char * \fIprompt
+is the message text which will be displayed in the widget,
+used here to determine how large the widget should be.
+.TP 5
+.B int * \fIheight
+is the nominal height.
+.TP 5
+.B int * \fIwidth
+is the nominal width.
+.TP 5
+.B int \fIboxlines
+is the number of lines to reserve in the vertical direction.
+.TP 5
+.B int \fImincols
+is the minimum number of columns to use.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_auto_sizefile
+Like \fBdlg_auto_size\fP, but use a file contents to decide how large
+the widget should be.
+.RS
+.TP 5
+.B const char * \fItitle
+is the title string to display at the top of the widget.
+.TP 5
+.B const char * \fIfile
+is the name of the file.
+.TP 5
+.B int * \fIheight
+is the nominal height.
+If it is -1, use the screen's height after subtracting \fBdialog_vars.begin_y\fP
+if \fBdialog_vars.begin_set\fP is true.
+.TP 5
+.B int \fI*width
+is the nominal width.
+If it is -1, use the screen's width after subtracting \fBdialog_vars.begin_x\fP
+if \fBdialog_vars.begin_set\fP is true.
+.TP 5
+.B int \fIboxlines
+is the number of lines to reserve on the screen for drawing boxes.
+.TP 5
+.B int \fImincols
+is the number of columns to reserve on the screen for drawing boxes.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_beeping
+If \fBdialog_vars.beep_signal\fP is nonzero,
+this calls \fBbeep\fP once and sets
+\fBdialog_vars.beep_signal\fP to zero.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_boxchar
+returns its parameter transformed as follows:
+.RS
+.TP 3
+.B -
+if neither \fBdialog_vars.ascii_lines\fP nor \fBdialog_vars.no_lines\fP is set.
+.TP 3
+.B -
+if \fBdialog_vars.ascii_lines\fP is set, returns the corresponding "+" or "-", etc. for the line-drawing characters used in \fBdialog\fP.
+.TP 3
+.B -
+otherwise, if \fBdialog_vars.no_lines\fP is set, returns a space for the line-drawing characters.
+.TP 3
+.B -
+if the parameter is not a line-drawing or other special character such as ACS_DARROW, it returns the parameter unchanged.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_box_x_ordinate
+returns a suitable x-ordinate (column) for a new widget.
+If \fBdialog_vars.begin_set\fP is 1,
+use \fBdialog_vars.begin_x\fP;
+otherwise center the widget on the screen (using the \fIwidth\fP parameter).
+.RS
+.TP 5
+.B int \fIwidth
+is the width of the widget.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_box_y_ordinate
+returns a suitable y-ordinate (row) for a new widget.
+If \fBdialog_vars.begin_set\fP is 1,
+use \fBdialog_vars.begin_y\fP;
+otherwise center the widget on the screen (using the \fIheight\fP parameter).
+.RS
+.TP 5
+.B int \fIheight
+is the height of the widget.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_button_count
+Count the buttons in the list.
+.RS
+.TP 5
+.B const char ** \fIlabels
+is a list of (pointers to) button labels terminated by a null pointer.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_button_layout
+Make sure there is enough space for the buttons by
+computing the width required for their labels,
+adding margins and limiting based on the screen size.
+.RS
+.TP 5
+.B const char ** \fIlabels
+is a list of (pointers to) button labels terminated by a null pointer.
+.TP 5
+.B int * \fIlimit
+the function sets the referenced \fIlimit\fP to the width required for
+the widest label (limited by the screen size)
+if that is wider than the passed-in limit.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_button_sizes
+Compute the size of the button array in columns.
+.RS
+.TP 5
+.B const char ** \fIlabels
+is a list of (pointers to) button labels terminated by a null pointer.
+.TP 5
+.B int \fIvertical
+is true if the buttons are arranged in a column rather than a row.
+.TP 5
+.B int * \fIlongest
+Return the total number of columns in the referenced location.
+.TP 5
+.B int * \fIlength
+Return the longest button's columns in the referenced location.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_button_x_step
+Compute the step-size needed between elements of the button array.
+.RS
+.TP 5
+.B const char ** \fIlabels
+is a list of (pointers to) button labels terminated by a null pointer.
+.TP 5
+.B int \fIlimit
+is the maximum number of columns to allow for the buttons.
+.TP 5
+.B int * \fIgap
+store the nominal gap between buttons in the referenced location.
+This is constrained to be at least one.
+.TP 5
+.B int * \fImargin
+store the left+right total margins (for the list of buttons) in the referenced
+location.
+.TP 5
+.B int * \fIstep
+store the step-size in the referenced location.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_button_to_char
+Find the first uppercase character in the label, which we may use for an
+abbreviation.
+If the label is empty, return -1.
+If no uppercase character is found, return 0.
+Otherwise return the uppercase character.
+.RS
+.TP 5
+.B const char * \fIlabel
+is the label to test.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_calc_list_width
+Calculate the minimum width for the list, assuming none of the items
+are truncated.
+.RS
+.TP 5
+.B int \fIitem_no
+is the number of \fIitems\fP.
+.TP 5
+.B DIALOG_LISTITEM * \fIitems
+contains a \fIname\fP and \fItext\fP field,
+e.g., for checklists or radiobox lists.
+The function returns the sum of the widest columns
+needed for of each of these fields.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_calc_listh
+Calculate new height and list_height values.
+.RS
+.TP 5
+.B int * \fIheight
+on input, is the height without adding the list-height.
+On return, this contains the total list-height and is the
+actual widget's height.
+.TP 5
+.B int * \fIlist_height
+on input, is the requested list-height.
+On return, this contains the number of rows available for displaying
+the list after taking into account the screen size and
+the \fBdialog_vars.begin_set\fP and \fBdialog_vars.begin_y\fP variables.
+.TP 5
+.B int \fIitem_no
+is the number of \fIitems\fP in the list.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_calc_listw
+This function is obsolete, provided for library-compatibility.
+It is replaced by \fIdlg_calc_list_width\fP.
+.RS
+.TP 5
+.B int \fIitem_no
+is the number of \fIitems\fP.
+.TP 5
+.B char ** \fIitems
+is a list of character pointers.
+.TP 5
+.B int \fIgroup
+is the number of items in each group, e.g., the second array index.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_char_to_button
+Given a list of button labels,
+and a character which may be the abbreviation for one, find it, if it exists.
+An abbreviation will be the first character
+which happens to be capitalized in the label.
+If the character is found, return its index within the list of \fIlabels\fP.
+Otherwise, return \fBDLG_EXIT_UNKNOWN\fP.
+.RS
+.TP 5
+.B int \fIch
+is the character to find.
+.TP 5
+.B const char ** \fIlabels
+is a list of (pointers to) button labels terminated by a null pointer.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_checklist
+This entrypoint provides the \fB--checklist\fP or \fP--radiolist\fP
+functionality without the limitations of \fBdialog\fP's command-line syntax
+(compare to \fBdialog_checklist\fP).
+.RS
+.TP 5
+.B const char * \fItitle
+is the title string to display at the top of the widget.
+.TP 5
+.B const char * \fIcprompt
+is the prompt text shown within the widget.
+.TP 5
+.B int \fIheight
+is the desired height of the box.
+If zero, the height is adjusted to use the available screen size.
+.TP 5
+.B int \fIwidth
+is the desired width of the box.
+If zero, the height is adjusted to use the available screen size.
+.TP 5
+.B int \fIlist_height
+is the minimum height to reserve for displaying the list.
+If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
+.TP 5
+.B int \fIitem_no
+is the number of \fIitems\fP.
+.TP 5
+.B DIALOG_LISTITEM * \fIitems
+This is a list of the items to display in the checklist.
+.TP 5
+.B const char * \fIstates
+This is a list of characters to display for the given states.
+Normally a checklist provides true (1) and false (0) values,
+which the widget displays as "*" and space, respectively.
+An application may set this parameter to an arbitrary null-terminated string.
+The widget determines the number of states from the length of this string,
+and will cycle through the corresponding display characters as the user
+presses the space-bar.
+.TP 5
+.B int \fIflag
+This is should be one of \fBFLAG_CHECK\fP or \fPFLAG_RADIO\fP,
+depending on whether the widget should act as a checklist or radiobox.
+.TP 5
+.B int * \fIcurrent_item
+The widget sets the referenced location to the index of the current display
+item (cursor) when it returns.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_clear
+Set window to the default dialog screen attribute.
+This is set in the rc-file with \fBscreen_color\fP.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_clr_result
+Free storage used for the result buffer (\fBdialog_vars.input_result\fP).
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_color_count
+Return the number of colors that can be configured in \fBdialog\fP.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_color_setup
+Initialize the color pairs used in \fBdialog\fP.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_count_columns
+Returns the number of columns used for a string.
+This is not necessarily the number of bytes in a string.
+.RS
+.TP 5
+.B const char * \fIstring
+is the string to measure.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_count_wchars
+Returns the number of wide-characters in the string.
+.RS
+.TP 5
+.B const char * \fIstring
+is the string to measure.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_create_rc
+Create a configuration file,
+i.e., write internal tables to a file which can be read back by \fBdialog\fP
+as an rc-file.
+.RS
+.TP 5
+.B const char * \fIfilename
+is the name of the file to write to.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_ctl_size
+If \fBdialog_vars.size_err\fP is true,
+check if the given window size is too large to fit on the screen.
+If so, exit with an error reporting the size of the window.
+.RS
+.TP 5
+.B int \fIheight
+is the window's height
+.TP 5
+.B int \fIwidth
+is the window's width
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_default_formitem
+If \fBdialog_vars.default_item\fP is not null,
+find that name by matching the \fIname\fP field in the list of form \fIitems\fP.
+If found, return the index of that item in the list.
+Otherwise, return zero.
+.RS
+.TP 5
+.B DIALOG_FORMITEM * \fIitems
+is the list of items to search.
+It is terminated by an entry with a null \fIname\fP field.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_default_item
+This function is obsolete, provided for library-compatibility.
+It is replaced by \fIdlg_default_formitem\fP and \fIdlg_default_listitem\fP.
+.RS
+.TP 5
+.B char ** \fIitems
+is the list of items to search.
+.TP 5
+.B int \fIllen
+is the number of items in each group, e.g., the second array index.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_defaultno_button
+If \fBdialog_vars.defaultno\fP is true, and \fBdialog_vars.nocancel\fP is not,
+find the button-index for the "Cancel" button.
+Otherwise, return the index for "OK" (always zero).
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_del_window
+Remove a window, repainting everything else.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window to remove.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_does_output
+This is called each time a widget is invoked which may do output.
+It increments dialog_state.output_count,
+so the output function in \fBdialog\fP can test this and add a separator.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_draw_arrows
+Draw up/down arrows on a window, e.g., for scrollable lists.
+It calls \fBdlg_draw_arrows2\fP using the
+\fImenubox_color\fP and \fImenubox_border_color\fP attributes.
+.RS
+.TP 5
+.B WINDOW * \fIdialog
+is the window on which to draw an arrow.
+.TP 5
+.B int \fItop_arrow
+is true if an up-arrow should be drawn at the top of the window.
+.TP 5
+.B int \fIbottom_arrow
+is true if an down-arrow should be drawn at the bottom of the window.
+.TP 5
+.B int \fIx
+is the zero-based column within the window on which to draw arrows.
+.TP 5
+.B int \fItop
+is the zero-based row within the window on which to draw up-arrows
+as well as a horizontal line to show the window's top.
+.TP 5
+.B int \fIbottom
+is the zero-based row within the window on which to draw down-arrows
+as well as a horizontal line to show the window's bottom.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_draw_arrows2
+Draw up/down arrows on a window, e.g., for scrollable lists.
+.RS
+.TP 5
+.B WINDOW * \fIdialog
+is the window on which to draw an arrow.
+.TP 5
+.B int \fItop_arrow
+is true if an up-arrow should be drawn at the top of the window.
+.TP 5
+.B int \fIbottom_arrow
+is true if an down-arrow should be drawn at the bottom of the window.
+.TP 5
+.B int \fIx
+is the zero-based column within the window on which to draw arrows.
+.TP 5
+.B int \fItop
+is the zero-based row within the window on which to draw up-arrows
+as well as a horizontal line to show the window's top.
+.TP 5
+.B int \fIbottom
+is the zero-based row within the window on which to draw down-arrows
+as well as a horizontal line to show the window's bottom.
+.TP 5
+.B chtype \fIattr
+is the window's background attribute.
+.TP 5
+.B chtype \fIborderattr
+is the window's border attribute.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_draw_bottom_box
+Draw a partial box at the bottom of a window,
+e.g., to surround a row of buttons.
+It is designed to merge with an existing box around
+the whole window, so it uses tee-elements rather than corner-elements
+on the top corners of this box.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window to update.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_draw_box
+Draw a rectangular box with line drawing characters.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window to update.
+.TP 5
+.B int \fIy
+is the top row of the box.
+.TP 5
+.B int \fIx
+is the left column of the box.
+.TP 5
+.B int \fIheight
+is the height of the box.
+.TP 5
+.B int \fIwidth
+is the width of the box.
+.TP 5
+.B chtype \fIboxchar
+is used to color the right/lower edges.
+It also is fill-color used for the box contents.
+.TP 5
+.B chtype \fIborderchar
+is used to color the upper/left edges.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_draw_buttons
+Print a list of buttons at the given position.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window to update.
+.TP 5
+.B int \fIy
+is the starting row.
+.TP 5
+.B int \fIx
+is the starting column.
+.TP 5
+.B const char ** \fIlabels
+is a list of (pointers to) button labels terminated by a null pointer.
+.TP 5
+.B int \fIselected
+is the index within the list of the selected button.
+.TP 5
+.B int \fIvertical
+is true if the buttons are arranged in a column rather than a row.
+.TP 5
+.B int \fIlimit
+is the number of columns (or rows if \fIvertical\fP) allowed for the display.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_draw_shadow
+Draw shadows along the right and bottom edge of a window to give it
+a 3-dimensional look.
+(The height, etc., may not be the same as the window's actual values).
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window to update.
+.TP 5
+.B int \fIheight
+is the height of the window.
+.TP 5
+.B int \fIwidth
+is the width of the window.
+.TP 5
+.B int \fIy
+is the top row of the window.
+.TP 5
+.B int \fIx
+is the left column of the window.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_draw_title
+Draw a title centered at the top of the window.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window to update.
+.TP 5
+.B const char * \fItitle
+is the title string to display at the top of the widget.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_dump_keys
+Write all user-defined key-bindings to the given stream,
+e.g., as part of \fBdlg_create_rc\fP.
+.RS
+.TP 5
+.B FILE * \fIfp
+is the stream on which to write the bindings.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_edit_offset
+Given the character-offset in the string,
+returns the display-offset where
+dialog should position the cursor.
+In this context, "characters" may be multicolumn,
+since the string can be a multibyte character string.
+.RS
+.TP 5
+.B char * \fIstring
+is the string to analyze
+.TP 5
+.B int \fIoffset
+is the character-offset
+.TP 5
+.B int \fIx_last
+is a limit on the column positions that can be used,
+e.g., the window's size.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_edit_string
+Updates the string and character-offset, given various editing characters
+or literal characters which are inserted at the character-offset.
+Returns true if an editing change was made (and the display should
+be updated), and false if the key was something like KEY_ENTER,
+which is a non-editing action outside this function.
+.RS
+.TP 5
+.B char * \fIstring
+is the (multibyte) string to update
+.TP 5
+.B int * \fIoffset
+is the character-offset
+.TP 5
+.B int \fIkey
+is the editing key
+.TP 5
+.B int \fIfkey
+is true if the editing key is a function-key
+.TP 5
+.B bool \fIforce
+is used in a special loop case by calling code to force the return
+value of this function when a function-key code 0 is passed in.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_exit
+Given an internal exit code,
+check if the corresponding environment variable is set.
+If so, remap the exit code to match the environment variable.
+Finally call \fBexit\fP with the resulting exit code.
+.RS
+.TP 5
+.B int \fIcode
+is the internal exit code, e.g., \fBDLG_EXIT_OK\fP,
+which may be remapped.
+.RE
+.IP
+The \fBdialog\fP program uses this function
+to allow shell scripts to remap the exit codes so they can distinguish ESC
+from ERROR.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_exit_buttoncode
+Map the given button index for \fBdlg_exit_label\fP into dialog's exit-code.
+.RS
+.TP 5
+.B int \fIbutton
+is the button index
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_exit_label
+Return a list of button labels.
+If dialog_var.extra_button is true, return the result of \fBdlg_ok_labels\fP.
+Otherwise, return a list with the "Exit" label and (if \fBdialog_vars.help_button\fP
+is set) the "Help" button as well.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_exiterr
+Quit program killing all \fBtailboxbg\fP widgets.
+.RS
+.TP 5
+.B const char * \fIfmt
+is the format of the \fBprintf\fP-like message to write.
+.TP 5
+.
+are the variables to apply to the \fIfmt\fP format.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_find_index
+Given the character-offset to find in the list, return the corresponding
+array index.
+.RS
+.TP 5
+.B const int *\fIlist
+contains a list of character-offsets,
+i.e., indices into a string that denote the beginning of multibyte characters.
+.TP 5
+.B int \fIlimit
+is the last index into \fBlist\fP to search.
+.TP 5
+.B int \fIto_find
+is the character-offset to find.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_flush_getc
+Cancel the local data saved by \fBdlg_last_getc\fP.
+.\" ---------------------------------------------------------------------------
+.IP dlg_editbox
+This entrypoint provides the \fB--editbox\fP
+functionality without the limitations of \fBdialog\fP's command-line syntax
+(compare to \fBdialog_editbox\fP).
+.RS
+.TP 5
+.B const char * \fItitle
+is the title string to display at the top of the widget.
+.TP 5
+.B char *** \fIlist
+is a pointer to an array of \fBchar\ *\fP pointers.
+The array is allocated by the caller,
+and so are the strings to which it points.
+The \fBdlg_editbox\fP function may reallocate the
+array and the strings.
+.TP 5
+.B int * \fIrows
+points to the nominal length of \fIlist\fP.
+The referenced value is updated if\fIlist\fP is reallocated.
+.TP 5
+.B int \fIheight
+is the desired height of the box.
+If zero, the height is adjusted to use the available screen size.
+.TP 5
+.B int \fIwidth
+is the desired width of the box.
+If zero, the height is adjusted to use the available screen size.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_form
+This entrypoint provides the \fB--form\fP
+functionality without the limitations of \fBdialog\fP's command-line syntax
+(compare to \fBdialog_form\fP).
+.RS
+.TP 5
+.B const char * \fItitle
+is the title string to display at the top of the widget.
+.TP 5
+.B const char * \fIcprompt
+is the prompt text shown within the widget.
+.TP 5
+.B int \fIheight
+is the desired height of the box.
+If zero, the height is adjusted to use the available screen size.
+.TP 5
+.B int \fIwidth
+is the desired width of the box.
+If zero, the height is adjusted to use the available screen size.
+.TP 5
+.B int \fIform_height
+is the minimum height to reserve for displaying the list.
+If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
+.TP 5
+.B int \fIitem_no
+is the number of \fIitems\fP.
+.TP 5
+.B DIALOG_FORMITEM * \fIitems
+This is a list of the items to display in the form.
+.TP 5
+.B int * \fIcurrent_item
+The widget sets the referenced location to the index of the current display
+item (cursor) when it returns.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_free_columns
+Free data allocated by \fBdlg_align_columns\fP.
+.RS
+.TP 5
+.B char **\fItarget
+This is the array which was reformatted.
+It points to the first string to free.
+.TP 5
+.B int \fIper_row
+This is the size of the struct for each row of the array.
+.TP 5
+.B int \fInum_rows
+This is the number of rows in the array.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_free_formitems
+Free memory owned by a list of DIALOG_FORMITEM's.
+.RS
+.TP 5
+.B DIALOG_FORMITEM * \fIitems
+is the list to free.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_getc
+Read a character from the given window.
+Handle repainting here (to simplify
+things in the calling application).
+Also, if input-callback(s) are set up,
+poll the corresponding files and handle the updates,
+e.g., for displaying a tailbox.
+Returns the key-code.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window within which to read.
+.TP 5
+.B int * \fIfkey
+as a side-effect, set this to true if the key-code is really a function-key.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_getc_callbacks
+passes the given key-code \fIch\fP to the current window that
+has established a callback.
+If the callback returns zero, remove it and try the next window.
+If no more callbacks remain, return.
+If any callbacks were found, return true, otherwise false.
+.RS
+.TP 5
+.B int \fIch
+is the key-code
+.TP 5
+.B int \fIfkey
+is true if the key is a function-key
+.TP 5
+.B int * \fIresult
+is used to pass an exit-code to the caller,
+which should pass that via \fBdlg_exit\fP.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_index_columns
+Build a list of the display-columns for the given multibyte string's characters.
+.RS
+.TP 5
+.B const char * \fIstring
+is the string to analyze
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_index_wchars
+Build an index of the wide-characters in the string,
+so the caller can easily tell
+which byte-offset begins a given wide-character.
+.RS
+.TP 5
+.B const char * \fIstring
+is the string to analyze
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_item_help
+Draw the string for the \fBdialog_vars.item_help\fP feature.
+.RS
+.TP 5
+.B char * \fItxt
+is the help-message
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_killall_bg
+If \fBdialog\fP has callbacks active,
+purge the list of all that are not marked
+to keep in the background.
+If any remain, run those in a background process.
+.RS
+.TP 5
+.B int * \fIretval
+stores the exit-code to pass back to the caller.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_last_getc
+returns the most recent character that was read via \fBdlg_getc\fP.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_limit_columns
+Given a column limit,
+count the number of wide characters that can fit into that limit.
+The offset is used to skip over a leading character
+that was already written.
+.RS
+.TP 5
+.B const char * \fIstring
+is the string to analyze
+.TP 5
+.B int \fIlimit
+is the column limit
+.TP 5
+.B int \fIoffset
+is the starting offset from which analysis should continue
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_lookup_key
+Check for a key-binding.
+If there is no binding associated with the widget, it simply returns
+the given curses-key.
+Otherwise, it returns the result of the binding
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window on which the binding is checked
+.TP 5
+.B int \fIcurses_key
+is the curses key-code
+.TP 5
+.B int * \fIdialog_key
+is the corresponding dialog internal code
+(see \fBDLG_KEYS_ENUM\fP in dlg_key.h).
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_max_input
+Limit the parameter according to \fBdialog_vars.max_input\fP
+.RS
+.TP 5
+.B int \fImax_len
+is the value to limit
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_match_char
+Match a given character against the beginning of the string,
+ignoring case of the given character.
+The matching string must begin with an uppercase character.
+.RS
+.TP 5
+.B int \fIch
+is the character to check
+.TP 5
+.B const char * \fIstring
+is the string to search
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_menu
+This entrypoint provides the \fB--menu\fP
+functionality without the limitations of \fBdialog\fP's command-line syntax
+(compare to \fBdialog_menu\fP).
+.RS
+.TP 5
+.B const char * \fItitle
+is the title string to display at the top of the widget.
+.TP 5
+.B const char * \fIcprompt
+is the prompt text shown within the widget.
+.TP 5
+.B int \fIheight
+is the desired height of the box.
+If zero, the height is adjusted to use the available screen size.
+.TP 5
+.B int \fIwidth
+is the desired width of the box.
+If zero, the height is adjusted to use the available screen size.
+.TP 5
+.B int \fImenu_height
+is the minimum height to reserve for displaying the list.
+If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
+.TP 5
+.B int \fIitem_no
+is the number of \fIitems\fP.
+.TP 5
+.B DIALOG_LISTITEM * \fIitems
+This is a list of the items to display in the form.
+.TP 5
+.B int * \fIcurrent_item
+The widget sets the referenced location to the index of the current display
+item (cursor) when it returns.
+.TP 5
+.B DIALOG_INPUTMENU \fIrename_menutext
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_move_window
+Moves/resizes the given window to the given position and size.
+.RS
+.TP 5
+.B WINDOW *\fIwin
+is the window to move/resize.
+.TP 5
+.B WINDOW *\fIheight
+is the height of the resized window.
+.TP 5
+.B WINDOW *\fIwidth
+is the width of the resized window.
+.TP 5
+.B WINDOW *\fIy
+y-ordinate to use for the repositioned window.
+.TP 5
+.B WINDOW *\fIx
+x-ordinate to use for the repositioned window.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_mouse_bigregion
+Retrieve the big-region under the pointer.
+.RS
+.TP 5
+.B int \fIy
+is the row on which the mouse click occurred
+.TP 5
+.B int \fIx
+is the column on which the mouse click occurred
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_mouse_free_regions
+Free the memory associated with mouse regions.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_mouse_mkbigregion
+Creates a region on which the mouse-clicks will return a specifed code.
+.RS
+.TP 5
+.B int \fIy
+is the top-row of the region.
+.TP 5
+.B int \fIx
+is the left-column of the region.
+.TP 5
+.B int \fIheight
+is the height of the region.
+.TP 5
+.B int \fIwidth
+is the width of the region.
+.TP 5
+.B int \fIcode
+is a code used to make the region unique within a widget
+.TP 5
+.B int \fIstep_x
+is used in modes 2 (columns) and 3 (cells) to determine the width
+of a column/cell.
+.TP 5
+.B int \fIstep_y
+is currently unused
+.TP 5
+.B int \fImode
+is used to determine how the mouse position is translated into
+a code (like a function-key):
+.RS
+.TP
+1
+index by lines
+.TP
+2
+index by columns
+.TP
+3
+index by cells
+.RE
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_mouse_mkregion
+.RS
+.TP 5
+.B int \fIy
+is the top-row of the region.
+.TP 5
+.B int \fIx
+is the left-column of the region.
+.TP 5
+.B int \fIheight
+is the height of the region.
+.TP 5
+.B int \fIwidth
+is the width of the region.
+.TP 5
+.B int \fIcode
+is a code used to make the region unique within a widget
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_mouse_region
+Retrieve the frame under the mouse pointer
+.RS
+.TP 5
+.B int \fIy
+is the row of the mouse-click
+.TP 5
+.B int \fIx
+is the column of the mouse-click
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_mouse_setbase
+Sets a base for subsequent calls to \fBdlg_mouse_mkregion\fP,
+so they can make regions relative to the start of a given window.
+.RS
+.TP 5
+.B int \fIx
+is the left-column for the base
+.TP 5
+.B int \fIy
+is the top-row for the base
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_mouse_wgetch
+is a wrapper for \fBdlg_getc\fP which additionally maps mouse-clicks
+(if the curses library supports those) into extended function-keys
+which encode the position according to the \fImode\fP in
+\fBdlg_mouse_mkbigregion\fP.
+Returns the corresponding key-code.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window on which to perform the input
+.TP 5
+.B int * \fIfkey
+the referenced location is set to true if the key-code is an actual
+or extended (mouse) function-key.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_mouse_wgetch_nowait
+This is a non-blocking variant of \fBdlg_mouse_wgetch\fP.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window on which to perform the input
+.TP 5
+.B int * \fIfkey
+the referenced location is set to true if the key-code is an actual
+or extended (mouse) function-key.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_need_separator
+Check if an output-separator is needed.
+If \fBdialog_vars.output_separator\fP is set, return true.
+Otherwise, if \fBdialog_vars.input_result\fP is nonempty, return true.
+If neither, return false.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_new_modal_window
+Create a modal window, optionally with a shadow.
+The shadow is created if dialog_state.use_shadow is true.
+.RS
+.TP 5
+.B WINDOW * \fIparent
+is the parent window (usually the top-level window of a widget)
+.TP 5
+.B int \fIheight
+is the window's height
+.TP 5
+.B int \fIwidth
+is the window's width
+.TP 5
+.B int \fIy
+is the window's top-row
+.TP 5
+.B int \fIx
+is the window's left-column
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_new_window
+Create a window, optionally with a shadow.
+The shadow is created if dialog_state.use_shadow is true.
+.RS
+.TP 5
+.B int \fIheight
+is the window's height
+.TP 5
+.B int \fIwidth
+is the window's width
+.TP 5
+.B int \fIy
+is the window's top-row
+.TP 5
+.B int \fIx
+is the window's left-column
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_next_button
+Return the next index in the list of labels.
+.RS
+.TP 5
+.B const char ** \fIlabels
+is a list of (pointers to) button labels terminated by a null pointer.
+.TP 5
+.B int \fIbutton
+is the current button-index.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_next_ok_buttonindex
+Assuming that the caller is using \fBdlg_ok_labels\fP to list buttons,
+find the next index in the list of buttons.
+.RS
+.TP 5
+.B int \fIcurrent
+is the current index in the list of buttons
+.TP 5
+.B int \fIextra
+if negative, provides a way to enumerate extra active areas on the widget.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_ok_buttoncode
+Map the given button index for \fBdlg_ok_labels\fP
+into \fBdialog\fP's exit-code.
+.RS
+.TP 5
+.B int \fIbutton
+is the button-index (which is not necessarily the same as the index
+in the list of labels).
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_ok_label
+Returns a list with the "Ok" label,
+and if \fBdialog_vars.help_button\fP is true, the "Help" label as well.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_ok_labels
+Return a list of button labels for the OK/Cancel group of widgets.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_ordinate
+Decode the string as an integer, decrement if greater than zero to make
+a curses-ordinate from a dialog-ordinate.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_parse_bindkey
+Parse the parameters of the "bindkeys" configuration-file entry. This
+expects widget name which may be "*", followed by curses key definition and
+then dialog key definition.
+.RS
+.TP 5
+.B char * \fIparams
+is the parameter string to parse.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_parse_rc
+Parse the configuration file and set up variables.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_prev_button
+Return the previous index in the list of labels.
+.RS
+.TP 5
+.B const char ** \fIlabels
+is a list of (pointers to) button labels terminated by a null pointer.
+.TP 5
+.B int \fIbutton
+is the current button index
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_print_line
+Print one line of the prompt in the window within the limits of the
+specified right margin.
+The line will end on a word boundary and a pointer
+to the start of the next line is returned, or a NULL pointer if the end of
+*prompt is reached.
+.RS
+.TP 5
+.B WINDOW *\fIwin
+is the window to update.
+.TP 5
+.B chtype *\fIattr
+holds the starting attributes, and is updated to reflect the final attributes
+applied to the string.
+.TP 5
+.B const char *\fIprompt
+is the string to print
+.TP 5
+.B int \fIlm
+is the left margin.
+.TP 5
+.B int \fIrm
+is the right margin
+.TP 5
+.B int *\fIx
+returns the ending x-ordinate.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_prev_ok_buttonindex
+Find the previous button index in the list from \fBdlg_ok_labels\fP.
+.RS
+.TP 5
+.B int \fIcurrent
+is the current index
+.TP 5
+.B int \fIextra
+if negative provides a way to enumerate extra active areas on the widget.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_print_autowrap
+Print a string of text in a window, automatically wrap around to the next
+line if the string is too long to fit on one line.
+Note that the string may contain embedded newlines.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window to update.
+.TP 5
+.B const char * \fIprompt
+is the string to print
+.TP 5
+.B int \fIheight
+is the nominal height the wrapped string is limited to
+.TP 5
+.B int \fIwidth
+is the width that the wrapping should occur in
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_print_size
+If \fBdialog_vars.print_siz\fP is true,
+print the given height/width (from a widget)
+to dialog_state.output, e.g.,
+\fBSize: height, width\fP.
+.RS
+.TP 5
+.B int \fIheight
+is the window's height
+.TP 5
+.B int \fIwidth
+is the window's width
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_print_text
+Print up to \fIcols\fP columns from \fBtext\fP,
+optionally rendering \fBdialog\fP's escape sequences for attributes and color.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window to update.
+.TP 5
+.B const char * \fItxt
+is the string to print
+.TP 5
+.B int \fIcol
+is the column limit
+.TP 5
+.B chtype * \fIattr
+holds the starting attributes, and is updated to reflect the final attributes
+applied to the string.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_put_backtitle
+Display the background title if \fBdialog_vars.backtitle\fP is non-null.
+The background title is shown at the top of the screen.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_register_buttons
+The widget developer should call this function after \fBdlg_register_window\fP,
+for the list of button labels associated with the widget.
+One may bind a key to a button, e.g., "OK" for \fBDLGK_OK\fP,
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window with which to associate the buttons
+.TP 5
+.B const char * \fIname
+is the widget's binding name (usually the name of the widget).
+.TP 5
+.B const char ** \fIbuttons
+is the list of buttons
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_register_window
+For a given named widget's window, associate a binding table.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window with which to associate the buttons
+.TP 5
+.B const char * \fIname
+is the widget's binding name (usually the name of the widget).
+.TP 5
+.B DLG_KEYS_BINDING * \fIbinding
+is the binding table
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_remove_callback
+Remove a callback.
+.RS
+.TP 5
+.B DIALOG_CALLBACK \fI* p
+contains the callback information.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_restore_vars
+Restore dialog's variables from the given variable (see \fBdialog_save_vars\fP).
+.RS
+.TP 5
+.B DIALOG_VARS * \fIsave
+is the variable from which to restore.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_result_key
+Test a dialog internal keycode to see if it corresponds to one of the push
+buttons on the widget such as "OK".
+This is only useful if there are user-defined key bindings, since there are
+no built-in bindings that map directly to \fBDLGK_OK\fP, etc.
+Return true if a mapping was done.
+.RS
+.TP 5
+.B int \fIdialog_key
+is the dialog key to test
+.TP 5
+.B int \fIfkey
+is true if this is a function key
+.TP 5
+.B int * \fIresultp
+store the result of the mapping in the referenced location.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_save_vars
+Save dialog's variables into the given variable (see \fBdialog_restore_vars\fP).
+.RS
+.TP 5
+.B DIALOG_VARS * \fIsave
+is the variable into which to save.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_set_focus
+Set focus on the given window,
+making it display above other windows on the screen.
+.RS
+.TP 5
+.B WINDOW * \fIparent
+is the parent window (usually the top-level window of a widget)
+.TP 5
+.B WINDOW * \fIwin
+is the window on which to place focus (usually a subwindow of a widget)
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_set_result
+Setup a fixed-buffer for the result in \fBdialog_vars.input_result\fP
+.RS
+.TP 5
+.B const char * \fIstring
+is the new contents for the result
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_show_string
+Displays the string, shifted as necessary, to fit within the box and show
+the current character-offset.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window within which to display
+.TP 5
+.B const char * \fIstring
+is the string to display
+.TP 5
+.B int \fIoffset
+is the starting (character, not bytes) offset
+.TP 5
+.B chtype \fIattr
+is the window attribute to use for the string
+.TP 5
+.B int \fIy_base
+beginning row on screen
+.TP 5
+.B int \fIx_base
+beginning column on screen
+.TP 5
+.B int \fIx_last
+number of columns on screen
+.TP 5
+.B bool \fIhidden
+if true, do not echo input
+.TP 5
+.B bool \fIforce
+if true, force repaint
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_strclone
+duplicate the string, like \fBstrdup\fP.
+.RS
+.TP 5
+.B const char * \fIcprompt
+is the string to duplicate
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_strcmp
+compare two strings, ignoring case.
+.RS
+.TP 5
+.B const char \fI* a
+is one string
+.TP 5
+.B const char \fI* b
+is the other string
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_sub_window
+create a subwindow, e.g., for an input area of a widget
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the parent window
+.TP 5
+.B int \fIheight
+is the subwindow's height
+.TP 5
+.B int \fIwidth
+is the subwindow's width
+.TP 5
+.B int \fIy
+is the subwindow's top-row
+.TP 5
+.B int \fIx
+is the subwindow's left-column
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_tab_correct_str
+If the \fBdialog_vars.tab_correct\fP is true, convert tabs to single spaces.
+Return the converted result.
+The caller is responsible for freeing the string.
+.RS
+.TP 5
+.B char * \fIprompt
+is the string to convert
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_trace
+If the parameter is non-null, opens a trace file with that
+name and stores the file pointer in \fBdialog_state.trace\fP.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_trace_chr
+If \fBdialog_state.trace\fP is set,
+translate the parameters into a printable representation,
+log it on a "chr" line.
+.RS
+.TP 5
+.B int ch
+is the nominal keycode value.
+.TP 5
+.B int fkey
+is nonzero if the value is really a function key.
+Some of these may be values declared in the DLG_KEYS_ENUM.
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_trace_win
+If \fBdialog_state.trace\fP is set,
+log a printable picture of the given window.
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_trim_string
+Change embedded "\\n" substrings to '\\n' characters and tabs to single spaces.
+If there are no "\\n"s, the function strips all extra spaces, for justification.
+If it has "\\n"'s, the function preserves extra spaces.
+If \fBdialog_vars.cr_wrap\fP is set, the function preserves '\\n's.
+.RS
+.TP 5
+.B char * \fIsrc
+is the string to trim
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_unregister_window
+Remove the bindings for a given window.
+.RS
+.TP 5
+.B WINDOW * \fIwin
+is the window from which to remove bindings
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_yes_buttoncode
+Map the given button index for \fBdlg_yes_labels\fP into \fBdialog\fP's exit-code.
+.RS
+.TP 5
+.B int \fIbutton
+is the button index
+.RE
+.\" ---------------------------------------------------------------------------
+.TP 5
+.B dlg_yes_labels
+Return a list of buttons for Yes/No labels.
+.
+.\" ************************************************************************
+.SH SEE ALSO
+dialog (1).
+.
+.\" ************************************************************************
+.SH AUTHOR
+Thomas E. Dickey
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/dialog.c b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.c
new file mode 100644
index 00000000000..cb6197b6333
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.c
@@ -0,0 +1,1695 @@
+/*
+ * $Id: dialog.c,v 1.174 2008/08/19 23:21:36 tom Exp $
+ *
+ * cdialog - Display simple dialog boxes from shell scripts
+ *
+ * Copyright 2000-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors
+ * Savio Lam (lam836@cs.cuhk.hk)
+ */
+
+#include <dialog.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#ifdef HAVE_SETLOCALE
+#include <locale.h>
+#endif
+
+#define PASSARGS t, av, offset_add
+#define CALLARGS const char *t, char *av[], int *offset_add
+typedef int (callerFn) (CALLARGS);
+
+typedef enum {
+ o_unknown = 0
+ ,o_allow_close
+ ,o_and_widget
+ ,o_ascii_lines
+ ,o_aspect
+ ,o_auto_placement
+ ,o_backtitle
+ ,o_beep
+ ,o_beep_after
+ ,o_begin
+ ,o_calendar
+ ,o_cancel_label
+ ,o_checklist
+ ,o_clear
+ ,o_colors
+ ,o_column_separator
+ ,o_cr_wrap
+ ,o_create_rc
+ ,o_default_item
+ ,o_defaultno
+ ,o_dselect
+ ,o_editbox
+ ,o_exit_label
+ ,o_extra_button
+ ,o_extra_label
+ ,o_fixed_font
+ ,o_form
+ ,o_fselect
+ ,o_fullbutton
+ ,o_gauge
+ ,o_help
+ ,o_help_button
+ ,o_help_label
+ ,o_help_status
+ ,o_icon
+ ,o_ignore
+ ,o_infobox
+ ,o_input_fd
+ ,o_inputbox
+ ,o_inputmenu
+ ,o_insecure
+ ,o_item_help
+ ,o_keep_colors
+ ,o_keep_tite
+ ,o_keep_window
+ ,o_max_input
+ ,o_menu
+ ,o_mixedform
+ ,o_mixedgauge
+ ,o_msgbox
+ ,o_no_close
+ ,o_no_collapse
+ ,o_no_cr_wrap
+ ,o_no_kill
+ ,o_no_label
+ ,o_no_lines
+ ,o_no_shadow
+ ,o_nocancel
+ ,o_noitem
+ ,o_nook
+ ,o_ok_label
+ ,o_output_fd
+ ,o_output_separator
+ ,o_passwordbox
+ ,o_passwordform
+ ,o_pause
+ ,o_print_maxsize
+ ,o_print_size
+ ,o_print_version
+ ,o_progressbox
+ ,o_quoted
+ ,o_radiolist
+ ,o_screen_center
+ ,o_separate_output
+ ,o_separate_widget
+ ,o_separator
+ ,o_shadow
+ ,o_single_quoted
+ ,o_size_err
+ ,o_sleep
+ ,o_smooth
+ ,o_stderr
+ ,o_stdout
+ ,o_tab_correct
+ ,o_tab_len
+ ,o_tailbox
+ ,o_tailboxbg
+ ,o_textbox
+ ,o_timebox
+ ,o_timeout
+ ,o_title
+ ,o_trim
+ ,o_under_mouse
+ ,o_visit_items
+ ,o_wmclass
+ ,o_yes_label
+ ,o_yesno
+#ifdef HAVE_DLG_TRACE
+ ,o_trace
+#endif
+} eOptions;
+
+/*
+ * The bits in 'pass' are used to decide which options are applicable at
+ * different stages in the program:
+ * 1 flags before widgets
+ * 2 widgets
+ * 4 non-widget options
+ */
+typedef struct {
+ const char *name;
+ eOptions code;
+ int pass; /* 1,2,4 or combination */
+ const char *help; /* NULL to suppress, non-empty to display params */
+} Options;
+
+typedef struct {
+ eOptions code;
+ int argmin, argmax;
+ callerFn *jumper;
+} Mode;
+
+static bool *dialog_opts;
+static char **dialog_argv;
+
+static bool ignore_unknown = FALSE;
+
+static const char *program = "dialog";
+
+/*
+ * The options[] table is organized this way to make it simple to maintain
+ * a sorted list of options for the help-message.
+ */
+/* *INDENT-OFF* */
+static const Options options[] = {
+ { "allow-close", o_allow_close, 1, NULL },
+ { "and-widget", o_and_widget, 4, NULL },
+ { "ascii-lines", o_ascii_lines, 1, "" },
+ { "aspect", o_aspect, 1, "<ratio>" },
+ { "auto-placement", o_auto_placement, 1, NULL },
+ { "backtitle", o_backtitle, 1, "<backtitle>" },
+ { "beep", o_beep, 1, NULL },
+ { "beep-after", o_beep_after, 1, NULL },
+ { "begin", o_begin, 1, "<y> <x>" },
+ { "calendar", o_calendar, 2, "<text> <height> <width> <day> <month> <year>" },
+ { "cancel-label", o_cancel_label, 1, "<str>" },
+ { "checklist", o_checklist, 2, "<text> <height> <width> <list height> <tag1> <item1> <status1>..." },
+ { "clear", o_clear, 1, "" },
+ { "colors", o_colors, 1, "" },
+ { "column-separator",o_column_separator, 1, "<str>" },
+ { "cr-wrap", o_cr_wrap, 1, "" },
+ { "create-rc", o_create_rc, 1, NULL },
+ { "default-item", o_default_item, 1, "<str>" },
+ { "defaultno", o_defaultno, 1, "" },
+ { "dselect", o_dselect, 2, "<directory> <height> <width>" },
+ { "editbox", o_editbox, 2, "<file> <height> <width>" },
+ { "exit-label", o_exit_label, 1, "<str>" },
+ { "extra-button", o_extra_button, 1, "" },
+ { "extra-label", o_extra_label, 1, "<str>" },
+ { "fb", o_fullbutton, 1, NULL },
+ { "fixed-font", o_fixed_font, 1, NULL },
+ { "form", o_form, 2, "<text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>..." },
+ { "fselect", o_fselect, 2, "<filepath> <height> <width>" },
+ { "fullbutton", o_fullbutton, 1, NULL },
+ { "gauge", o_gauge, 2, "<text> <height> <width> [<percent>]" },
+ { "guage", o_gauge, 2, NULL },
+ { "help", o_help, 4, "" },
+ { "help-button", o_help_button, 1, "" },
+ { "help-label", o_help_label, 1, "<str>" },
+ { "help-status", o_help_status, 1, "" },
+ { "icon", o_icon, 1, NULL },
+ { "ignore", o_ignore, 1, "" },
+ { "infobox", o_infobox, 2, "<text> <height> <width>" },
+ { "input-fd", o_input_fd, 1, "<fd>" },
+ { "inputbox", o_inputbox, 2, "<text> <height> <width> [<init>]" },
+ { "inputmenu", o_inputmenu, 2, "<text> <height> <width> <menu height> <tag1> <item1>..." },
+ { "insecure", o_insecure, 1, "" },
+ { "item-help", o_item_help, 1, "" },
+ { "keep-colors", o_keep_colors, 1, NULL },
+ { "keep-tite", o_keep_tite, 1, "" },
+ { "keep-window", o_keep_window, 1, "" },
+ { "max-input", o_max_input, 1, "<n>" },
+ { "menu", o_menu, 2, "<text> <height> <width> <menu height> <tag1> <item1>..." },
+ { "mixedform", o_mixedform, 2, "<text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1> <itype>..." },
+ { "mixedgauge", o_mixedgauge, 2, "<text> <height> <width> <percent> <tag1> <item1>..." },
+ { "msgbox", o_msgbox, 2, "<text> <height> <width>" },
+ { "no-cancel", o_nocancel, 1, "" },
+ { "no-close", o_no_close, 1, NULL },
+ { "no-collapse", o_no_collapse, 1, "" },
+ { "no-cr-wrap", o_no_cr_wrap, 1, NULL },
+ { "no-kill", o_no_kill, 1, "" },
+ { "no-label", o_no_label, 1, "<str>" },
+ { "no-lines", o_no_lines, 1, "" },
+ { "no-ok", o_nook, 1, "" },
+ { "no-shadow", o_no_shadow, 1, "" },
+ { "nocancel", o_nocancel, 1, NULL }, /* see --no-cancel */
+ { "noitem", o_noitem, 1, NULL },
+ { "nook", o_nook, 1, "" }, /* See no-ok */
+ { "ok-label", o_ok_label, 1, "<str>" },
+ { "output-fd", o_output_fd, 1, "<fd>" },
+ { "output-separator",o_output_separator, 1, "<str>" },
+ { "passwordbox", o_passwordbox, 2, "<text> <height> <width> [<init>]" },
+ { "passwordform", o_passwordform, 2, "<text> <height> <width> <form height> <label1> <l_y1> <l_x1> <item1> <i_y1> <i_x1> <flen1> <ilen1>..." },
+ { "pause", o_pause, 2, "<text> <height> <width> <seconds>" },
+ { "print-maxsize", o_print_maxsize, 1, "" },
+ { "print-size", o_print_size, 1, "" },
+ { "print-version", o_print_version, 5, "" },
+ { "progressbox", o_progressbox, 2, "<height> <width>" },
+ { "quoted", o_quoted, 1, "" },
+ { "radiolist", o_radiolist, 2, "<text> <height> <width> <list height> <tag1> <item1> <status1>..." },
+ { "screen-center", o_screen_center, 1, NULL },
+ { "separate-output",o_separate_output, 1, "" },
+ { "separate-widget",o_separate_widget, 1, "<str>" },
+ { "separator", o_separator, 1, NULL },
+ { "shadow", o_shadow, 1, "" },
+ { "single-quoted", o_single_quoted, 1, "" },
+ { "size-err", o_size_err, 1, "" },
+ { "sleep", o_sleep, 1, "<secs>" },
+ { "smooth", o_smooth, 1, NULL },
+ { "stderr", o_stderr, 1, "" },
+ { "stdout", o_stdout, 1, "" },
+ { "tab-correct", o_tab_correct, 1, "" },
+ { "tab-len", o_tab_len, 1, "<n>" },
+ { "tailbox", o_tailbox, 2, "<file> <height> <width>" },
+ { "tailboxbg", o_tailboxbg, 2, "<file> <height> <width>" },
+ { "textbox", o_textbox, 2, "<file> <height> <width>" },
+ { "timebox", o_timebox, 2, "<text> <height> <width> <hour> <minute> <second>" },
+ { "timeout", o_timeout, 1, "<secs>" },
+ { "title", o_title, 1, "<title>" },
+ { "trim", o_trim, 1, "" },
+ { "under-mouse", o_under_mouse, 1, NULL },
+ { "version", o_print_version, 5, "" },
+ { "visit-items", o_visit_items, 1, "" },
+ { "wmclass", o_wmclass, 1, NULL },
+ { "yes-label", o_yes_label, 1, "<str>" },
+ { "yesno", o_yesno, 2, "<text> <height> <width>" },
+#ifdef HAVE_DLG_TRACE
+ { "trace", o_trace, 1, "<file>" },
+#endif
+};
+/* *INDENT-ON* */
+
+/*
+ * Convert a string to an argv[], returning a char** index (which must be
+ * freed by the caller). The string is modified (replacing gaps between
+ * tokens with nulls).
+ */
+static char **
+string_to_argv(char *blob)
+{
+ int n;
+ int pass;
+ int length = strlen(blob);
+ char **result = 0;
+
+ for (pass = 0; pass < 2; ++pass) {
+ bool inparm = FALSE;
+ bool quoted = FALSE;
+ char *param = blob;
+ int count = 0;
+
+ for (n = 0; n < length; ++n) {
+ if (quoted && blob[n] == '"') {
+ quoted = FALSE;
+ } else if (blob[n] == '"') {
+ quoted = TRUE;
+ if (!inparm) {
+ if (pass)
+ result[count] = param;
+ ++count;
+ inparm = TRUE;
+ }
+ } else if (blob[n] == '\\') {
+ if (quoted && !isspace(UCH(blob[n + 1]))) {
+ if (!inparm) {
+ if (pass)
+ result[count] = param;
+ ++count;
+ inparm = TRUE;
+ }
+ if (pass) {
+ *param++ = blob[n];
+ *param++ = blob[n + 1];
+ }
+ }
+ ++n;
+ } else if (!quoted && isspace(UCH(blob[n]))) {
+ inparm = FALSE;
+ if (pass) {
+ *param++ = '\0';
+ }
+ } else {
+ if (!inparm) {
+ if (pass)
+ result[count] = param;
+ ++count;
+ inparm = TRUE;
+ }
+ if (pass) {
+ *param++ = blob[n];
+ }
+ }
+ }
+
+ if (!pass) {
+ if (count) {
+ result = dlg_calloc(char *, count + 1);
+ assert_ptr(result, "string_to_argv");
+ } else {
+ break; /* no tokens found */
+ }
+ } else {
+ *param = '\0';
+ }
+ }
+ return result;
+}
+
+/*
+ * Count the entries in an argv list.
+ */
+static int
+count_argv(char **argv)
+{
+ int result = 0;
+
+ if (argv != 0) {
+ while (argv[result] != 0)
+ ++result;
+ }
+ return result;
+}
+
+static int
+eat_argv(int *argcp, char ***argvp, int start, int count)
+{
+ int k;
+
+ *argcp -= count;
+ for (k = start; k <= *argcp; k++)
+ (*argvp)[k] = (*argvp)[k + count];
+ (*argvp)[*argcp] = 0;
+ return TRUE;
+}
+
+/*
+ * Make an array showing which argv[] entries are options. Use "--" as a
+ * special token to escape the next argument, allowing it to begin with "--".
+ * When we find a "--" argument, also remove it from argv[] and adjust argc.
+ * That appears to be an undocumented feature of the popt library.
+ *
+ * Also, if we see a "--file", expand it into the parameter list by reading the
+ * text from the given file and stripping quotes, treating whitespace outside
+ * quotes as a parameter delimiter.
+ *
+ * Finally, if we see a "--args", dump the current list of arguments to the
+ * standard error. This is used for debugging complex --file combinations.
+ */
+static void
+unescape_argv(int *argcp, char ***argvp)
+{
+ int j, k;
+ int limit_includes = 20 + *argcp;
+ int count_includes = 0;
+ bool changed = FALSE;
+ bool doalloc = FALSE;
+ char *filename;
+
+ dialog_opts = dlg_calloc(bool, *argcp + 1);
+ assert_ptr(dialog_opts, "unescape_argv");
+
+ for (j = 1; j < *argcp; j++) {
+ bool escaped = FALSE;
+ if (!strcmp((*argvp)[j], "--")) {
+ escaped = TRUE;
+ changed = eat_argv(argcp, argvp, j, 1);
+ } else if (!strcmp((*argvp)[j], "--args")) {
+ fprintf(stderr, "Showing arguments at arg%d\n", j);
+ for (k = 0; k < *argcp; ++k) {
+ fprintf(stderr, " arg%d:%s\n", k, (*argvp)[k]);
+ }
+ changed = eat_argv(argcp, argvp, j, 1);
+ } else if (!strcmp((*argvp)[j], "--file")) {
+ if (++count_includes > limit_includes)
+ dlg_exiterr("Too many --file options");
+
+ if ((filename = (*argvp)[j + 1]) != 0) {
+ FILE *fp;
+ char **list;
+ char *blob;
+ int added;
+ int bytes_read;
+ int length;
+ int n;
+
+ if (*filename == '&') {
+ fp = fdopen(atoi(filename + sizeof(char)), "r");
+ } else {
+ fp = fopen(filename, "r");
+ }
+
+ if (fp) {
+ blob = NULL;
+ length = 0;
+ do {
+ blob = dlg_realloc(char, length + BUFSIZ + 1, blob);
+ assert_ptr(blob, "unescape_argv");
+ bytes_read = fread(blob + length,
+ sizeof(char),
+ BUFSIZ,
+ fp);
+ length += bytes_read;
+ if (ferror(fp))
+ dlg_exiterr("error on filehandle in unescape_argv");
+ } while (bytes_read == BUFSIZ);
+ fclose(fp);
+
+ blob[length] = '\0';
+
+ list = string_to_argv(blob);
+ if ((added = count_argv(list)) != 0) {
+ if (added > 2) {
+ size_t need = (*argcp + added + 1);
+ if (doalloc) {
+ *argvp = dlg_realloc(char *, need, *argvp);
+ assert_ptr(*argvp, "unescape_argv");
+ } else {
+ char **newp = dlg_malloc(char *, need);
+ assert_ptr(newp, "unescape_argv");
+ for (n = 0; n < *argcp; ++n) {
+ newp[n] = (*argvp)[n];
+ }
+ *argvp = newp;
+ doalloc = TRUE;
+ }
+ dialog_opts = dlg_realloc(bool, *argcp + added, dialog_opts);
+ assert_ptr(dialog_opts, "unescape_argv");
+ }
+ for (n = *argcp; n >= j + 2; --n) {
+ (*argvp)[n + added - 2] = (*argvp)[n];
+ dialog_opts[n + added - 2] = dialog_opts[n];
+ }
+ for (n = 0; n < added; ++n) {
+ (*argvp)[n + j] = list[n];
+ dialog_opts[n + j] = FALSE;
+ }
+ *argcp += added - 2;
+ free(list);
+ }
+ } else {
+ dlg_exiterr("Cannot open --file %s", filename);
+ }
+ (*argvp)[*argcp] = 0;
+ ++j;
+ continue;
+ } else {
+ dlg_exiterr("No value given for --file");
+ }
+ }
+ if (!escaped
+ && (*argvp)[j] != 0
+ && !strncmp((*argvp)[j], "--", 2)
+ && isalpha(UCH((*argvp)[j][2]))) {
+ dialog_opts[j] = TRUE;
+ }
+ }
+
+ /* if we didn't find any "--" tokens, there's no reason to do the table
+ * lookup in isOption()
+ */
+ if (!changed) {
+ free(dialog_opts);
+ dialog_opts = 0;
+ }
+ dialog_argv = (*argvp);
+}
+
+/*
+ * Check if the given string from main's argv is an option.
+ */
+static bool
+isOption(const char *arg)
+{
+ bool result = FALSE;
+
+ if (arg != 0) {
+ if (dialog_opts != 0) {
+ int n;
+ for (n = 1; dialog_argv[n] != 0; ++n) {
+ if (dialog_argv[n] == arg) {
+ result = dialog_opts[n];
+ break;
+ }
+ }
+ } else if (!strncmp(arg, "--", 2) && isalpha(UCH(arg[2]))) {
+ result = TRUE;
+ }
+ }
+ return result;
+}
+
+static eOptions
+lookupOption(const char *name, int pass)
+{
+ unsigned n;
+
+ if (isOption(name)) {
+ name += 2;
+ for (n = 0; n < sizeof(options) / sizeof(options[0]); n++) {
+ if ((pass & options[n].pass) != 0
+ && !strcmp(name, options[n].name)) {
+ return options[n].code;
+ }
+ }
+ }
+ return o_unknown;
+}
+
+static void
+Usage(char *msg)
+{
+ dlg_exiterr("Error: %s.\nUse --help to list options.\n\n", msg);
+}
+
+/*
+ * Count arguments, stopping at the end of the argument list, or on any of our
+ * "--" tokens.
+ */
+static int
+arg_rest(char *argv[])
+{
+ int i = 1; /* argv[0] points to a "--" token */
+
+ while (argv[i] != 0
+ && (!isOption(argv[i]) || lookupOption(argv[i], 7) == o_unknown))
+ i++;
+ return i;
+}
+
+/*
+ * In MultiWidget this function is needed to count how many tags
+ * a widget (menu, checklist, radiolist) has
+ */
+static int
+howmany_tags(char *argv[], int group)
+{
+ int result = 0;
+ int have;
+ const char *format = "Expected %d arguments, found only %d";
+ char temp[80];
+
+ while (argv[0] != 0) {
+ if (isOption(argv[0]))
+ break;
+ if ((have = arg_rest(argv)) < group) {
+ sprintf(temp, format, group, have);
+ Usage(temp);
+ }
+
+ argv += group;
+ result++;
+ }
+
+ return result;
+}
+
+static int
+numeric_arg(char **av, int n)
+{
+ char *last = 0;
+ int result = strtol(av[n], &last, 10);
+ char msg[80];
+
+ if (last == 0 || *last != 0) {
+ sprintf(msg, "Expected a number for token %d of %.20s", n, av[0]);
+ Usage(msg);
+ }
+ return result;
+}
+
+static char *
+optional_str(char **av, int n, char *dft)
+{
+ char *ret = dft;
+ if (arg_rest(av) > n)
+ ret = av[n];
+ return ret;
+}
+
+#if defined(HAVE_DLG_GAUGE) || defined(HAVE_XDIALOG)
+static int
+optional_num(char **av, int n, int dft)
+{
+ int ret = dft;
+ if (arg_rest(av) > n)
+ ret = numeric_arg(av, n);
+ return ret;
+}
+#endif
+
+/*
+ * On AIX 4.x, we have to flush the output right away since there is a bug in
+ * the curses package which discards stdout even when we've used newterm to
+ * redirect output to /dev/tty.
+ */
+static int
+show_result(int ret)
+{
+ bool either = FALSE;
+
+ switch (ret) {
+ case DLG_EXIT_OK:
+ case DLG_EXIT_EXTRA:
+ case DLG_EXIT_HELP:
+ case DLG_EXIT_ITEM_HELP:
+ if ((dialog_state.output_count > 1) && !dialog_vars.separate_output) {
+ fputs((dialog_state.separate_str
+ ? dialog_state.separate_str
+ : DEFAULT_SEPARATE_STR),
+ dialog_state.output);
+ either = TRUE;
+ }
+ if (dialog_vars.input_result[0] != '\0') {
+ fputs(dialog_vars.input_result, dialog_state.output);
+ either = TRUE;
+ }
+ if (either) {
+ fflush(dialog_state.output);
+ }
+ break;
+ }
+ return ret;
+}
+
+/*
+ * These are the widget callers.
+ */
+
+static int
+call_yesno(CALLARGS)
+{
+ *offset_add = 4;
+ return dialog_yesno(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3));
+}
+
+static int
+call_msgbox(CALLARGS)
+{
+ *offset_add = 4;
+ return dialog_msgbox(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3), 1);
+}
+
+static int
+call_infobox(CALLARGS)
+{
+ *offset_add = 4;
+ return dialog_msgbox(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3), 0);
+}
+
+static int
+call_textbox(CALLARGS)
+{
+ *offset_add = 4;
+ return dialog_textbox(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3));
+}
+
+static int
+call_menu(CALLARGS)
+{
+ int tags = howmany_tags(av + 5, MENUBOX_TAGS);
+ *offset_add = 5 + tags * MENUBOX_TAGS;
+
+ return dialog_menu(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ numeric_arg(av, 4),
+ tags, av + 5);
+}
+
+static int
+call_inputmenu(CALLARGS)
+{
+ int tags = howmany_tags(av + 5, MENUBOX_TAGS);
+
+ dialog_vars.input_menu = TRUE;
+
+ if (dialog_vars.max_input == 0)
+ dialog_vars.max_input = MAX_LEN / 2;
+
+ if (dialog_vars.extra_label == 0)
+ dialog_vars.extra_label = _("Rename");
+
+ dialog_vars.extra_button = TRUE;
+
+ *offset_add = 5 + tags * MENUBOX_TAGS;
+ return dialog_menu(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ numeric_arg(av, 4),
+ tags, av + 5);
+}
+
+static int
+call_checklist(CALLARGS)
+{
+ int tags = howmany_tags(av + 5, CHECKBOX_TAGS);
+ int code;
+ bool save_quoted = dialog_vars.quoted;
+
+ dialog_vars.quoted = !dialog_vars.separate_output;
+ *offset_add = 5 + tags * CHECKBOX_TAGS;
+ code = dialog_checklist(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ numeric_arg(av, 4),
+ tags, av + 5, FLAG_CHECK);
+ dialog_vars.quoted = save_quoted;
+ return code;
+}
+
+static int
+call_radiolist(CALLARGS)
+{
+ int tags = howmany_tags(av + 5, CHECKBOX_TAGS);
+ *offset_add = 5 + tags * CHECKBOX_TAGS;
+ return dialog_checklist(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ numeric_arg(av, 4),
+ tags, av + 5, FLAG_RADIO);
+}
+
+static int
+call_inputbox(CALLARGS)
+{
+ *offset_add = arg_rest(av);
+ return dialog_inputbox(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ optional_str(av, 4, 0), 0);
+}
+
+static int
+call_passwordbox(CALLARGS)
+{
+ *offset_add = arg_rest(av);
+ return dialog_inputbox(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ optional_str(av, 4, 0), 1);
+}
+
+#ifdef HAVE_XDIALOG
+static int
+call_calendar(CALLARGS)
+{
+ *offset_add = arg_rest(av);
+ return dialog_calendar(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ optional_num(av, 4, -1),
+ optional_num(av, 5, -1),
+ optional_num(av, 6, -1));
+}
+
+static int
+call_dselect(CALLARGS)
+{
+ *offset_add = arg_rest(av);
+ return dialog_dselect(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3));
+}
+
+static int
+call_editbox(CALLARGS)
+{
+ *offset_add = 4;
+ return dialog_editbox(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3));
+}
+
+static int
+call_fselect(CALLARGS)
+{
+ *offset_add = arg_rest(av);
+ return dialog_fselect(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3));
+}
+
+static int
+call_timebox(CALLARGS)
+{
+ *offset_add = arg_rest(av);
+ return dialog_timebox(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ optional_num(av, 4, -1),
+ optional_num(av, 5, -1),
+ optional_num(av, 6, -1));
+}
+#endif /* HAVE_XDIALOG */
+
+#ifdef HAVE_DLG_FORMBOX
+static int
+call_form(CALLARGS)
+{
+ int group = FORMBOX_TAGS;
+ int tags = howmany_tags(av + 5, group);
+ *offset_add = 5 + tags * group;
+
+ return dialog_form(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ numeric_arg(av, 4),
+ tags, av + 5);
+}
+
+static int
+call_password_form(CALLARGS)
+{
+ int save = dialog_vars.formitem_type;
+ int result;
+
+ dialog_vars.formitem_type = 1;
+ result = call_form(PASSARGS);
+ dialog_vars.formitem_type = save;
+
+ return result;
+}
+#endif /* HAVE_DLG_FORMBOX */
+
+#ifdef HAVE_DLG_MIXEDFORM
+static int
+call_mixed_form(CALLARGS)
+{
+ int group = MIXEDFORM_TAGS;
+ int tags = howmany_tags(av + 5, group);
+ *offset_add = 5 + tags * group;
+
+ return dialog_mixedform(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ numeric_arg(av, 4),
+ tags, av + 5);
+}
+#endif /* HAVE_DLG_MIXEDFORM */
+
+#ifdef HAVE_DLG_GAUGE
+static int
+call_gauge(CALLARGS)
+{
+ *offset_add = arg_rest(av);
+ return dialog_gauge(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ optional_num(av, 4, 0));
+}
+
+static int
+call_pause(CALLARGS)
+{
+ *offset_add = arg_rest(av);
+ return dialog_pause(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ numeric_arg(av, 4));
+}
+#endif
+
+#ifdef HAVE_MIXEDGAUGE
+static int
+call_mixed_gauge(CALLARGS)
+{
+#define MIXEDGAUGE_BASE 5
+ int tags = howmany_tags(av + MIXEDGAUGE_BASE, MIXEDGAUGE_TAGS);
+ *offset_add = MIXEDGAUGE_BASE + tags * MIXEDGAUGE_TAGS;
+ return dialog_mixedgauge(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ numeric_arg(av, 4),
+ tags, av + MIXEDGAUGE_BASE);
+}
+#endif
+
+#ifdef HAVE_DLG_GAUGE
+static int
+call_progressbox(CALLARGS)
+{
+ *offset_add = arg_rest(av);
+ /* the original version does not accept a prompt string, but for
+ * consistency we allow it.
+ */
+ return ((*offset_add == 4)
+ ? dialog_progressbox(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3))
+ : dialog_progressbox(t,
+ "",
+ numeric_arg(av, 1),
+ numeric_arg(av, 2)));
+}
+#endif
+
+#ifdef HAVE_DLG_TAILBOX
+static int
+call_tailbox(CALLARGS)
+{
+ *offset_add = 4;
+ return dialog_tailbox(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ FALSE);
+}
+
+static int
+call_tailboxbg(CALLARGS)
+{
+ *offset_add = 4;
+ return dialog_tailbox(t,
+ av[1],
+ numeric_arg(av, 2),
+ numeric_arg(av, 3),
+ TRUE);
+}
+#endif
+/* *INDENT-OFF* */
+static const Mode modes[] =
+{
+ {o_yesno, 4, 4, call_yesno},
+ {o_msgbox, 4, 4, call_msgbox},
+ {o_infobox, 4, 4, call_infobox},
+ {o_textbox, 4, 4, call_textbox},
+ {o_menu, 7, 0, call_menu},
+ {o_inputmenu, 7, 0, call_inputmenu},
+ {o_checklist, 8, 0, call_checklist},
+ {o_radiolist, 8, 0, call_radiolist},
+ {o_inputbox, 4, 5, call_inputbox},
+ {o_passwordbox, 4, 5, call_passwordbox},
+#ifdef HAVE_DLG_GAUGE
+ {o_gauge, 4, 5, call_gauge},
+ {o_pause, 5, 5, call_pause},
+ {o_progressbox, 3, 4, call_progressbox},
+#endif
+#ifdef HAVE_DLG_FORMBOX
+ {o_passwordform, 13, 0, call_password_form},
+ {o_form, 13, 0, call_form},
+#endif
+#ifdef HAVE_MIXEDGAUGE
+ {o_mixedgauge, MIXEDGAUGE_BASE, 0, call_mixed_gauge},
+#endif
+#ifdef HAVE_DLG_MIXEDFORM
+ {o_mixedform, 13, 0, call_mixed_form},
+#endif
+#ifdef HAVE_DLG_TAILBOX
+ {o_tailbox, 4, 4, call_tailbox},
+ {o_tailboxbg, 4, 4, call_tailboxbg},
+#endif
+#ifdef HAVE_XDIALOG
+ {o_calendar, 4, 7, call_calendar},
+ {o_dselect, 4, 5, call_dselect},
+ {o_editbox, 4, 4, call_editbox},
+ {o_fselect, 4, 5, call_fselect},
+ {o_timebox, 4, 7, call_timebox},
+#endif
+};
+/* *INDENT-ON* */
+
+static char *
+optionString(char **argv, int *num)
+{
+ int next = *num + 1;
+ char *result = argv[next];
+ if (result == 0) {
+ char temp[80];
+ sprintf(temp, "Expected a string-parameter for %.20s", argv[*num]);
+ Usage(temp);
+ }
+ *num = next;
+ return result;
+}
+
+static int
+optionValue(char **argv, int *num)
+{
+ int next = *num + 1;
+ char *src = argv[next];
+ char *tmp = 0;
+ int result = 0;
+
+ if (src != 0) {
+ result = strtol(src, &tmp, 0);
+ if (tmp == 0 || *tmp != 0)
+ src = 0;
+ }
+
+ if (src == 0) {
+ char temp[80];
+ sprintf(temp, "Expected a numeric-parameter for %.20s", argv[*num]);
+ Usage(temp);
+ }
+ *num = next;
+ return result;
+}
+
+/*
+ * Print parts of a message
+ */
+static void
+PrintList(const char *const *list)
+{
+ const char *leaf = strrchr(program, '/');
+ unsigned n = 0;
+
+ if (leaf != 0)
+ leaf++;
+ else
+ leaf = program;
+
+ while (*list != 0) {
+ fprintf(dialog_state.output, *list, n ? leaf : dialog_version());
+ (void) fputc('\n', dialog_state.output);
+ n = 1;
+ list++;
+ }
+}
+
+static const Mode *
+lookupMode(eOptions code)
+{
+ const Mode *modePtr = 0;
+ unsigned n;
+
+ for (n = 0; n < sizeof(modes) / sizeof(modes[0]); n++) {
+ if (modes[n].code == code) {
+ modePtr = &modes[n];
+ break;
+ }
+ }
+ return modePtr;
+}
+
+static int
+compare_opts(const void *a, const void *b)
+{
+ Options *const *p = (Options * const *) a;
+ Options *const *q = (Options * const *) b;
+ return strcmp((*p)->name, (*q)->name);
+}
+
+/*
+ * Print program help-message
+ */
+static void
+Help(void)
+{
+ static const char *const tbl_1[] =
+ {
+ "cdialog (ComeOn Dialog!) version %s",
+ "Copyright 2000-2007,2008 Thomas E. Dickey",
+ "This is free software; see the source for copying conditions. There is NO",
+ "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.",
+ "",
+ "* Display dialog boxes from shell scripts *",
+ "",
+ "Usage: %s <options> { --and-widget <options> }",
+ "where options are \"common\" options, followed by \"box\" options",
+ "",
+#ifdef HAVE_RC_FILE
+ "Special options:",
+ " [--create-rc \"file\"]",
+#endif
+ 0
+ }, *const tbl_3[] =
+ {
+ "",
+ "Auto-size with height and width = 0. Maximize with height and width = -1.",
+ "Global-auto-size if also menu_height/list_height = 0.",
+ 0
+ };
+ unsigned limit = sizeof(options) / sizeof(options[0]);
+ unsigned j, k;
+ const Options **opts;
+
+ opts = dlg_calloc(const Options *, limit);
+ assert_ptr(opts, "Help");
+ for (j = 0; j < limit; ++j) {
+ opts[j] = &(options[j]);
+ }
+ qsort(opts, limit, sizeof(Options *), compare_opts);
+
+ PrintList(tbl_1);
+ fprintf(dialog_state.output, "Common options:\n ");
+ for (j = k = 0; j < limit; j++) {
+ if ((opts[j]->pass & 1)
+ && opts[j]->help != 0) {
+ unsigned len = 6 + strlen(opts[j]->name) + strlen(opts[j]->help);
+ k += len;
+ if (k > 75) {
+ fprintf(dialog_state.output, "\n ");
+ k = len;
+ }
+ fprintf(dialog_state.output, " [--%s%s%s]", opts[j]->name,
+ *(opts[j]->help) ? " " : "", opts[j]->help);
+ }
+ }
+ fprintf(dialog_state.output, "\nBox options:\n");
+ for (j = 0; j < limit; j++) {
+ if ((opts[j]->pass & 2) != 0
+ && opts[j]->help != 0
+ && lookupMode(opts[j]->code))
+ fprintf(dialog_state.output, " --%-12s %s\n", opts[j]->name,
+ opts[j]->help);
+ }
+ PrintList(tbl_3);
+
+ free(opts);
+ dlg_exit(DLG_EXIT_OK);
+}
+
+/*
+ * "Common" options apply to all widgets more/less. Most of the common options
+ * set values in dialog_vars, a few set dialog_state and a couple write to the
+ * output stream.
+ */
+static int
+process_common_options(int argc, char **argv, int offset, bool output)
+{
+ bool done = FALSE;
+
+ while (offset < argc && !done) { /* Common options */
+ switch (lookupOption(argv[offset], 1)) {
+ case o_title:
+ dialog_vars.title = optionString(argv, &offset);
+ break;
+ case o_backtitle:
+ dialog_vars.backtitle = optionString(argv, &offset);
+ break;
+ case o_separate_widget:
+ dialog_state.separate_str = optionString(argv, &offset);
+ break;
+ case o_separate_output:
+ dialog_vars.separate_output = TRUE;
+ break;
+ case o_colors:
+ dialog_vars.colors = TRUE;
+ break;
+ case o_cr_wrap:
+ dialog_vars.cr_wrap = TRUE;
+ break;
+ case o_no_collapse:
+ dialog_vars.nocollapse = TRUE;
+ break;
+ case o_no_kill:
+ dialog_vars.cant_kill = TRUE;
+ break;
+ case o_nocancel:
+ dialog_vars.nocancel = TRUE;
+ break;
+ case o_nook:
+ dialog_vars.nook = TRUE;
+ break;
+ case o_quoted:
+ dialog_vars.quoted = TRUE;
+ break;
+ case o_single_quoted:
+ dialog_vars.single_quoted = TRUE;
+ break;
+ case o_size_err:
+ dialog_vars.size_err = TRUE;
+ break;
+ case o_beep:
+ dialog_vars.beep_signal = TRUE;
+ break;
+ case o_beep_after:
+ dialog_vars.beep_after_signal = TRUE;
+ break;
+ case o_shadow:
+ dialog_state.use_shadow = TRUE;
+ break;
+ case o_defaultno:
+ dialog_vars.defaultno = TRUE;
+ break;
+ case o_default_item:
+ dialog_vars.default_item = optionString(argv, &offset);
+ break;
+ case o_insecure:
+ dialog_vars.insecure = TRUE;
+ break;
+ case o_item_help:
+ dialog_vars.item_help = TRUE;
+ break;
+ case o_help_button:
+ dialog_vars.help_button = TRUE;
+ break;
+ case o_help_status:
+ dialog_vars.help_status = TRUE;
+ break;
+ case o_extra_button:
+ dialog_vars.extra_button = TRUE;
+ break;
+ case o_ignore:
+ ignore_unknown = TRUE;
+ break;
+ case o_keep_window:
+ dialog_vars.keep_window = TRUE;
+ break;
+ case o_no_shadow:
+ dialog_state.use_shadow = FALSE;
+ break;
+ case o_print_size:
+ dialog_vars.print_siz = TRUE;
+ break;
+ case o_print_maxsize:
+ if (output) {
+ /*
+ * If this is the last option, we do not want any error
+ * messages - just our output. Calling end_dialog() cancels
+ * the refresh() at the end of the program as well.
+ */
+ if (argv[offset + 1] == 0) {
+ ignore_unknown = TRUE;
+ end_dialog();
+ }
+ fflush(dialog_state.output);
+ fprintf(dialog_state.output, "MaxSize: %d, %d\n", SLINES, SCOLS);
+ }
+ break;
+ case o_print_version:
+ if (output) {
+ fprintf(stdout, "Version: %s\n", dialog_version());
+ }
+ break;
+ case o_separator:
+ case o_output_separator:
+ dialog_vars.output_separator = optionString(argv, &offset);
+ break;
+ case o_column_separator:
+ dialog_vars.column_separator = optionString(argv, &offset);
+ break;
+ case o_tab_correct:
+ dialog_vars.tab_correct = TRUE;
+ break;
+ case o_sleep:
+ dialog_vars.sleep_secs = optionValue(argv, &offset);
+ break;
+ case o_timeout:
+ dialog_vars.timeout_secs = optionValue(argv, &offset);
+ break;
+ case o_max_input:
+ dialog_vars.max_input = optionValue(argv, &offset);
+ break;
+ case o_tab_len:
+ dialog_state.tab_len = optionValue(argv, &offset);
+ break;
+ case o_trim:
+ dialog_vars.trim_whitespace = TRUE;
+ break;
+ case o_visit_items:
+ dialog_state.visit_items = TRUE;
+ break;
+ case o_aspect:
+ dialog_state.aspect_ratio = optionValue(argv, &offset);
+ break;
+ case o_begin:
+ dialog_vars.begin_set = TRUE;
+ dialog_vars.begin_y = optionValue(argv, &offset);
+ dialog_vars.begin_x = optionValue(argv, &offset);
+ break;
+ case o_clear:
+ dialog_vars.dlg_clear_screen = TRUE;
+ break;
+ case o_yes_label:
+ dialog_vars.yes_label = optionString(argv, &offset);
+ break;
+ case o_no_label:
+ dialog_vars.no_label = optionString(argv, &offset);
+ break;
+ case o_ok_label:
+ dialog_vars.ok_label = optionString(argv, &offset);
+ break;
+ case o_cancel_label:
+ dialog_vars.cancel_label = optionString(argv, &offset);
+ break;
+ case o_extra_label:
+ dialog_vars.extra_label = optionString(argv, &offset);
+ break;
+ case o_exit_label:
+ dialog_vars.exit_label = optionString(argv, &offset);
+ break;
+ case o_help_label:
+ dialog_vars.help_label = optionString(argv, &offset);
+ break;
+ case o_keep_tite:
+ dialog_vars.keep_tite = TRUE;
+ break;
+ case o_ascii_lines:
+ dialog_vars.ascii_lines = TRUE;
+ dialog_vars.no_lines = FALSE;
+ break;
+ case o_no_lines:
+ dialog_vars.no_lines = TRUE;
+ dialog_vars.ascii_lines = FALSE;
+ break;
+ case o_noitem:
+ case o_fullbutton:
+ /* ignore */
+ break;
+ /* options of Xdialog which we ignore */
+ case o_icon:
+ case o_wmclass:
+ (void) optionString(argv, &offset);
+ /* FALLTHRU */
+ case o_allow_close:
+ case o_auto_placement:
+ case o_fixed_font:
+ case o_keep_colors:
+ case o_no_close:
+ case o_no_cr_wrap:
+ case o_screen_center:
+ case o_smooth:
+ case o_under_mouse:
+ break;
+ case o_unknown:
+ if (ignore_unknown)
+ break;
+ /* FALLTHRU */
+ default: /* no more common options */
+ done = TRUE;
+ break;
+#ifdef HAVE_DLG_TRACE
+ case o_trace:
+ dlg_trace(optionString(argv, &offset));
+ break;
+#endif
+ }
+ if (!done)
+ offset++;
+ }
+ return offset;
+}
+
+/*
+ * Initialize options at the start of a series of common options culminating
+ * in a widget.
+ */
+static void
+init_result(char *buffer)
+{
+ static bool first = TRUE;
+ static char **special_argv = 0;
+ static int special_argc = 0;
+
+ /* clear everything we do not save for the next widget */
+ memset(&dialog_vars, 0, sizeof(dialog_vars));
+
+ dialog_vars.input_result = buffer;
+ dialog_vars.input_result[0] = '\0';
+
+ /*
+ * The first time this is called, check for common options given by an
+ * environment variable.
+ */
+ if (first) {
+ char *env = getenv("DIALOGOPTS");
+ if (env != 0)
+ env = dlg_strclone(env);
+ if (env != 0) {
+ special_argv = string_to_argv(env);
+ special_argc = count_argv(special_argv);
+ }
+ }
+ if (special_argv != 0) {
+ process_common_options(special_argc, special_argv, 0, FALSE);
+#ifdef NO_LEAKS
+ free(special_argv[0]);
+ free(special_argv);
+ first = TRUE;
+#endif
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ char temp[256];
+ bool esc_pressed = FALSE;
+ bool keep_tite = FALSE;
+ int offset = 1;
+ int offset_add;
+ int retval = DLG_EXIT_OK;
+ int j, have;
+ eOptions code;
+ const Mode *modePtr;
+ char my_buffer[MAX_LEN + 1];
+
+ memset(&dialog_state, 0, sizeof(dialog_state));
+ memset(&dialog_vars, 0, sizeof(dialog_vars));
+
+#if defined(ENABLE_NLS)
+ /* initialize locale support */
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#elif defined(HAVE_SETLOCALE)
+ (void) setlocale(LC_ALL, "");
+#endif
+
+ unescape_argv(&argc, &argv);
+ program = argv[0];
+ dialog_state.output = stderr;
+ dialog_state.input = stdin;
+
+ /*
+ * Look for the last --stdout, --stderr or --output-fd option, and use
+ * that. We can only write to one of them. If --stdout is used, that
+ * can interfere with initializing the curses library, so we want to
+ * know explicitly if it is used.
+ */
+ while (offset < argc) {
+ int base = offset;
+ switch (lookupOption(argv[offset], 7)) {
+ case o_stdout:
+ dialog_state.output = stdout;
+ break;
+ case o_stderr:
+ dialog_state.output = stderr;
+ break;
+ case o_input_fd:
+ if ((j = optionValue(argv, &offset)) < 0
+ || (dialog_state.input = fdopen(j, "r")) == 0)
+ dlg_exiterr("Cannot open input-fd\n");
+ break;
+ case o_output_fd:
+ if ((j = optionValue(argv, &offset)) < 0
+ || (dialog_state.output = fdopen(j, "w")) == 0)
+ dlg_exiterr("Cannot open output-fd\n");
+ break;
+ case o_keep_tite:
+ keep_tite = TRUE;
+ break;
+ default:
+ ++offset;
+ continue;
+ }
+ for (j = base; j < argc; ++j) {
+ dialog_argv[j] = dialog_argv[j + 1 + (offset - base)];
+ if (dialog_opts != 0)
+ dialog_opts[j] = dialog_opts[j + 1 + (offset - base)];
+ }
+ argc -= (1 + offset - base);
+ offset = base;
+ }
+ offset = 1;
+ init_result(my_buffer);
+
+ if (argc == 2) { /* if we don't want clear screen */
+ switch (lookupOption(argv[1], 7)) {
+ case o_print_maxsize:
+ (void) initscr();
+ endwin();
+ fflush(dialog_state.output);
+ fprintf(dialog_state.output, "MaxSize: %d, %d\n", SLINES, SCOLS);
+ break;
+ case o_print_version:
+ fprintf(stdout, "Version: %s\n", dialog_version());
+ break;
+ case o_clear:
+ initscr();
+ refresh();
+ endwin();
+ break;
+ case o_ignore:
+ break;
+ default:
+ case o_help:
+ dialog_state.output = stdout;
+ Help();
+ break;
+ }
+ return DLG_EXIT_OK;
+ }
+
+ if (argc < 2) {
+ Help();
+ }
+#ifdef HAVE_RC_FILE
+ if (lookupOption(argv[1], 7) == o_create_rc) {
+ if (argc != 3) {
+ sprintf(temp, "Expected a filename for %.50s", argv[1]);
+ Usage(temp);
+ }
+ if (dlg_parse_rc() == -1) /* Read the configuration file */
+ dlg_exiterr("dialog: dlg_parse_rc");
+ dlg_create_rc(argv[2]);
+ return DLG_EXIT_OK;
+ }
+#endif
+
+ dialog_vars.keep_tite = keep_tite; /* init_result() cleared global */
+
+ init_dialog(dialog_state.input, dialog_state.output);
+
+ while (offset < argc && !esc_pressed) {
+ init_result(my_buffer);
+
+ offset = process_common_options(argc, argv, offset, TRUE);
+
+ if (argv[offset] == NULL) {
+ if (ignore_unknown)
+ break;
+ Usage("Expected a box option");
+ }
+
+ if (lookupOption(argv[offset], 2) != o_checklist
+ && dialog_vars.separate_output) {
+ sprintf(temp, "Expected --checklist, not %.20s", argv[offset]);
+ Usage(temp);
+ }
+
+ if (dialog_state.aspect_ratio == 0)
+ dialog_state.aspect_ratio = DEFAULT_ASPECT_RATIO;
+
+ dlg_put_backtitle();
+
+ /* use a table to look for the requested mode, to avoid code duplication */
+
+ modePtr = 0;
+ if ((code = lookupOption(argv[offset], 2)) != o_unknown)
+ modePtr = lookupMode(code);
+ if (modePtr == 0) {
+ sprintf(temp, "%s option %.20s",
+ lookupOption(argv[offset], 7) != o_unknown
+ ? "Unexpected"
+ : "Unknown",
+ argv[offset]);
+ Usage(temp);
+ }
+
+ have = arg_rest(&argv[offset]);
+ if (have < modePtr->argmin) {
+ sprintf(temp, "Expected at least %d tokens for %.20s, have %d",
+ modePtr->argmin - 1, argv[offset],
+ have - 1);
+ Usage(temp);
+ }
+ if (modePtr->argmax && have > modePtr->argmax) {
+ sprintf(temp,
+ "Expected no more than %d tokens for %.20s, have %d",
+ modePtr->argmax - 1, argv[offset],
+ have - 1);
+ Usage(temp);
+ }
+
+ /*
+ * Trim whitespace from non-title option values, e.g., the ones that
+ * will be used as captions or prompts. Do that only for the widget
+ * we are about to process, since the "--trim" option is reset before
+ * accumulating options for each widget.
+ */
+ for (j = offset + 1; j <= offset + have; j++) {
+ switch (lookupOption(argv[j - 1], 7)) {
+ case o_unknown:
+ case o_title:
+ case o_backtitle:
+ break;
+ default:
+ if (argv[j] != 0) {
+ dlg_trim_string(argv[j]);
+ }
+ break;
+ }
+ }
+
+ retval = show_result((*(modePtr->jumper)) (dialog_vars.title,
+ argv + offset,
+ &offset_add));
+ offset += offset_add;
+
+ if (dialog_vars.input_result != my_buffer)
+ free(dialog_vars.input_result);
+
+ if (retval == DLG_EXIT_ESC) {
+ esc_pressed = TRUE;
+ } else {
+
+ if (dialog_vars.beep_after_signal)
+ (void) beep();
+
+ if (dialog_vars.sleep_secs)
+ (void) napms(dialog_vars.sleep_secs * 1000);
+
+ if (offset < argc) {
+ switch (lookupOption(argv[offset], 7)) {
+ case o_and_widget:
+ offset++;
+ break;
+ case o_unknown:
+ sprintf(temp, "Expected --and-widget, not %.20s",
+ argv[offset]);
+ Usage(temp);
+ break;
+ default:
+ /* if we got a cancel, etc., stop chaining */
+ if (retval != DLG_EXIT_OK)
+ esc_pressed = TRUE;
+ else
+ dialog_vars.dlg_clear_screen = TRUE;
+ break;
+ }
+ }
+ if (dialog_vars.dlg_clear_screen)
+ dlg_clear();
+ }
+ }
+
+ dlg_killall_bg(&retval);
+ if (dialog_state.screen_initialized) {
+ (void) refresh();
+ end_dialog();
+ }
+ dlg_exit(retval);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/dialog.h b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.h
new file mode 100644
index 00000000000..a9ca4c38ca8
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.h
@@ -0,0 +1,758 @@
+/*
+ * $Id: dialog.h,v 1.202 2008/07/27 22:20:22 tom Exp $
+ *
+ * dialog.h -- common declarations for all dialog modules
+ *
+ * Copyright 2000-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors
+ * Savio Lam (lam836@cs.cuhk.hk)
+ */
+
+#ifndef DIALOG_H_included
+#define DIALOG_H_included 1
+
+#include <dlg_config.h>
+
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <signal.h> /* fork() etc. */
+#include <math.h> /* sqrt() */
+
+#if defined(HAVE_NCURSESW_NCURSES_H)
+#include <ncursesw/ncurses.h>
+#elif defined(HAVE_NCURSES_NCURSES_H)
+#include <ncurses/ncurses.h>
+#elif defined(HAVE_NCURSES_CURSES_H)
+#include <ncurses/curses.h>
+#elif defined(HAVE_NCURSES_H)
+#include <ncurses.h>
+#elif defined(ultrix)
+#include <cursesX.h>
+#else
+#include <curses.h>
+#endif
+
+/* possible conflicts with <term.h> which may be included in <curses.h> */
+#ifdef color_names
+#undef color_names
+#endif
+
+#ifdef buttons
+#undef buttons
+#endif
+
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#include <langinfo.h>
+#define _(s) dgettext(PACKAGE, s)
+#else
+#undef _
+#define _(s) s
+#endif
+
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /*nothing*/
+#endif
+
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /*nothing*/
+#endif
+
+#ifndef HAVE_WGET_WCH
+#undef USE_WIDE_CURSES
+#endif
+
+/*
+ * FIXME: a configure check would be useful
+ */
+#ifdef __hpux
+#undef ACS_UARROW
+#undef ACS_DARROW
+#endif
+
+/*
+ * Change these if you want
+ */
+#define USE_SHADOW TRUE
+#define USE_COLORS TRUE
+
+#ifdef HAVE_COLOR
+#define SCOLS (COLS - (dialog_state.use_shadow ? 2 : 0))
+#define SLINES (LINES - (dialog_state.use_shadow ? 1 : 0))
+#else
+#define SCOLS COLS
+#define SLINES LINES
+#endif
+
+#define DLG_EXIT_ESC 255
+#define DLG_EXIT_UNKNOWN -2 /* never return this (internal use) */
+#define DLG_EXIT_ERROR -1 /* the shell sees this as 255 */
+#define DLG_EXIT_OK 0
+#define DLG_EXIT_CANCEL 1
+#define DLG_EXIT_HELP 2
+#define DLG_EXIT_EXTRA 3
+#define DLG_EXIT_ITEM_HELP 4 /* actually DLG_EXIT_HELP */
+
+#define DLG_CTRL(n) ((n) & 0x1f) /* CTRL is preferred, but conflicts */
+
+#define CHR_BACKSPACE DLG_CTRL('H')
+#define CHR_REPAINT DLG_CTRL('L')
+#define CHR_KILL DLG_CTRL('U')
+#define CHR_LITERAL DLG_CTRL('V')
+#define CHR_DELETE 127
+#define CHR_NEXT DLG_CTRL('N')
+#define CHR_PREVIOUS DLG_CTRL('P')
+#define CHR_TRACE DLG_CTRL('T')
+
+#define ESC 27
+#define TAB DLG_CTRL('I')
+
+#define MARGIN 1
+#define GUTTER 2
+#define SHADOW_ROWS 1
+#define SHADOW_COLS 2
+#define ARROWS_COL 5
+
+#define MAX_LEN 2048
+#define BUF_SIZE (10*1024)
+
+#undef MIN
+#define MIN(x,y) ((x) < (y) ? (x) : (y))
+
+#undef MAX
+#define MAX(x,y) ((x) > (y) ? (x) : (y))
+
+#define DEFAULT_SEPARATE_STR "\t"
+#define DEFAULT_ASPECT_RATIO 9
+/* how many spaces is a tab long (default)? */
+#define TAB_LEN 8
+#define WTIMEOUT_VAL 10
+
+#ifndef A_CHARTEXT
+#define A_CHARTEXT 0xff
+#endif
+
+#define CharOf(ch) ((ch) & A_CHARTEXT)
+
+#ifndef ACS_ULCORNER
+#define ACS_ULCORNER '+'
+#endif
+#ifndef ACS_LLCORNER
+#define ACS_LLCORNER '+'
+#endif
+#ifndef ACS_URCORNER
+#define ACS_URCORNER '+'
+#endif
+#ifndef ACS_LRCORNER
+#define ACS_LRCORNER '+'
+#endif
+#ifndef ACS_HLINE
+#define ACS_HLINE '-'
+#endif
+#ifndef ACS_VLINE
+#define ACS_VLINE '|'
+#endif
+#ifndef ACS_LTEE
+#define ACS_LTEE '+'
+#endif
+#ifndef ACS_RTEE
+#define ACS_RTEE '+'
+#endif
+#ifndef ACS_UARROW
+#define ACS_UARROW '^'
+#endif
+#ifndef ACS_DARROW
+#define ACS_DARROW 'v'
+#endif
+
+/* these definitions may work for antique versions of curses */
+#ifndef HAVE_GETBEGYX
+#undef getbegyx
+#define getbegyx(win,y,x) (y = (win)?(win)->_begy:ERR, x = (win)?(win)->_begx:ERR)
+#endif
+
+#ifndef HAVE_GETMAXYX
+#undef getmaxyx
+#define getmaxyx(win,y,x) (y = (win)?(win)->_maxy:ERR, x = (win)?(win)->_maxx:ERR)
+#endif
+
+#ifndef HAVE_GETPARYX
+#undef getparyx
+#define getparyx(win,y,x) (y = (win)?(win)->_pary:ERR, x = (win)?(win)->_parx:ERR)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* these definitions may be needed for bleeding-edge curses implementations */
+#if !(defined(HAVE_GETBEGX) && defined(HAVE_GETBEGY))
+#undef getbegx
+#undef getbegy
+#define getbegx(win) dlg_getbegx(win)
+#define getbegy(win) dlg_getbegy(win)
+extern int dlg_getbegx(WINDOW * /*win*/);
+extern int dlg_getbegy(WINDOW * /*win*/);
+#endif
+
+#if !(defined(HAVE_GETCURX) && defined(HAVE_GETCURY))
+#undef getcurx
+#undef getcury
+#define getcurx(win) dlg_getcurx(win)
+#define getcury(win) dlg_getcury(win)
+extern int dlg_getcurx(WINDOW * /*win*/);
+extern int dlg_getcury(WINDOW * /*win*/);
+#endif
+
+#if !(defined(HAVE_GETMAXX) && defined(HAVE_GETMAXY))
+#undef getmaxx
+#undef getmaxy
+#define getmaxx(win) dlg_getmaxx(win)
+#define getmaxy(win) dlg_getmaxy(win)
+extern int dlg_getmaxx(WINDOW * /*win*/);
+extern int dlg_getmaxy(WINDOW * /*win*/);
+#endif
+
+#if !(defined(HAVE_GETPARX) && defined(HAVE_GETPARY))
+#undef getparx
+#undef getpary
+#define getparx(win) dlg_getparx(win)
+#define getpary(win) dlg_getpary(win)
+extern int dlg_getparx(WINDOW * /*win*/);
+extern int dlg_getpary(WINDOW * /*win*/);
+#endif
+
+/*
+ * This is a list of "old" names, which should be helpful in updating
+ * applications that use libdialog. Starting with 2003/11/26, all exported
+ * symbols from libdialog have "dlg_" prefix, or "dialog_" prefix or "_dialog"
+ * suffix (or suffix "_dialog", e.g., init_dialog).
+ */
+#ifdef __DIALOG_OLD_NAMES__
+#define color_table dlg_color_table
+#define attr_clear(win,h,w,a) dlg_attr_clear(win,h,w,a)
+#define auto_size(t,s,h,w,xl,mc) dlg_auto_size(t,s,h,w,xl,mc)
+#define auto_sizefile(t,f,h,w,xl,mc) dlg_auto_sizefile(t,f,h,w,xl,mc)
+#define beeping() dlg_beeping()
+#define box_x_ordinate(w) dlg_box_x_ordinate(w)
+#define box_y_ordinate(h) dlg_box_y_ordinate(h)
+#define calc_listh(h,lh,in) dlg_calc_listh(h,lh,in)
+#define calc_listw(in,items,group) dlg_calc_listw(in,items,group)
+#define color_setup() dlg_color_setup()
+#define create_rc(f) dlg_create_rc(f)
+#define ctl_size(h,w) dlg_ctl_size(h,w)
+#define del_window(win) dlg_del_window(win)
+#define dialog_clear() dlg_clear()
+#define draw_bottom_box(win) dlg_draw_bottom_box(win)
+#define draw_box(win,y,x,h,w,xc,bc) dlg_draw_box(win,y,x,h,w,xc,bc)
+#define draw_shadow(win,h,w,y,x) dlg_draw_shadow(win,h,w,y,x)
+#define draw_title(win,t) dlg_draw_title(win,t)
+#define exiterr dlg_exiterr
+#define killall_bg(n) dlg_killall_bg(n)
+#define mouse_bigregion(y,x) dlg_mouse_bigregion(y,x)
+#define mouse_free_regions() dlg_mouse_free_regions()
+#define mouse_mkbigregion(y,x,h,w,n,ix,iy,m) dlg_mouse_mkbigregion(y,x,h,w,n,ix,iy,m)
+#define mouse_mkregion(y,x,h,w,n) dlg_mouse_mkregion(y,x,h,w,n)
+#define mouse_region(y,x) dlg_mouse_region(y,x)
+#define mouse_setbase(x,y) dlg_mouse_setbase(x,y)
+#define mouse_wgetch(w,c) dlg_mouse_wgetch(w,c)
+#define new_window(h,w,y,x) dlg_new_window(h,w,y,x)
+#define parse_rc() dlg_parse_rc()
+#define print_autowrap(win,s,h,w) dlg_print_autowrap(win,s,h,w)
+#define print_size(h,w) dlg_print_size(h,w)
+#define put_backtitle() dlg_put_backtitle()
+#define strclone(cprompt) dlg_strclone(cprompt)
+#define sub_window(win,h,w,y,x) dlg_sub_window(win,h,w,y,x)
+#define tab_correct_str(s) dlg_tab_correct_str(s)
+#endif
+
+/*
+ * Attribute names
+ */
+#define DIALOG_ATR(n) dlg_color_table[n].atr
+
+#define screen_attr DIALOG_ATR(0)
+#define shadow_attr DIALOG_ATR(1)
+#define dialog_attr DIALOG_ATR(2)
+#define title_attr DIALOG_ATR(3)
+#define border_attr DIALOG_ATR(4)
+#define button_active_attr DIALOG_ATR(5)
+#define button_inactive_attr DIALOG_ATR(6)
+#define button_key_active_attr DIALOG_ATR(7)
+#define button_key_inactive_attr DIALOG_ATR(8)
+#define button_label_active_attr DIALOG_ATR(9)
+#define button_label_inactive_attr DIALOG_ATR(10)
+#define inputbox_attr DIALOG_ATR(11)
+#define inputbox_border_attr DIALOG_ATR(12)
+#define searchbox_attr DIALOG_ATR(13)
+#define searchbox_title_attr DIALOG_ATR(14)
+#define searchbox_border_attr DIALOG_ATR(15)
+#define position_indicator_attr DIALOG_ATR(16)
+#define menubox_attr DIALOG_ATR(17)
+#define menubox_border_attr DIALOG_ATR(18)
+#define item_attr DIALOG_ATR(19)
+#define item_selected_attr DIALOG_ATR(20)
+#define tag_attr DIALOG_ATR(21)
+#define tag_selected_attr DIALOG_ATR(22)
+#define tag_key_attr DIALOG_ATR(23)
+#define tag_key_selected_attr DIALOG_ATR(24)
+#define check_attr DIALOG_ATR(25)
+#define check_selected_attr DIALOG_ATR(26)
+#define uarrow_attr DIALOG_ATR(27)
+#define darrow_attr DIALOG_ATR(28)
+#define itemhelp_attr DIALOG_ATR(29)
+#define form_active_text_attr DIALOG_ATR(30)
+#define form_text_attr DIALOG_ATR(31)
+#define form_item_readonly_attr DIALOG_ATR(32)
+
+#define DLGK_max (KEY_MAX + 256)
+
+/*
+ * Callbacks are used to implement the "background" tailbox.
+ */
+typedef struct _dlg_callback {
+ struct _dlg_callback *next;
+ FILE *input;
+ WINDOW *win;
+ bool keep_bg; /* keep in background, on exit */
+ bool bg_task; /* true if this is background task */
+ bool (*handle_getc)(struct _dlg_callback *p, int ch, int fkey, int *result);
+} DIALOG_CALLBACK;
+
+typedef struct _dlg_windows {
+ struct _dlg_windows *next;
+ WINDOW *normal;
+ WINDOW *shadow;
+} DIALOG_WINDOWS;
+
+/*
+ * Global variables, which are initialized as needed
+ */
+typedef struct {
+ DIALOG_CALLBACK *getc_callbacks;
+ DIALOG_CALLBACK *getc_redirect;
+ DIALOG_WINDOWS *all_windows;
+ FILE *output; /* option "--output-fd fd" */
+ FILE *pipe_input; /* used for gauge widget */
+ FILE *screen_output; /* newterm(), etc. */
+ bool screen_initialized;
+ bool use_colors; /* use colors by default? */
+ bool use_scrollbar; /* RESERVED */
+ bool use_shadow; /* shadow dialog boxes by default? */
+ bool visit_items; /* option "--visit-items" */
+ char *separate_str; /* option "--separate-widget string" */
+ int aspect_ratio; /* option "--aspect ratio" */
+ int output_count; /* # of widgets that may have done output */
+ int tab_len; /* option "--tab-len n" */
+ /* 1.0-20070227 */
+ FILE *input; /* option "--input-fd fd" */
+#ifdef HAVE_DLG_TRACE
+ FILE *trace_output; /* option "--trace file" */
+#endif
+} DIALOG_STATE;
+
+extern DIALOG_STATE dialog_state;
+
+/*
+ * Global variables, which dialog resets before each widget
+ */
+typedef struct {
+ bool beep_after_signal; /* option "--beep-after" */
+ bool beep_signal; /* option "--beep" */
+ bool begin_set; /* option "--begin y x" was used */
+ bool cant_kill; /* option "--no-kill" */
+ bool colors; /* option "--colors" */
+ bool cr_wrap; /* option "--cr-wrap" */
+ bool defaultno; /* option "--defaultno" */
+ bool dlg_clear_screen; /* option "--clear" */
+ bool extra_button; /* option "--extra-button" */
+ bool help_button; /* option "--help-button" */
+ bool help_status; /* option "--help-status" */
+ bool input_menu; /* menu vs inputmenu widget */
+ bool insecure; /* option "--insecure" */
+ bool item_help; /* option "--item-help" */
+ bool keep_window; /* option "--keep-window" */
+ bool nocancel; /* option "--no-cancel" */
+ bool nocollapse; /* option "--no-collapse" */
+ bool print_siz; /* option "--print-size" */
+ bool separate_output; /* option "--separate-output" */
+ bool single_quoted; /* option "--single-quoted" */
+ bool size_err; /* option "--size-err" */
+ bool tab_correct; /* option "--tab-correct" */
+ bool trim_whitespace; /* option "--trim" */
+ char *backtitle; /* option "--backtitle backtitle" */
+ char *cancel_label; /* option "--cancel-label string" */
+ char *default_item; /* option "--default-item string" */
+ char *exit_label; /* option "--exit-label string" */
+ char *extra_label; /* option "--extra-label string" */
+ char *help_label; /* option "--help-label string" */
+ char *input_result;
+ char *no_label; /* option "--no-label string" */
+ char *ok_label; /* option "--ok-label string" */
+ char *title; /* option "--title title" */
+ char *yes_label; /* option "--yes-label string" */
+ int begin_x; /* option "--begin y x" (second value) */
+ int begin_y; /* option "--begin y x" (first value) */
+ int max_input; /* option "--max-input size" */
+ int scale_factor; /* RESERVED */
+ int sleep_secs; /* option "--sleep secs" */
+ int timeout_secs; /* option "--timeout secs" */
+ unsigned input_length; /* nonzero if input_result is allocated */
+ /* 1.0-20051207 */
+ unsigned formitem_type; /* DIALOG_FORMITEM.type in dialog_form() */
+ /* 1.1-20070227 */
+ bool keep_tite; /* option "--keep-tite" */
+ bool ascii_lines; /* option "--ascii-lines" */
+ bool no_lines; /* option "--no-lines" */
+ /* 1.1-20070930 */
+ bool nook; /* option "--no-ok" */
+ /* 1.2-20080727 */
+ bool quoted; /* option "--quoted" */
+ char *column_header; /* RESERVED "--column-header" */
+ char *column_separator; /* option "--column-separator" */
+ char *output_separator; /* option "--output-separator" */
+} DIALOG_VARS;
+
+#define USE_ITEM_HELP(s) (dialog_vars.item_help && (s) != 0)
+#define CHECKBOX_TAGS (dialog_vars.item_help ? 4 : 3)
+#define MENUBOX_TAGS (dialog_vars.item_help ? 3 : 2)
+#define FORMBOX_TAGS (dialog_vars.item_help ? 9 : 8)
+#define MIXEDFORM_TAGS (FORMBOX_TAGS + 1)
+#define MIXEDGAUGE_TAGS 2
+
+extern DIALOG_VARS dialog_vars;
+
+#ifndef HAVE_TYPE_CHTYPE
+#define chtype long
+#endif
+
+#define UCH(ch) ((unsigned char)(ch))
+
+#define assert_ptr(ptr,msg) if ((ptr) == 0) dlg_exiterr("cannot allocate memory in " msg)
+
+#define dlg_malloc(t,n) (t *) malloc((n) * sizeof(t))
+#define dlg_calloc(t,n) (t *) calloc((n), sizeof(t))
+#define dlg_realloc(t,n,p) (t *) realloc((p), (n) * sizeof(t))
+
+/*
+ * Table for attribute- and color-values.
+ */
+typedef struct {
+ chtype atr;
+#ifdef HAVE_COLOR
+ int fg;
+ int bg;
+ int hilite;
+#endif
+#ifdef HAVE_RC_FILE
+ char *name;
+ char *comment;
+#endif
+} DIALOG_COLORS;
+
+extern DIALOG_COLORS dlg_color_table[];
+
+/*
+ * Function prototypes
+ */
+extern char *dialog_version(void);
+
+/* widgets, each in separate files */
+extern int dialog_calendar(const char * /*title*/, const char * /*subtitle*/, int /*height*/, int /*width*/, int /*day*/, int /*month*/, int /*year*/);
+extern int dialog_checklist(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*list_height*/, int /*item_no*/, char ** /*items*/, int /*flag*/);
+extern int dialog_dselect(const char * /*title*/, const char * /*path*/, int /*height*/, int /*width*/);
+extern int dialog_editbox(const char * /*title*/, const char * /*file*/, int /*height*/, int /*width*/);
+extern int dialog_form(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*form_height*/, int /*item_no*/, char ** /*items*/);
+extern int dialog_fselect(const char * /*title*/, const char * /*path*/, int /*height*/, int /*width*/);
+extern int dialog_gauge(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*percent*/);
+extern int dialog_inputbox(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, const char * /*init*/, const int /*password*/);
+extern int dialog_menu(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*menu_height*/, int /*item_no*/, char ** /*items*/);
+extern int dialog_mixedform(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*form_height*/, int /*item_no*/, char ** /*items*/);
+extern int dialog_mixedgauge(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*percent*/, int /*item_no*/, char ** /*items*/);
+extern int dialog_msgbox(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*pauseopt*/);
+extern int dialog_pause(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*seconds*/);
+extern int dialog_progressbox(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/);
+extern int dialog_tailbox(const char * /*title*/, const char * /*file*/, int /*height*/, int /*width*/, int /*bg_task*/);
+extern int dialog_textbox(const char * /*title*/, const char * /*file*/, int /*height*/, int /*width*/);
+extern int dialog_timebox(const char * /*title*/, const char * /*subtitle*/, int /*height*/, int /*width*/, int /*hour*/, int /*minute*/, int /*second*/);
+extern int dialog_yesno(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/);
+
+/* some widgets have alternate entrypoints, to allow list manipulation */
+typedef struct {
+ char *name;
+ char *text;
+ char *help;
+ int state;
+} DIALOG_LISTITEM;
+
+typedef struct {
+ unsigned type; /* the field type (0=input, 1=password) */
+ char *name; /* the field label */
+ int name_len; /* ...its length */
+ int name_y; /* ...its y-ordinate */
+ int name_x; /* ...its x-ordinate */
+ bool name_free; /* ...true if .name can be freed */
+ char *text; /* the field contents */
+ int text_len; /* ...its length on the screen */
+ int text_y; /* ...its y-ordinate */
+ int text_x; /* ...its x-ordinate */
+ int text_flen; /* ...its length on screen, or 0 if no input allowed */
+ int text_ilen; /* ...its limit on amount to be entered */
+ bool text_free; /* ...true if .text can be freed */
+ char *help; /* help-message, if any */
+ bool help_free; /* ...true if .help can be freed */
+} DIALOG_FORMITEM;
+
+typedef int (DIALOG_INPUTMENU) (DIALOG_LISTITEM * /*items*/, int /*current*/, char * /*newtext*/);
+
+extern int dlg_checklist(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*list_height*/, int /*item_no*/, DIALOG_LISTITEM * /*items*/, const char * /*states*/, int /*flag*/, int * /*current_item*/);
+extern int dlg_form(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*form_height*/, int /*item_no*/, DIALOG_FORMITEM * /*items*/, int * /*current_item*/);
+extern int dlg_menu(const char * /*title*/, const char * /*cprompt*/, int /*height*/, int /*width*/, int /*menu_height*/, int /*item_no*/, DIALOG_LISTITEM * /*items*/, int * /*current_item*/, DIALOG_INPUTMENU /*rename_menu*/);
+
+/* arrows.c */
+extern void dlg_draw_arrows(WINDOW * /*dialog*/, int /*top_arrow*/, int /*bottom_arrow*/, int /*x*/, int /*top*/, int /*bottom*/);
+extern void dlg_draw_arrows2(WINDOW * /*dialog*/, int /*top_arrow*/, int /*bottom_arrow*/, int /*x*/, int /*top*/, int /*bottom*/, chtype /*attr*/, chtype /*borderattr*/);
+
+/* buttons.c */
+extern const char ** dlg_exit_label(void);
+extern const char ** dlg_ok_label(void);
+extern const char ** dlg_ok_labels(void);
+extern const char ** dlg_yes_labels(void);
+extern int dlg_button_count(const char ** /*labels*/);
+extern int dlg_button_to_char(const char * /*label*/);
+extern int dlg_button_x_step(const char ** /*labels*/, int /*limit*/, int * /*gap*/, int * /*margin*/, int * /*step*/);
+extern int dlg_char_to_button(int /*ch*/, const char ** /*labels*/);
+extern int dlg_exit_buttoncode(int /*button*/);
+extern int dlg_match_char(int /*ch*/, const char * /*string*/);
+extern int dlg_next_button(const char ** /*labels*/, int /*button*/);
+extern int dlg_next_ok_buttonindex(int /*current*/, int /*extra*/);
+extern int dlg_ok_buttoncode(int /*button*/);
+extern int dlg_prev_button(const char ** /*labels*/, int /*button*/);
+extern int dlg_prev_ok_buttonindex(int /*current*/, int /*extra*/);
+extern int dlg_yes_buttoncode(int /*button*/);
+extern void dlg_button_layout(const char ** /*labels*/, int * /*limit*/);
+extern void dlg_button_sizes(const char ** /*labels*/, int /*vertical*/, int * /*longest*/, int * /*length*/);
+extern void dlg_draw_buttons(WINDOW * /*win*/, int /*y*/, int /*x*/, const char ** /*labels*/, int /*selected*/, int /*vertical*/, int /*limit*/);
+
+/* columns.c */
+extern void dlg_align_columns(char ** /* target */, int /* per_row */, int /* num_rows */);
+extern void dlg_free_columns(char ** /* target */, int /* per_row */, int /* num_rows */);
+
+/* editbox.c */
+extern int dlg_editbox(const char */*title*/, char ***/*list*/, int */*rows*/, int /*height*/, int /*width*/);
+
+/* formbox.c */
+extern int dlg_default_formitem(DIALOG_FORMITEM * /*items*/);
+extern int dlg_ordinate(const char * /*s*/);
+extern void dlg_free_formitems(DIALOG_FORMITEM * /*items*/);
+
+/* inputstr.c */
+extern bool dlg_edit_string(char * /*string*/, int * /*offset*/, int /*key*/, int /*fkey*/, bool /*force*/);
+extern const int * dlg_index_columns(const char * /*string*/);
+extern const int * dlg_index_wchars(const char * /*string*/);
+extern int dlg_count_columns(const char * /*string*/);
+extern int dlg_count_wchars(const char * /*string*/);
+extern int dlg_edit_offset(char * /*string*/, int /*offset*/, int /*x_last*/);
+extern int dlg_find_index(const int * /*list*/, int /*limit*/, int /*to_find*/);
+extern int dlg_limit_columns(const char * /*string*/, int /*limit*/, int /*offset*/);
+extern void dlg_show_string(WINDOW * /*win*/, const char * /*string*/, int /*offset*/, chtype /*attr*/, int /*y_base*/, int /*x_base*/, int /*x_last*/, bool /*hidden*/, bool /*force*/);
+
+/* rc.c */
+#ifdef HAVE_RC_FILE
+extern int dlg_parse_rc(void);
+extern void dlg_create_rc(const char * /*filename*/);
+#endif
+
+/* ui_getc.c */
+extern int dlg_getc(WINDOW * /*win*/, int * /*fkey*/);
+extern int dlg_getc_callbacks(int /*ch*/, int /*fkey*/, int * /*result*/);
+extern int dlg_last_getc(void);
+extern void dlg_add_callback(DIALOG_CALLBACK * /*p*/);
+extern void dlg_flush_getc(void);
+extern void dlg_remove_callback(DIALOG_CALLBACK * /*p*/);
+extern void dlg_killall_bg(int *retval);
+
+/* util.c */
+extern WINDOW * dlg_new_modal_window(WINDOW * /*parent*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
+extern WINDOW * dlg_new_window(int /*height*/, int /*width*/, int /*y*/, int /*x*/);
+extern WINDOW * dlg_sub_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
+extern bool dlg_need_separator(void);
+extern char * dlg_set_result(const char * /*string*/);
+extern char * dlg_strclone(const char * /*cprompt*/);
+extern char * dlg_strempty(void);
+extern chtype dlg_asciibox(chtype /*ch*/);
+extern chtype dlg_boxchar(chtype /*ch*/);
+extern const char * dlg_print_line(WINDOW */*win*/, chtype */*attr*/, const char */*prompt*/, int /*lm*/, int /*rm*/, int */*x*/);
+extern int dlg_box_x_ordinate(int /*width*/);
+extern int dlg_box_y_ordinate(int /*height*/);
+extern int dlg_calc_list_width(int /*item_no*/, DIALOG_LISTITEM * /*items*/);
+extern int dlg_calc_listw(int /*item_no*/, char ** /*items*/, int /*group*/);
+extern int dlg_default_item(char ** /*items*/, int /*llen*/);
+extern int dlg_default_listitem(DIALOG_LISTITEM * /*items*/);
+extern int dlg_defaultno_button(void);
+extern int dlg_max_input(int /*max_len*/);
+extern void dlg_add_quoted(char * /*string*/);
+extern void dlg_add_result(const char * /*string*/);
+extern void dlg_add_separator(void);
+extern void dlg_add_string(char * /*string*/);
+extern void dlg_attr_clear(WINDOW * /*win*/, int /*height*/, int /*width*/, chtype /*attr*/);
+extern void dlg_auto_size(const char * /*title*/, const char * /*prompt*/, int * /*height*/, int * /*width*/, int /*boxlines*/, int /*mincols*/);
+extern void dlg_auto_sizefile(const char * /*title*/, const char * /*file*/, int * /*height*/, int * /*width*/, int /*boxlines*/, int /*mincols*/);
+extern void dlg_beeping(void);
+extern void dlg_calc_listh(int * /*height*/, int * /*list_height*/, int /*item_no*/);
+extern void dlg_clear(void);
+extern void dlg_clr_result(void);
+extern void dlg_ctl_size(int /*height*/, int /*width*/);
+extern void dlg_del_window(WINDOW * /*win*/);
+extern void dlg_does_output(void);
+extern void dlg_draw_bottom_box(WINDOW * /*win*/);
+extern void dlg_draw_box(WINDOW * /*win*/, int /*y*/, int /*x*/, int /*height*/, int /*width*/, chtype /*boxchar*/, chtype /*borderchar*/);
+extern void dlg_draw_title(WINDOW *win, const char *title);
+extern void dlg_exit(int /*code*/) GCC_NORETURN;
+extern void dlg_item_help(char * /*txt*/);
+extern void dlg_print_autowrap(WINDOW * /*win*/, const char * /*prompt*/, int /*height*/, int /*width*/);
+extern void dlg_print_size(int /*height*/, int /*width*/);
+extern void dlg_print_text(WINDOW * /*win*/, const char * /*txt*/, int /*len*/, chtype * /*attr*/);
+extern void dlg_put_backtitle(void);
+extern void dlg_restore_vars(DIALOG_VARS * /* save */);
+extern void dlg_save_vars(DIALOG_VARS * /* save */);
+extern void dlg_set_focus(WINDOW * /*parent*/, WINDOW * /*win*/);
+extern void dlg_tab_correct_str(char * /*prompt*/);
+extern void dlg_trim_string(char * /*src*/);
+extern void end_dialog(void);
+extern void init_dialog(FILE * /*input*/, FILE * /*output*/);
+
+extern void dlg_exiterr(const char *, ...) GCC_NORETURN
+#if defined(__GNUC__) && !defined(printf)
+__attribute__((format(printf,1,2)))
+#endif
+;
+
+#ifdef HAVE_COLOR
+extern chtype dlg_color_pair(int /*foreground*/, int /*background*/);
+extern int dlg_color_count(void);
+extern void dlg_color_setup(void);
+extern void dlg_draw_shadow(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
+#endif
+
+#ifdef HAVE_STRCASECMP
+#define dlg_strcmp(a,b) strcasecmp(a,b)
+#else
+extern int dlg_strcmp(const char * /*a*/, const char * /*b*/);
+#endif
+
+#ifdef HAVE_DLG_TRACE
+#define DLG_TRACE(params) dlg_trace_msg params
+extern void dlg_trace_msg(const char *fmt, ...)
+#ifdef GCC_PRINTF
+ __attribute__((format(printf,1,2)))
+#endif
+;
+extern void dlg_trace_win(WINDOW * /*win*/);
+extern void dlg_trace_chr(int /*ch*/, int /*fkey*/);
+extern void dlg_trace(const char * /*fname*/);
+#else
+#define DLG_TRACE(params) /* nothing */
+#define dlg_trace_win(win) /* nothing */
+#define dlg_trace_chr(ch,fkey) /* nothing */
+#define dlg_trace(fname) /* nothing */
+#endif
+
+#ifdef KEY_RESIZE
+extern void dlg_move_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
+#endif
+
+/*
+ * The following stuff is needed for mouse support
+ */
+typedef struct mseRegion {
+ int x, y, X, Y, code;
+ int mode, step_x, step_y;
+ struct mseRegion *next;
+} mseRegion;
+
+#if defined(NCURSES_MOUSE_VERSION)
+
+#define mouse_open() mousemask(BUTTON1_CLICKED, (mmask_t *) 0)
+#define mouse_close() mousemask(0, (mmask_t *) 0)
+
+extern mseRegion * dlg_mouse_mkregion (int /*y*/, int /*x*/, int /*height*/, int /*width*/, int /*code*/);
+extern void dlg_mouse_free_regions (void);
+extern void dlg_mouse_mkbigregion (int /*y*/, int /*x*/, int /*height*/, int /*width*/, int /*code*/, int /*step_x*/, int /*step_y*/, int /*mode*/);
+extern void dlg_mouse_setbase (int /*x*/, int /*y*/);
+
+#define USE_MOUSE 1
+
+#else
+
+#define mouse_open() /*nothing*/
+#define mouse_close() /*nothing*/
+#define dlg_mouse_free_regions() /* nothing */
+#define dlg_mouse_mkregion(y, x, height, width, code) /*nothing*/
+#define dlg_mouse_mkbigregion(y, x, height, width, code, step_x, step_y, mode) /*nothing*/
+#define dlg_mouse_setbase(x, y) /*nothing*/
+
+#define USE_MOUSE 0
+
+#endif
+
+extern mseRegion *dlg_mouse_region (int /*y*/, int /*x*/);
+extern mseRegion *dlg_mouse_bigregion (int /*y*/, int /*x*/);
+extern int dlg_mouse_wgetch (WINDOW * /*win*/, int * /*fkey*/);
+extern int dlg_mouse_wgetch_nowait (WINDOW * /*win*/, int * /*fkey*/);
+
+#define mouse_mkbutton(y,x,len,code) dlg_mouse_mkregion(y,x,1,len,code);
+
+/*
+ * This is the base for fictitious keys, which activate
+ * the buttons.
+ *
+ * Mouse-generated keys are the following:
+ * -- the first 32 are used as numbers, in addition to '0'-'9'
+ * -- uppercase chars are used to invoke the button (M_EVENT + 'O')
+ */
+#define M_EVENT (DLGK_max + 1)
+
+/*
+ * The `flag' parameter in checklist is used to select between
+ * radiolist and checklist
+ */
+#define FLAG_CHECK 1
+#define FLAG_RADIO 0
+
+/*
+ * This is used only for debugging (FIXME: should have a separate header).
+ */
+#ifdef NO_LEAKS
+extern void _dlg_inputstr_leaks(void);
+#if defined(NCURSES_VERSION) && defined(HAVE__NC_FREE_AND_EXIT)
+extern void _nc_free_and_exit(int); /* nc_alloc.h normally not installed */
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* DIALOG_H_included */
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/dialog.lsm b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.lsm
new file mode 100644
index 00000000000..be527abbdf9
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.lsm
@@ -0,0 +1,23 @@
+Begin3
+Title: dialog - Display dialog boxes in scripts
+Version: 1.0-20060221
+Entered-date: 21FEB06
+Description: Dialog is a program that will let you present a variety
+ of questions or display messages in nice looking color
+ non-graphical dialog boxes from a shell or perl script.
+ Various dialog boxes can be presented such as yes/no, menu,
+ input, message, checklist, radiolist, and more.
+
+ This program is based on the no longer maintained cdialog, but
+ contains bug fixes and more features.
+Keywords: dialog, cdialog, shell, script, window
+Author: Originally Savio Lam for the ancient version
+Maintained-by: Thomas E. Dickey <dickey@invisible-island.net>
+ Vila, Santiago <sanvila@debian.org>
+Primary-site: http://invisible-island.net/dialog/
+ http://packages.debian.org/
+Alternate-site: ftp://ftp.us.debian.org/debian/pool/main/d/dialog/
+Original-site: ftp://sunsite.unc.edu/pub/Linux/utils/shell
+Platforms: Linux *nix, OS/2 EMX
+Copying-policy: LGPL
+End
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/dialog.pl b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.pl
new file mode 100644
index 00000000000..8fbb68fd8eb
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/dialog.pl
@@ -0,0 +1,454 @@
+# Functions that handle calling dialog(1) -*-perl-*-
+# $Id: dialog.pl,v 1.4 2001/10/13 00:40:22 tom Exp $
+
+# Return values are 1 for success and 0 for failure (or cancel)
+# Resultant text (if any) is in dialog_result
+
+# Unfortunately, the gauge requires use of /bin/sh to get going.
+# I didn't bother to make the others shell-free, although it
+# would be simple to do.
+
+# Note that dialog generally returns 0 for success, so I invert the
+# sense of the return code for more readable boolean expressions.
+
+$scr_lines = 24;
+
+require "flush.pl";
+
+sub rhs_clear {
+ return system("dialog --clear");
+}
+
+sub rhs_textbox {
+ local ( $title, $file, $width, $height ) = @_;
+
+ system("dialog --title \"$title\" --textbox $file $height $width");
+
+ return 1;
+}
+
+sub rhs_msgbox {
+ local ( $title, $message, $width ) = @_;
+ local ( $tmp, $height, $message_len );
+
+ $message = &rhs_wordwrap($message, $width);
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+ $height = 4 + $message_len;
+
+ $tmp = system("dialog --title \"$title\" --msgbox \"$message\" $height $width");
+ if ($tmp) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+sub rhs_infobox {
+ local ( $title, $message, $width ) = @_;
+ local ( $tmp, $height, $message_len );
+
+ $message = &rhs_wordwrap($message, $width);
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+ $height = 2 + $message_len;
+
+ return system("dialog --title \"$title\" --infobox \"$message\" $height $width");
+}
+
+sub rhs_yesno {
+ local ( $title, $message, $width ) = @_;
+ local ( $tmp, $height, $message_len );
+
+ $message = &rhs_wordwrap($message, $width);
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+ $height = 4 + $message_len;
+
+ $tmp = system("dialog --title \"$title\" --yesno \"$message\" $height $width");
+ # Dumb: dialog returns 0 for "yes" and 1 for "no"
+ if (! $tmp) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub rhs_gauge {
+ local ( $title, $message, $width, $percent ) = @_;
+ local ( $tmp, $height, $message_len );
+
+ $gauge_width = $width;
+
+ $message = &rhs_wordwrap($message, $width);
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+ $height = 5 + $message_len;
+
+ open(GAUGE, "|dialog --title \"$title\" --gauge \"$message\" $height $width $percent");
+}
+
+sub rhs_update_gauge {
+ local ( $percent ) = @_;
+
+ &printflush(GAUGE, "$percent\n");
+}
+
+sub rhs_update_gauge_and_message {
+ local ( $message, $percent ) = @_;
+
+ $message = &rhs_wordwrap($message, $gauge_width);
+ $message =~ s/\n/\\n/g;
+ &printflush(GAUGE, "XXX\n$percent\n$message\nXXX\n");
+}
+
+sub rhs_stop_gauge {
+ close GAUGE;
+}
+
+sub rhs_inputbox {
+ local ( $title, $message, $width, $instr ) = @_;
+ local ( $tmp, $height, $message_len );
+
+ $message = &rhs_wordwrap($message, $width);
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+ $height = 7 + $message_len;
+
+ return &return_output(0, "dialog --title \"$title\" --inputbox \"$message\" $height $width \"$instr\"");
+}
+
+sub rhs_menu {
+ local ( $title, $message, $width, $numitems ) = @_;
+ local ( $i, $tmp, $ent, $height, $menuheight, @list, $message_len );
+
+ shift; shift; shift; shift;
+
+ @list = ();
+ for ($i = 0; $i < $numitems; $i++) {
+ $ent = shift;
+ $list[@list] = "\"$ent\"";
+ $ent = shift;
+ $list[@list] = "\"$ent\"";
+ }
+
+ $message = &rhs_wordwrap($message, $width);
+
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+
+ $height = $message_len + 6 + $numitems;
+ if ($height <= $scr_lines) {
+ $menuheight = $numitems;
+ } else {
+ $height = $scr_lines;
+ $menuheight = $scr_lines - $message_len - 6;
+ }
+
+ return &return_output(0, "dialog --title \"$title\" --menu \"$message\" $height $width $menuheight @list");
+}
+
+sub rhs_menul {
+ local ( $title, $message, $width, $numitems ) = @_;
+ local ( $i, $tmp, $ent, $height, $menuheight, @list, $message_len );
+
+ shift; shift; shift; shift;
+
+ @list = ();
+ for ($i = 0; $i < $numitems; $i++) {
+ $ent = shift;
+ $list[@list] = "\"$ent\"";
+ $list[@list] = "\"\"";
+ }
+
+ $message = &rhs_wordwrap($message, $width);
+
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+
+ $height = $message_len + 6 + $numitems;
+ if ($height <= $scr_lines) {
+ $menuheight = $numitems;
+ } else {
+ $height = $scr_lines;
+ $menuheight = $scr_lines - $message_len - 6;
+ }
+
+ return &return_output(0, "dialog --title \"$title\" --menu \"$message\" $height $width $menuheight @list");
+}
+
+sub rhs_menua {
+ local ( $title, $message, $width, %items ) = @_;
+ local ( $tmp, $ent, $height, $menuheight, @list, $message_len );
+
+ @list = ();
+ foreach $ent (sort keys (%items)) {
+ $list[@list] = "\"$ent\"";
+ $list[@list] = "\"$items{$ent}\"";
+ }
+
+ $message = &rhs_wordwrap($message, $width);
+
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+
+ $numitems = keys(%items);
+ $height = $message_len + 6 + $numitems;
+ if ($height <= $scr_lines) {
+ $menuheight = $numitems;
+ } else {
+ $height = $scr_lines;
+ $menuheight = $scr_lines - $message_len - 6;
+ }
+
+ return &return_output(0, "dialog --title \"$title\" --menu \"$message\" $height $width $menuheight @list");
+}
+
+sub rhs_checklist {
+ local ( $title, $message, $width, $numitems ) = @_;
+ local ( $i, $tmp, $ent, $height, $menuheight, @list, $message_len );
+
+ shift; shift; shift; shift;
+
+ @list = ();
+ for ($i = 0; $i < $numitems; $i++) {
+ $ent = shift;
+ $list[@list] = "\"$ent\"";
+ $ent = shift;
+ $list[@list] = "\"$ent\"";
+ $ent = shift;
+ if ($ent) {
+ $list[@list] = "ON";
+ } else {
+ $list[@list] = "OFF";
+ }
+ }
+
+ $message = &rhs_wordwrap($message, $width);
+
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+
+ $height = $message_len + 6 + $numitems;
+ if ($height <= $scr_lines) {
+ $menuheight = $numitems;
+ } else {
+ $height = $scr_lines;
+ $menuheight = $scr_lines - $message_len - 6;
+ }
+
+ return &return_output("list", "dialog --title \"$title\" --separate-output --checklist \"$message\" $height $width $menuheight @list");
+}
+
+sub rhs_checklistl {
+ local ( $title, $message, $width, $numitems ) = @_;
+ local ( $i, $tmp, $ent, $height, $menuheight, @list, $message_len );
+
+ shift; shift; shift; shift;
+
+ @list = ();
+ for ($i = 0; $i < $numitems; $i++) {
+ $ent = shift;
+ $list[@list] = "\"$ent\"";
+ $list[@list] = "\"\"";
+ $list[@list] = "OFF";
+ }
+
+ $message = &rhs_wordwrap($message, $width);
+
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+
+ $height = $message_len + 6 + $numitems;
+ if ($height <= $scr_lines) {
+ $menuheight = $numitems;
+ } else {
+ $height = $scr_lines;
+ $menuheight = $scr_lines - $message_len - 6;
+ }
+ return &return_output("list", "dialog --title \"$title\" --separate-output --checklist \"$message\" $height $width $menuheight @list");
+}
+
+sub rhs_checklista {
+ local ( $title, $message, $width, %items ) = @_;
+ local ( $tmp, $ent, $height, $menuheight, @list, $message_len );
+
+ shift; shift; shift; shift;
+
+ @list = ();
+ foreach $ent (sort keys (%items)) {
+ $list[@list] = "\"$ent\"";
+ $list[@list] = "\"$items{$ent}\"";
+ $list[@list] = "OFF";
+ }
+
+ $message = &rhs_wordwrap($message, $width);
+
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+
+ $numitems = keys(%items);
+ $height = $message_len + 6 + $numitems;
+ if ($height <= $scr_lines) {
+ $menuheight = $numitems;
+ } else {
+ $height = $scr_lines;
+ $menuheight = $scr_lines - $message_len - 6;
+ }
+
+ return &return_output("list", "dialog --title \"$title\" --separate-output --checklist \"$message\" $height $width $menuheight @list");
+}
+
+sub rhs_radiolist {
+ local ( $title, $message, $width, $numitems ) = @_;
+ local ( $i, $tmp, $ent, $height, $menuheight, @list, $message_len );
+
+ shift; shift; shift; shift;
+
+ @list = ();
+ for ($i = 0; $i < $numitems; $i++) {
+ $ent = shift;
+ $list[@list] = "\"$ent\"";
+ $ent = shift;
+ $list[@list] = "\"$ent\"";
+ $ent = shift;
+ if ($ent) {
+ $list[@list] = "ON";
+ } else {
+ $list[@list] = "OFF";
+ }
+ }
+
+ $message = &rhs_wordwrap($message, $width);
+
+ $message_len = split(/^/, $message);
+ $tmp = $message;
+ if (chop($tmp) eq "\n") {
+ $message_len++;
+ }
+
+ $height = $message_len + 6 + $numitems;
+ if ($height <= $scr_lines) {
+ $menuheight = $numitems;
+ } else {
+ $height = $scr_lines;
+ $menuheight = $scr_lines - $message_len - 6;
+ }
+
+ return &return_output(0 , "dialog --title \"$title\" --radiolist \"$message\" $height $width $menuheight @list");
+}
+
+sub return_output {
+ local ( $listp, $command ) = @_;
+ local ( $res ) = 1;
+
+ pipe(PARENT_READER, CHILD_WRITER);
+ # We have to fork (as opposed to using "system") so that the parent
+ # process can read from the pipe to avoid deadlock.
+ my ($pid) = fork;
+ if ($pid == 0) { # child
+ close(PARENT_READER);
+ open(STDERR, ">&CHILD_WRITER");
+ exec($command);
+ die("no exec");
+ }
+ if ($pid > 0) { # parent
+ close( CHILD_WRITER );
+ if ($listp) {
+ @dialog_result = ();
+ while (<PARENT_READER>) {
+ chop;
+ $dialog_result[@dialog_result] = $_;
+ }
+ }
+ else { $dialog_result = <PARENT_READER>; }
+ close(PARENT_READER);
+ waitpid($pid,0);
+ $res = $?;
+ }
+
+ # Again, dialog returns results backwards
+ if (! $res) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+sub rhs_wordwrap {
+ local ( $intext, $width ) = @_;
+ local ( $outtext, $i, $j, @lines, $wrap, @words, $pos, $pad );
+
+ $outtext = "";
+ $pad = 3; # leave 3 spaces around each line
+ $pos = $pad; # current insert position
+ $wrap = 0; # 1 if we have been auto wraping
+ $insert_nl = 0; # 1 if we just did an absolute
+ # and we should preface any new text
+ # with a new line
+ @lines = split(/\n/, $intext);
+ for ($i = 0; $i <= $#lines; $i++) {
+ if ($lines[$i] =~ /^>/) {
+ $outtext .= "\n" if ($insert_nl);
+ $outtext .= "\n" if ($wrap);
+ $lines[$i] =~ /^>(.*)$/;
+ $outtext .= $1;
+ $insert_nl = 1;
+ $wrap = 0;
+ $pos = $pad;
+ } else {
+ $wrap = 1;
+ @words = split(/\s+/,$lines[$i]);
+ for ($j = 0; $j <= $#words; $j++) {
+ if ($insert_nl) {
+ $outtext .= "\n";
+ $insert_nl = 0;
+ }
+ if ((length($words[$j]) + $pos) > $width - $pad) {
+ $outtext .= "\n";
+ $pos = $pad;
+ }
+ $outtext .= $words[$j] . " ";
+ $pos += length($words[$j]) + 1;
+ }
+ }
+ }
+
+ return $outtext;
+}
+
+############
+1;
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/dlg_colors.h b/Build/source/utils/dialog/dialog-1.1-20080819/dlg_colors.h
new file mode 100644
index 00000000000..f8d8b119106
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/dlg_colors.h
@@ -0,0 +1,182 @@
+/*
+ * $Id: dlg_colors.h,v 1.15 2007/02/18 18:23:29 tom Exp $
+ *
+ * colors.h -- color attribute definitions
+ *
+ * Copyright 2000-2005,2006 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors
+ * Savio Lam (lam836@cs.cuhk.hk)
+ */
+
+#ifndef COLORS_H_included
+#define COLORS_H_included 1
+
+#include <dialog.h>
+
+/*
+ * Default color definitions (DLGC means "Dialog Color")
+ *
+ * DLGC_FG_xxx = foreground for "xxx"
+ * DLGC_BG_xxx = background for "xxx"
+ * DLGC_HL_xxx = highlight for "xxx"
+ */
+#define DLGC_FG_SCREEN COLOR_CYAN
+#define DLGC_BG_SCREEN COLOR_BLUE
+#define DLGC_HL_SCREEN TRUE
+
+#define DLGC_FG_SHADOW COLOR_BLACK
+#define DLGC_BG_SHADOW COLOR_BLACK
+#define DLGC_HL_SHADOW TRUE
+
+#define DLGC_FG_DIALOG COLOR_BLACK
+#define DLGC_BG_DIALOG COLOR_WHITE
+#define DLGC_HL_DIALOG FALSE
+
+#define DLGC_FG_TITLE COLOR_BLUE
+#define DLGC_BG_TITLE COLOR_WHITE
+#define DLGC_HL_TITLE TRUE
+
+#define DLGC_FG_BORDER COLOR_WHITE
+#define DLGC_BG_BORDER COLOR_WHITE
+#define DLGC_HL_BORDER TRUE
+
+#define DLGC_FG_BUTTON_ACTIVE COLOR_WHITE
+#define DLGC_BG_BUTTON_ACTIVE COLOR_BLUE
+#define DLGC_HL_BUTTON_ACTIVE TRUE
+
+#define DLGC_FG_BUTTON_INACTIVE COLOR_BLACK
+#define DLGC_BG_BUTTON_INACTIVE COLOR_WHITE
+#define DLGC_HL_BUTTON_INACTIVE FALSE
+
+#define DLGC_FG_BUTTON_KEY_ACTIVE COLOR_WHITE
+#define DLGC_BG_BUTTON_KEY_ACTIVE COLOR_BLUE
+#define DLGC_HL_BUTTON_KEY_ACTIVE TRUE
+
+#define DLGC_FG_BUTTON_KEY_INACTIVE COLOR_RED
+#define DLGC_BG_BUTTON_KEY_INACTIVE COLOR_WHITE
+#define DLGC_HL_BUTTON_KEY_INACTIVE FALSE
+
+#define DLGC_FG_BUTTON_LABEL_ACTIVE COLOR_YELLOW
+#define DLGC_BG_BUTTON_LABEL_ACTIVE COLOR_BLUE
+#define DLGC_HL_BUTTON_LABEL_ACTIVE TRUE
+
+#define DLGC_FG_BUTTON_LABEL_INACTIVE COLOR_BLACK
+#define DLGC_BG_BUTTON_LABEL_INACTIVE COLOR_WHITE
+#define DLGC_HL_BUTTON_LABEL_INACTIVE TRUE
+
+#define DLGC_FG_FORM_ITEM_READONLY COLOR_CYAN
+#define DLGC_BG_FORM_ITEM_READONLY COLOR_WHITE
+#define DLGC_HL_FORM_ITEM_READONLY TRUE
+
+#define DLGC_FG_INPUTBOX COLOR_BLACK
+#define DLGC_BG_INPUTBOX COLOR_WHITE
+#define DLGC_HL_INPUTBOX FALSE
+
+#define DLGC_FG_INPUTBOX_BORDER COLOR_BLACK
+#define DLGC_BG_INPUTBOX_BORDER COLOR_WHITE
+#define DLGC_HL_INPUTBOX_BORDER FALSE
+
+#define DLGC_FG_SEARCHBOX COLOR_BLACK
+#define DLGC_BG_SEARCHBOX COLOR_WHITE
+#define DLGC_HL_SEARCHBOX FALSE
+
+#define DLGC_FG_SEARCHBOX_TITLE COLOR_BLUE
+#define DLGC_BG_SEARCHBOX_TITLE COLOR_WHITE
+#define DLGC_HL_SEARCHBOX_TITLE TRUE
+
+#define DLGC_FG_SEARCHBOX_BORDER COLOR_WHITE
+#define DLGC_BG_SEARCHBOX_BORDER COLOR_WHITE
+#define DLGC_HL_SEARCHBOX_BORDER TRUE
+
+#define DLGC_FG_POSITION_INDICATOR COLOR_BLUE
+#define DLGC_BG_POSITION_INDICATOR COLOR_WHITE
+#define DLGC_HL_POSITION_INDICATOR TRUE
+
+#define DLGC_FG_MENUBOX COLOR_BLACK
+#define DLGC_BG_MENUBOX COLOR_WHITE
+#define DLGC_HL_MENUBOX FALSE
+
+#define DLGC_FG_MENUBOX_BORDER COLOR_WHITE
+#define DLGC_BG_MENUBOX_BORDER COLOR_WHITE
+#define DLGC_HL_MENUBOX_BORDER TRUE
+
+#define DLGC_FG_ITEM COLOR_BLACK
+#define DLGC_BG_ITEM COLOR_WHITE
+#define DLGC_HL_ITEM FALSE
+
+#define DLGC_FG_ITEM_SELECTED COLOR_WHITE
+#define DLGC_BG_ITEM_SELECTED COLOR_BLUE
+#define DLGC_HL_ITEM_SELECTED TRUE
+
+#define DLGC_FG_TAG COLOR_BLUE
+#define DLGC_BG_TAG COLOR_WHITE
+#define DLGC_HL_TAG TRUE
+
+#define DLGC_FG_TAG_SELECTED COLOR_YELLOW
+#define DLGC_BG_TAG_SELECTED COLOR_BLUE
+#define DLGC_HL_TAG_SELECTED TRUE
+
+#define DLGC_FG_TAG_KEY COLOR_RED
+#define DLGC_BG_TAG_KEY COLOR_WHITE
+#define DLGC_HL_TAG_KEY FALSE
+
+#define DLGC_FG_TAG_KEY_SELECTED COLOR_RED
+#define DLGC_BG_TAG_KEY_SELECTED COLOR_BLUE
+#define DLGC_HL_TAG_KEY_SELECTED TRUE
+
+#define DLGC_FG_CHECK COLOR_BLACK
+#define DLGC_BG_CHECK COLOR_WHITE
+#define DLGC_HL_CHECK FALSE
+
+#define DLGC_FG_CHECK_SELECTED COLOR_WHITE
+#define DLGC_BG_CHECK_SELECTED COLOR_BLUE
+#define DLGC_HL_CHECK_SELECTED TRUE
+
+#define DLGC_FG_UARROW COLOR_GREEN
+#define DLGC_BG_UARROW COLOR_WHITE
+#define DLGC_HL_UARROW TRUE
+
+#define DLGC_FG_DARROW COLOR_GREEN
+#define DLGC_BG_DARROW COLOR_WHITE
+#define DLGC_HL_DARROW TRUE
+
+#define DLGC_FG_ITEMHELP COLOR_WHITE
+#define DLGC_BG_ITEMHELP COLOR_BLACK
+#define DLGC_HL_ITEMHELP FALSE
+
+#define DLGC_FG_FORM_ACTIVE_TEXT COLOR_WHITE
+#define DLGC_BG_FORM_ACTIVE_TEXT COLOR_BLUE
+#define DLGC_HL_FORM_ACTIVE_TEXT TRUE
+
+#define DLGC_FG_FORM_TEXT COLOR_WHITE
+#define DLGC_BG_FORM_TEXT COLOR_CYAN
+#define DLGC_HL_FORM_TEXT TRUE
+
+/* End of default color definitions */
+
+/*
+ * Global variables
+ */
+
+typedef struct {
+ const char *name;
+ int value;
+} color_names_st;
+
+#endif /* COLORS_H_included */
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/dlg_keys.c b/Build/source/utils/dialog/dialog-1.1-20080819/dlg_keys.c
new file mode 100644
index 00000000000..2a141dbd518
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/dlg_keys.c
@@ -0,0 +1,725 @@
+/*
+ * $Id: dlg_keys.c,v 1.24 2007/09/30 21:15:42 tom Exp $
+ *
+ * dlg_keys.c -- runtime binding support for dialog
+ *
+ * Copyright 2006,2007 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#define LIST_BINDINGS struct _list_bindings
+
+LIST_BINDINGS {
+ LIST_BINDINGS *link;
+ WINDOW *win; /* window on which widget gets input */
+ const char *name; /* widget name */
+ bool buttons; /* true only for dlg_register_buttons() */
+ DLG_KEYS_BINDING *binding; /* list of bindings */
+};
+
+static LIST_BINDINGS *all_bindings;
+static const DLG_KEYS_BINDING end_keys_binding = END_KEYS_BINDING;
+
+/*
+ * For a given named widget's window, associate a binding table.
+ */
+void
+dlg_register_window(WINDOW *win, const char *name, DLG_KEYS_BINDING * binding)
+{
+ LIST_BINDINGS *p, *q;
+
+ for (p = all_bindings, q = 0; p != 0; q = p, p = p->link) {
+ if (p->win == win && !strcmp(p->name, name)) {
+ p->binding = binding;
+ return;
+ }
+ }
+ /* add built-in bindings at the end of the list (see compare_bindings). */
+ if ((p = dlg_calloc(LIST_BINDINGS, 1)) != 0) {
+ p->win = win;
+ p->name = name;
+ p->binding = binding;
+ if (q != 0)
+ q->link = p;
+ else
+ all_bindings = p;
+ }
+}
+
+/*
+ * Unlike dlg_lookup_key(), this looks for either widget-builtin or rc-file
+ * definitions, depending on whether 'win' is null.
+ */
+static int
+key_is_bound(WINDOW *win, const char *name, int curses_key, int function_key)
+{
+ LIST_BINDINGS *p;
+
+ for (p = all_bindings; p != 0; p = p->link) {
+ if (p->win == win && !dlg_strcmp(p->name, name)) {
+ int n;
+ for (n = 0; p->binding[n].is_function_key >= 0; ++n) {
+ if (p->binding[n].curses_key == curses_key
+ && p->binding[n].is_function_key == function_key) {
+ return TRUE;
+ }
+ }
+ }
+ }
+ return FALSE;
+}
+
+/*
+ * Call this function after dlg_register_window(), for the list of button
+ * labels associated with the widget.
+ *
+ * Ensure that dlg_lookup_key() will not accidentally translate a key that
+ * we would like to use for a button abbreviation to some other key, e.g.,
+ * h/j/k/l for navigation into a cursor key. Do this by binding the key
+ * to itself.
+ *
+ * See dlg_char_to_button().
+ */
+void
+dlg_register_buttons(WINDOW *win, const char *name, const char **buttons)
+{
+ int n;
+ LIST_BINDINGS *p;
+ DLG_KEYS_BINDING *q;
+
+ if (buttons == 0)
+ return;
+
+ for (n = 0; buttons[n] != 0; ++n) {
+ int curses_key = dlg_button_to_char(buttons[n]);
+
+ /* ignore multibyte characters */
+ if (curses_key >= KEY_MIN)
+ continue;
+
+ /* if it is not bound in the widget, skip it (no conflicts) */
+ if (!key_is_bound(win, name, curses_key, FALSE))
+ continue;
+
+#ifdef HAVE_RC_FILE
+ /* if it is bound in the rc-file, skip it */
+ if (key_is_bound(0, name, curses_key, FALSE))
+ continue;
+#endif
+
+ if ((p = dlg_calloc(LIST_BINDINGS, 1)) != 0) {
+ if ((q = dlg_calloc(DLG_KEYS_BINDING, 2)) != 0) {
+ q[0].is_function_key = 0;
+ q[0].curses_key = curses_key;
+ q[0].dialog_key = curses_key;
+ q[1] = end_keys_binding;
+
+ p->win = win;
+ p->name = name;
+ p->buttons = TRUE;
+ p->binding = q;
+
+ /* put these at the beginning, to override the widget's table */
+ p->link = all_bindings;
+ all_bindings = p;
+ } else {
+ free(p);
+ }
+ }
+ }
+}
+
+/*
+ * Remove the bindings for a given window.
+ */
+void
+dlg_unregister_window(WINDOW *win)
+{
+ LIST_BINDINGS *p, *q;
+
+ for (p = all_bindings, q = 0; p != 0; p = p->link) {
+ if (p->win == win) {
+ if (q != 0) {
+ q->link = p->link;
+ } else {
+ all_bindings = p->link;
+ }
+ /* the user-defined and buttons-bindings all are length=1 */
+ if (p->binding[1].is_function_key < 0)
+ free(p->binding);
+ free(p);
+ dlg_unregister_window(win);
+ break;
+ }
+ q = p;
+ }
+}
+
+/*
+ * Call this after wgetch(), using the same window pointer and passing
+ * the curses-key.
+ *
+ * If there is no binding associated with the widget, it simply returns
+ * the given curses-key.
+ *
+ * Parameters:
+ * win is the window on which the wgetch() was done.
+ * curses_key is the value returned by wgetch().
+ * fkey in/out (on input, it is true if curses_key is a function key,
+ * and on output, it is true if the result is a function key).
+ */
+int
+dlg_lookup_key(WINDOW *win, int curses_key, int *fkey)
+{
+ LIST_BINDINGS *p;
+ int n;
+
+ /*
+ * Ignore mouse clicks, since they are already encoded properly.
+ */
+#ifdef KEY_MOUSE
+ if (*fkey != 0 && curses_key == KEY_MOUSE) {
+ ;
+ } else
+#endif
+ /*
+ * Ignore resize events, since they are already encoded properly.
+ */
+#ifdef KEY_RESIZE
+ if (*fkey != 0 && curses_key == KEY_RESIZE) {
+ ;
+ } else
+#endif
+ if (*fkey == 0 || curses_key < KEY_MAX) {
+ for (p = all_bindings; p != 0; p = p->link) {
+ if (p->win == win || p->win == 0) {
+ int function_key = (*fkey != 0);
+ for (n = 0; p->binding[n].is_function_key >= 0; ++n) {
+ if (p->buttons
+ && !function_key
+ && p->binding[n].curses_key == (int) dlg_toupper(curses_key)) {
+ *fkey = 0;
+ return p->binding[n].dialog_key;
+ }
+ if (p->binding[n].curses_key == curses_key
+ && p->binding[n].is_function_key == function_key) {
+ *fkey = p->binding[n].dialog_key;
+ return *fkey;
+ }
+ }
+ }
+ }
+ }
+ return curses_key;
+}
+
+/*
+ * Test a dialog internal keycode to see if it corresponds to one of the push
+ * buttons on the widget such as "OK".
+ *
+ * This is only useful if there are user-defined key bindings, since there are
+ * no built-in bindings that map directly to DLGK_OK, etc.
+ *
+ * See also dlg_ok_buttoncode().
+ */
+int
+dlg_result_key(int dialog_key, int fkey GCC_UNUSED, int *resultp)
+{
+ int done = FALSE;
+
+#ifdef HAVE_RC_FILE
+ if (fkey) {
+ switch ((DLG_KEYS_ENUM) dialog_key) {
+ case DLGK_OK:
+ *resultp = DLG_EXIT_OK;
+ done = TRUE;
+ break;
+ case DLGK_CANCEL:
+ if (!dialog_vars.nocancel) {
+ *resultp = DLG_EXIT_CANCEL;
+ done = TRUE;
+ }
+ break;
+ case DLGK_EXTRA:
+ if (dialog_vars.extra_button) {
+ *resultp = DLG_EXIT_EXTRA;
+ done = TRUE;
+ }
+ break;
+ case DLGK_HELP:
+ if (dialog_vars.help_button) {
+ *resultp = DLG_EXIT_HELP;
+ done = TRUE;
+ }
+ break;
+ case DLGK_ESC:
+ *resultp = DLG_EXIT_ESC;
+ done = TRUE;
+ break;
+ default:
+ break;
+ }
+ } else
+#endif
+ if (dialog_key == ESC) {
+ *resultp = DLG_EXIT_ESC;
+ done = TRUE;
+ }
+ return done;
+}
+
+#ifdef HAVE_RC_FILE
+typedef struct {
+ const char *name;
+ int code;
+} CODENAME;
+
+#define CURSES_NAME(upper) { #upper, KEY_ ## upper }
+#define COUNT_CURSES sizeof(curses_names)/sizeof(curses_names[0])
+static const CODENAME curses_names[] =
+{
+ CURSES_NAME(DOWN),
+ CURSES_NAME(UP),
+ CURSES_NAME(LEFT),
+ CURSES_NAME(RIGHT),
+ CURSES_NAME(HOME),
+ CURSES_NAME(BACKSPACE),
+ CURSES_NAME(F0),
+ CURSES_NAME(DL),
+ CURSES_NAME(IL),
+ CURSES_NAME(DC),
+ CURSES_NAME(IC),
+ CURSES_NAME(EIC),
+ CURSES_NAME(CLEAR),
+ CURSES_NAME(EOS),
+ CURSES_NAME(EOL),
+ CURSES_NAME(SF),
+ CURSES_NAME(SR),
+ CURSES_NAME(NPAGE),
+ CURSES_NAME(PPAGE),
+ CURSES_NAME(STAB),
+ CURSES_NAME(CTAB),
+ CURSES_NAME(CATAB),
+ CURSES_NAME(ENTER),
+ CURSES_NAME(PRINT),
+ CURSES_NAME(LL),
+ CURSES_NAME(A1),
+ CURSES_NAME(A3),
+ CURSES_NAME(B2),
+ CURSES_NAME(C1),
+ CURSES_NAME(C3),
+ CURSES_NAME(BTAB),
+ CURSES_NAME(BEG),
+ CURSES_NAME(CANCEL),
+ CURSES_NAME(CLOSE),
+ CURSES_NAME(COMMAND),
+ CURSES_NAME(COPY),
+ CURSES_NAME(CREATE),
+ CURSES_NAME(END),
+ CURSES_NAME(EXIT),
+ CURSES_NAME(FIND),
+ CURSES_NAME(HELP),
+ CURSES_NAME(MARK),
+ CURSES_NAME(MESSAGE),
+ CURSES_NAME(MOVE),
+ CURSES_NAME(NEXT),
+ CURSES_NAME(OPEN),
+ CURSES_NAME(OPTIONS),
+ CURSES_NAME(PREVIOUS),
+ CURSES_NAME(REDO),
+ CURSES_NAME(REFERENCE),
+ CURSES_NAME(REFRESH),
+ CURSES_NAME(REPLACE),
+ CURSES_NAME(RESTART),
+ CURSES_NAME(RESUME),
+ CURSES_NAME(SAVE),
+ CURSES_NAME(SBEG),
+ CURSES_NAME(SCANCEL),
+ CURSES_NAME(SCOMMAND),
+ CURSES_NAME(SCOPY),
+ CURSES_NAME(SCREATE),
+ CURSES_NAME(SDC),
+ CURSES_NAME(SDL),
+ CURSES_NAME(SELECT),
+ CURSES_NAME(SEND),
+ CURSES_NAME(SEOL),
+ CURSES_NAME(SEXIT),
+ CURSES_NAME(SFIND),
+ CURSES_NAME(SHELP),
+ CURSES_NAME(SHOME),
+ CURSES_NAME(SIC),
+ CURSES_NAME(SLEFT),
+ CURSES_NAME(SMESSAGE),
+ CURSES_NAME(SMOVE),
+ CURSES_NAME(SNEXT),
+ CURSES_NAME(SOPTIONS),
+ CURSES_NAME(SPREVIOUS),
+ CURSES_NAME(SPRINT),
+ CURSES_NAME(SREDO),
+ CURSES_NAME(SREPLACE),
+ CURSES_NAME(SRIGHT),
+ CURSES_NAME(SRSUME),
+ CURSES_NAME(SSAVE),
+ CURSES_NAME(SSUSPEND),
+ CURSES_NAME(SUNDO),
+ CURSES_NAME(SUSPEND),
+ CURSES_NAME(UNDO),
+};
+
+#define DIALOG_NAME(upper) { #upper, DLGK_ ## upper }
+#define COUNT_DIALOG sizeof(dialog_names)/sizeof(dialog_names[0])
+static const CODENAME dialog_names[] =
+{
+ DIALOG_NAME(OK),
+ DIALOG_NAME(CANCEL),
+ DIALOG_NAME(EXTRA),
+ DIALOG_NAME(HELP),
+ DIALOG_NAME(ESC),
+ DIALOG_NAME(PAGE_FIRST),
+ DIALOG_NAME(PAGE_LAST),
+ DIALOG_NAME(PAGE_NEXT),
+ DIALOG_NAME(PAGE_PREV),
+ DIALOG_NAME(ITEM_FIRST),
+ DIALOG_NAME(ITEM_LAST),
+ DIALOG_NAME(ITEM_NEXT),
+ DIALOG_NAME(ITEM_PREV),
+ DIALOG_NAME(FIELD_FIRST),
+ DIALOG_NAME(FIELD_LAST),
+ DIALOG_NAME(FIELD_NEXT),
+ DIALOG_NAME(FIELD_PREV),
+ DIALOG_NAME(GRID_UP),
+ DIALOG_NAME(GRID_DOWN),
+ DIALOG_NAME(GRID_LEFT),
+ DIALOG_NAME(GRID_RIGHT),
+ DIALOG_NAME(DELETE_LEFT),
+ DIALOG_NAME(DELETE_RIGHT),
+ DIALOG_NAME(DELETE_ALL),
+ DIALOG_NAME(ENTER),
+ DIALOG_NAME(BEGIN),
+ DIALOG_NAME(FINAL),
+ DIALOG_NAME(SELECT)
+};
+
+static char *
+skip_white(char *s)
+{
+ while (*s != '\0' && isspace(UCH(*s)))
+ ++s;
+ return s;
+}
+
+static char *
+skip_black(char *s)
+{
+ while (*s != '\0' && !isspace(UCH(*s)))
+ ++s;
+ return s;
+}
+
+/*
+ * Find a user-defined binding, given the curses key code.
+ */
+static DLG_KEYS_BINDING *
+find_binding(char *widget, int curses_key)
+{
+ LIST_BINDINGS *p;
+ DLG_KEYS_BINDING *result = 0;
+
+ for (p = all_bindings; p != 0; p = p->link) {
+ if (p->win == 0
+ && !dlg_strcmp(p->name, widget)
+ && p->binding->curses_key == curses_key) {
+ result = p->binding;
+ break;
+ }
+ }
+ return result;
+}
+
+/*
+ * Built-in bindings have a nonzero "win" member, and the associated binding
+ * table can have more than one entry. We keep those last, since lookups will
+ * find the user-defined bindings first and use those.
+ *
+ * Sort "*" (all-widgets) entries past named widgets, since those are less
+ * specific.
+ */
+static int
+compare_bindings(LIST_BINDINGS * a, LIST_BINDINGS * b)
+{
+ int result = 0;
+ if (a->win == b->win) {
+ if (!strcmp(a->name, b->name)) {
+ result = a->binding[0].curses_key - b->binding[0].curses_key;
+ } else if (!strcmp(b->name, "*")) {
+ result = -1;
+ } else if (!strcmp(a->name, "*")) {
+ result = 1;
+ } else {
+ result = dlg_strcmp(a->name, b->name);
+ }
+ } else if (b->win) {
+ result = -1;
+ } else {
+ result = 1;
+ }
+ return result;
+}
+
+/*
+ * Find a user-defined binding, given the curses key code. If it does not
+ * exist, create a new one, inserting it into the linked list, keeping it
+ * sorted to simplify lookups for user-defined bindings that can override
+ * the built-in bindings.
+ */
+static DLG_KEYS_BINDING *
+make_binding(char *widget, int curses_key, int is_function, int dialog_key)
+{
+ LIST_BINDINGS *entry = 0;
+ DLG_KEYS_BINDING *data = 0;
+ char *name;
+ LIST_BINDINGS *p, *q;
+ DLG_KEYS_BINDING *result = find_binding(widget, curses_key);
+
+ if (result == 0
+ && (entry = dlg_calloc(LIST_BINDINGS, 1)) != 0
+ && (data = dlg_calloc(DLG_KEYS_BINDING, 2)) != 0
+ && (name = dlg_strclone(widget)) != 0) {
+
+ entry->name = name;
+ entry->binding = data;
+
+ data[0].is_function_key = is_function;
+ data[0].curses_key = curses_key;
+ data[0].dialog_key = dialog_key;
+
+ data[1] = end_keys_binding;
+
+ for (p = all_bindings, q = 0; p != 0; q = p, p = p->link) {
+ if (compare_bindings(entry, p) < 0) {
+ break;
+ }
+ }
+ if (q != 0) {
+ q->link = entry;
+ } else {
+ all_bindings = entry;
+ }
+ if (p != 0) {
+ entry->link = p;
+ }
+ result = data;
+ } else if (entry != 0) {
+ free(entry);
+ if (data)
+ free(data);
+ }
+
+ return result;
+}
+
+/*
+ * Parse the parameters of the "bindkeys" configuration-file entry. This
+ * expects widget name which may be "*", followed by curses key definition and
+ * then dialog key definition.
+ *
+ * The curses key "should" be one of the names (ignoring case) from
+ * curses_names[], but may also be a single control character (prefix "^" or
+ * "~" depending on whether it is C0 or C1), or an escaped single character.
+ * Binding a printable character with dialog is possible but not useful.
+ *
+ * The dialog key must be one of the names from dialog_names[].
+ */
+int
+dlg_parse_bindkey(char *params)
+{
+ char *p = skip_white(params);
+ char *q;
+ bool escaped = FALSE;
+ int modified = 0;
+ int result = FALSE;
+ unsigned xx;
+ char *widget;
+ int is_function = FALSE;
+ int curses_key;
+ int dialog_key;
+
+ curses_key = -1;
+ dialog_key = -1;
+ widget = p;
+
+ p = skip_black(p);
+ if (p != widget && *p != '\0') {
+ *p++ = '\0';
+ q = p;
+ while (*p != '\0' && curses_key < 0) {
+ if (escaped) {
+ escaped = FALSE;
+ curses_key = *p;
+ } else if (*p == '\\') {
+ escaped = TRUE;
+ } else if (modified) {
+ if (*p == '?') {
+ curses_key = ((modified == '^')
+ ? 127
+ : 255);
+ } else {
+ curses_key = ((modified == '^')
+ ? (*p & 0x1f)
+ : ((*p & 0x1f) | 0x80));
+ }
+ } else if (*p == '^') {
+ modified = *p;
+ } else if (*p == '~') {
+ modified = *p;
+ } else if (isspace(UCH(*p))) {
+ break;
+ }
+ ++p;
+ }
+ if (!isspace(UCH(*p))) {
+ ;
+ } else {
+ *p++ = '\0';
+ if (curses_key < 0) {
+ char fprefix[2];
+ char check[2];
+ int keynumber;
+ if (sscanf(q, "%[Ff]%d%c", fprefix, &keynumber, check) == 2) {
+ curses_key = KEY_F(keynumber);
+ is_function = TRUE;
+ } else {
+ for (xx = 0; xx < COUNT_CURSES; ++xx) {
+ if (!dlg_strcmp(curses_names[xx].name, q)) {
+ curses_key = curses_names[xx].code;
+ is_function = TRUE;
+ break;
+ }
+ }
+ }
+ }
+ }
+ q = skip_white(p);
+ p = skip_black(q);
+ if (p != q) {
+ for (xx = 0; xx < COUNT_DIALOG; ++xx) {
+ if (!dlg_strcmp(dialog_names[xx].name, q)) {
+ dialog_key = dialog_names[xx].code;
+ break;
+ }
+ }
+ }
+ if (*widget != '\0'
+ && curses_key >= 0
+ && dialog_key >= 0
+ && make_binding(widget, curses_key, is_function, dialog_key) != 0) {
+ result = TRUE;
+ }
+ }
+ return result;
+}
+
+static void
+dump_curses_key(FILE *fp, int curses_key)
+{
+ if (curses_key > KEY_MIN) {
+ unsigned n;
+ bool found = FALSE;
+ for (n = 0; n < COUNT_CURSES; ++n) {
+ if (curses_names[n].code == curses_key) {
+ fprintf(fp, "%s", curses_names[n].name);
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found) {
+ if (curses_key >= KEY_F(0)) {
+ fprintf(fp, "F%d", curses_key - KEY_F(0));
+ } else {
+ fprintf(fp, "curses%d", curses_key);
+ }
+ }
+ } else if (curses_key >= 0 && curses_key < 32) {
+ fprintf(fp, "^%c", curses_key + 64);
+ } else if (curses_key == 127) {
+ fprintf(fp, "^?");
+ } else if (curses_key >= 128 && curses_key < 160) {
+ fprintf(fp, "~%c", curses_key - 64);
+ } else if (curses_key == 255) {
+ fprintf(fp, "~?");
+ } else {
+ fprintf(fp, "\\%c", curses_key);
+ }
+}
+
+static void
+dump_dialog_key(FILE *fp, int dialog_key)
+{
+ unsigned n;
+ bool found = FALSE;
+ for (n = 0; n < COUNT_DIALOG; ++n) {
+ if (dialog_names[n].code == dialog_key) {
+ fputs(dialog_names[n].name, fp);
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found) {
+ fprintf(fp, "dialog%d", dialog_key);
+ }
+}
+
+static void
+dump_one_binding(FILE *fp, const char *widget, DLG_KEYS_BINDING * binding)
+{
+ fprintf(fp, "bindkey %s ", widget);
+ dump_curses_key(fp, binding->curses_key);
+ fputc(' ', fp);
+ dump_dialog_key(fp, binding->dialog_key);
+ fputc('\n', fp);
+}
+
+void
+dlg_dump_keys(FILE *fp)
+{
+ LIST_BINDINGS *p;
+ const char *last = "";
+ unsigned n;
+ unsigned count = 0;
+
+ for (p = all_bindings; p != 0; p = p->link) {
+ if (p->win == 0) {
+ ++count;
+ }
+ }
+ if (count != 0) {
+ for (p = all_bindings, n = 0; p != 0; p = p->link) {
+ if (p->win == 0) {
+ if (dlg_strcmp(last, p->name)) {
+ fprintf(fp, "\n# key bindings for %s widgets\n",
+ !strcmp(p->name, "*") ? "all" : p->name);
+ last = p->name;
+ }
+ dump_one_binding(fp, p->name, p->binding);
+ }
+ }
+ }
+}
+#endif /* HAVE_RC_FILE */
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/dlg_keys.h b/Build/source/utils/dialog/dialog-1.1-20080819/dlg_keys.h
new file mode 100644
index 00000000000..145dd4248cb
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/dlg_keys.h
@@ -0,0 +1,130 @@
+/*
+ * $Id: dlg_keys.h,v 1.22 2007/07/04 11:17:55 tom Exp $
+ *
+ * dlg_keys.h -- runtime binding support for dialog
+ *
+ * Copyright 2005,2007 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#ifndef DLG_KEYS_H_included
+#define DLG_KEYS_H_included 1
+
+#include <dialog.h>
+
+#ifdef USE_WIDE_CURSES
+#include <wctype.h>
+#define dlg_toupper(ch) towupper(ch)
+#define dlg_isupper(ch) iswupper(ch)
+#else
+#define dlg_toupper(ch) toupper(ch)
+#define dlg_isupper(ch) (isalpha(ch) && isupper(ch))
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ int is_function_key;
+ int curses_key;
+ int dialog_key;
+} DLG_KEYS_BINDING;
+
+#define DLG_KEYS_DATA(dialog, curses) { curses >= KEY_MIN, curses, dialog }
+
+#define END_KEYS_BINDING { -1, 0, 0 }
+
+/*
+ * Define dialog's internal function-keys past the range used by curses.
+ */
+typedef enum {
+ DLGK_MIN = KEY_MAX + 1,
+ /* predefined buttons */
+ DLGK_OK,
+ DLGK_CANCEL,
+ DLGK_EXTRA,
+ DLGK_HELP,
+ DLGK_ESC,
+ /* moving from screen to screen (pages) */
+ DLGK_PAGE_FIRST,
+ DLGK_PAGE_LAST,
+ DLGK_PAGE_NEXT,
+ DLGK_PAGE_PREV,
+ /* moving within a list */
+ DLGK_ITEM_FIRST,
+ DLGK_ITEM_LAST,
+ DLGK_ITEM_NEXT,
+ DLGK_ITEM_PREV,
+ /* moving from field to field (or buttons) */
+ DLGK_FIELD_FIRST,
+ DLGK_FIELD_LAST,
+ DLGK_FIELD_NEXT,
+ DLGK_FIELD_PREV,
+ /* moving within a grid */
+ DLGK_GRID_UP,
+ DLGK_GRID_DOWN,
+ DLGK_GRID_LEFT,
+ DLGK_GRID_RIGHT,
+ /* delete */
+ DLGK_DELETE_LEFT,
+ DLGK_DELETE_RIGHT,
+ DLGK_DELETE_ALL,
+ /* special */
+ DLGK_ENTER,
+ DLGK_BEGIN,
+ DLGK_FINAL,
+ DLGK_SELECT,
+ DLGK_TRACE
+} DLG_KEYS_ENUM;
+
+#define is_DLGK_MOUSE(code) ((code) >= M_EVENT)
+#define DLGK_MOUSE(code) ((code) + M_EVENT)
+
+#define ENTERKEY_BINDINGS \
+ DLG_KEYS_DATA( DLGK_ENTER, '\n' ), \
+ DLG_KEYS_DATA( DLGK_ENTER, '\r' ), \
+ DLG_KEYS_DATA( DLGK_ENTER, KEY_ENTER )
+
+/* ^U == 21 */
+#define INPUTSTR_BINDINGS \
+ DLG_KEYS_DATA( DLGK_BEGIN, KEY_HOME ), \
+ DLG_KEYS_DATA( DLGK_DELETE_ALL, CHR_KILL ), \
+ DLG_KEYS_DATA( DLGK_DELETE_LEFT, CHR_BACKSPACE ), \
+ DLG_KEYS_DATA( DLGK_DELETE_LEFT, KEY_BACKSPACE ), \
+ DLG_KEYS_DATA( DLGK_DELETE_RIGHT, CHR_DELETE ), \
+ DLG_KEYS_DATA( DLGK_DELETE_RIGHT, KEY_DC ), \
+ DLG_KEYS_DATA( DLGK_FINAL, KEY_END ), \
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, KEY_LEFT ), \
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, KEY_RIGHT )
+
+extern int dlg_lookup_key(WINDOW * /*win*/, int /*curses_key*/, int * /*dialog_key*/);
+extern int dlg_result_key(int /*dialog_key*/, int /*fkey*/, int * /*resultp*/);
+extern void dlg_register_buttons(WINDOW * /*win*/, const char * /*name*/, const char ** /*buttons*/);
+extern void dlg_register_window(WINDOW * /*win*/, const char * /*name*/, DLG_KEYS_BINDING * /*binding*/);
+extern void dlg_unregister_window(WINDOW * /*win*/);
+
+#ifdef HAVE_RC_FILE
+extern int dlg_parse_bindkey(char * /*params*/);
+extern void dlg_dump_keys(FILE * /*fp*/);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* DLG_KEYS_H_included */
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/editbox.c b/Build/source/utils/dialog/dialog-1.1-20080819/editbox.c
new file mode 100644
index 00000000000..f90e44d1820
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/editbox.c
@@ -0,0 +1,683 @@
+/*
+ * $Id: editbox.c,v 1.46 2008/06/21 12:07:54 tom Exp $
+ *
+ * editbox.c -- implements the edit box
+ *
+ * Copyright 2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#include <sys/stat.h>
+
+#define sTEXT -1
+
+static void
+fail_list(void)
+{
+ dlg_exiterr("File too large");
+}
+
+static void
+grow_list(char ***list, int *have, int want)
+{
+ if (want > *have) {
+ unsigned last = *have;
+ unsigned need = (want | 31) + 3;
+ *have = need;
+ (*list) = dlg_realloc(char *, need, *list);
+ if ((*list) == 0) {
+ fail_list();
+ }
+ while (++last < need) {
+ (*list)[last] = 0;
+ }
+ }
+}
+
+static void
+load_list(const char *file, char ***list, int *rows)
+{
+ FILE *fp;
+ char *blob = 0;
+ struct stat sb;
+ unsigned n, pass;
+ unsigned need;
+ unsigned size;
+
+ *list = 0;
+ *rows = 0;
+
+ if (stat(file, &sb) < 0 ||
+ (sb.st_mode & S_IFMT) != S_IFREG)
+ dlg_exiterr("Not a file: %s", file);
+
+ size = sb.st_size;
+ if ((blob = dlg_malloc(char, size + 1)) == 0)
+ fail_list();
+ blob[size] = '\0';
+
+ if ((fp = fopen(file, "r")) == 0)
+ dlg_exiterr("Cannot open: %s", file);
+ size = fread(blob, sizeof(char), size, fp);
+ fclose(fp);
+
+ for (pass = 0; pass < 2; ++pass) {
+ int first = TRUE;
+ need = 0;
+ for (n = 0; n < size; ++n) {
+ if (first && pass) {
+ (*list)[need] = blob + n;
+ first = FALSE;
+ }
+ if (blob[n] == '\n') {
+ first = TRUE;
+ ++need;
+ if (pass)
+ blob[n] = '\0';
+ }
+ }
+ if (pass) {
+ if (need == 0) {
+ (*list)[0] = dlg_strclone("");
+ (*list)[1] = 0;
+ } else {
+ for (n = 0; n < need; ++n) {
+ (*list)[n] = dlg_strclone((*list)[n]);
+ }
+ (*list)[need] = 0;
+ }
+ } else {
+ grow_list(list, rows, need + 1);
+ }
+ }
+ free(blob);
+}
+
+static void
+free_list(char ***list, int *rows)
+{
+ if (*list != 0) {
+ int n;
+ for (n = 0; n < (*rows); ++n) {
+ if ((*list)[n] != 0)
+ free((*list)[n]);
+ }
+ free(*list);
+ *list = 0;
+ }
+ *rows = 0;
+}
+
+/*
+ * Display a single row in the editing window:
+ * thisrow is the actual row number that's being displayed.
+ * show_row is the row number that's highlighted for edit.
+ * base_row is the first row number in the window
+ */
+static bool
+display_one(WINDOW *win,
+ char *text,
+ int thisrow,
+ int show_row,
+ int base_row,
+ int chr_offset)
+{
+ bool result;
+
+ if (text != 0) {
+ dlg_show_string(win,
+ text,
+ chr_offset,
+ ((thisrow == show_row)
+ ? form_active_text_attr
+ : form_text_attr),
+ thisrow - base_row,
+ 0,
+ getmaxx(win),
+ FALSE,
+ FALSE);
+ result = TRUE;
+ } else {
+ result = FALSE;
+ }
+ return result;
+}
+
+static void
+display_all(WINDOW *win,
+ char **list,
+ int show_row,
+ int firstrow,
+ int lastrow,
+ int chr_offset)
+{
+ int limit = getmaxy(win);
+ int row;
+
+ dlg_attr_clear(win, getmaxy(win), getmaxx(win), dialog_attr);
+ if (lastrow - firstrow >= limit)
+ lastrow = firstrow + limit;
+ for (row = firstrow; row < lastrow; ++row) {
+ if (!display_one(win, list[row],
+ row, show_row, firstrow,
+ (row == show_row) ? chr_offset : 0))
+ break;
+ }
+}
+
+static int
+size_list(char **list)
+{
+ int result = 0;
+
+ if (list != 0) {
+ while (*list++ != 0) {
+ ++result;
+ }
+ }
+ return result;
+}
+
+static bool
+scroll_to(int pagesize, int rows, int *base_row, int *this_row, int target)
+{
+ bool result = FALSE;
+
+ if (target < *base_row) {
+ if (target < 0) {
+ if (*base_row == 0 && *this_row == 0) {
+ beep();
+ } else {
+ *this_row = 0;
+ *base_row = 0;
+ result = TRUE;
+ }
+ } else {
+ *this_row = target;
+ *base_row = target;
+ result = TRUE;
+ }
+ } else if (target >= rows) {
+ if (*this_row < rows - 1) {
+ *this_row = rows - 1;
+ *base_row = rows - 1;
+ result = TRUE;
+ } else {
+ beep();
+ }
+ } else if (target >= *base_row + pagesize) {
+ *this_row = target;
+ *base_row = target;
+ result = TRUE;
+ } else {
+ *this_row = target;
+ result = FALSE;
+ }
+ if (pagesize < rows) {
+ if (*base_row + pagesize >= rows) {
+ *base_row = rows - pagesize;
+ }
+ } else {
+ *base_row = 0;
+ }
+ return result;
+}
+
+static int
+col_to_chr_offset(const char *text, int col)
+{
+ const int *cols = dlg_index_columns(text);
+ const int *indx = dlg_index_wchars(text);
+ bool found = FALSE;
+ int result = 0;
+ unsigned n;
+ unsigned len = dlg_count_wchars(text);
+
+ for (n = 0; n < len; ++n) {
+ if (cols[n] <= col && cols[n + 1] > col) {
+ result = indx[n];
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found && len && cols[len] == col) {
+ result = indx[len];
+ }
+ return result;
+}
+
+#define SCROLL_TO(target) show_all = scroll_to(pagesize, listsize, &base_row, &thisrow, target)
+
+#define PREV_ROW (*list)[thisrow - 1]
+#define THIS_ROW (*list)[thisrow]
+#define NEXT_ROW (*list)[thisrow + 1]
+
+#define UPDATE_COL(input) col_offset = dlg_edit_offset(input, chr_offset, box_width)
+
+/*
+ * Display a dialog box for editing a copy of a file
+ */
+int
+dlg_editbox(const char *title,
+ char ***list,
+ int *rows,
+ int height,
+ int width)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ INPUTSTR_BINDINGS,
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, KEY_LEFT ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_PAGE_FIRST, KEY_HOME ),
+ DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_END ),
+ DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_LL ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, DLGK_MOUSE(KEY_NPAGE) ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, DLGK_MOUSE(KEY_PPAGE) ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+ int x, y, box_y, box_x, box_height, box_width;
+ int show_buttons;
+ int thisrow, base_row, lastrow;
+ int goal_col = -1;
+ int col_offset = 0;
+ int chr_offset = 0;
+ int key, fkey, code;
+ int pagesize;
+ int listsize = size_list(*list);
+ int result = DLG_EXIT_UNKNOWN;
+ int state;
+ int max_len = dlg_max_input(MAX_LEN);
+ char *input, *buffer;
+ bool show_all, show_one, was_mouse;
+ WINDOW *dialog;
+ WINDOW *editing;
+ DIALOG_VARS save_vars;
+ const char **buttons = dlg_ok_labels();
+
+ dlg_save_vars(&save_vars);
+ dialog_vars.separate_output = TRUE;
+
+ dlg_does_output();
+
+ buffer = dlg_malloc(char, max_len);
+ assert_ptr(buffer, "dlg_editbox");
+
+ thisrow = base_row = lastrow = 0;
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+ show_buttons = TRUE;
+ state = dialog_vars.defaultno ? dlg_defaultno_button() : sTEXT;
+ key = fkey = 0;
+
+ dlg_auto_size(title, "", &height, &width, 3 * LINES / 4, 3 * COLS / 4);
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+ dialog = dlg_new_window(height, width, y, x);
+ dlg_register_window(dialog, "editbox", binding);
+ dlg_register_buttons(dialog, "editbox", buttons);
+
+ dlg_mouse_setbase(x, y);
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+
+ /* Draw the editing field in a box */
+ box_y = MARGIN + 0;
+ box_x = MARGIN + 1;
+ box_width = width - 2 - (2 * MARGIN);
+ box_height = height - (4 * MARGIN);
+
+ dlg_draw_box(dialog,
+ box_y,
+ box_x,
+ box_height,
+ box_width,
+ border_attr, dialog_attr);
+ dlg_mouse_mkbigregion(box_y + MARGIN,
+ box_x + MARGIN,
+ box_height - (2 * MARGIN),
+ box_width - (2 * MARGIN),
+ KEY_MAX, 1, 1, 3);
+ editing = dlg_sub_window(dialog,
+ box_height - (2 * MARGIN),
+ box_width - (2 * MARGIN),
+ getbegy(dialog) + box_y + 1,
+ getbegx(dialog) + box_x + 1);
+ dlg_register_window(editing, "editbox", binding);
+
+ show_all = TRUE;
+ show_one = FALSE;
+ pagesize = getmaxy(editing);
+
+ while (result == DLG_EXIT_UNKNOWN) {
+ int edit = 0;
+
+ if (show_all) {
+ display_all(editing, *list, thisrow, base_row, listsize, chr_offset);
+ display_one(editing, THIS_ROW,
+ thisrow, thisrow, base_row, chr_offset);
+ show_all = FALSE;
+ show_one = TRUE;
+ } else {
+ if (thisrow != lastrow) {
+ display_one(editing, (*list)[lastrow],
+ lastrow, thisrow, base_row, 0);
+ show_one = TRUE;
+ }
+ }
+ if (show_one) {
+ display_one(editing, THIS_ROW,
+ thisrow, thisrow, base_row, chr_offset);
+ getyx(editing, y, x);
+ dlg_draw_arrows2(dialog,
+ base_row != 0,
+ base_row + pagesize < listsize,
+ box_x + ARROWS_COL,
+ box_y + 0,
+ box_y + getmaxy(editing) + 1,
+ dialog_attr,
+ border_attr);
+ wmove(editing, y, x);
+ show_one = FALSE;
+ }
+ lastrow = thisrow;
+ input = THIS_ROW;
+
+ /*
+ * The last field drawn determines where the cursor is shown:
+ */
+ if (show_buttons) {
+ show_buttons = FALSE;
+ UPDATE_COL(input);
+ if (state != sTEXT) {
+ display_one(editing, input, thisrow,
+ -1, base_row, 0);
+ wrefresh(editing);
+ }
+ dlg_draw_buttons(dialog,
+ height - 2,
+ 0,
+ buttons,
+ (state != sTEXT) ? state : 99,
+ FALSE,
+ width);
+ if (state == sTEXT) {
+ display_one(editing, input, thisrow,
+ thisrow, base_row, chr_offset);
+ }
+ }
+
+ key = dlg_mouse_wgetch((state == sTEXT) ? editing : dialog, &fkey);
+ if (state != sTEXT) {
+ if (dlg_result_key(key, fkey, &result))
+ break;
+ }
+
+ was_mouse = (fkey && is_DLGK_MOUSE(key));
+ if (was_mouse)
+ key -= M_EVENT;
+
+ /*
+ * Handle mouse clicks first, since we want to know if this is a
+ * button, or something that dlg_edit_string() should handle.
+ */
+ if (fkey
+ && was_mouse
+ && (code = dlg_ok_buttoncode(key)) >= 0) {
+ result = code;
+ continue;
+ }
+
+ if (was_mouse
+ && (key >= KEY_MAX)) {
+ int wide = getmaxx(editing);
+ int cell = key - KEY_MAX;
+ thisrow = (cell / wide) + base_row;
+ col_offset = (cell % wide);
+ chr_offset = col_to_chr_offset(THIS_ROW, col_offset);
+ show_one = TRUE;
+ if (state != sTEXT) {
+ state = sTEXT;
+ show_buttons = TRUE;
+ }
+ continue;
+ } else if (was_mouse && key >= KEY_MIN) {
+ key = dlg_lookup_key(dialog, key, &fkey);
+ }
+
+ if (state == sTEXT) { /* editing box selected */
+ /*
+ * Intercept scrolling keys that dlg_edit_string() does not
+ * understand.
+ */
+ if (fkey) {
+ bool moved = TRUE;
+
+ switch (key) {
+ case DLGK_GRID_UP:
+ SCROLL_TO(thisrow - 1);
+ break;
+ case DLGK_GRID_DOWN:
+ SCROLL_TO(thisrow + 1);
+ break;
+ case DLGK_PAGE_FIRST:
+ SCROLL_TO(0);
+ break;
+ case DLGK_PAGE_LAST:
+ SCROLL_TO(listsize);
+ break;
+ case DLGK_PAGE_NEXT:
+ SCROLL_TO(base_row + pagesize);
+ break;
+ case DLGK_PAGE_PREV:
+ if (thisrow > base_row) {
+ SCROLL_TO(base_row);
+ } else {
+ SCROLL_TO(base_row - pagesize);
+ }
+ break;
+ case DLGK_DELETE_LEFT:
+ if (chr_offset == 0) {
+ if (thisrow == 0) {
+ beep();
+ } else {
+ int len = strlen(THIS_ROW) + strlen(PREV_ROW) + 1;
+ char *tmp = dlg_malloc(char, len);
+
+ assert_ptr(tmp, "dlg_editbox");
+
+ chr_offset = dlg_count_wchars(PREV_ROW);
+ UPDATE_COL(PREV_ROW);
+ goal_col = col_offset;
+
+ sprintf(tmp, "%s%s", PREV_ROW, THIS_ROW);
+ if (len > max_len)
+ tmp[max_len] = '\0';
+
+ free(PREV_ROW);
+ PREV_ROW = tmp;
+ for (y = thisrow; y < listsize; ++y) {
+ (*list)[y] = (*list)[y + 1];
+ }
+ --listsize;
+ --thisrow;
+ SCROLL_TO(thisrow);
+
+ show_all = TRUE;
+ }
+ } else {
+ /* dlg_edit_string() can handle this case */
+ moved = FALSE;
+ }
+ break;
+ default:
+ moved = FALSE;
+ break;
+ }
+ if (moved) {
+ if (thisrow != lastrow) {
+ if (goal_col < 0)
+ goal_col = col_offset;
+ chr_offset = col_to_chr_offset(THIS_ROW, goal_col);
+ } else {
+ UPDATE_COL(THIS_ROW);
+ }
+ continue;
+ }
+ }
+ strcpy(buffer, input);
+ edit = dlg_edit_string(buffer, &chr_offset, key, fkey, FALSE);
+
+ if (edit) {
+ goal_col = UPDATE_COL(input);
+ if (strcmp(input, buffer)) {
+ free(input);
+ THIS_ROW = dlg_strclone(buffer);
+ input = THIS_ROW;
+ }
+ display_one(editing, input, thisrow,
+ thisrow, base_row, chr_offset);
+ continue;
+ }
+ }
+
+ /* handle non-functionkeys */
+ if (!fkey && (code = dlg_char_to_button(key, buttons)) >= 0) {
+ dlg_del_window(dialog);
+ result = dlg_ok_buttoncode(code);
+ continue;
+ }
+
+ /* handle functionkeys */
+ if (fkey) {
+ switch (key) {
+ case DLGK_FIELD_PREV:
+ show_buttons = TRUE;
+ state = dlg_prev_ok_buttonindex(state, sTEXT);
+ break;
+ case DLGK_FIELD_NEXT:
+ show_buttons = TRUE;
+ state = dlg_next_ok_buttonindex(state, sTEXT);
+ break;
+ case DLGK_ENTER:
+ if (state == sTEXT) {
+ const int *indx = dlg_index_wchars(THIS_ROW);
+ int split = indx[chr_offset];
+ char *tmp = dlg_strclone(THIS_ROW + split);
+
+ assert_ptr(tmp, "dlg_editbox");
+ grow_list(list, rows, listsize + 1);
+ ++listsize;
+ for (y = listsize; y > thisrow; --y) {
+ (*list)[y] = (*list)[y - 1];
+ }
+ THIS_ROW[split] = '\0';
+ ++thisrow;
+ chr_offset = 0;
+ col_offset = 0;
+ THIS_ROW = tmp;
+ SCROLL_TO(thisrow);
+ show_all = TRUE;
+ } else {
+ result = dlg_ok_buttoncode(state);
+ }
+ break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ /* reset data */
+ height = old_height;
+ width = old_width;
+ /* repaint */
+ dlg_clear();
+ dlg_del_window(editing);
+ dlg_del_window(dialog);
+ refresh();
+ dlg_mouse_free_regions();
+ goto retry;
+#endif
+ default:
+ beep();
+ break;
+ }
+ } else {
+ if ((key == ' ') && (state != sTEXT)) {
+ result = dlg_ok_buttoncode(state);
+ } else {
+ beep();
+ }
+ }
+ }
+
+ dlg_unregister_window(editing);
+ dlg_del_window(editing);
+ dlg_del_window(dialog);
+ dlg_mouse_free_regions();
+
+ /*
+ * The caller's copy of the (*list)[] array has been updated, but for
+ * consistency with the other widgets, we put the "real" result in
+ * the output buffer.
+ */
+ if (result == DLG_EXIT_OK) {
+ int n;
+ for (n = 0; n < listsize; ++n) {
+ dlg_add_result((*list)[n]);
+ dlg_add_separator();
+ }
+ }
+ free(buffer);
+ dlg_restore_vars(&save_vars);
+ return result;
+}
+
+int
+dialog_editbox(const char *title, const char *file, int height, int width)
+{
+ int result;
+ char **list;
+ int rows;
+
+ load_list(file, &list, &rows);
+ result = dlg_editbox(title, &list, &rows, height, width);
+ free_list(&list, &rows);
+ return result;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/formbox.c b/Build/source/utils/dialog/dialog-1.1-20080819/formbox.c
new file mode 100644
index 00000000000..e3fa3a97da4
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/formbox.c
@@ -0,0 +1,886 @@
+/*
+ * $Id: formbox.c,v 1.66 2008/06/21 12:12:05 tom Exp $
+ *
+ * formbox.c -- implements the form (i.e, some pairs label/editbox)
+ *
+ * Copyright 2003-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * This is adapted from source contributed by
+ * Valery Reznic (valery_reznic@users.sourceforge.net)
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#define LLEN(n) ((n) * FORMBOX_TAGS)
+
+#define ItemName(i) items[LLEN(i) + 0]
+#define ItemNameY(i) items[LLEN(i) + 1]
+#define ItemNameX(i) items[LLEN(i) + 2]
+#define ItemText(i) items[LLEN(i) + 3]
+#define ItemTextY(i) items[LLEN(i) + 4]
+#define ItemTextX(i) items[LLEN(i) + 5]
+#define ItemTextFLen(i) items[LLEN(i) + 6]
+#define ItemTextILen(i) items[LLEN(i) + 7]
+#define ItemHelp(i) (dialog_vars.item_help ? items[LLEN(i) + 8] : dlg_strempty())
+
+static bool
+is_readonly(DIALOG_FORMITEM * item)
+{
+ return ((item->type & 2) != 0) || (item->text_flen <= 0);
+}
+
+static bool
+is_hidden(DIALOG_FORMITEM * item)
+{
+ return ((item->type & 1) != 0);
+}
+
+static bool
+in_window(WINDOW *win, int scrollamt, int y)
+{
+ return (y >= scrollamt && y - scrollamt < getmaxy(win));
+}
+
+static bool
+ok_move(WINDOW *win, int scrollamt, int y, int x)
+{
+ return in_window(win, scrollamt, y)
+ && (wmove(win, y - scrollamt, x) != ERR);
+}
+
+static void
+move_past(WINDOW *win, int y, int x)
+{
+ if (wmove(win, y, x) == ERR)
+ wmove(win, y, getmaxx(win) - 1);
+}
+
+/*
+ * Print form item
+ */
+static int
+print_item(WINDOW *win, DIALOG_FORMITEM * item, int scrollamt, bool choice)
+{
+ int count = 0;
+ int len;
+
+ if (ok_move(win, scrollamt, item->name_y, item->name_x)) {
+ len = item->name_len;
+ len = MIN(len, getmaxx(win) - item->name_x);
+ if (len > 0) {
+ dlg_show_string(win,
+ item->name,
+ 0,
+ menubox_attr,
+ item->name_y - scrollamt,
+ item->name_x,
+ len,
+ FALSE,
+ FALSE);
+ move_past(win, item->name_y - scrollamt, item->name_x + len);
+ count = 1;
+ }
+ }
+ if (item->text_len && ok_move(win, scrollamt, item->text_y, item->text_x)) {
+ chtype this_item_attribute;
+
+ len = item->text_len;
+ len = MIN(len, getmaxx(win) - item->text_x);
+
+ if (!is_readonly(item)) {
+ this_item_attribute = choice
+ ? form_active_text_attr
+ : form_text_attr;
+ } else {
+ this_item_attribute = form_item_readonly_attr;
+ }
+
+ if (len > 0) {
+ dlg_show_string(win,
+ item->text,
+ 0,
+ this_item_attribute,
+ item->text_y - scrollamt,
+ item->text_x,
+ len,
+ is_hidden(item),
+ FALSE);
+ move_past(win, item->text_y - scrollamt, item->text_x + len);
+ count = 1;
+ }
+ }
+ return count;
+}
+
+/*
+ * Print the entire form.
+ */
+static void
+print_form(WINDOW *win, DIALOG_FORMITEM * item, int total, int scrollamt, int choice)
+{
+ int n;
+ int count = 0;
+
+ for (n = 0; n < total; ++n) {
+ count += print_item(win, item + n, scrollamt, n == choice);
+ }
+ if (count) {
+ wbkgdset(win, menubox_attr | ' ');
+ wclrtobot(win);
+ (void) wnoutrefresh(win);
+ }
+}
+
+static int
+set_choice(DIALOG_FORMITEM item[], int choice, int item_no, bool * noneditable)
+{
+ int result = -1;
+ int i;
+
+ *noneditable = FALSE;
+ if (!is_readonly(&item[choice])) {
+ result = choice;
+ } else {
+ for (i = 0; i < item_no; i++) {
+ if (!is_readonly(&(item[i]))) {
+ result = i;
+ break;
+ }
+ }
+ if (result < 0) {
+ *noneditable = TRUE;
+ result = 0;
+ }
+ }
+ return result;
+}
+
+/*
+ * Find the last y-value in the form.
+ */
+static int
+form_limit(DIALOG_FORMITEM item[])
+{
+ int n;
+ int limit = 0;
+ for (n = 0; item[n].name != 0; ++n) {
+ if (limit < item[n].name_y)
+ limit = item[n].name_y;
+ if (limit < item[n].text_y)
+ limit = item[n].text_y;
+ }
+ return limit;
+}
+
+/*
+ * Tab to the next field.
+ */
+static bool
+tab_next(WINDOW *win,
+ DIALOG_FORMITEM item[],
+ int item_no,
+ int stepsize,
+ int *choice,
+ int *scrollamt)
+{
+ int old_choice = *choice;
+ int old_scroll = *scrollamt;
+ bool wrapped = FALSE;
+
+ do {
+ do {
+ *choice += stepsize;
+ if (*choice < 0) {
+ *choice = item_no - 1;
+ wrapped = TRUE;
+ } else if (*choice >= item_no) {
+ *choice = 0;
+ wrapped = TRUE;
+ }
+ } while ((*choice != old_choice) && is_readonly(&(item[*choice])));
+
+ if (item[*choice].text_flen > 0) {
+ int lo = MIN(item[*choice].name_y, item[*choice].text_y);
+ int hi = MAX(item[*choice].name_y, item[*choice].text_y);
+
+ if (old_choice == *choice)
+ break;
+ print_item(win, item + old_choice, *scrollamt, FALSE);
+
+ if (*scrollamt < lo + 1 - getmaxy(win))
+ *scrollamt = lo + 1 - getmaxy(win);
+ if (*scrollamt > hi)
+ *scrollamt = hi;
+ /*
+ * If we have to scroll to show a wrap-around, it does get
+ * confusing. Just give up rather than scroll. Tab'ing to the
+ * next field in a multi-column form is a different matter. Scroll
+ * for that.
+ */
+ if (*scrollamt != old_scroll) {
+ if (wrapped) {
+ beep();
+ *scrollamt = old_scroll;
+ *choice = old_choice;
+ } else {
+ scrollok(win, TRUE);
+ wscrl(win, *scrollamt - old_scroll);
+ scrollok(win, FALSE);
+ }
+ }
+ break;
+ }
+ } while (*choice != old_choice);
+
+ return (old_choice != *choice) || (old_scroll != *scrollamt);
+}
+
+/*
+ * Scroll to the next page, putting the choice at the first editable field
+ * in that page. Note that fields are not necessarily in top-to-bottom order,
+ * nor is there necessarily a field on each row of the window.
+ */
+static bool
+scroll_next(WINDOW *win, DIALOG_FORMITEM item[], int stepsize, int *choice, int *scrollamt)
+{
+ int old_choice = *choice;
+ int old_scroll = *scrollamt;
+ int old_row = MIN(item[old_choice].text_y, item[old_choice].name_y);
+ int target = old_scroll + stepsize;
+ int n;
+
+ if (stepsize < 0) {
+ if (old_row != old_scroll)
+ target = old_scroll;
+ else
+ target = old_scroll + stepsize;
+ if (target < 0)
+ target = 0;
+ } else {
+ int limit = form_limit(item);
+ if (target > limit)
+ target = limit;
+ }
+
+ for (n = 0; item[n].name != 0; ++n) {
+ if (item[n].text_flen > 0) {
+ int new_row = MIN(item[n].text_y, item[n].name_y);
+ if (abs(new_row - target) < abs(old_row - target)) {
+ old_row = new_row;
+ *choice = n;
+ }
+ }
+ }
+
+ if (old_choice != *choice)
+ print_item(win, item + old_choice, *scrollamt, FALSE);
+
+ *scrollamt = *choice;
+ if (*scrollamt != old_scroll) {
+ scrollok(win, TRUE);
+ wscrl(win, *scrollamt - old_scroll);
+ scrollok(win, FALSE);
+ }
+ return (old_choice != *choice) || (old_scroll != *scrollamt);
+}
+
+/*
+ * Do a sanity check on the field length, and return the "right" value.
+ */
+static int
+real_length(DIALOG_FORMITEM * item)
+{
+ return (item->text_flen > 0
+ ? item->text_flen
+ : (item->text_flen < 0
+ ? -item->text_flen
+ : item->text_len));
+}
+
+/*
+ * Compute the form size, setup field buffers.
+ */
+static void
+make_FORM_ELTs(DIALOG_FORMITEM * item,
+ int item_no,
+ int *min_height,
+ int *min_width)
+{
+ int i;
+ int min_w = 0;
+ int min_h = 0;
+
+ for (i = 0; i < item_no; ++i) {
+ int real_len = real_length(item + i);
+
+ /*
+ * Special value '0' for text_flen: no input allowed
+ * Special value '0' for text_ilen: 'be the same as text_flen'
+ */
+ if (item[i].text_ilen == 0)
+ item[i].text_ilen = real_len;
+
+ min_h = MAX(min_h, item[i].name_y + 1);
+ min_h = MAX(min_h, item[i].text_y + 1);
+ min_w = MAX(min_w, item[i].name_x + 1 + item[i].name_len);
+ min_w = MAX(min_w, item[i].text_x + 1 + real_len);
+
+ item[i].text_len = real_length(item + i);
+
+ /*
+ * We do not know the actual length of .text, so we allocate it here
+ * to ensure it is big enough.
+ */
+ if (item[i].text_flen > 0) {
+ int max_len = dlg_max_input(MAX(item[i].text_ilen + 1, MAX_LEN));
+ char *old_text = item[i].text;
+
+ item[i].text = dlg_malloc(char, max_len + 1);
+ assert_ptr(item[i].text, "make_FORM_ELTs");
+
+ sprintf(item[i].text, "%.*s", item[i].text_ilen, old_text);
+
+ if (item[i].text_free) {
+ item[i].text_free = FALSE;
+ free(old_text);
+ }
+ item[i].text_free = TRUE;
+ }
+ }
+
+ *min_height = min_h;
+ *min_width = min_w;
+}
+
+int
+dlg_default_formitem(DIALOG_FORMITEM * items)
+{
+ int result = 0;
+
+ if (dialog_vars.default_item != 0) {
+ int count = 0;
+ while (items->name != 0) {
+ if (!strcmp(dialog_vars.default_item, items->name)) {
+ result = count;
+ break;
+ }
+ ++items;
+ count++;
+ }
+ }
+ return result;
+}
+
+#define sTEXT -1
+
+static int
+next_valid_buttonindex(int state, int extra, bool non_editable)
+{
+ state = dlg_next_ok_buttonindex(state, extra);
+ while (non_editable && state == sTEXT)
+ state = dlg_next_ok_buttonindex(state, sTEXT);
+ return state;
+}
+
+static int
+prev_valid_buttonindex(int state, int extra, bool non_editable)
+{
+ state = dlg_prev_ok_buttonindex(state, extra);
+ while (non_editable && state == sTEXT)
+ state = dlg_prev_ok_buttonindex(state, sTEXT);
+ return state;
+}
+
+/*
+ * Display a form for fulfill a number of fields
+ */
+int
+dlg_form(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int form_height,
+ int item_no,
+ DIALOG_FORMITEM * items,
+ int *current_item)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ INPUTSTR_BINDINGS,
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, CHR_NEXT ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_NEXT ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, CHR_PREVIOUS ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_PREVIOUS ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+
+ int form_width;
+ int first = TRUE;
+ int chr_offset = 0;
+ int state = dialog_vars.defaultno ? dlg_defaultno_button() : sTEXT;
+ int x, y, cur_x, cur_y, box_x, box_y;
+ int code;
+ int key = 0;
+ int fkey;
+ int choice = dlg_default_formitem(items);
+ int new_choice, new_scroll;
+ int scrollamt = 0;
+ int result = DLG_EXIT_UNKNOWN;
+ int min_width = 0, min_height = 0;
+ bool was_autosize = (height == 0 || width == 0);
+ bool show_buttons = FALSE;
+ bool scroll_changed = FALSE;
+ bool field_changed = FALSE;
+ bool non_editable = FALSE;
+ WINDOW *dialog, *form;
+ char *prompt = dlg_strclone(cprompt);
+ const char **buttons = dlg_ok_labels();
+ DIALOG_FORMITEM *current;
+
+ make_FORM_ELTs(items, item_no, &min_height, &min_width);
+ dlg_does_output();
+ dlg_tab_correct_str(prompt);
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+
+ dlg_auto_size(title, prompt, &height, &width,
+ 1 + 3 * MARGIN,
+ MAX(26, 2 + min_width));
+
+ if (form_height == 0)
+ form_height = min_height;
+
+ if (was_autosize) {
+ form_height = MIN(SLINES - height, form_height);
+ height += form_height;
+ } else {
+ int thigh = 0;
+ int twide = 0;
+ dlg_auto_size(title, prompt, &thigh, &twide, 0, width);
+ thigh = SLINES - (height - (thigh + 1 + 3 * MARGIN));
+ form_height = MIN(thigh, form_height);
+ }
+
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+ dialog = dlg_new_window(height, width, y, x);
+ dlg_register_window(dialog, "formbox", binding);
+ dlg_register_buttons(dialog, "formbox", buttons);
+
+ dlg_mouse_setbase(x, y);
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+ dlg_print_autowrap(dialog, prompt, height, width);
+
+ form_width = width - 6;
+ getyx(dialog, cur_y, cur_x);
+ box_y = cur_y + 1;
+ box_x = (width - form_width) / 2 - 1;
+
+ /* create new window for the form */
+ form = dlg_sub_window(dialog, form_height, form_width, y + box_y + 1,
+ x + box_x + 1);
+
+ /* draw a box around the form items */
+ dlg_draw_box(dialog, box_y, box_x, form_height + 2, form_width + 2,
+ menubox_border_attr, menubox_attr);
+
+ /* register the new window, along with its borders */
+ dlg_mouse_mkbigregion(getbegy(form) - getbegy(dialog),
+ getbegx(form) - getbegx(dialog),
+ getmaxy(form),
+ getmaxx(form),
+ KEY_MAX, 1, 1, 3 /* by cells */ );
+
+ show_buttons = TRUE;
+ scroll_changed = TRUE;
+
+ choice = set_choice(items, choice, item_no, &non_editable);
+ current = &items[choice];
+ if (non_editable)
+ state = next_valid_buttonindex(state, sTEXT, non_editable);
+
+ while (result == DLG_EXIT_UNKNOWN) {
+ int edit = FALSE;
+
+ if (scroll_changed) {
+ print_form(form, items, item_no, scrollamt, choice);
+ dlg_draw_arrows(dialog, scrollamt,
+ scrollamt + form_height < item_no,
+ box_x + 1,
+ box_y,
+ box_y + form_height + 1);
+ scroll_changed = FALSE;
+ }
+
+ if (show_buttons) {
+ dlg_item_help("");
+ dlg_draw_buttons(dialog, height - 2, 0, buttons,
+ ((state < 0)
+ ? 1000 /* no such button, not highlighted */
+ : state),
+ FALSE, width);
+ show_buttons = FALSE;
+ }
+
+ if (field_changed || state == sTEXT) {
+ if (field_changed)
+ chr_offset = 0;
+ current = &items[choice];
+ dialog_vars.max_input = current->text_ilen;
+ dlg_item_help(current->help);
+ dlg_show_string(form, current->text, chr_offset,
+ form_active_text_attr,
+ current->text_y - scrollamt,
+ current->text_x,
+ current->text_len,
+ is_hidden(current), first);
+ field_changed = FALSE;
+ }
+
+ key = dlg_mouse_wgetch(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+
+ /* handle non-functionkeys */
+ if (!fkey) {
+ if (state != sTEXT) {
+ code = dlg_char_to_button(key, buttons);
+ if (code >= 0) {
+ dlg_del_window(dialog);
+ result = dlg_ok_buttoncode(code);
+ continue;
+ }
+ if (key == ' ') {
+ fkey = TRUE;
+ key = DLGK_ENTER;
+ }
+ }
+ }
+
+ /* handle functionkeys */
+ if (fkey) {
+ bool do_scroll = FALSE;
+ bool do_tab = FALSE;
+ int move_by = 0;
+
+ switch (key) {
+ case DLGK_MOUSE(KEY_PPAGE):
+ case DLGK_PAGE_PREV:
+ do_scroll = TRUE;
+ move_by = -form_height;
+ break;
+
+ case DLGK_MOUSE(KEY_NPAGE):
+ case DLGK_PAGE_NEXT:
+ do_scroll = TRUE;
+ move_by = form_height;
+ break;
+
+ case DLGK_ENTER:
+ dlg_del_window(dialog);
+ result = (state >= 0) ? dlg_ok_buttoncode(state) : DLG_EXIT_OK;
+ continue;
+
+ case DLGK_GRID_LEFT:
+ if (state == sTEXT)
+ break;
+ /* FALLTHRU */
+ case DLGK_ITEM_PREV:
+ if (state == sTEXT) {
+ do_tab = TRUE;
+ move_by = -1;
+ break;
+ } else {
+ state = prev_valid_buttonindex(state, 0, non_editable);
+ show_buttons = TRUE;
+ continue;
+ }
+
+ case DLGK_FIELD_PREV:
+ state = prev_valid_buttonindex(state, sTEXT, non_editable);
+ show_buttons = TRUE;
+ continue;
+
+ case DLGK_FIELD_NEXT:
+ state = next_valid_buttonindex(state, sTEXT, non_editable);
+ show_buttons = TRUE;
+ continue;
+
+ case DLGK_GRID_RIGHT:
+ if (state == sTEXT)
+ break;
+ /* FALLTHRU */
+
+ case DLGK_ITEM_NEXT:
+ if (state == sTEXT) {
+ do_tab = TRUE;
+ move_by = 1;
+ break;
+ } else {
+ state = next_valid_buttonindex(state, 0, non_editable);
+ show_buttons = TRUE;
+ continue;
+ }
+
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ /* reset data */
+ height = old_height;
+ width = old_width;
+ /* repaint */
+ dlg_clear();
+ dlg_del_window(dialog);
+ refresh();
+ dlg_mouse_free_regions();
+ goto retry;
+#endif
+ default:
+#if USE_MOUSE
+ if (is_DLGK_MOUSE(key)) {
+ if (key >= DLGK_MOUSE(KEY_MAX)) {
+ int cell = key - DLGK_MOUSE(KEY_MAX);
+ int row = (cell / getmaxx(form)) + scrollamt;
+ int col = (cell % getmaxx(form));
+ int n;
+
+ for (n = 0; n < item_no; ++n) {
+ if (items[n].name_y == row
+ && items[n].name_x <= col
+ && (items[n].name_x + items[n].name_len > col
+ || (items[n].name_y == items[n].text_y
+ && items[n].text_x > col))) {
+ if (!is_readonly(&(items[n]))) {
+ field_changed = TRUE;
+ break;
+ }
+ }
+ if (items[n].text_y == row
+ && items[n].text_x <= col
+ && items[n].text_x + items[n].text_ilen > col) {
+ if (!is_readonly(&(items[n]))) {
+ field_changed = TRUE;
+ break;
+ }
+ }
+ }
+ if (field_changed) {
+ print_item(form, items + choice, scrollamt, FALSE);
+ choice = n;
+ continue;
+ }
+ beep();
+ } else if ((code = dlg_ok_buttoncode(key - M_EVENT)) >= 0) {
+ result = code;
+ }
+ continue;
+ }
+#endif
+ break;
+ }
+
+ new_scroll = scrollamt;
+ new_choice = choice;
+ if (do_scroll) {
+ if (scroll_next(form, items, move_by, &new_choice, &new_scroll)) {
+ if (choice != new_choice) {
+ choice = new_choice;
+ field_changed = TRUE;
+ }
+ if (scrollamt != new_scroll) {
+ scrollamt = new_scroll;
+ scroll_changed = TRUE;
+ }
+ }
+ continue;
+ }
+ if (do_tab) {
+ if (tab_next(form, items, item_no, move_by, &new_choice, &new_scroll)) {
+ if (choice != new_choice) {
+ choice = new_choice;
+ field_changed = TRUE;
+ }
+ if (scrollamt != new_scroll) {
+ scrollamt = new_scroll;
+ scroll_changed = TRUE;
+ }
+ }
+ continue;
+ }
+ }
+
+ if (state == sTEXT) { /* Input box selected */
+ if (!is_readonly(current))
+ edit = dlg_edit_string(current->text, &chr_offset, key,
+ fkey, first);
+ if (edit) {
+ dlg_show_string(form, current->text, chr_offset,
+ form_active_text_attr,
+ current->text_y - scrollamt,
+ current->text_x,
+ current->text_len,
+ is_hidden(current), first);
+ continue;
+ }
+ }
+
+ }
+
+ dlg_mouse_free_regions();
+ dlg_del_window(dialog);
+ free(prompt);
+
+ *current_item = choice;
+ return result;
+}
+
+/*
+ * Free memory owned by a list of DIALOG_FORMITEM's.
+ */
+void
+dlg_free_formitems(DIALOG_FORMITEM * items)
+{
+ int n;
+ for (n = 0; items[n].name != 0; ++n) {
+ if (items[n].name_free)
+ free(items[n].name);
+ if (items[n].text_free)
+ free(items[n].text);
+ if (items[n].help_free && items[n].help != dlg_strempty())
+ free(items[n].help);
+ }
+ free(items);
+}
+
+/*
+ * The script accepts values beginning at 1, while curses starts at 0.
+ */
+int
+dlg_ordinate(const char *s)
+{
+ int result = atoi(s);
+ if (result > 0)
+ --result;
+ else
+ result = 0;
+ return result;
+}
+
+int
+dialog_form(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int form_height,
+ int item_no,
+ char **items)
+{
+ int result;
+ int choice;
+ int i;
+ DIALOG_FORMITEM *listitems;
+ DIALOG_VARS save_vars;
+ bool show_status = FALSE;
+
+ dlg_save_vars(&save_vars);
+ dialog_vars.separate_output = TRUE;
+
+ listitems = dlg_calloc(DIALOG_FORMITEM, item_no + 1);
+ assert_ptr(listitems, "dialog_form");
+
+ for (i = 0; i < item_no; ++i) {
+ listitems[i].type = dialog_vars.formitem_type;
+ listitems[i].name = ItemName(i);
+ listitems[i].name_len = strlen(ItemName(i));
+ listitems[i].name_y = dlg_ordinate(ItemNameY(i));
+ listitems[i].name_x = dlg_ordinate(ItemNameX(i));
+ listitems[i].text = ItemText(i);
+ listitems[i].text_len = strlen(ItemText(i));
+ listitems[i].text_y = dlg_ordinate(ItemTextY(i));
+ listitems[i].text_x = dlg_ordinate(ItemTextX(i));
+ listitems[i].text_flen = atoi(ItemTextFLen(i));
+ listitems[i].text_ilen = atoi(ItemTextILen(i));
+ listitems[i].help = (dialog_vars.item_help) ? ItemHelp(i) :
+ dlg_strempty();
+ }
+
+ result = dlg_form(title,
+ cprompt,
+ height,
+ width,
+ form_height,
+ item_no,
+ listitems,
+ &choice);
+
+ switch (result) {
+ case DLG_EXIT_OK: /* FALLTHRU */
+ case DLG_EXIT_EXTRA:
+ show_status = TRUE;
+ break;
+ case DLG_EXIT_HELP:
+ dlg_add_result("HELP ");
+ show_status = dialog_vars.help_status;
+ if (USE_ITEM_HELP(listitems[choice].help)) {
+ dlg_add_string(listitems[choice].help);
+ result = DLG_EXIT_ITEM_HELP;
+ } else {
+ dlg_add_string(listitems[choice].name);
+ }
+ if (show_status)
+ dlg_add_separator();
+ break;
+ }
+ if (show_status) {
+ for (i = 0; i < item_no; i++) {
+ if (listitems[i].text_flen > 0) {
+ dlg_add_string(listitems[i].text);
+ dlg_add_separator();
+ }
+ }
+ }
+
+ dlg_free_formitems(listitems);
+ dlg_restore_vars(&save_vars);
+
+ return result;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/fselect.c b/Build/source/utils/dialog/dialog-1.1-20080819/fselect.c
new file mode 100644
index 00000000000..bfc6dcf2385
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/fselect.c
@@ -0,0 +1,856 @@
+/*
+ * $Id: fselect.c,v 1.70 2008/03/16 13:04:57 tom Exp $
+ *
+ * fselect.c -- implements the file-selector box
+ *
+ * Copyright 2000-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
+
+# if defined(_FILE_OFFSET_BITS) && defined(HAVE_STRUCT_DIRENT64)
+# if !defined(_LP64) && (_FILE_OFFSET_BITS == 64)
+# define DIRENT struct dirent64
+# else
+# define DIRENT struct dirent
+# endif
+# else
+# define DIRENT struct dirent
+# endif
+
+#define EXT_WIDE 1
+#define HDR_HIGH 1
+#define BTN_HIGH (1 + 2 * MARGIN) /* Ok/Cancel, also input-box */
+#define MIN_HIGH (HDR_HIGH - MARGIN + (BTN_HIGH * 2) + 4 * MARGIN)
+#define MIN_WIDE (2 * MAX(dlg_count_columns(d_label), dlg_count_columns(f_label)) + 6 * MARGIN + 2 * EXT_WIDE)
+
+#define MOUSE_D (KEY_MAX + 0)
+#define MOUSE_F (KEY_MAX + 10000)
+#define MOUSE_T (KEY_MAX + 20000)
+
+typedef enum {
+ sDIRS = -3
+ ,sFILES = -2
+ ,sTEXT = -1
+} STATES;
+
+typedef struct {
+ WINDOW *par; /* parent window */
+ WINDOW *win; /* this window */
+ int length; /* length of the data[] array */
+ int offset; /* index of first item on screen */
+ int choice; /* index of the selection */
+ int mousex; /* base of mouse-code return-values */
+ unsigned allocd;
+ char **data;
+} LIST;
+
+typedef struct {
+ int length;
+ char **data;
+} MATCH;
+
+static void
+init_list(LIST * list, WINDOW *par, WINDOW *win, int mousex)
+{
+ list->par = par;
+ list->win = win;
+ list->length = 0;
+ list->offset = 0;
+ list->choice = 0;
+ list->mousex = mousex;
+ list->allocd = 0;
+ list->data = 0;
+ dlg_mouse_mkbigregion(getbegy(win), getbegx(win),
+ getmaxy(win), getmaxx(win),
+ mousex, 1, 1, 1 /* by lines */ );
+}
+
+static char *
+leaf_of(char *path)
+{
+ char *leaf = strrchr(path, '/');
+ if (leaf != 0)
+ leaf++;
+ else
+ leaf = path;
+ return leaf;
+}
+
+static char *
+data_of(LIST * list)
+{
+ if (list != 0
+ && list->data != 0)
+ return list->data[list->choice];
+ return 0;
+}
+
+static void
+free_list(LIST * list, int reinit)
+{
+ int n;
+
+ if (list->data != 0) {
+ for (n = 0; list->data[n] != 0; n++)
+ free(list->data[n]);
+ free(list->data);
+ list->data = 0;
+ }
+ if (reinit)
+ init_list(list, list->par, list->win, list->mousex);
+}
+
+static void
+add_to_list(LIST * list, char *text)
+{
+ unsigned need;
+
+ need = list->length + 1;
+ if (need + 1 > list->allocd) {
+ list->allocd = 2 * (need + 1);
+ if (list->data == 0) {
+ list->data = dlg_malloc(char *, list->allocd);
+ } else {
+ list->data = dlg_realloc(char *, list->allocd, list->data);
+ }
+ assert_ptr(list->data, "add_to_list");
+ }
+ list->data[list->length++] = dlg_strclone(text);
+ list->data[list->length] = 0;
+}
+
+static void
+keep_visible(LIST * list)
+{
+ int high = getmaxy(list->win);
+
+ if (list->choice < list->offset) {
+ list->offset = list->choice;
+ }
+ if (list->choice - list->offset >= high)
+ list->offset = list->choice - high + 1;
+}
+
+#define Value(c) (int)((c) & 0xff)
+
+static int
+find_choice(char *target, LIST * list)
+{
+ int n;
+ int choice = list->choice;
+ int len_1, len_2, cmp_1, cmp_2;
+
+ if (*target == 0) {
+ list->choice = 0;
+ } else {
+ /* find the match with the longest length. If more than one has the
+ * same length, choose the one with the closest match of the final
+ * character.
+ */
+ len_1 = 0;
+ cmp_1 = 256;
+ for (n = 0; n < list->length; n++) {
+ char *a = target;
+ char *b = list->data[n];
+
+ len_2 = 0;
+ while ((*a != 0) && (*b != 0) && (*a == *b)) {
+ a++;
+ b++;
+ len_2++;
+ }
+ cmp_2 = Value(*a) - Value(*b);
+ if (cmp_2 < 0)
+ cmp_2 = -cmp_2;
+ if ((len_2 > len_1)
+ || (len_1 == len_2 && cmp_2 < cmp_1)) {
+ len_1 = len_2;
+ cmp_1 = cmp_2;
+ list->choice = n;
+ }
+ }
+ }
+ if (choice != list->choice) {
+ keep_visible(list);
+ }
+ return (choice != list->choice);
+}
+
+static void
+display_list(LIST * list)
+{
+ int n;
+ int x;
+ int y;
+ int top;
+ int bottom;
+
+ if (list->win != 0) {
+ dlg_attr_clear(list->win, getmaxy(list->win), getmaxx(list->win), item_attr);
+ for (n = list->offset; n < list->length && list->data[n]; n++) {
+ y = n - list->offset;
+ if (y >= getmaxy(list->win))
+ break;
+ (void) wmove(list->win, y, 0);
+ if (n == list->choice)
+ wattrset(list->win, item_selected_attr);
+ (void) waddstr(list->win, list->data[n]);
+ wattrset(list->win, item_attr);
+ }
+ wattrset(list->win, item_attr);
+
+ getparyx(list->win, y, x);
+
+ top = y - 1;
+ bottom = y + getmaxy(list->win);
+ dlg_draw_arrows(list->par, list->offset,
+ list->length - list->offset > getmaxy(list->win),
+ x + 1,
+ top,
+ bottom);
+
+ (void) wmove(list->win, list->choice - list->offset, 0);
+ (void) wnoutrefresh(list->win);
+ }
+}
+
+/* FIXME: see arrows.c
+ * This workaround is used to allow two lists to have scroll-tabs at the same
+ * time, by reassigning their return-values to be different. Just for
+ * readability, we use the names of keys with similar connotations, though all
+ * that is really required is that they're distinct, so we can put them in a
+ * switch statement.
+ */
+static void
+fix_arrows(LIST * list)
+{
+ int x;
+ int y;
+ int top;
+ int bottom;
+
+ if (list->win != 0) {
+ getparyx(list->win, y, x);
+ top = y - 1;
+ bottom = y + getmaxy(list->win);
+
+ mouse_mkbutton(top, x, 6,
+ ((list->mousex == MOUSE_D)
+ ? KEY_PREVIOUS
+ : KEY_PPAGE));
+ mouse_mkbutton(bottom, x, 6,
+ ((list->mousex == MOUSE_D)
+ ? KEY_NEXT
+ : KEY_NPAGE));
+ }
+}
+
+static int
+show_list(char *target, LIST * list, bool keep)
+{
+ int changed = keep || find_choice(target, list);
+ display_list(list);
+ return changed;
+}
+
+/*
+ * Highlight the closest match to 'target' in the given list, setting offset
+ * to match.
+ */
+static int
+show_both_lists(char *input, LIST * d_list, LIST * f_list, bool keep)
+{
+ char *leaf = leaf_of(input);
+
+ return show_list(leaf, d_list, keep) | show_list(leaf, f_list, keep);
+}
+
+/*
+ * Move up/down in the given list
+ */
+static bool
+change_list(int choice, LIST * list)
+{
+ if (data_of(list) != 0) {
+ int last = list->length - 1;
+
+ choice += list->choice;
+ if (choice < 0)
+ choice = 0;
+ if (choice > last)
+ choice = last;
+ list->choice = choice;
+ keep_visible(list);
+ display_list(list);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static void
+scroll_list(int direction, LIST * list)
+{
+ if (data_of(list) != 0) {
+ int length = getmaxy(list->win);
+ if (change_list(direction * length, list))
+ return;
+ }
+ beep();
+}
+
+static int
+compar(const void *a, const void *b)
+{
+ return strcmp(*(const char *const *) a, *(const char *const *) b);
+}
+
+static int
+match(char *name, LIST * d_list, LIST * f_list, MATCH * match_list)
+{
+ char *test = leaf_of(name);
+ int test_len = strlen(test);
+ char **matches = dlg_malloc(char *, (d_list->length + f_list->length));
+ int data_len = 0;
+ int i;
+ for (i = 2; i < d_list->length; i++) {
+ if (strncmp(test, d_list->data[i], test_len) == 0) {
+ matches[data_len++] = d_list->data[i];
+ }
+ }
+ for (i = 0; i < f_list->length; i++) {
+ if (strncmp(test, f_list->data[i], test_len) == 0) {
+ matches[data_len++] = f_list->data[i];
+ }
+ }
+ matches = dlg_realloc(char *, data_len, matches);
+ match_list->data = matches;
+ match_list->length = data_len;
+ return data_len;
+}
+
+static void
+free_match(MATCH * match_list)
+{
+ free(match_list->data);
+ match_list->length = 0;
+}
+
+static int
+complete(char *name, LIST * d_list, LIST * f_list, char **buff_ptr)
+{
+ MATCH match_list;
+ char *test;
+ int test_len;
+ int i, j;
+ char *buff;
+ match(name, d_list, f_list, &match_list);
+ if (match_list.length == 0) {
+ *buff_ptr = NULL;
+ return 0;
+ }
+ test = match_list.data[0];
+ test_len = strlen(test);
+ buff = dlg_malloc(char, test_len + 2);
+ if (match_list.length == 1) {
+ strcpy(buff, test);
+ i = test_len;
+ if (test == data_of(d_list)) {
+ buff[test_len] = '/';
+ i++;
+ }
+ } else {
+ for (i = 0; i < test_len; i++) {
+ char test_char = test[i];
+ if (test_char == '\0')
+ break;
+ for (j = 0; j < match_list.length; j++) {
+ if (match_list.data[j][i] != test_char) {
+ break;
+ }
+ }
+ if (j == match_list.length) {
+ (buff)[i] = test_char;
+ } else
+ break;
+ }
+ buff = dlg_realloc(char, i + 1, buff);
+ }
+ free_match(&match_list);
+ buff[i] = '\0';
+ *buff_ptr = buff;
+ return i;
+}
+
+static bool
+fill_lists(char *current, char *input, LIST * d_list, LIST * f_list, bool keep)
+{
+ DIR *dp;
+ DIRENT *de;
+ struct stat sb;
+ int n;
+ char path[MAX_LEN + 1];
+ char *leaf;
+
+ /* check if we've updated the lists */
+ for (n = 0; current[n] && input[n]; n++) {
+ if (current[n] != input[n])
+ break;
+ }
+ if (current[n] == input[n])
+ return FALSE;
+ if (strchr(current + n, '/') == 0
+ && strchr(input + n, '/') == 0) {
+ return show_both_lists(input, d_list, f_list, keep);
+ }
+
+ strcpy(current, input);
+
+ /* refill the lists */
+ free_list(d_list, TRUE);
+ free_list(f_list, TRUE);
+ strcpy(path, current);
+ if ((leaf = strrchr(path, '/')) != 0) {
+ *++leaf = 0;
+ } else {
+ strcpy(path, "./");
+ leaf = path + strlen(path);
+ }
+ if ((dp = opendir(path)) != 0) {
+ while ((de = readdir(dp)) != 0) {
+ strncpy(leaf, de->d_name, NAMLEN(de))[NAMLEN(de)] = 0;
+ if (stat(path, &sb) == 0) {
+ if ((sb.st_mode & S_IFMT) == S_IFDIR)
+ add_to_list(d_list, leaf);
+ else if (f_list->win)
+ add_to_list(f_list, leaf);
+ }
+ }
+ (void) closedir(dp);
+ /* sort the lists */
+ qsort(d_list->data, d_list->length, sizeof(d_list->data[0]), compar);
+ qsort(f_list->data, f_list->length, sizeof(f_list->data[0]), compar);
+ }
+
+ (void) show_both_lists(input, d_list, f_list, FALSE);
+ d_list->offset = d_list->choice;
+ f_list->offset = f_list->choice;
+ return TRUE;
+}
+
+static bool
+usable_state(int state, LIST * dirs, LIST * files)
+{
+ bool result;
+
+ switch (state) {
+ case sDIRS:
+ result = (dirs->win != 0) && (data_of(dirs) != 0);
+ break;
+ case sFILES:
+ result = (files->win != 0) && (data_of(files) != 0);
+ break;
+ default:
+ result = TRUE;
+ break;
+ }
+ return result;
+}
+
+#define which_list() ((state == sFILES) \
+ ? &f_list \
+ : ((state == sDIRS) \
+ ? &d_list \
+ : 0))
+/*
+ * Display a dialog box for entering a filename
+ */
+static int
+dlg_fselect(const char *title, const char *path, int height, int width, bool dselect)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ), /* override inputstr */
+ INPUTSTR_BINDINGS,
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_DOWN),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, CHR_NEXT ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_NEXT ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, CHR_PREVIOUS ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+ bool resized = FALSE;
+#endif
+ int tbox_y, tbox_x, tbox_width, tbox_height;
+ int dbox_y, dbox_x, dbox_width, dbox_height;
+ int fbox_y, fbox_x, fbox_width, fbox_height;
+ int show_buttons = TRUE;
+ int offset = 0;
+ int key = 0;
+ int fkey = FALSE;
+ int code;
+ int result = DLG_EXIT_UNKNOWN;
+ int state = dialog_vars.defaultno ? dlg_defaultno_button() : sTEXT;
+ int button = state;
+ int first = (state == sTEXT);
+ char *input;
+ char *completed;
+ char current[MAX_LEN + 1];
+ WINDOW *dialog = 0;
+ WINDOW *w_text = 0;
+ WINDOW *w_work = 0;
+ const char **buttons = dlg_ok_labels();
+ char *d_label = _("Directories");
+ char *f_label = _("Files");
+ char *partial;
+ int min_wide = MIN_WIDE;
+ int min_items = height ? 0 : 4;
+ LIST d_list, f_list;
+
+ dlg_does_output();
+
+ /* Set up the initial value */
+ input = dlg_set_result(path);
+ offset = strlen(input);
+ *current = 0;
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+ dlg_auto_size(title, (char *) 0, &height, &width, 6, 25);
+ height += MIN_HIGH + min_items;
+ if (width < min_wide)
+ width = min_wide;
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ dialog = dlg_new_window(height, width,
+ dlg_box_y_ordinate(height),
+ dlg_box_x_ordinate(width));
+ dlg_register_window(dialog, "fselect", binding);
+ dlg_register_buttons(dialog, "fselect", buttons);
+
+ dlg_mouse_setbase(0, 0);
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+
+ /* Draw the input field box */
+ tbox_height = 1;
+ tbox_width = width - (4 * MARGIN + 2);
+ tbox_y = height - (BTN_HIGH * 2) + MARGIN;
+ tbox_x = (width - tbox_width) / 2;
+
+ w_text = derwin(dialog, tbox_height, tbox_width, tbox_y, tbox_x);
+ if (w_text == 0)
+ return DLG_EXIT_ERROR;
+
+ (void) keypad(w_text, TRUE);
+ dlg_draw_box(dialog, tbox_y - MARGIN, tbox_x - MARGIN,
+ (2 * MARGIN + 1), tbox_width + (MARGIN + EXT_WIDE),
+ menubox_border_attr, menubox_attr);
+ dlg_mouse_mkbigregion(getbegy(dialog) + tbox_y - MARGIN,
+ getbegx(dialog) + tbox_x - MARGIN,
+ 1 + (2 * MARGIN),
+ tbox_width + (MARGIN + EXT_WIDE),
+ MOUSE_T, 1, 1, 3 /* doesn't matter */ );
+
+ /* Draw the directory listing box */
+ if (dselect)
+ dbox_width = (width - (6 * MARGIN));
+ else
+ dbox_width = (width - (6 * MARGIN + 2 * EXT_WIDE)) / 2;
+ dbox_height = height - MIN_HIGH;
+ dbox_y = (2 * MARGIN + 1);
+ dbox_x = tbox_x;
+
+ w_work = derwin(dialog, dbox_height, dbox_width, dbox_y, dbox_x);
+ if (w_work == 0)
+ return DLG_EXIT_ERROR;
+
+ (void) keypad(w_work, TRUE);
+ (void) mvwprintw(dialog, dbox_y - (MARGIN + 1), dbox_x - MARGIN, d_label);
+ dlg_draw_box(dialog,
+ dbox_y - MARGIN, dbox_x - MARGIN,
+ dbox_height + (MARGIN + 1), dbox_width + (MARGIN + 1),
+ menubox_border_attr, menubox_attr);
+ init_list(&d_list, dialog, w_work, MOUSE_D);
+
+ if (!dselect) {
+ /* Draw the filename listing box */
+ fbox_height = dbox_height;
+ fbox_width = dbox_width;
+ fbox_y = dbox_y;
+ fbox_x = tbox_x + dbox_width + (2 * MARGIN);
+
+ w_work = derwin(dialog, fbox_height, fbox_width, fbox_y, fbox_x);
+ if (w_work == 0)
+ return DLG_EXIT_ERROR;
+
+ (void) keypad(w_work, TRUE);
+ (void) mvwprintw(dialog, fbox_y - (MARGIN + 1), fbox_x - MARGIN, f_label);
+ dlg_draw_box(dialog,
+ fbox_y - MARGIN, fbox_x - MARGIN,
+ fbox_height + (MARGIN + 1), fbox_width + (MARGIN + 1),
+ menubox_border_attr, menubox_attr);
+ init_list(&f_list, dialog, w_work, MOUSE_F);
+ } else {
+ memset(&f_list, 0, sizeof(f_list));
+ }
+
+ while (result == DLG_EXIT_UNKNOWN) {
+
+ if (fill_lists(current, input, &d_list, &f_list, state < sTEXT))
+ show_buttons = TRUE;
+
+#ifdef KEY_RESIZE
+ if (resized) {
+ resized = FALSE;
+ dlg_show_string(w_text, input, offset, inputbox_attr,
+ 0, 0, tbox_width, 0, first);
+ }
+#endif
+
+ /*
+ * The last field drawn determines where the cursor is shown:
+ */
+ if (show_buttons) {
+ show_buttons = FALSE;
+ button = (state < 0) ? 0 : state;
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
+ }
+ if (state < 0) {
+ switch (state) {
+ case sTEXT:
+ dlg_set_focus(dialog, w_text);
+ break;
+ case sFILES:
+ dlg_set_focus(dialog, f_list.win);
+ break;
+ case sDIRS:
+ dlg_set_focus(dialog, d_list.win);
+ break;
+ }
+ }
+
+ if (first) {
+ (void) wrefresh(dialog);
+ } else {
+ fix_arrows(&d_list);
+ fix_arrows(&f_list);
+ key = dlg_mouse_wgetch(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+ }
+
+ if (!fkey && key == ' ') {
+ key = DLGK_SELECT;
+ fkey = TRUE;
+ }
+
+ if (fkey) {
+ switch (key) {
+ case DLGK_MOUSE(KEY_PREVIOUS):
+ state = sDIRS;
+ scroll_list(-1, which_list());
+ continue;
+ case DLGK_MOUSE(KEY_NEXT):
+ state = sDIRS;
+ scroll_list(1, which_list());
+ continue;
+ case DLGK_MOUSE(KEY_PPAGE):
+ state = sFILES;
+ scroll_list(-1, which_list());
+ continue;
+ case DLGK_MOUSE(KEY_NPAGE):
+ state = sFILES;
+ scroll_list(1, which_list());
+ continue;
+ case DLGK_PAGE_PREV:
+ scroll_list(-1, which_list());
+ continue;
+ case DLGK_PAGE_NEXT:
+ scroll_list(1, which_list());
+ continue;
+ case DLGK_ITEM_PREV:
+ if (change_list(-1, which_list()))
+ continue;
+ /* FALLTHRU */
+ case DLGK_FIELD_PREV:
+ show_buttons = TRUE;
+ do {
+ state = dlg_prev_ok_buttonindex(state, sDIRS);
+ } while (!usable_state(state, &d_list, &f_list));
+ continue;
+ case DLGK_ITEM_NEXT:
+ if (change_list(1, which_list()))
+ continue;
+ /* FALLTHRU */
+ case DLGK_FIELD_NEXT:
+ show_buttons = TRUE;
+ do {
+ state = dlg_next_ok_buttonindex(state, sDIRS);
+ } while (!usable_state(state, &d_list, &f_list));
+ continue;
+ case DLGK_SELECT:
+ completed = 0;
+ partial = 0;
+ if (state == sFILES && !dselect) {
+ completed = data_of(&f_list);
+ } else if (state == sDIRS) {
+ completed = data_of(&d_list);
+ } else {
+ if (complete(input, &d_list, &f_list, &partial)) {
+ completed = partial;
+ }
+ }
+ if (completed != 0) {
+ state = sTEXT;
+ show_buttons = TRUE;
+ strcpy(leaf_of(input), completed);
+ offset = strlen(input);
+ dlg_show_string(w_text, input, offset, inputbox_attr,
+ 0, 0, tbox_width, 0, first);
+ if (partial != NULL)
+ free(partial);
+ continue;
+ } else { /* if (state < sTEXT) */
+ (void) beep();
+ continue;
+ }
+ /* FALLTHRU */
+ case DLGK_ENTER:
+ result = (state > 0) ? dlg_ok_buttoncode(state) : DLG_EXIT_OK;
+ continue;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ /* reset data */
+ height = old_height;
+ width = old_width;
+ show_buttons = TRUE;
+ *current = 0;
+ resized = TRUE;
+ /* repaint */
+ dlg_clear();
+ dlg_del_window(dialog);
+ refresh();
+ dlg_mouse_free_regions();
+ goto retry;
+#endif
+ default:
+ if (key >= DLGK_MOUSE(MOUSE_T)) {
+ state = sTEXT;
+ continue;
+ } else if (key >= DLGK_MOUSE(MOUSE_F)) {
+ if (f_list.win != 0) {
+ state = sFILES;
+ f_list.choice = (key - DLGK_MOUSE(MOUSE_F)) + f_list.offset;
+ display_list(&f_list);
+ }
+ continue;
+ } else if (key >= DLGK_MOUSE(MOUSE_D)) {
+ if (d_list.win != 0) {
+ state = sDIRS;
+ d_list.choice = (key - DLGK_MOUSE(MOUSE_D)) + d_list.offset;
+ display_list(&d_list);
+ }
+ continue;
+ } else if (is_DLGK_MOUSE(key)
+ && (code = dlg_ok_buttoncode(key - M_EVENT)) >= 0) {
+ result = code;
+ continue;
+ }
+ break;
+ }
+ }
+
+ if (state < 0) { /* Input box selected if we're editing */
+ int edit = dlg_edit_string(input, &offset, key, fkey, first);
+
+ if (edit) {
+ dlg_show_string(w_text, input, offset, inputbox_attr,
+ 0, 0, tbox_width, 0, first);
+ first = FALSE;
+ state = sTEXT;
+ }
+ } else if (state >= 0 &&
+ (code = dlg_char_to_button(key, buttons)) >= 0) {
+ result = dlg_ok_buttoncode(code);
+ break;
+ }
+ }
+
+ dlg_del_window(dialog);
+ dlg_mouse_free_regions();
+ free_list(&d_list, FALSE);
+ free_list(&f_list, FALSE);
+ return result;
+}
+
+/*
+ * Display a dialog box for entering a filename
+ */
+int
+dialog_fselect(const char *title, const char *path, int height, int width)
+{
+ return dlg_fselect(title, path, height, width, FALSE);
+}
+
+/*
+ * Display a dialog box for entering a directory
+ */
+int
+dialog_dselect(const char *title, const char *path, int height, int width)
+{
+ return dlg_fselect(title, path, height, width, TRUE);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/guage.c b/Build/source/utils/dialog/dialog-1.1-20080819/guage.c
new file mode 100644
index 00000000000..6dbc84e7bd8
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/guage.c
@@ -0,0 +1,239 @@
+/*
+ * $Id: guage.c,v 1.40 2007/02/24 00:06:25 tom Exp $
+ *
+ * guage.c -- implements the gauge dialog
+ *
+ * Copyright 2000-2006,2007 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors
+ * Marc Ewing, Red Hat Software
+ */
+
+#include <dialog.h>
+#include <errno.h>
+
+#define MY_LEN (MAX_LEN)/2
+
+#define MIN_HIGH (4)
+#define MIN_WIDE (10 + 2 * (2 + MARGIN))
+
+#define isMarker(buf) !strncmp(buf, "XXX", 3)
+
+#define if_FINISH(status,statement) if ((status) == 0) statement
+
+#ifdef KEY_RESIZE
+#define if_RESIZE(status,statement) if ((status) < 0) statement
+#else
+#define if_RESIZE(status,statement) /* nothing */
+#endif
+
+static int
+read_data(char *buffer, FILE *fp)
+{
+ int result;
+
+ if (feof(fp)) {
+ result = 0;
+ } else if (fgets(buffer, MY_LEN, fp) != 0) {
+ dlg_trim_string(buffer);
+ result = 1;
+ } else {
+ result = -1;
+#ifdef KEY_RESIZE
+ /*
+ * Since we weren't doing getch's before, we won't necessarily
+ * have a KEY_RESIZE returned. Call getch() anyway to force it
+ * to call resizeterm as-needed.
+ */
+ if (errno == EINTR) {
+ (void) getch(); /* allow it to call resizeterm() */
+ refresh();
+ dlg_clear();
+ (void) getch();
+ } else {
+ result = 0;
+ }
+#endif
+ }
+ return result;
+}
+
+static int
+decode_percent(char *buffer)
+{
+ char *tmp = 0;
+ long value = strtol(buffer, &tmp, 10);
+
+ if (tmp != 0 && (*tmp == 0 || isspace(UCH(*tmp))) && value >= 0) {
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*
+ * Display a gauge, or progress meter. Starts at percent% and reads stdin. If
+ * stdin is not XXX, then it is interpreted as a percentage, and the display is
+ * updated accordingly. Otherwise the next line is the percentage, and
+ * subsequent lines up to another XXX are used for the new prompt. Note that
+ * the size of the window never changes, so the prompt can not get any larger
+ * than the height and width specified.
+ */
+int
+dialog_gauge(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int percent)
+{
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+ int i, x, y;
+ int status;
+ char buf[MY_LEN];
+ char prompt_buf[MY_LEN];
+ char *prompt = dlg_strclone(cprompt);
+ WINDOW *dialog;
+
+ curs_set(0);
+
+ dlg_tab_correct_str(prompt);
+
+#ifdef KEY_RESIZE
+ nodelay(stdscr, TRUE);
+ goto first_try;
+ retry:
+ dlg_del_window(dialog);
+ height = old_height;
+ width = old_width;
+ first_try:
+#endif
+
+ dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MIN_WIDE);
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ /* center dialog box on screen */
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+ dialog = dlg_new_window(height, width, y, x);
+
+ do {
+ (void) werase(dialog);
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+ dlg_print_autowrap(dialog, prompt, height, width);
+
+ dlg_draw_box(dialog,
+ height - 4, 2 + MARGIN,
+ 2 + MARGIN, width - 2 * (2 + MARGIN),
+ dialog_attr,
+ border_attr);
+
+ /*
+ * Clear the area for the progress bar by filling it with spaces
+ * in the title-attribute, and write the percentage with that
+ * attribute.
+ */
+ (void) wmove(dialog, height - 3, 4);
+ wattrset(dialog, title_attr);
+
+ for (i = 0; i < (width - 2 * (3 + MARGIN)); i++)
+ (void) waddch(dialog, ' ');
+
+ (void) wmove(dialog, height - 3, (width / 2) - 2);
+ (void) wprintw(dialog, "%3d%%", percent);
+
+ /*
+ * Now draw a bar in reverse, relative to the background.
+ * The window attribute was useful for painting the background,
+ * but requires some tweaks to reverse it.
+ */
+ x = (percent * (width - 2 * (3 + MARGIN))) / 100;
+ if ((title_attr & A_REVERSE) != 0) {
+ wattroff(dialog, A_REVERSE);
+ } else {
+ wattrset(dialog, A_REVERSE);
+ }
+ (void) wmove(dialog, height - 3, 4);
+ for (i = 0; i < x; i++) {
+ chtype ch = winch(dialog);
+ if (title_attr & A_REVERSE) {
+ ch &= ~A_REVERSE;
+ }
+ (void) waddch(dialog, ch);
+ }
+
+ (void) wrefresh(dialog);
+
+ status = read_data(buf, dialog_state.pipe_input);
+ if_FINISH(status, break);
+ if_RESIZE(status, goto retry);
+
+ if (isMarker(buf)) {
+ /*
+ * Historically, next line should be percentage, but one of the
+ * worse-written clones of 'dialog' assumes the number is missing.
+ * (Gresham's Law applied to software).
+ */
+ status = read_data(buf, dialog_state.pipe_input);
+ if_FINISH(status, break);
+ if_RESIZE(status, goto retry);
+
+ prompt_buf[0] = '\0';
+ if (decode_percent(buf))
+ percent = atoi(buf);
+ else
+ strcpy(prompt_buf, buf);
+
+ /* Rest is message text */
+ while ((status = read_data(buf, dialog_state.pipe_input)) > 0
+ && !isMarker(buf)) {
+ if (strlen(prompt_buf) + strlen(buf) < sizeof(prompt_buf) - 1) {
+ strcat(prompt_buf, buf);
+ }
+ }
+ if_FINISH(status, break);
+ if_RESIZE(status, goto retry);
+
+ if (prompt != prompt_buf)
+ free(prompt);
+ prompt = prompt_buf;
+ } else if (decode_percent(buf)) {
+ percent = atoi(buf);
+ }
+ } while (1);
+
+#ifdef KEY_RESIZE
+ nodelay(stdscr, FALSE);
+#endif
+
+ fclose(dialog_state.pipe_input);
+ dialog_state.pipe_input = 0;
+
+ curs_set(1);
+ dlg_del_window(dialog);
+ if (prompt != prompt_buf)
+ free(prompt);
+ return (DLG_EXIT_OK);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/headers-sh.in b/Build/source/utils/dialog/dialog-1.1-20080819/headers-sh.in
new file mode 100755
index 00000000000..930f420a8de
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/headers-sh.in
@@ -0,0 +1,150 @@
+#! /bin/sh
+# $Id: headers-sh.in,v 1.5 2007/07/05 00:20:18 tom Exp $
+##############################################################################
+# Copyright (c) 2004,2007 Thomas E. Dickey #
+# #
+# 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, distribute #
+# with modifications, 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 ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
+# DEALINGS IN THE SOFTWARE. #
+# #
+# Except as contained in this notice, the name(s) of the above copyright #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written #
+# authorization. #
+##############################################################################
+#
+# Adjust includes for header files that reside in a subdirectory of
+# /usr/include, etc.
+#
+# Parameters (the first case creates the sed script):
+# $1 is the target directory
+# $2 is the source directory
+# or (the second case does the install, using the sed script):
+# $1 is the script to use for installing
+# $2 is the target directory
+# $3 is the source directory
+# $4 is the file to install, editing source/target/etc.
+
+PACKAGE=@PACKAGE@
+PKGNAME=@PACKAGE_PREFIX@
+CONFIGH=@PACKAGE_CONFIG@
+
+TMPSED=headers.sed
+
+DIGIT=0123456789
+alpha=abcdefghijklmnopqrstuvwxyz
+ALPHA=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+
+alnum=_${DIGIT}${alpha}
+ALNUM=_${DIGIT}${ALPHA}
+MIXED=_${DIGIT}${ALPHA}${alpha}
+
+if test $# = 2 ; then
+ rm -f $TMPSED
+ DST=$1
+ REF=$2
+ LEAF=`basename $DST`
+
+ # map the include-directory, if needed, to the subdirectory
+ case $DST in
+ /*/include/$LEAF)
+ END=`basename $DST`
+ for i in $REF/*.h
+ do
+ NAME=`basename $i`
+ echo "s/<$NAME>/<$END\/$NAME>/g" >> $TMPSED
+ done
+ ;;
+ *)
+ echo "" >> $TMPSED
+ ;;
+ esac
+
+ # cannot do _this_ in -e options:
+ cat >headers.tmp <<EOF
+s/^#[^ ][^ ]*//
+s/[^'$MIXED']/ /g
+s/[ ][ ]*/ /g
+s/^ //
+s/ $//
+:split
+ h
+ s/ .*//
+ p
+ t next
+ b done
+:next
+ x
+ s/^[^ ][^ ]* //
+ t split
+:done
+EOF
+ # pick up autoconf-style symbols used in the application's headers
+ for i in $REF/*.h
+ do
+ sed -e 's/^[ ][ ]*#[ ][ ]*/#/' $i \
+ | egrep '^#(if|ifdef|ifndef|elif)' \
+ | sed -f headers.tmp \
+ | sort -u \
+ | egrep '^(HAVE_|NEED_|NO_|ENABLE_|DISABLE_)' \
+ | sed -e 's%^\(.*\)%s/\\<\1\\>/'${PKGNAME}'_\1/g%' >>$TMPSED
+ done
+ rm -f headers.tmp
+
+ # pick up autoconf-defined symbols in the config.h file
+ for name in `
+ egrep '^#define[ ][ ]*['$ALNUM']' $REF/$CONFIGH \
+ | sed -e 's/^#define[ ][ ]*//' \
+ -e 's/[ ].*//' \
+ | egrep -v "^${PACKAGE}_" \
+ | sort -u \
+ | egrep -v "^${PKGNAME}_"`
+ do
+ echo "s/\\<$name\\>/${PKGNAME}_$name/g" >>$TMPSED
+ done
+
+ # reduce the count if possible, since some old sed's limit is 100 lines
+ sort -u $TMPSED >headers.tmp
+ mv headers.tmp $TMPSED
+else
+ PRG=""
+ while test $# != 3
+ do
+ PRG="$PRG $1"; shift
+ done
+
+ DST=$1
+ REF=$2
+ SRC=$3
+
+ SHOW=`basename $SRC`
+ TMPSRC=${TMPDIR-/tmp}/${SHOW}$$
+
+ echo " ... $SHOW"
+ test -f $REF/$SRC && SRC="$REF/$SRC"
+
+ rm -f $TMPSRC
+ sed -f $TMPSED $SRC > $TMPSRC
+ NAME=`basename $SRC`
+
+ # Just in case someone gzip'd manpages, remove the conflicting copy.
+ test -f $DST/$NAME.gz && rm -f $DST/$NAME.gz
+
+ eval $PRG $TMPSRC $DST/$NAME
+ rm -f $TMPSRC
+fi
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/inputbox.c b/Build/source/utils/dialog/dialog-1.1-20080819/inputbox.c
new file mode 100644
index 00000000000..5a8b71f6596
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/inputbox.c
@@ -0,0 +1,217 @@
+/*
+ * $Id: inputbox.c,v 1.60 2008/03/16 13:49:48 Yura.Kalinichenko Exp $
+ *
+ * inputbox.c -- implements the input box
+ *
+ * Copyright 2000-2005,2006 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors:
+ * Savio Lam (lam836@cs.cuhk.hk)
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#define sTEXT -1
+
+/*
+ * Display a dialog box for entering a string
+ */
+int
+dialog_inputbox(const char *title, const char *cprompt, int height, int width,
+ const char *init, const int password)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ INPUTSTR_BINDINGS,
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_UP ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+ int x, y, box_y, box_x, box_width;
+ int show_buttons;
+ int col_offset = 0;
+ int chr_offset = 0;
+ int key, fkey, code;
+ int result = DLG_EXIT_UNKNOWN;
+ int state;
+ int first;
+ char *input;
+ WINDOW *dialog;
+ char *prompt = dlg_strclone(cprompt);
+ const char **buttons = dlg_ok_labels();
+
+ dlg_does_output();
+
+ dlg_tab_correct_str(prompt);
+
+ /* Set up the initial value */
+ input = dlg_set_result(init);
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+ show_buttons = TRUE;
+ state = dialog_vars.defaultno ? dlg_defaultno_button() : sTEXT;
+ first = (state == sTEXT);
+ key = fkey = 0;
+
+ if (init != NULL) {
+ dlg_auto_size(title, prompt, &height, &width, 5,
+ MIN(MAX(dlg_count_columns(init) + 7, 26),
+ SCOLS - (dialog_vars.begin_set ?
+ dialog_vars.begin_x : 0)));
+ chr_offset = strlen(init);
+ } else {
+ dlg_auto_size(title, prompt, &height, &width, 5, 26);
+ }
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+ dialog = dlg_new_window(height, width, y, x);
+ dlg_register_window(dialog, "inputbox", binding);
+ dlg_register_buttons(dialog, "inputbox", buttons);
+
+ dlg_mouse_setbase(x, y);
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+ dlg_print_autowrap(dialog, prompt, height, width);
+
+ /* Draw the input field box */
+ box_width = width - 6;
+ getyx(dialog, y, x);
+ box_y = y + 2;
+ box_x = (width - box_width) / 2;
+ dlg_mouse_mkregion(y + 1, box_x - 1, 3, box_width + 2, 'i');
+ dlg_draw_box(dialog, y + 1, box_x - 1, 3, box_width + 2,
+ border_attr, dialog_attr);
+
+ while (result == DLG_EXIT_UNKNOWN) {
+ int edit = 0;
+
+ /*
+ * The last field drawn determines where the cursor is shown:
+ */
+ if (show_buttons) {
+ show_buttons = FALSE;
+ col_offset = dlg_edit_offset(input, chr_offset, box_width);
+ (void) wmove(dialog, box_y, box_x + col_offset);
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, state, FALSE, width);
+ }
+
+ if (!first) {
+ key = dlg_mouse_wgetch(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+ }
+
+ /*
+ * Handle mouse clicks first, since we want to know if this is a button,
+ * or something that dlg_edit_string() should handle.
+ */
+ if (fkey
+ && is_DLGK_MOUSE(key)
+ && (code = dlg_ok_buttoncode(key - M_EVENT)) >= 0) {
+ result = code;
+ continue;
+ }
+
+ if (state == sTEXT) { /* Input box selected */
+ edit = dlg_edit_string(input, &chr_offset, key, fkey, first);
+
+ if (edit) {
+ dlg_show_string(dialog, input, chr_offset, inputbox_attr,
+ box_y, box_x, box_width, password, first);
+ first = FALSE;
+ continue;
+ } else if (first) {
+ first = FALSE;
+ continue;
+ }
+ }
+
+ /* handle non-functionkeys */
+ if (!fkey && (code = dlg_char_to_button(key, buttons)) >= 0) {
+ dlg_del_window(dialog);
+ result = dlg_ok_buttoncode(code);
+ continue;
+ }
+
+ /* handle functionkeys */
+ if (fkey) {
+ switch (key) {
+ case DLGK_MOUSE('i'): /* mouse enter events */
+ state = 0;
+ /* FALLTHRU */
+ case DLGK_FIELD_PREV:
+ show_buttons = TRUE;
+ state = dlg_prev_ok_buttonindex(state, sTEXT);
+ break;
+ case DLGK_FIELD_NEXT:
+ show_buttons = TRUE;
+ state = dlg_next_ok_buttonindex(state, sTEXT);
+ break;
+ case ' ': /* FIXME: conflict with inputstr.c */
+ case DLGK_ENTER:
+ dlg_del_window(dialog);
+ result = (state >= 0) ? dlg_ok_buttoncode(state) : DLG_EXIT_OK;
+ break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ /* reset data */
+ height = old_height;
+ width = old_width;
+ /* repaint */
+ dlg_clear();
+ dlg_del_window(dialog);
+ refresh();
+ dlg_mouse_free_regions();
+ goto retry;
+#endif
+ default:
+ beep();
+ break;
+ }
+ } else {
+ beep();
+ }
+ }
+
+ dlg_del_window(dialog);
+ dlg_mouse_free_regions();
+ free(prompt);
+ return result;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/inputstr.c b/Build/source/utils/dialog/dialog-1.1-20080819/inputstr.c
new file mode 100644
index 00000000000..ca061b94cf9
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/inputstr.c
@@ -0,0 +1,745 @@
+/*
+ * $Id: inputstr.c,v 1.64 2008/03/16 20:19:43 tom Exp $
+ *
+ * inputstr.c -- functions for input/display of a string
+ *
+ * Copyright 2000-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#include <errno.h>
+
+#ifdef HAVE_SETLOCALE
+#include <locale.h>
+#endif
+
+#if defined(HAVE_SEARCH_H) && defined(HAVE_TSEARCH)
+#include <search.h>
+#else
+#undef HAVE_TSEARCH
+#endif
+
+#ifdef NEED_WCHAR_H
+#include <wchar.h>
+#endif
+
+#if defined(USE_WIDE_CURSES)
+#define USE_CACHING 1
+#elif defined(HAVE_XDIALOG)
+#define USE_CACHING 1 /* editbox really needs caching! */
+#else
+#define USE_CACHING 0
+#endif
+
+typedef struct _cache {
+ struct _cache *next;
+#if USE_CACHING
+ struct _cache *cache_at; /* unique: associate caches by CACHE */
+ const char *string_at; /* unique: associate caches by char* */
+#endif
+ unsigned s_len; /* strlen(string) - we add 1 for EOS */
+ unsigned i_len; /* length(list) - we add 1 for EOS */
+ char *string; /* a copy of the last-processed string */
+ int *list; /* indices into the string */
+} CACHE;
+
+#if USE_CACHING
+#define SAME_CACHE(c,s,l) (c->string != 0 && memcmp(c->string,s,l) == 0)
+
+static CACHE *cache_list;
+
+#ifdef HAVE_TSEARCH
+static void *sorted_cache;
+#endif
+
+#ifdef USE_WIDE_CURSES
+static int
+have_locale(void)
+{
+ static int result = -1;
+ if (result < 0) {
+ char *test = setlocale(LC_ALL, 0);
+ if (test == 0 || *test == 0) {
+ result = FALSE;
+ } else if (strcmp(test, "C") && strcmp(test, "POSIX")) {
+ result = TRUE;
+ } else {
+ result = FALSE;
+ }
+ }
+ return result;
+}
+#endif
+
+#ifdef HAVE_TSEARCH
+static int
+compare_cache(const void *a, const void *b)
+{
+ const CACHE *p = (const CACHE *) a;
+ const CACHE *q = (const CACHE *) b;
+ int result = 0;
+ result = p->cache_at - q->cache_at;
+ if (result == 0)
+ result = p->string_at - q->string_at;
+ return result;
+}
+#endif
+
+static CACHE *
+find_cache(CACHE * cache, const char *string)
+{
+ CACHE *p;
+
+#ifdef HAVE_TSEARCH
+ void *pp;
+ CACHE find;
+
+ memset(&find, 0, sizeof(find));
+ find.cache_at = cache;
+ find.string_at = string;
+
+ if ((pp = tfind(&find, &sorted_cache, compare_cache)) != 0) {
+ p = *(CACHE **) pp;
+ } else {
+ p = 0;
+ }
+#else
+ for (p = cache_list; p != 0; p = p->next) {
+ if (p->cache_at == cache
+ && p->string_at == string) {
+ break;
+ }
+ }
+#endif
+ return p;
+}
+
+static void
+make_cache(CACHE * cache, const char *string)
+{
+ CACHE *p;
+
+ p = dlg_calloc(CACHE, 1);
+ assert_ptr(p, "load_cache");
+ p->next = cache_list;
+ cache_list = p;
+
+ p->cache_at = cache;
+ p->string_at = string;
+
+ *cache = *p;
+#ifdef HAVE_TSEARCH
+ (void) tsearch(p, &sorted_cache, compare_cache);
+#endif
+}
+
+static void
+load_cache(CACHE * cache, const char *string)
+{
+ CACHE *p;
+
+ if ((p = find_cache(cache, string)) != 0) {
+ *cache = *p;
+ } else {
+ make_cache(cache, string);
+ }
+}
+
+static void
+save_cache(CACHE * cache, const char *string)
+{
+ CACHE *p;
+
+ if ((p = find_cache(cache, string)) != 0) {
+ CACHE *q = p->next;
+ *p = *cache;
+ p->next = q;
+ }
+}
+#else
+#define SAME_CACHE(c,s,l) (c->string != 0)
+#define load_cache(cache, string) /* nothing */
+#define save_cache(cache, string) /* nothing */
+#endif /* USE_WIDE_CURSES */
+
+/*
+ * If the given string has not changed, we do not need to update the index.
+ * If we need to update the index, allocate enough memory for it.
+ */
+static bool
+same_cache2(CACHE * cache, const char *string, unsigned i_len)
+{
+ unsigned need;
+ unsigned s_len = strlen(string);
+
+ if (cache->s_len != 0
+ && cache->s_len >= s_len
+ && cache->list != 0
+ && SAME_CACHE(cache, string, s_len)) {
+ return TRUE;
+ }
+
+ need = (i_len + 1);
+ if (cache->list == 0) {
+ cache->list = dlg_malloc(int, need);
+ } else if (cache->i_len < i_len) {
+ cache->list = dlg_realloc(int, need, cache->list);
+ }
+ cache->i_len = i_len;
+
+ if (cache->s_len >= s_len && cache->string != 0) {
+ strcpy(cache->string, string);
+ } else {
+ if (cache->string != 0)
+ free(cache->string);
+ cache->string = dlg_strclone(string);
+ }
+ cache->s_len = s_len;
+
+ return FALSE;
+}
+
+#ifdef USE_WIDE_CURSES
+/*
+ * Like same_cache2(), but we are only concerned about caching a copy of the
+ * string and its associated length.
+ */
+static bool
+same_cache1(CACHE * cache, const char *string, unsigned i_len)
+{
+ unsigned s_len = strlen(string);
+
+ if (cache->s_len == s_len
+ && SAME_CACHE(cache, string, s_len)) {
+ return TRUE;
+ }
+
+ if (cache->s_len >= s_len && cache->string != 0) {
+ strcpy(cache->string, string);
+ } else {
+ if (cache->string != 0)
+ free(cache->string);
+ cache->string = dlg_strclone(string);
+ }
+ cache->s_len = s_len;
+ cache->i_len = i_len;
+
+ return FALSE;
+}
+#endif /* USE_CACHING */
+
+/*
+ * Counts the number of bytes that make up complete wide-characters, up to byte
+ * 'len'. If there is no locale set, simply return the original length.
+ */
+#ifdef USE_WIDE_CURSES
+static int
+dlg_count_wcbytes(const char *string, size_t len)
+{
+ int result;
+
+ if (have_locale()) {
+ static CACHE cache;
+
+ load_cache(&cache, string);
+ if (!same_cache1(&cache, string, len)) {
+ while (len != 0) {
+ int part = 0;
+ int code = 0;
+ const char *src = cache.string;
+ mbstate_t state;
+ int save = cache.string[len];
+
+ cache.string[len] = '\0';
+ memset(&state, 0, sizeof(state));
+ code = mbsrtowcs((wchar_t *) 0, &src, len, &state);
+ cache.string[len] = save;
+ if (code >= 0) {
+ break;
+ }
+ ++part;
+ --len;
+ }
+ cache.i_len = len;
+ save_cache(&cache, string);
+ }
+ result = cache.i_len;
+ } else {
+ result = len;
+ }
+ return result;
+}
+#endif /* USE_WIDE_CURSES */
+
+/*
+ * Counts the number of wide-characters in the string.
+ */
+int
+dlg_count_wchars(const char *string)
+{
+ int result;
+
+#ifdef USE_WIDE_CURSES
+ if (have_locale()) {
+ static CACHE cache;
+ size_t len = strlen(string);
+
+ load_cache(&cache, string);
+ if (!same_cache1(&cache, string, len)) {
+ const char *src = cache.string;
+ mbstate_t state;
+ int part = dlg_count_wcbytes(cache.string, len);
+ int save = cache.string[part];
+ int code;
+ wchar_t *temp = dlg_calloc(wchar_t, len + 1);
+
+ cache.string[part] = '\0';
+ memset(&state, 0, sizeof(state));
+ code = mbsrtowcs(temp, &src, part, &state);
+ cache.i_len = (code >= 0) ? wcslen(temp) : 0;
+ cache.string[part] = save;
+ free(temp);
+ save_cache(&cache, string);
+ }
+ result = cache.i_len;
+ } else
+#endif /* USE_WIDE_CURSES */
+ {
+ result = strlen(string);
+ }
+ return result;
+}
+
+/*
+ * Build an index of the wide-characters in the string, so we can easily tell
+ * which byte-offset begins a given wide-character.
+ */
+const int *
+dlg_index_wchars(const char *string)
+{
+ static CACHE cache;
+ unsigned len = dlg_count_wchars(string);
+ unsigned inx;
+
+ load_cache(&cache, string);
+ if (!same_cache2(&cache, string, len)) {
+ const char *current = string;
+
+ cache.list[0] = 0;
+ for (inx = 1; inx <= len; ++inx) {
+#ifdef USE_WIDE_CURSES
+ if (have_locale()) {
+ mbstate_t state;
+ int width;
+ memset(&state, 0, sizeof(state));
+ width = mbrlen(current, strlen(current), &state);
+ if (width <= 0)
+ width = 1; /* FIXME: what if we have a control-char? */
+ current += width;
+ cache.list[inx] = cache.list[inx - 1] + width;
+ } else
+#endif /* USE_WIDE_CURSES */
+ {
+ (void) current;
+ cache.list[inx] = inx;
+ }
+ }
+ save_cache(&cache, string);
+ }
+ return cache.list;
+}
+
+/*
+ * Given the character-offset to find in the list, return the corresponding
+ * array index.
+ */
+int
+dlg_find_index(const int *list, int limit, int to_find)
+{
+ int result;
+ for (result = 0; result <= limit; ++result) {
+ if (to_find == list[result]
+ || result == limit
+ || to_find < list[result + 1])
+ break;
+ }
+ return result;
+}
+
+/*
+ * Build a list of the display-columns for the given string's characters.
+ */
+const int *
+dlg_index_columns(const char *string)
+{
+ static CACHE cache;
+ unsigned len = dlg_count_wchars(string);
+ unsigned inx;
+
+ load_cache(&cache, string);
+ if (!same_cache2(&cache, string, len)) {
+ cache.list[0] = 0;
+#ifdef USE_WIDE_CURSES
+ if (have_locale()) {
+ size_t num_bytes = strlen(string);
+ const int *inx_wchars = dlg_index_wchars(string);
+ mbstate_t state;
+
+ for (inx = 0; inx < len; ++inx) {
+ wchar_t temp[2];
+ int check;
+ int result;
+
+ if (string[inx_wchars[inx]] == TAB) {
+ result = ((cache.list[inx] | 7) + 1) - cache.list[inx];
+ } else {
+ memset(&state, 0, sizeof(state));
+ memset(temp, 0, sizeof(temp));
+ check = mbrtowc(temp,
+ string + inx_wchars[inx],
+ num_bytes - inx_wchars[inx], &state);
+ if (check <= 0) {
+ result = 1;
+ } else {
+ result = wcwidth(temp[0]);
+ }
+ if (result < 0) {
+ wchar_t *printable;
+ cchar_t temp2;
+ setcchar(&temp2, temp, 0, 0, 0);
+ printable = wunctrl(&temp2);
+ result = printable ? wcslen(printable) : 1;
+ }
+ }
+ cache.list[inx + 1] = result;
+ if (inx != 0)
+ cache.list[inx + 1] += cache.list[inx];
+ }
+ } else
+#endif /* USE_WIDE_CURSES */
+ {
+ for (inx = 0; inx < len; ++inx) {
+ int ch = UCH(string[inx]);
+
+ if (ch == TAB)
+ cache.list[inx + 1] =
+ ((cache.list[inx] | 7) + 1) - cache.list[inx];
+ else if (isprint(ch))
+ cache.list[inx + 1] = 1;
+ else {
+ const char *printable;
+ printable = unctrl(ch);
+ cache.list[inx + 1] = printable ? strlen(printable) : 1;
+ }
+ if (inx != 0)
+ cache.list[inx + 1] += cache.list[inx];
+ }
+ }
+ save_cache(&cache, string);
+ }
+ return cache.list;
+}
+
+/*
+ * Returns the number of columns used for a string. That happens to be the
+ * end-value of the cols[] array.
+ */
+int
+dlg_count_columns(const char *string)
+{
+ int result = 0;
+ int limit = dlg_count_wchars(string);
+ if (limit > 0) {
+ const int *cols = dlg_index_columns(string);
+ result = cols[limit];
+ } else {
+ result = strlen(string);
+ }
+ return result;
+}
+
+/*
+ * Given a column limit, count the number of wide characters that can fit
+ * into that limit. The offset is used to skip over a leading character
+ * that was already written.
+ */
+int
+dlg_limit_columns(const char *string, int limit, int offset)
+{
+ const int *cols = dlg_index_columns(string);
+ int result = dlg_count_wchars(string);
+
+ while (result > 0 && (cols[result] - cols[offset]) > limit)
+ --result;
+ return result;
+}
+
+/*
+ * Updates the string and character-offset, given various editing characters
+ * or literal characters which are inserted at the character-offset.
+ */
+bool
+dlg_edit_string(char *string, int *chr_offset, int key, int fkey, bool force)
+{
+ int i;
+ int len = strlen(string);
+ int limit = dlg_count_wchars(string);
+ const int *indx = dlg_index_wchars(string);
+ int offset = dlg_find_index(indx, limit, *chr_offset);
+ int max_len = dlg_max_input(MAX_LEN);
+ bool edit = TRUE;
+
+ /* transform editing characters into equivalent function-keys */
+ if (!fkey) {
+ fkey = TRUE; /* assume we transform */
+ switch (key) {
+ case 0:
+ break;
+ case ESC:
+ case TAB:
+ fkey = FALSE; /* this is used for navigation */
+ break;
+ default:
+ fkey = FALSE; /* ...no, we did not transform */
+ break;
+ }
+ }
+
+ if (fkey) {
+ switch (key) {
+ case 0: /* special case for loop entry */
+ edit = force;
+ break;
+ case DLGK_GRID_LEFT:
+ if (*chr_offset)
+ *chr_offset = indx[offset - 1];
+ break;
+ case DLGK_GRID_RIGHT:
+ if (offset < limit)
+ *chr_offset = indx[offset + 1];
+ break;
+ case DLGK_BEGIN:
+ if (*chr_offset)
+ *chr_offset = 0;
+ break;
+ case DLGK_FINAL:
+ if (offset < limit)
+ *chr_offset = indx[limit];
+ break;
+ case DLGK_DELETE_LEFT:
+ if (offset) {
+ int gap = indx[offset] - indx[offset - 1];
+ *chr_offset = indx[offset - 1];
+ if (gap > 0) {
+ for (i = *chr_offset;
+ (string[i] = string[i + gap]) != '\0';
+ i++) {
+ ;
+ }
+ }
+ }
+ break;
+ case DLGK_DELETE_RIGHT:
+ if (limit) {
+ if (--limit == 0) {
+ string[*chr_offset = 0] = '\0';
+ } else {
+ int gap = ((offset <= limit)
+ ? (indx[offset + 1] - indx[offset])
+ : 0);
+ if (gap > 0) {
+ for (i = indx[offset];
+ (string[i] = string[i + gap]) != '\0';
+ i++) {
+ ;
+ }
+ } else if (offset > 0) {
+ string[indx[offset - 1]] = '\0';
+ }
+ if (*chr_offset > indx[limit])
+ *chr_offset = indx[limit];
+ }
+ }
+ break;
+ case DLGK_DELETE_ALL:
+ string[*chr_offset = 0] = '\0';
+ break;
+ case DLGK_ENTER:
+ edit = 0;
+ break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ edit = 0;
+ break;
+#endif
+ case DLGK_GRID_UP:
+ case DLGK_GRID_DOWN:
+ case DLGK_FIELD_NEXT:
+ case DLGK_FIELD_PREV:
+ edit = 0;
+ break;
+ default:
+ beep();
+ break;
+ }
+ } else {
+ if (key == ESC) {
+ edit = 0;
+ } else {
+ if (len < max_len) {
+ for (i = ++len; i > *chr_offset; i--)
+ string[i] = string[i - 1];
+ string[*chr_offset] = key;
+ *chr_offset += 1;
+ } else {
+ (void) beep();
+ }
+ }
+ }
+ return edit;
+}
+
+static void
+compute_edit_offset(const char *string,
+ int chr_offset,
+ int x_last,
+ int *p_dpy_column,
+ int *p_scroll_amt)
+{
+ const int *cols = dlg_index_columns(string);
+ const int *indx = dlg_index_wchars(string);
+ int limit = dlg_count_wchars(string);
+ int offset = dlg_find_index(indx, limit, chr_offset);
+ int offset2;
+ int dpy_column;
+ int n;
+
+ for (n = offset2 = 0; n <= offset; ++n) {
+ if ((cols[offset] - cols[n]) < x_last
+ && (offset == limit || (cols[offset + 1] - cols[n]) < x_last)) {
+ offset2 = n;
+ break;
+ }
+ }
+
+ dpy_column = cols[offset] - cols[offset2];
+
+ if (p_dpy_column != 0)
+ *p_dpy_column = dpy_column;
+ if (p_scroll_amt != 0)
+ *p_scroll_amt = offset2;
+}
+
+/*
+ * Given the character-offset in the string, returns the display-offset where
+ * we will position the cursor.
+ */
+int
+dlg_edit_offset(char *string, int chr_offset, int x_last)
+{
+ int result;
+
+ compute_edit_offset(string, chr_offset, x_last, &result, 0);
+
+ return result;
+}
+
+/*
+ * Displays the string, shifted as necessary, to fit within the box and show
+ * the current character-offset.
+ */
+void
+dlg_show_string(WINDOW *win,
+ const char *string, /* string to display (may be multibyte) */
+ int chr_offset, /* character (not bytes) offset */
+ chtype attr, /* window-attributes */
+ int y_base, /* beginning row on screen */
+ int x_base, /* beginning column on screen */
+ int x_last, /* number of columns on screen */
+ bool hidden, /* if true, do not echo */
+ bool force) /* if true, force repaint */
+{
+ x_last = MIN(x_last + x_base, getmaxx(win)) - x_base;
+
+ if (hidden && !dialog_vars.insecure) {
+ if (force) {
+ (void) wmove(win, y_base, x_base);
+ wrefresh(win);
+ }
+ } else {
+ const int *cols = dlg_index_columns(string);
+ const int *indx = dlg_index_wchars(string);
+ int limit = dlg_count_wchars(string);
+
+ int i, j, k;
+ int input_x;
+ int scrollamt;
+
+ compute_edit_offset(string, chr_offset, x_last, &input_x, &scrollamt);
+
+ wattrset(win, attr);
+ (void) wmove(win, y_base, x_base);
+ for (i = scrollamt, k = 0; i < limit && k < x_last; ++i) {
+ int check = cols[i + 1] - cols[scrollamt];
+ if (check <= x_last) {
+ for (j = indx[i]; j < indx[i + 1]; ++j) {
+ int ch = UCH(string[j]);
+ if (hidden && dialog_vars.insecure) {
+ waddch(win, '*');
+ } else if (ch == TAB) {
+ int count = cols[i + 1] - cols[i];
+ while (--count >= 0)
+ waddch(win, ' ');
+ } else {
+ waddch(win, ch);
+ }
+ }
+ k = check;
+ } else {
+ break;
+ }
+ }
+ while (k++ < x_last)
+ waddch(win, ' ');
+ (void) wmove(win, y_base, x_base + input_x);
+ wrefresh(win);
+ }
+}
+
+#ifdef NO_LEAKS
+void
+_dlg_inputstr_leaks(void)
+{
+#if USE_CACHING
+ while (cache_list != 0) {
+ CACHE *next = cache_list->next;
+#ifdef HAVE_TSEARCH
+ tdelete(cache_list, &sorted_cache, compare_cache);
+#endif
+ if (cache_list->string != 0)
+ free(cache_list->string);
+ if (cache_list->list != 0)
+ free(cache_list->list);
+ free(cache_list);
+ cache_list = next;
+ }
+#endif /* USE_CACHING */
+}
+#endif /* NO_LEAKS */
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/install-sh b/Build/source/utils/dialog/dialog-1.1-20080819/install-sh
new file mode 100755
index 00000000000..462fa9c3d57
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/install-sh
@@ -0,0 +1,294 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+#
+# 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. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd=$cpprog
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "$0: no input file specified" >&2
+ exit 1
+else
+ :
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d "$dst" ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=$mkdirprog
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f "$src" ] || [ -d "$src" ]
+ then
+ :
+ else
+ echo "$0: $src does not exist" >&2
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "$0: no destination specified" >&2
+ exit 1
+ else
+ :
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d "$dst" ]
+ then
+ dst=$dst/`basename "$src"`
+ else
+ :
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+ '
+IFS="${IFS-$defaultIFS}"
+
+oIFS=$IFS
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS=$oIFS
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp=$pathcomp$1
+ shift
+
+ if [ ! -d "$pathcomp" ] ;
+ then
+ $mkdirprog "$pathcomp"
+ else
+ :
+ fi
+
+ pathcomp=$pathcomp/
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd "$dst" &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename "$dst"`
+ else
+ dstfile=`basename "$dst" $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename "$dst"`
+ else
+ :
+ fi
+
+# Make a couple of temp file names in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+ rmtmp=$dstdir/#rm.$$#
+
+# Trap to clean up temp files at exit.
+
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd "$src" "$dsttmp" &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
+
+# Now remove or move aside any old file at destination location. We try this
+# two ways since rm can't unlink itself on some systems and the destination
+# file might be busy for other reasons. In this case, the final cleanup
+# might fail but the new file should still install successfully.
+
+{
+ if [ -f "$dstdir/$dstfile" ]
+ then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
+ $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
+ {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit
+ }
+ else
+ :
+ fi
+} &&
+
+# Now rename the file to the real destination.
+
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+
+fi &&
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+
+{
+ (exit 0); exit
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/makefile.in b/Build/source/utils/dialog/dialog-1.1-20080819/makefile.in
new file mode 100644
index 00000000000..cd646027d86
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/makefile.in
@@ -0,0 +1,235 @@
+# $Id: makefile.in,v 1.62 2008/07/20 18:30:36 tom Exp $
+# template makefile for DIALOG
+#
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+top_builddir = .
+
+x = @EXEEXT@
+o = .@OBJEXT@
+a = @LIB_SUFFIX@
+
+DESTDIR =
+
+bindir = @bindir@
+includedir = @includedir@
+libdir = @libdir@
+mandir = @mandir@
+
+BINDIR = $(DESTDIR)$(bindir)
+INCLUDEDIR = $(DESTDIR)$(includedir)
+LIBDIR = $(DESTDIR)$(libdir)
+MANDIR = $(DESTDIR)$(mandir)
+
+MAN1DIR = $(MANDIR)/man1
+MAN3DIR = $(MANDIR)/man3
+
+# see po/makefile
+localedir = $(prefix)/@DATADIRNAME@/locale
+
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@ @DEFS@ -I. -I$(srcdir) -DLOCALEDIR=\"$(localedir)\"
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
+CC = @CC@
+CPP = @CPP@
+AR = @AR@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@ @INTLDIR_MAKE@ @INTLLIBS@
+RANLIB = @LIB_PREP@
+
+RM = rm -f
+LINT = lint
+
+LIBTOOL = @LIBTOOL@ @ECHO_LT@
+LIBTOOL_OPTS = @LIBTOOL_OPTS@
+LIBTOOL_CLEAN = @LIB_CLEAN@
+LIBTOOL_COMPILE = @LIB_COMPILE@
+LIBTOOL_CREATE = @LIB_CREATE@
+LIBTOOL_LINK = @LIB_LINK@
+LIBTOOL_INSTALL = @LIB_INSTALL@
+LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = $(LIBTOOL_INSTALL) @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_DATA = @INSTALL_DATA@
+
+LINK = $(LIBTOOL_LINK)
+
+PACKAGE = `echo @PACKAGE@ |sed @program_transform_name@`
+#
+# Standard .c to .o compile line.
+#
+.SUFFIXES: .c .i $o
+.c.i :
+@RULE_CC@
+ @ECHO_CC@$(CPP) $(CPPFLAGS) -c $< >$@
+.c$o :
+@RULE_CC@
+ @ECHO_CC@$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c $<
+
+EXTRAOBJS = @EXTRAOBJS@
+OBJECTS = $(EXTRAOBJS) \
+ arrows$o \
+ buttons$o \
+ checklist$o \
+ columns$o \
+ dlg_keys$o \
+ editbox$o \
+ inputbox$o \
+ inputstr$o \
+ menubox$o \
+ mouse$o \
+ mousewget$o \
+ msgbox$o \
+ textbox$o \
+ ui_getc$o \
+ util$o \
+ version$o \
+ yesno$o
+
+LIB_OBJECT = @LIB_OBJECT@
+
+SRCS = $(OBJECTS:$o=.c)
+HDRS = \
+ dialog.h \
+ dlg_colors.h \
+ dlg_config.h \
+ dlg_keys.h
+
+LIB = @LIB_PREFIX@dialog$a
+PROG = dialog$x
+ALL = $(LIB) $(PROG)
+
+BIN_DIRS = $(BINDIR) $(MAN1DIR)
+LIB_DIRS = $(LIBDIR) $(INCLUDEDIR)
+
+PO_DIR = $(srcdir)/po
+
+all :: $(ALL)
+
+@LIBTOOL_MAKE@install :: install-lib
+@LIBTOOL_MAKE@uninstall :: uninstall-lib
+
+@INTLDIR_MAKE@@INTLLIBS@ :
+@INTLDIR_MAKE@ @echo "Building GNU gettext library..."
+@INTLDIR_MAKE@ @cd intl && $(MAKE) @cf_cv_makeflags@
+
+dialog$o \
+$(OBJECTS) : $(srcdir)/dialog.h $(srcdir)/dlg_keys.h dlg_config.h VERSION
+
+$(LIB) : $(LIB_OBJECT)
+ $(LIBTOOL_CREATE) $(LIB) $(LIB_OBJECT)
+ $(RANLIB) $@
+
+dialog$x : $(LIB) dialog$o @INTLDIR_MAKE@ @INTLLIBS@
+ $(LINK) -o $@ dialog$o -L. -ldialog $(LDFLAGS) $(LIBS)
+
+clean \
+distclean \
+install \
+install-full \
+install-strip \
+uninstall ::
+ @echo making $@
+@INTLDIR_MAKE@ @-test -f intl/makefile && cd intl && $(MAKE) @cf_cv_makeflags@ $@
+@MSG_DIR_MAKE@ @-test -f po/makefile && cd po && $(MAKE) @cf_cv_makeflags@ $@
+
+clean ::
+ @- $(RM) -r autom4te.cache
+ - $(RM) *.*cov *.da *.bb *.bbg
+ - $(LIBTOOL_CLEAN) $(RM) *.i *$o $(ALL)
+ - $(RM) headers.sed
+ - $(RM) core *~ tags TAGS
+
+distclean :: clean
+ $(RM) intl/libintl.h intl/po2tbl.sed
+ $(RM) makefile dlg_config.h config.cache config.log config.status
+ $(RM) samples/install/makefile
+ $(RM) headers-sh
+ $(RM) dialog-config
+
+install :: install-bin install-man
+ @echo "made $@"
+
+install-full :: install-lib install-bin install-man
+ @echo "made $@"
+
+install-strip :: $(PROG) $(BINDIR)
+ $(INSTALL_PROGRAM) -s $(PROG) $(BINDIR)
+
+uninstall :: uninstall-bin uninstall-man
+ @echo "made $@"
+
+uninstall-full :: uninstall-bin uninstall-man uninstall-lib
+ @echo "made $@"
+
+install-bin : $(PROG) $(BINDIR)
+ $(INSTALL_PROGRAM) $(PROG) $(BINDIR)/$(PACKAGE)$x
+
+uninstall-bin :
+ $(RM) $(BINDIR)/$(PACKAGE)$x
+
+install-man :: $(MAN1DIR)
+ $(INSTALL_DATA) $(srcdir)/dialog.1 $(MAN1DIR)/$(PACKAGE).1
+
+uninstall-man ::
+ $(RM) $(MAN1DIR)/$(PACKAGE).1
+
+# most users do not want/need the library, so the install rules are distinct.
+install-lib :: $(BINDIR) dialog-config
+ @ echo "** installing config script in $(BINDIR)"
+ @ $(INSTALL_SCRIPT) dialog-config $(BINDIR)
+
+install-lib :: $(LIB_DIRS) $(LIB) headers.sed
+ @ echo "** installing library in $(LIBDIR)"
+ @ $(LIBTOOL_INSTALL) $(INSTALL_DATA) $(LIB) $(LIBDIR)
+ @ echo "** installing headers in $(INCLUDEDIR)"
+ @ $(SHELL) $(srcdir)/headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dialog.h
+ @ $(SHELL) $(srcdir)/headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dlg_colors.h
+ @ $(SHELL) $(srcdir)/headers-sh $(INSTALL_DATA) $(INCLUDEDIR) $(srcdir) dlg_keys.h
+ @ $(SHELL) $(srcdir)/headers-sh $(INSTALL_DATA) $(INCLUDEDIR) . dlg_config.h
+
+uninstall-lib :: $(BINDIR)
+ $(RM) $(BINDIR)/dialog-config
+
+uninstall-lib :: $(LIB_DIRS)
+ - $(LIBTOOL_UNINSTALL) $(RM) $(LIBDIR)/$(LIB)
+ $(RM) $(INCLUDEDIR)/dialog.h
+ $(RM) $(INCLUDEDIR)/dlg_colors.h
+ $(RM) $(INCLUDEDIR)/dlg_keys.h
+ $(RM) $(INCLUDEDIR)/dlg_config.h
+
+install-lib :: $(MAN3DIR)
+ $(INSTALL_DATA) $(srcdir)/dialog.3 $(MAN3DIR)/$(PACKAGE).3
+
+uninstall-lib ::
+ $(RM) $(MAN3DIR)/$(PACKAGE).3
+
+headers.sed : $(srcdir)/headers-sh
+ $(SHELL) $(srcdir)/headers-sh $(INCLUDEDIR) $(srcdir)
+
+$(MAN1DIR) \
+$(MAN3DIR) \
+$(BINDIR) \
+$(INCLUDEDIR) \
+$(LIBDIR) : ; $(srcdir)/mkdirs.sh $@
+
+@MAKE_LOWER_TAGS@tags :
+@MAKE_LOWER_TAGS@ ctags $(SRCS) $(HDRS)
+
+@MAKE_LOWER_TAGS@TAGS :
+@MAKE_LOWER_TAGS@ etags $(SRCS) $(HDRS)
+
+update-po:
+ rsync -Lrtvz translationproject.org::tp/latest/dialog/ $(PO_DIR)
+ test -f $(PO_DIR)/makefile && cd $(PO_DIR) && $(MAKE) $@
+
+lint:
+ $(LINT) $(CPPFLAGS) *.c
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/menubox.c b/Build/source/utils/dialog/dialog-1.1-20080819/menubox.c
new file mode 100644
index 00000000000..8a844f84662
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/menubox.c
@@ -0,0 +1,808 @@
+/*
+ * $Id: menubox.c,v 1.115 2008/06/20 00:54:16 tom Exp $
+ *
+ * menubox.c -- implements the menu box
+ *
+ * Copyright 2000-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public Licens, version 2.1e
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors
+ * Savio Lam (lam836@cs.cuhk.hk)
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+static int menu_width, tag_x, item_x;
+
+typedef enum {
+ Unselected = 0,
+ Selected,
+ Editing
+} Mode;
+
+#define MIN_HIGH (1 + (5 * MARGIN))
+
+#define INPUT_ROWS 3 /* rows per inputmenu entry */
+
+#define LLEN(n) ((n) * MENUBOX_TAGS)
+#define ItemName(i) items[LLEN(i)]
+#define ItemText(i) items[LLEN(i) + 1]
+#define ItemHelp(i) items[LLEN(i) + 2]
+
+#define RowHeight(i) (is_inputmenu ? ((i) * INPUT_ROWS) : ((i) * 1))
+#define ItemToRow(i) (is_inputmenu ? ((i) * INPUT_ROWS + 1) : (i))
+#define RowToItem(i) (is_inputmenu ? ((i) / INPUT_ROWS + 0) : (i))
+
+static void
+print_arrows(WINDOW *win,
+ int box_x,
+ int box_y,
+ int scrollamt,
+ int max_choice,
+ int item_no,
+ int menu_height)
+{
+ dlg_draw_arrows(win, scrollamt,
+ scrollamt + max_choice < item_no,
+ box_x + tag_x + 1,
+ box_y,
+ box_y + menu_height + 1);
+}
+
+/*
+ * Print the tag of a menu-item
+ */
+static void
+print_tag(WINDOW *win,
+ DIALOG_LISTITEM * item,
+ int choice,
+ Mode selected,
+ bool is_inputmenu)
+{
+ int my_x = item_x;
+ int my_y = ItemToRow(choice);
+ int tag_width = (my_x - tag_x - GUTTER);
+ const int *cols;
+ const int *indx;
+ int limit;
+ unsigned prefix;
+
+ cols = dlg_index_columns(item->name);
+ indx = dlg_index_wchars(item->name);
+ limit = dlg_count_wchars(item->name);
+ prefix = indx[1] - indx[0];
+
+ /* highlight first char of the tag to be special */
+ (void) wmove(win, my_y, tag_x);
+ wattrset(win, selected ? tag_key_selected_attr : tag_key_attr);
+ if (strlen(item->name) != 0)
+ (void) waddnstr(win, item->name, prefix);
+ /* print rest of the string */
+ wattrset(win, selected ? tag_selected_attr : tag_attr);
+ if (strlen(item->name) > prefix) {
+ limit = dlg_limit_columns(item->name, tag_width, 1);
+ if (limit > 0)
+ (void) waddnstr(win, item->name + indx[1], indx[limit] - indx[1]);
+ }
+}
+
+/*
+ * Print menu item
+ */
+static void
+print_item(WINDOW *win,
+ DIALOG_LISTITEM * items,
+ int choice,
+ Mode selected,
+ bool is_inputmenu)
+{
+ chtype save = getattrs(win);
+ int n;
+ int my_width = menu_width;
+ int my_x = item_x;
+ int my_y = ItemToRow(choice);
+ chtype attr = A_NORMAL;
+ chtype textchar;
+ chtype bordchar;
+
+ switch (selected) {
+ default:
+ case Unselected:
+ textchar = item_attr;
+ bordchar = item_attr;
+ break;
+ case Selected:
+ textchar = item_selected_attr;
+ bordchar = item_selected_attr;
+ break;
+ case Editing:
+ textchar = inputbox_attr;
+ bordchar = dialog_attr;
+ break;
+ }
+
+ /* Clear 'residue' of last item and mark current current item */
+ if (is_inputmenu) {
+ wattrset(win, (selected != Unselected) ? item_selected_attr : item_attr);
+ for (n = my_y - 1; n < my_y + INPUT_ROWS - 1; n++) {
+ wmove(win, n, 0);
+ wprintw(win, "%*s", my_width, " ");
+ }
+ } else {
+ wattrset(win, menubox_attr);
+ wmove(win, my_y, 0);
+ wprintw(win, "%*s", my_width, " ");
+ }
+
+ print_tag(win, items, choice, selected, is_inputmenu);
+
+ /* Draw the input field box (only for inputmenu) */
+ (void) wmove(win, my_y, my_x);
+ if (is_inputmenu) {
+ my_width -= 1;
+ dlg_draw_box(win, my_y - 1, my_x, INPUT_ROWS, my_width - my_x - tag_x,
+ bordchar,
+ bordchar);
+ my_width -= 1;
+ ++my_x;
+ }
+
+ /* print actual item */
+ wmove(win, my_y, my_x);
+ wattrset(win, textchar);
+ dlg_print_text(win, items->text, my_width - my_x, &attr);
+
+ if (selected) {
+ dlg_item_help(items->help);
+ }
+ wattrset(win, save);
+}
+
+/*
+ * Allow the user to edit the text of a menu entry.
+ */
+static int
+input_menu_edit(WINDOW *win,
+ DIALOG_LISTITEM * items,
+ int choice,
+ char **resultp)
+{
+ chtype save = getattrs(win);
+ char *result;
+ int offset = 0;
+ int key = 0, fkey = 0;
+ int first = TRUE;
+ /* see above */
+ bool is_inputmenu = TRUE;
+ int y = ItemToRow(choice);
+ int code = TRUE;
+ int max_len = dlg_max_input(MAX(strlen(items->text) + 1, MAX_LEN));
+
+ result = dlg_malloc(char, max_len);
+ assert_ptr(result, "input_menu_edit");
+
+ /* original item is used to initialize the input string. */
+ result[0] = '\0';
+ strcpy(result, items->text);
+
+ print_item(win, items, choice, Editing, TRUE);
+
+ /* taken out of inputbox.c - but somewhat modified */
+ for (;;) {
+ if (!first)
+ key = dlg_mouse_wgetch(win, &fkey);
+ if (dlg_edit_string(result, &offset, key, fkey, first)) {
+ dlg_show_string(win, result, offset, inputbox_attr,
+ y, item_x + 1, menu_width - item_x - 3,
+ FALSE, first);
+ first = FALSE;
+ } else if (key == ESC || key == TAB) {
+ code = FALSE;
+ break;
+ } else {
+ break;
+ }
+ }
+ print_item(win, items, choice, Selected, TRUE);
+ wattrset(win, save);
+
+ *resultp = result;
+ return code;
+}
+
+static int
+handle_button(int code, DIALOG_LISTITEM * items, int choice)
+{
+ switch (code) {
+ case DLG_EXIT_OK: /* FALLTHRU */
+ case DLG_EXIT_EXTRA:
+ dlg_add_string(items[choice].name);
+ break;
+ case DLG_EXIT_HELP:
+ dlg_add_result("HELP ");
+ if (USE_ITEM_HELP(items[choice].help)) {
+ dlg_add_string(items[choice].help);
+ code = DLG_EXIT_ITEM_HELP;
+ } else {
+ dlg_add_string(items[choice].name);
+ }
+ break;
+ }
+ return code;
+}
+
+static int
+dlg_renamed_menutext(DIALOG_LISTITEM * items, int current, char *newtext)
+{
+ if (dialog_vars.input_result)
+ dialog_vars.input_result[0] = '\0';
+ dlg_add_result("RENAMED ");
+ dlg_add_string(items[current].name);
+ dlg_add_result(" ");
+ dlg_add_string(newtext);
+ return DLG_EXIT_EXTRA;
+}
+
+static int
+dlg_dummy_menutext(DIALOG_LISTITEM * items, int current, char *newtext)
+{
+ (void) items;
+ (void) current;
+ (void) newtext;
+ return DLG_EXIT_ERROR;
+}
+
+/*
+ * This is an alternate interface to 'menu' which allows the application
+ * to read the list item states back directly without putting them in the
+ * output buffer.
+ */
+int
+dlg_menu(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int menu_height,
+ int item_no,
+ DIALOG_LISTITEM * items,
+ int *current_item,
+ DIALOG_INPUTMENU rename_menutext)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, ' ' ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, '+' ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, CHR_NEXT ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, '-' ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, CHR_PREVIOUS ),
+ DLG_KEYS_DATA( DLGK_PAGE_FIRST, KEY_HOME ),
+ DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_END ),
+ DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_LL ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ),
+ END_KEYS_BINDING
+ };
+ static DLG_KEYS_BINDING binding2[] = {
+ INPUTSTR_BINDINGS,
+ ENTERKEY_BINDINGS,
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+ int i, j, x, y, cur_x, cur_y, box_x, box_y;
+ int key = 0, fkey;
+ int button = dialog_state.visit_items ? -1 : dlg_defaultno_button();
+ int choice = dlg_default_listitem(items);
+ int result = DLG_EXIT_UNKNOWN;
+ int scrollamt = 0;
+ int max_choice, min_width;
+ int found;
+ int use_height, use_width, name_width, text_width;
+ WINDOW *dialog, *menu;
+ char *prompt = dlg_strclone(cprompt);
+ const char **buttons = dlg_ok_labels();
+ bool is_inputmenu = (rename_menutext == dlg_renamed_menutext);
+
+ dlg_does_output();
+ dlg_tab_correct_str(prompt);
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+
+ use_height = menu_height;
+ if (use_height == 0) {
+ min_width = dlg_calc_list_width(item_no, items) + 10;
+ /* calculate height without items (4) */
+ dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MAX(26, min_width));
+ dlg_calc_listh(&height, &use_height, item_no);
+ } else {
+ dlg_auto_size(title, prompt, &height, &width, MIN_HIGH + use_height, 26);
+ }
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+ dialog = dlg_new_window(height, width, y, x);
+ dlg_register_window(dialog, "menubox", binding);
+ dlg_register_buttons(dialog, "menubox", buttons);
+
+ dlg_mouse_setbase(x, y);
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+ dlg_print_autowrap(dialog, prompt, height, width);
+
+ menu_width = width - 6;
+ getyx(dialog, cur_y, cur_x);
+ box_y = cur_y + 1;
+ box_x = (width - menu_width) / 2 - 1;
+
+ /*
+ * After displaying the prompt, we know how much space we really have.
+ * Limit the list to avoid overwriting the ok-button.
+ */
+ if (use_height + MIN_HIGH > height - cur_y)
+ use_height = height - MIN_HIGH - cur_y;
+ if (use_height <= 0)
+ use_height = 1;
+
+ /* Find out maximal number of displayable items at once. */
+ max_choice = MIN(use_height,
+ RowHeight(item_no));
+ if (is_inputmenu)
+ max_choice /= INPUT_ROWS;
+
+ /* create new window for the menu */
+ menu = dlg_sub_window(dialog, use_height, menu_width,
+ y + box_y + 1,
+ x + box_x + 1);
+ dlg_register_window(menu, "menu", binding2);
+ dlg_register_buttons(menu, "menu", buttons);
+
+ /* draw a box around the menu items */
+ dlg_draw_box(dialog, box_y, box_x, use_height + 2, menu_width + 2,
+ menubox_border_attr, menubox_attr);
+
+ name_width = 0;
+ text_width = 0;
+
+ /* Find length of longest item to center menu *
+ * only if --menu was given, using --inputmenu *
+ * won't be centered. */
+ for (i = 0; i < item_no; i++) {
+ name_width = MAX(name_width, dlg_count_columns(items[i].name));
+ text_width = MAX(text_width, dlg_count_columns(items[i].text));
+ }
+
+ /* If the name+text is wider than the list is allowed, then truncate
+ * one or both of them. If the name is no wider than 30% of the list,
+ * leave it intact.
+ *
+ * FIXME: the gutter width and name/list ratio should be configurable.
+ */
+ use_width = (menu_width - GUTTER);
+ if (text_width + name_width > use_width) {
+ int need = (int) (0.30 * use_width);
+ if (name_width > need) {
+ int want = (int) (use_width
+ * ((double) name_width)
+ / (text_width + name_width));
+ name_width = (want > need) ? want : need;
+ }
+ text_width = use_width - name_width;
+ }
+
+ tag_x = (is_inputmenu
+ ? 0
+ : (use_width - text_width - name_width) / 2);
+ item_x = name_width + tag_x + GUTTER;
+
+ if (choice - scrollamt >= max_choice) {
+ scrollamt = choice - (max_choice - 1);
+ choice = max_choice - 1;
+ }
+
+ /* Print the menu */
+ for (i = 0; i < max_choice; i++) {
+ print_item(menu,
+ &items[i + scrollamt],
+ i,
+ (i == choice) ? Selected : Unselected,
+ is_inputmenu);
+ }
+ (void) wnoutrefresh(menu);
+
+ /* register the new window, along with its borders */
+ dlg_mouse_mkbigregion(box_y + 1, box_x, use_height + 2, menu_width + 2,
+ KEY_MAX, 1, 1, 1 /* by lines */ );
+
+ print_arrows(dialog, box_x, box_y, scrollamt, max_choice, item_no, use_height);
+
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
+
+ while (result == DLG_EXIT_UNKNOWN) {
+ if (button < 0) /* --visit-items */
+ wmove(dialog, box_y + ItemToRow(choice) + 1, box_x + tag_x + 1);
+
+ key = dlg_mouse_wgetch(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+
+ found = FALSE;
+ if (fkey) {
+ /*
+ * Allow a mouse-click on a box to switch selection to that box.
+ * Handling a button click is a little more complicated, since we
+ * push a KEY_ENTER back onto the input stream so we'll put the
+ * cursor at the right place before handling the "keypress".
+ */
+ if (key >= DLGK_MOUSE(KEY_MAX)) {
+ key -= DLGK_MOUSE(KEY_MAX);
+ i = RowToItem(key);
+ if (i < max_choice) {
+ found = TRUE;
+ } else {
+ beep();
+ continue;
+ }
+ } else if (is_DLGK_MOUSE(key)
+ && dlg_ok_buttoncode(key - M_EVENT) >= 0) {
+ button = (key - M_EVENT);
+ ungetch('\n');
+ continue;
+ }
+ } else {
+ /*
+ * Check if key pressed matches first character of any item tag in
+ * list. If there is more than one match, we will cycle through
+ * each one as the same key is pressed repeatedly.
+ */
+ if (button < 0 || !dialog_state.visit_items) {
+ for (j = scrollamt + choice + 1; j < item_no; j++) {
+ if (dlg_match_char(dlg_last_getc(), items[j].name)) {
+ found = TRUE;
+ i = j - scrollamt;
+ break;
+ }
+ }
+ if (!found) {
+ for (j = 0; j <= scrollamt + choice; j++) {
+ if (dlg_match_char(dlg_last_getc(), items[j].name)) {
+ found = TRUE;
+ i = j - scrollamt;
+ break;
+ }
+ }
+ }
+ if (found)
+ dlg_flush_getc();
+ } else if ((j = dlg_char_to_button(key, buttons)) >= 0) {
+ button = j;
+ ungetch('\n');
+ continue;
+ }
+
+ /*
+ * A single digit (1-9) positions the selection to that line in the
+ * current screen.
+ */
+ if (!found
+ && (key <= '9')
+ && (key > '0')
+ && (key - '1' < max_choice)) {
+ found = TRUE;
+ i = key - '1';
+ }
+ }
+
+ if (!found && fkey) {
+ found = TRUE;
+ switch (key) {
+ case DLGK_PAGE_FIRST:
+ i = -scrollamt;
+ break;
+ case DLGK_PAGE_LAST:
+ i = item_no - 1 - scrollamt;
+ break;
+ case DLGK_MOUSE(KEY_PPAGE):
+ case DLGK_PAGE_PREV:
+ if (choice)
+ i = 0;
+ else if (scrollamt != 0)
+ i = -MIN(scrollamt, max_choice);
+ else
+ continue;
+ break;
+ case DLGK_MOUSE(KEY_NPAGE):
+ case DLGK_PAGE_NEXT:
+ i = MIN(choice + max_choice, item_no - scrollamt - 1);
+ break;
+ case DLGK_ITEM_PREV:
+ i = choice - 1;
+ if (choice == 0 && scrollamt == 0)
+ continue;
+ break;
+ case DLGK_ITEM_NEXT:
+ i = choice + 1;
+ if (scrollamt + choice >= item_no - 1)
+ continue;
+ break;
+ default:
+ found = FALSE;
+ break;
+ }
+ }
+
+ if (found) {
+ if (i != choice) {
+ getyx(dialog, cur_y, cur_x);
+ if (i < 0 || i >= max_choice) {
+#if defined(NCURSES_VERSION_MAJOR) && NCURSES_VERSION_MAJOR < 5
+ /*
+ * Using wscrl to assist ncurses scrolling is not needed
+ * in version 5.x
+ */
+ if (i == -1) {
+ if (use_height > 1) {
+ /* De-highlight current first item */
+ print_item(menu,
+ &items[scrollamt],
+ 0, Unselected, is_inputmenu);
+ scrollok(menu, TRUE);
+ wscrl(menu, -RowHeight(1));
+ scrollok(menu, FALSE);
+ }
+ scrollamt--;
+ print_item(menu,
+ &items[scrollamt],
+ 0, Selected, is_inputmenu);
+ } else if (i == max_choice) {
+ if (use_height > 1) {
+ /* De-highlight current last item before scrolling up */
+ print_item(menu,
+ &items[scrollamt + max_choice - 1],
+ max_choice - 1,
+ Unselected,
+ is_inputmenu);
+ scrollok(menu, TRUE);
+ wscrl(menu, RowHeight(1));
+ scrollok(menu, FALSE);
+ }
+ scrollamt++;
+ print_item(menu,
+ &items[scrollamt + max_choice - 1],
+ max_choice - 1, TRUE,
+ is_inputmenu);
+ } else
+#endif
+ {
+ if (i < 0) {
+ scrollamt += i;
+ choice = 0;
+ } else {
+ choice = max_choice - 1;
+ scrollamt += (i - max_choice + 1);
+ }
+ for (i = 0; i < max_choice; i++) {
+ print_item(menu,
+ &items[scrollamt + i],
+ i,
+ (i == choice) ? Selected : Unselected,
+ is_inputmenu);
+ }
+ }
+ /* Clean bottom lines */
+ if (is_inputmenu) {
+ int spare_lines, x_count;
+ spare_lines = use_height % INPUT_ROWS;
+ wattrset(menu, menubox_attr);
+ for (; spare_lines; spare_lines--) {
+ wmove(menu, use_height - spare_lines, 0);
+ for (x_count = 0; x_count < menu_width;
+ x_count++) {
+ waddch(menu, ' ');
+ }
+ }
+ }
+ (void) wnoutrefresh(menu);
+ print_arrows(dialog,
+ box_x, box_y,
+ scrollamt, max_choice, item_no, use_height);
+ } else {
+ /* De-highlight current item */
+ print_item(menu,
+ &items[scrollamt + choice],
+ choice,
+ Unselected,
+ is_inputmenu);
+ /* Highlight new item */
+ choice = i;
+ print_item(menu,
+ &items[scrollamt + choice],
+ choice,
+ Selected,
+ is_inputmenu);
+ (void) wnoutrefresh(menu);
+ (void) wmove(dialog, cur_y, cur_x);
+ wrefresh(dialog);
+ }
+ }
+ continue; /* wait for another key press */
+ }
+
+ if (fkey) {
+ switch (key) {
+ case DLGK_FIELD_PREV:
+ button = dlg_prev_button(buttons, button);
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_FIELD_NEXT:
+ button = dlg_next_button(buttons, button);
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_ENTER:
+ result = dlg_ok_buttoncode(button);
+
+ /*
+ * If dlg_menu() is called from dialog_menu(), we want to
+ * capture the results into dialog_vars.input_result, but not
+ * if dlg_menu() is called directly from an application. We
+ * can check this by testing if rename_menutext is the function
+ * pointer owned by dialog_menu(). It would be nicer to have
+ * this logic inside dialog_menu(), but that cannot be done
+ * since we would lose compatibility for the results reported
+ * after input_menu_edit().
+ */
+ if (result == DLG_EXIT_ERROR) {
+ result = DLG_EXIT_UNKNOWN;
+ } else if (is_inputmenu
+ || rename_menutext == dlg_dummy_menutext) {
+ result = handle_button(result,
+ items,
+ scrollamt + choice);
+ }
+
+ /*
+ * If we have a rename_menutext function, interpret the Extra
+ * button as a request to rename the menu's text. If that
+ * function doesn't return "Unknown", we will exit from this
+ * function. Usually that is done for dialog_menu(), so the
+ * shell script can use the updated value. If it does return
+ * "Unknown", update the list item only. A direct caller of
+ * dlg_menu() can free the renamed value - we cannot.
+ */
+ if (is_inputmenu && result == DLG_EXIT_EXTRA) {
+ char *tmp;
+
+ if (input_menu_edit(menu,
+ &items[scrollamt + choice],
+ choice,
+ &tmp)) {
+ result = rename_menutext(items, scrollamt + choice, tmp);
+ if (result == DLG_EXIT_UNKNOWN) {
+ items[scrollamt + choice].text = tmp;
+ } else {
+ free(tmp);
+ }
+ } else {
+ result = DLG_EXIT_UNKNOWN;
+ print_item(menu,
+ &items[scrollamt + choice],
+ choice,
+ Selected,
+ is_inputmenu);
+ (void) wnoutrefresh(menu);
+ free(tmp);
+ }
+
+ if (result == DLG_EXIT_UNKNOWN) {
+ dlg_draw_buttons(dialog, height - 2, 0,
+ buttons, button, FALSE, width);
+ }
+ }
+ break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ /* reset data */
+ height = old_height;
+ width = old_width;
+ /* repaint */
+ dlg_clear();
+ dlg_del_window(dialog);
+ refresh();
+ dlg_mouse_free_regions();
+ goto retry;
+#endif
+ default:
+ flash();
+ break;
+ }
+ }
+ }
+
+ dlg_mouse_free_regions();
+ dlg_unregister_window(menu);
+ dlg_del_window(dialog);
+ free(prompt);
+
+ *current_item = scrollamt + choice;
+ return result;
+}
+
+/*
+ * Display a menu for choosing among a number of options
+ */
+int
+dialog_menu(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int menu_height,
+ int item_no,
+ char **items)
+{
+ int result;
+ int choice;
+ int i;
+ DIALOG_LISTITEM *listitems;
+
+ listitems = dlg_calloc(DIALOG_LISTITEM, item_no + 1);
+ assert_ptr(listitems, "dialog_menu");
+
+ for (i = 0; i < item_no; ++i) {
+ listitems[i].name = ItemName(i);
+ listitems[i].text = ItemText(i);
+ listitems[i].help = ((dialog_vars.item_help)
+ ? ItemHelp(i)
+ : dlg_strempty());
+ }
+ dlg_align_columns(&listitems[0].text, sizeof(DIALOG_LISTITEM), item_no);
+
+ result = dlg_menu(title,
+ cprompt,
+ height,
+ width,
+ menu_height,
+ item_no,
+ listitems,
+ &choice,
+ dialog_vars.input_menu ? dlg_renamed_menutext : dlg_dummy_menutext);
+
+ dlg_free_columns(&listitems[0].text, sizeof(DIALOG_LISTITEM), item_no);
+ free(listitems);
+ return result;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/mixedform.c b/Build/source/utils/dialog/dialog-1.1-20080819/mixedform.c
new file mode 100644
index 00000000000..aa2851056d1
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/mixedform.c
@@ -0,0 +1,121 @@
+/*
+ * $Id: mixedform.c,v 1.7 2008/06/21 12:11:42 tom Exp $
+ *
+ * formbox.c -- implements the form (i.e, some pairs label/editbox)
+ *
+ * Copyright 2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * This is inspired by a patch from Kiran Cherupally
+ * (but different interface design).
+ */
+
+#include <dialog.h>
+
+#define LLEN(n) ((n) * MIXEDFORM_TAGS)
+
+#define ItemName(i) items[LLEN(i) + 0]
+#define ItemNameY(i) items[LLEN(i) + 1]
+#define ItemNameX(i) items[LLEN(i) + 2]
+#define ItemText(i) items[LLEN(i) + 3]
+#define ItemTextY(i) items[LLEN(i) + 4]
+#define ItemTextX(i) items[LLEN(i) + 5]
+#define ItemTextFLen(i) items[LLEN(i) + 6]
+#define ItemTextILen(i) items[LLEN(i) + 7]
+#define ItemTypep(i) items[LLEN(i) + 8]
+#define ItemHelp(i) (dialog_vars.item_help ? items[LLEN(i) + 9] : dlg_strempty())
+
+int
+dialog_mixedform(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int form_height,
+ int item_no,
+ char **items)
+{
+ int result;
+ int choice;
+ int i;
+ DIALOG_FORMITEM *listitems;
+ DIALOG_VARS save_vars;
+ bool show_status = FALSE;
+
+ dlg_save_vars(&save_vars);
+ dialog_vars.separate_output = TRUE;
+
+ listitems = dlg_calloc(DIALOG_FORMITEM, item_no + 1);
+ assert_ptr(listitems, "dialog_mixedform");
+
+ for (i = 0; i < item_no; ++i) {
+ listitems[i].type = dialog_vars.formitem_type;
+ listitems[i].name = ItemName(i);
+ listitems[i].name_len = strlen(ItemName(i));
+ listitems[i].name_y = dlg_ordinate(ItemNameY(i));
+ listitems[i].name_x = dlg_ordinate(ItemNameX(i));
+ listitems[i].text = ItemText(i);
+ listitems[i].text_len = strlen(ItemText(i));
+ listitems[i].text_y = dlg_ordinate(ItemTextY(i));
+ listitems[i].text_x = dlg_ordinate(ItemTextX(i));
+ listitems[i].text_flen = atoi(ItemTextFLen(i));
+ listitems[i].text_ilen = atoi(ItemTextILen(i));
+ listitems[i].help = (dialog_vars.item_help ? ItemHelp(i) :
+ dlg_strempty());
+ listitems[i].type = atoi(ItemTypep(i));
+ }
+
+ result = dlg_form(title,
+ cprompt,
+ height,
+ width,
+ form_height,
+ item_no,
+ listitems,
+ &choice);
+
+ switch (result) {
+ case DLG_EXIT_OK: /* FALLTHRU */
+ case DLG_EXIT_EXTRA:
+ show_status = TRUE;
+ break;
+ case DLG_EXIT_HELP:
+ dlg_add_result("HELP ");
+ show_status = dialog_vars.help_status;
+ if (USE_ITEM_HELP(listitems[choice].help)) {
+ dlg_add_string(listitems[choice].help);
+ result = DLG_EXIT_ITEM_HELP;
+ } else {
+ dlg_add_string(listitems[choice].name);
+ }
+ if (show_status)
+ dlg_add_separator();
+ break;
+ }
+ if (show_status) {
+ for (i = 0; i < item_no; i++) {
+ if (listitems[i].text_flen > 0) {
+ dlg_add_string(listitems[i].text);
+ dlg_add_separator();
+ }
+ }
+ }
+
+ dlg_free_formitems(listitems);
+ dlg_restore_vars(&save_vars);
+
+ return result;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/mixedgauge.c b/Build/source/utils/dialog/dialog-1.1-20080819/mixedgauge.c
new file mode 100644
index 00000000000..4ff87907300
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/mixedgauge.c
@@ -0,0 +1,393 @@
+/*
+ * $Id: mixedgauge.c,v 1.17 2007/09/30 21:14:38 tom Exp $
+ *
+ * mixedgauge.c -- implements the mixedgauge dialog
+ *
+ * Copyright 2007 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * This is inspired by a patch from Kiran Cherupally
+ * (but different interface design).
+ */
+
+#include <dialog.h>
+
+#define LLEN(n) ((n) * MIXEDGAUGE_TAGS)
+#define ItemData(i) &items[LLEN(i)]
+#define ItemName(i) items[LLEN(i)]
+#define ItemText(i) items[LLEN(i) + 1]
+
+#define MIN_HIGH (4)
+#define MIN_WIDE (10 + 2 * (2 + MARGIN))
+
+typedef struct {
+ WINDOW *dialog;
+ WINDOW *caption;
+ const char *title;
+ char *prompt;
+ int height, old_height, min_height;
+ int width, old_width, min_width;
+ int len_name, len_text;
+ int item_no;
+ DIALOG_LISTITEM *list;
+} DIALOG_MIXEDGAUGE;
+
+static char *
+status_string(char *given, bool * freeMe)
+{
+ char *result;
+
+ *freeMe = FALSE;
+ if (isdigit(UCH(*given))) {
+ switch (*given) {
+ case '0':
+ result = _("Succeeded");
+ break;
+ case '1':
+ result = _("Failed");
+ break;
+ case '2':
+ result = _("Passed");
+ break;
+ case '3':
+ result = _("Completed");
+ break;
+ case '4':
+ result = _("Checked");
+ break;
+ case '5':
+ result = _("Done");
+ break;
+ case '6':
+ result = _("Skipped");
+ break;
+ case '7':
+ result = _("In Progress");
+ break;
+ case '8':
+ result = "";
+ break;
+ case '9':
+ result = _("N/A");
+ break;
+ default:
+ result = "?";
+ break;
+ }
+ } else if (*given == '-') {
+ unsigned need = strlen(++given);
+ char *temp = dlg_malloc(char, need);
+ *freeMe = TRUE;
+ sprintf(temp, "%3s%%", given);
+ result = temp;
+ } else if (!isspace(UCH(*given))) {
+ result = given;
+ } else {
+ result = 0;
+ }
+ return result;
+}
+
+/* This function displays status messages */
+static void
+myprint_status(DIALOG_MIXEDGAUGE * dlg)
+{
+ WINDOW *win = dlg->dialog;
+ int limit_y = dlg->height;
+ int limit_x = dlg->width;
+
+ int y = MARGIN;
+ int item;
+ int cells = dlg->len_text - 2;
+ int rm = limit_x; /* right margin */
+ int lm = limit_x - dlg->len_text - 1;
+ int bm = limit_y; /* bottom margin */
+ int last_y = 0, last_x = 0;
+ int j, xxx;
+ float percent;
+ char *status = "";
+ bool freeMe;
+
+ if (win) {
+ rm -= (2 * MARGIN);
+ bm -= (2 * MARGIN);
+ }
+ if (win != 0)
+ getyx(win, last_y, last_x);
+ for (item = 0; item < dlg->item_no; ++item) {
+ chtype attr = A_NORMAL;
+
+ y = item + MARGIN + 1;
+ if (y > bm)
+ break;
+
+ status = status_string(dlg->list[item].text, &freeMe);
+ if (status == 0 || *status == 0)
+ continue;
+
+ (void) wmove(win, y, 2 * MARGIN);
+ dlg_print_text(win, dlg->list[item].name, lm, &attr);
+
+ (void) wmove(win, y, lm);
+ (void) waddch(win, '[');
+ (void) wmove(win, y, lm + (cells - strlen(status)) / 2);
+ if (freeMe) {
+ (void) wmove(win, y, lm + 1);
+ wattrset(win, title_attr);
+ for (j = 0; j < cells; j++)
+ (void) waddch(win, ' ');
+
+ (void) wmove(win, y, lm + (cells - strlen(status)) / 2);
+ (void) waddstr(win, status);
+
+ if ((title_attr & A_REVERSE) != 0) {
+ wattroff(win, A_REVERSE);
+ } else {
+ wattrset(win, A_REVERSE);
+ }
+ (void) wmove(win, y, lm + 1);
+
+ if (sscanf(status, "%f%%", &percent) != 1)
+ percent = 0.0;
+ xxx = (int) ((cells * (percent + 0.5)) / 100.0);
+ for (j = 0; j < xxx; j++) {
+ chtype ch1 = winch(win);
+ if (title_attr & A_REVERSE) {
+ ch1 &= ~A_REVERSE;
+ }
+ (void) waddch(win, ch1);
+ }
+ free(status);
+
+ } else {
+ (void) wmove(win, y, lm + (cells - strlen(status)) / 2);
+ (void) waddstr(win, status);
+ }
+ (void) wmove(win, y, limit_x - 3);
+ (void) waddch(win, ']');
+ (void) wnoutrefresh(win);
+ }
+}
+
+static void
+mydraw_mixed_box(WINDOW *win, int y, int x, int height, int width,
+ chtype boxchar, chtype borderchar)
+{
+ dlg_draw_box(win, y, x, height, width, boxchar, borderchar);
+ {
+ chtype attr = A_NORMAL;
+ char *message = _("Overall Progress");
+ chtype save2 = getattrs(win);
+ wattrset(win, title_attr);
+ (void) wmove(win, y, x + 2);
+ dlg_print_text(win, message, width, &attr);
+ wattrset(win, save2);
+ }
+}
+
+static char *
+clean_copy(const char *string)
+{
+ char *result = dlg_strclone(string);
+
+ dlg_trim_string(result);
+ dlg_tab_correct_str(result);
+ return result;
+}
+
+/*
+ * Update mixed-gauge dialog (may be from pipe, may be via direct calls).
+ */
+static void
+dlg_update_mixedgauge(DIALOG_MIXEDGAUGE * dlg, int percent)
+{
+ int i, x;
+
+ /*
+ * Clear the area for the progress bar by filling it with spaces
+ * in the title-attribute, and write the percentage with that
+ * attribute.
+ */
+ (void) wmove(dlg->dialog, dlg->height - 3, 4);
+ wattrset(dlg->dialog, title_attr);
+
+ for (i = 0; i < (dlg->width - 2 * (3 + MARGIN)); i++)
+ (void) waddch(dlg->dialog, ' ');
+
+ (void) wmove(dlg->dialog, dlg->height - 3, (dlg->width / 2) - 2);
+ (void) wprintw(dlg->dialog, "%3d%%", percent);
+
+ /*
+ * Now draw a bar in reverse, relative to the background.
+ * The window attribute was useful for painting the background,
+ * but requires some tweaks to reverse it.
+ */
+ x = (percent * (dlg->width - 2 * (3 + MARGIN))) / 100;
+ if ((title_attr & A_REVERSE) != 0) {
+ wattroff(dlg->dialog, A_REVERSE);
+ } else {
+ wattrset(dlg->dialog, A_REVERSE);
+ }
+ (void) wmove(dlg->dialog, dlg->height - 3, 4);
+ for (i = 0; i < x; i++) {
+ chtype ch = winch(dlg->dialog);
+ if (title_attr & A_REVERSE) {
+ ch &= ~A_REVERSE;
+ }
+ (void) waddch(dlg->dialog, ch);
+ }
+ myprint_status(dlg);
+}
+
+/*
+ * Setup dialog.
+ */
+static void
+dlg_begin_mixedgauge(DIALOG_MIXEDGAUGE * dlg,
+ int *began,
+ const char *aTitle,
+ const char *aPrompt,
+ int aHeight,
+ int aWidth,
+ int aItemNo,
+ char **items)
+{
+ int n, y, x;
+
+ if (!*began) {
+ curs_set(0);
+
+ memset(dlg, 0, sizeof(*dlg));
+ dlg->title = aTitle;
+ dlg->prompt = clean_copy(aPrompt);
+ dlg->height = dlg->old_height = aHeight;
+ dlg->width = dlg->old_width = aWidth;
+ dlg->item_no = aItemNo;
+
+ dlg->list = dlg_calloc(DIALOG_LISTITEM, aItemNo);
+ assert_ptr(dlg->list, "dialog_mixedgauge");
+
+ dlg->len_name = 0;
+ dlg->len_text = 15;
+
+ for (n = 0; n < aItemNo; ++n) {
+ int thisWidth = strlen(ItemName(n));
+ if (dlg->len_name < thisWidth)
+ dlg->len_name = thisWidth;
+ dlg->list[n].name = ItemName(n);
+ dlg->list[n].text = ItemText(n);
+ }
+
+ dlg->min_height = MIN_HIGH + aItemNo;
+ dlg->min_width = MIN_WIDE + dlg->len_name + GUTTER + dlg->len_text;
+
+ if (dlg->prompt != 0 && *(dlg->prompt) != 0)
+ dlg->min_height += (2 * MARGIN);
+#ifdef KEY_RESIZE
+ nodelay(stdscr, TRUE);
+#endif
+ }
+#ifdef KEY_RESIZE
+ else {
+ dlg_del_window(dlg->dialog);
+ dlg->height = dlg->old_height;
+ dlg->width = dlg->old_width;
+ }
+#endif
+
+ dlg_auto_size(dlg->title, dlg->prompt,
+ &(dlg->height),
+ &(dlg->width),
+ dlg->min_height,
+ dlg->min_width);
+ dlg_print_size(dlg->height, dlg->width);
+ dlg_ctl_size(dlg->height, dlg->width);
+
+ /* center dialog box on screen */
+ x = dlg_box_x_ordinate(dlg->width);
+ y = dlg_box_y_ordinate(dlg->height);
+
+ dlg->dialog = dlg_new_window(dlg->height, dlg->width, y, x);
+
+ (void) werase(dlg->dialog);
+ dlg_draw_box(dlg->dialog,
+ 0, 0,
+ dlg->height,
+ dlg->width,
+ dialog_attr, border_attr);
+
+ dlg_draw_title(dlg->dialog, dlg->title);
+
+ if ((dlg->prompt != 0 && *(dlg->prompt) != 0)
+ && wmove(dlg->dialog, dlg->item_no, 0) != ERR) {
+ dlg->caption = dlg_sub_window(dlg->dialog,
+ dlg->height - dlg->item_no - (2 * MARGIN),
+ dlg->width,
+ y + dlg->item_no + (2 * MARGIN),
+ x);
+ wattrset(dlg->caption, dialog_attr);
+ dlg_print_autowrap(dlg->caption, dlg->prompt, dlg->height, dlg->width);
+ }
+
+ mydraw_mixed_box(dlg->dialog,
+ dlg->height - 4,
+ 2 + MARGIN,
+ 2 + MARGIN,
+ dlg->width - 2 * (2 + MARGIN),
+ dialog_attr,
+ border_attr);
+
+ *began += 1;
+}
+
+/*
+ * Discard the mixed-gauge dialog.
+ */
+static int
+dlg_finish_mixedgauge(DIALOG_MIXEDGAUGE * dlg, int status)
+{
+ (void) wrefresh(dlg->dialog);
+#ifdef KEY_RESIZE
+ nodelay(stdscr, FALSE);
+#endif
+ curs_set(1);
+ dlg_del_window(dlg->dialog);
+ return status;
+}
+
+/*
+ * Setup dialog, read mixed-gauge data from pipe.
+ */
+int
+dialog_mixedgauge(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int percent,
+ int item_no,
+ char **items)
+{
+ DIALOG_MIXEDGAUGE dlg;
+ int began = 0;
+
+ dlg_begin_mixedgauge(&dlg, &began, title, cprompt, height,
+ width, item_no, items);
+
+ dlg_update_mixedgauge(&dlg, percent);
+
+ return dlg_finish_mixedgauge(&dlg, DLG_EXIT_OK);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/mkdirs.sh b/Build/source/utils/dialog/dialog-1.1-20080819/mkdirs.sh
new file mode 100755
index 00000000000..59fc39c21ae
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/mkdirs.sh
@@ -0,0 +1,51 @@
+#! /bin/sh
+# $Id: mkdirs.sh,v 1.5 2007/03/25 22:29:46 tom Exp $
+# -----------------------------------------------------------------------------
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Last modified: 1994-03-25
+# Public domain
+# -----------------------------------------------------------------------------
+
+errstatus=0
+umask 022
+
+for file in ${1+"$@"} ; do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d in ${1+"$@"} ; do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp" 1>&2
+ case "$pathcomp" in
+ [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]: )
+ ;; # DOSISH systems
+ * )
+ mkdir "$pathcomp"
+ errstatus=$?
+ if test $errstatus != 0
+ then
+ # may have failed if invoked in a parallel "make -j# install"
+ if test -d "$pathcomp"
+ then
+ errstatus=0
+ fi
+ fi
+ ;;
+ esac
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/mouse.c b/Build/source/utils/dialog/dialog-1.1-20080819/mouse.c
new file mode 100644
index 00000000000..1dfcb435ff1
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/mouse.c
@@ -0,0 +1,139 @@
+/*
+ * $Id: mouse.c,v 1.18 2007/02/22 21:51:38 tom Exp $
+ *
+ * mouse.c -- mouse support for dialog
+ *
+ * Copyright 2002-2006,2007 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#if USE_MOUSE
+
+static int basex, basey;
+
+static mseRegion *regionList = NULL;
+
+/*=========== region related functions =============*/
+
+static mseRegion *
+find_region_by_code(int code)
+{
+ mseRegion *butPtr;
+
+ for (butPtr = regionList; butPtr; butPtr = butPtr->next) {
+ if (code == butPtr->code)
+ break;
+ }
+ return butPtr;
+}
+
+void
+dlg_mouse_setbase(int x, int y)
+{
+ basex = x;
+ basey = y;
+}
+
+void
+dlg_mouse_mkbigregion(int y, int x,
+ int height, int width,
+ int code,
+ int step_y, int step_x,
+ int mode)
+{
+ mseRegion *butPtr = dlg_mouse_mkregion(y, x, height, width, -DLGK_MOUSE(code));
+ butPtr->mode = mode;
+ butPtr->step_x = MAX(1, step_x);
+ butPtr->step_y = MAX(1, step_y);
+}
+
+void
+dlg_mouse_free_regions(void)
+{
+ while (regionList != 0) {
+ mseRegion *butPtr = regionList->next;
+ free(regionList);
+ regionList = butPtr;
+ }
+}
+
+mseRegion *
+dlg_mouse_mkregion(int y, int x, int height, int width, int code)
+{
+ mseRegion *butPtr;
+
+ if ((butPtr = find_region_by_code(code)) == 0) {
+ butPtr = dlg_malloc(mseRegion, 1);
+ assert_ptr(butPtr, "dlg_mouse_mkregion");
+ butPtr->next = regionList;
+ regionList = butPtr;
+ }
+ if (butPtr != 0) {
+ butPtr->mode = -1;
+ butPtr->step_x = 0;
+ butPtr->step_y = 0;
+ butPtr->y = basey + y;
+ butPtr->Y = basey + y + height;
+ butPtr->x = basex + x;
+ butPtr->X = basex + x + width;
+ butPtr->code = code;
+ }
+ return butPtr;
+}
+
+/* retrieve the frame under the pointer */
+static mseRegion *
+any_mouse_region(int y, int x, int small)
+{
+ mseRegion *butPtr;
+
+ for (butPtr = regionList; butPtr; butPtr = butPtr->next) {
+ if (small ^ (butPtr->code >= 0))
+ continue;
+ if (y < butPtr->y || y >= butPtr->Y)
+ continue;
+ if (x < butPtr->x || x >= butPtr->X)
+ continue;
+ break; /* found */
+ }
+ return butPtr;
+}
+
+/* retrieve the frame under the pointer */
+mseRegion *
+dlg_mouse_region(int y, int x)
+{
+ return any_mouse_region(y, x, TRUE);
+}
+
+/* retrieve the bigframe under the pointer */
+mseRegion *
+dlg_mouse_bigregion(int y, int x)
+{
+ return any_mouse_region(y, x, FALSE);
+}
+
+#else
+void mouse_dummy(void);
+void
+mouse_dummy(void)
+{
+}
+#endif /* USE_MOUSE */
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/mousewget.c b/Build/source/utils/dialog/dialog-1.1-20080819/mousewget.c
new file mode 100644
index 00000000000..13a021bfc02
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/mousewget.c
@@ -0,0 +1,91 @@
+/*
+ * $Id: mousewget.c,v 1.21 2008/03/16 20:09:03 tom Exp $
+ *
+ * mousewget.c -- mouse/wgetch support for dialog
+ *
+ * Copyright 2000-2006,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+static int
+mouse_wgetch(WINDOW *win, int *fkey, bool ignore_errs)
+{
+ int mouse_err = FALSE;
+ int key;
+
+ do {
+
+ key = dlg_getc(win, fkey);
+
+#if USE_MOUSE
+
+ mouse_err = FALSE;
+ if (fkey && (key == KEY_MOUSE)) {
+ MEVENT event;
+ mseRegion *p;
+
+ if (getmouse(&event) != ERR) {
+ if ((p = dlg_mouse_region(event.y, event.x)) != 0) {
+ key = DLGK_MOUSE(p->code);
+ } else if ((p = dlg_mouse_bigregion(event.y, event.x)) != 0) {
+ int x = event.x - p->x;
+ int y = event.y - p->y;
+ int row = (p->X - p->x) / p->step_x;
+
+ key = -(p->code);
+ switch (p->mode) {
+ case 1: /* index by lines */
+ key += y;
+ break;
+ case 2: /* index by columns */
+ key += (x / p->step_x);
+ break;
+ default:
+ case 3: /* index by cells */
+ key += (x / p->step_x) + (y * row);
+ break;
+ }
+ } else {
+ (void) beep();
+ mouse_err = TRUE;
+ }
+ } else {
+ (void) beep();
+ mouse_err = TRUE;
+ }
+ }
+#endif
+
+ } while (ignore_errs && mouse_err);
+
+ return key;
+}
+
+int
+dlg_mouse_wgetch(WINDOW *win, int *fkey)
+{
+ return mouse_wgetch(win, fkey, TRUE);
+}
+
+int
+dlg_mouse_wgetch_nowait(WINDOW *win, int *fkey)
+{
+ return mouse_wgetch(win, fkey, FALSE);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/msgbox.c b/Build/source/utils/dialog/dialog-1.1-20080819/msgbox.c
new file mode 100644
index 00000000000..88e74401a69
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/msgbox.c
@@ -0,0 +1,311 @@
+/*
+ * $Id: msgbox.c,v 1.58 2007/03/25 20:08:23 Brian.Rolfe Exp $
+ *
+ * msgbox.c -- implements the message box and info box
+ *
+ * Copyright 2000-2006,2007 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors:
+ * Savio Lam (lam836@cs.cuhk.hk)
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+/*
+ * Display the message in a scrollable window. Actually the way it works is
+ * that we create a "tall" window of the proper width, let the text wrap within
+ * that, and copy a slice of the result to the dialog.
+ *
+ * It works for ncurses. Other curses implementations show only blanks (Tru64)
+ * or garbage (NetBSD).
+ */
+static int
+show_message(WINDOW *dialog,
+ const char *prompt,
+ int offset,
+ int page,
+ int width,
+ int pauseopt)
+{
+#ifdef NCURSES_VERSION
+ if (pauseopt) {
+ int wide = width - (2 * MARGIN);
+ int high = LINES;
+ int y, x;
+ int len;
+ int percent;
+ WINDOW *dummy;
+ char buffer[5];
+
+#if defined(NCURSES_VERSION_PATCH) && NCURSES_VERSION_PATCH >= 20040417
+ /*
+ * If we're not limited by the screensize, allow text to possibly be
+ * one character per line.
+ */
+ if ((len = dlg_count_columns(prompt)) > high)
+ high = len;
+#endif
+ dummy = newwin(high, width, 0, 0);
+ wbkgdset(dummy, dialog_attr | ' ');
+ wattrset(dummy, dialog_attr);
+ werase(dummy);
+ dlg_print_autowrap(dummy, prompt, high, width);
+ getyx(dummy, y, x);
+
+ copywin(dummy, /* srcwin */
+ dialog, /* dstwin */
+ offset + MARGIN, /* sminrow */
+ MARGIN, /* smincol */
+ MARGIN, /* dminrow */
+ MARGIN, /* dmincol */
+ page, /* dmaxrow */
+ wide, /* dmaxcol */
+ FALSE);
+
+ delwin(dummy);
+
+ /* if the text is incomplete, or we have scrolled, show the percentage */
+ if (y > 0 && wide > 4) {
+ percent = (int) ((page + offset) * 100.0 / y);
+ if (percent < 0)
+ percent = 0;
+ if (percent > 100)
+ percent = 100;
+ if (offset != 0 || percent != 100) {
+ (void) wattrset(dialog, position_indicator_attr);
+ (void) wmove(dialog, MARGIN + page, wide - 4);
+ (void) sprintf(buffer, "%d%%", percent);
+ (void) waddstr(dialog, buffer);
+ if ((len = strlen(buffer)) < 4) {
+ wattrset(dialog, border_attr);
+ whline(dialog, dlg_boxchar(ACS_HLINE), 4 - len);
+ }
+ }
+ }
+ return (y - page);
+ }
+#endif
+ (void) offset;
+ wattrset(dialog, dialog_attr);
+ dlg_print_autowrap(dialog, prompt, page + 1 + (3 * MARGIN), width);
+ return 0;
+}
+
+/*
+ * Display a message box. Program will pause and display an "OK" button
+ * if the parameter 'pauseopt' is non-zero.
+ */
+int
+dialog_msgbox(const char *title, const char *cprompt, int height, int width,
+ int pauseopt)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, 'J' ),
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, 'j' ),
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, 'K' ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, 'k' ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_PAGE_FIRST, 'g' ),
+ DLG_KEYS_DATA( DLGK_PAGE_FIRST, KEY_HOME ),
+ DLG_KEYS_DATA( DLGK_PAGE_LAST, 'G' ),
+ DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_END ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, 'F' ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, 'f' ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, 'B' ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, 'b' ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+ int x, y, last = 0, page;
+ int button = 0;
+ int key = 0, fkey;
+ int result = DLG_EXIT_UNKNOWN;
+ WINDOW *dialog = 0;
+ char *prompt = dlg_strclone(cprompt);
+ const char **buttons = dlg_ok_label();
+ int offset = 0;
+ int check;
+ bool show = TRUE;
+
+#ifdef KEY_RESIZE
+ int req_high = height;
+ int req_wide = width;
+ restart:
+#endif
+
+ dlg_tab_correct_str(prompt);
+ dlg_auto_size(title, prompt, &height, &width,
+ (pauseopt == 1 ? 2 : 0),
+ (pauseopt == 1 ? 12 : 0));
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+#ifdef KEY_RESIZE
+ if (dialog != 0)
+ dlg_move_window(dialog, height, width, y, x);
+ else
+#endif
+ {
+ dialog = dlg_new_window(height, width, y, x);
+ dlg_register_window(dialog, "msgbox", binding);
+ dlg_register_buttons(dialog, "msgbox", buttons);
+ }
+ page = height - (1 + 3 * MARGIN);
+
+ dlg_mouse_setbase(x, y);
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+
+ if (pauseopt) {
+ dlg_draw_bottom_box(dialog);
+ mouse_mkbutton(height - 2, width / 2 - 4, 6, '\n');
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
+
+ while (result == DLG_EXIT_UNKNOWN) {
+ if (show) {
+ getyx(dialog, y, x);
+ last = show_message(dialog, prompt, offset, page, width, pauseopt);
+ wmove(dialog, y, x);
+ wrefresh(dialog);
+ show = FALSE;
+ }
+ key = dlg_mouse_wgetch(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+
+ if (!fkey && (check = dlg_char_to_button(key, buttons)) >= 0) {
+ result = check ? DLG_EXIT_HELP : DLG_EXIT_OK;
+ break;
+ }
+
+ if (fkey) {
+ switch (key) {
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ dlg_clear();
+ height = req_high;
+ width = req_wide;
+ show = TRUE;
+ goto restart;
+#endif
+ case DLGK_FIELD_NEXT:
+ button = dlg_next_button(buttons, button);
+ if (button < 0)
+ button = 0;
+ dlg_draw_buttons(dialog,
+ height - 2, 0,
+ buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_FIELD_PREV:
+ button = dlg_prev_button(buttons, button);
+ if (button < 0)
+ button = 0;
+ dlg_draw_buttons(dialog,
+ height - 2, 0,
+ buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_ENTER:
+ result = button ? DLG_EXIT_HELP : DLG_EXIT_OK;
+ break;
+ case DLGK_PAGE_FIRST:
+ if (offset > 0) {
+ offset = 0;
+ show = TRUE;
+ }
+ break;
+ case DLGK_PAGE_LAST:
+ if (offset < last) {
+ offset = last;
+ show = TRUE;
+ }
+ break;
+ case DLGK_GRID_UP:
+ if (offset > 0) {
+ --offset;
+ show = TRUE;
+ }
+ break;
+ case DLGK_GRID_DOWN:
+ if (offset < last) {
+ ++offset;
+ show = TRUE;
+ }
+ break;
+ case DLGK_PAGE_PREV:
+ if (offset > 0) {
+ offset -= page;
+ if (offset < 0)
+ offset = 0;
+ show = TRUE;
+ }
+ break;
+ case DLGK_PAGE_NEXT:
+ if (offset < last) {
+ offset += page;
+ if (offset > last)
+ offset = last;
+ show = TRUE;
+ }
+ break;
+ case DLGK_MOUSE(0):
+ result = DLG_EXIT_OK;
+ break;
+ case DLGK_MOUSE(1):
+ result = DLG_EXIT_HELP;
+ break;
+ default:
+ beep();
+ break;
+ }
+ } else {
+ beep();
+ }
+ }
+ } else {
+ show_message(dialog, prompt, offset, page, width, pauseopt);
+ wrefresh(dialog);
+ result = DLG_EXIT_OK;
+ }
+
+ dlg_del_window(dialog);
+ dlg_mouse_free_regions();
+ free(prompt);
+ return result;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/pause.c b/Build/source/utils/dialog/dialog-1.1-20080819/pause.c
new file mode 100644
index 00000000000..db363b00cc6
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/pause.c
@@ -0,0 +1,221 @@
+/*
+ * $Id: pause.c,v 1.19 2008/03/16 14:19:47 Yura.Kalinichenko Exp $
+ *
+ * pause.c -- implements the pause dialog
+ *
+ * Copyright 2004-2006,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * This is adapted from source contributed by
+ * Yura Kalinichenko
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#define MY_TIMEOUT 50
+
+/*
+ * This is like gauge, but can be interrupted.
+ *
+ * A pause box displays a meter along the bottom of the box. The meter
+ * indicates how many seconds remain until the end of the pause. The pause
+ * exits when timeout is reached (status OK) or the user presses:
+ * OK button (status OK)
+ * CANCEL button (status CANCEL)
+ * Esc key (status ESC)
+ *
+ */
+int
+dialog_pause(const char *title,
+ const char *cprompt,
+ int height,
+ int width,
+ int seconds)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+
+ int i, x, y, step;
+ int button = 0;
+ int seconds_orig;
+ WINDOW *dialog;
+ const char **buttons = dlg_ok_labels();
+ int key = 0, fkey;
+ int result = DLG_EXIT_UNKNOWN;
+ char *prompt = dlg_strclone(cprompt);
+
+ curs_set(0);
+
+ dlg_tab_correct_str(prompt);
+
+ seconds_orig = (seconds > 0) ? seconds : 1;
+
+#ifdef KEY_RESIZE
+ retry:
+ height = old_height;
+ width = old_width;
+#endif
+
+ dlg_auto_size(title, prompt, &height, &width, 0, 0);
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ /* center dialog box on screen */
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+ dialog = dlg_new_window(height, width, y, x);
+ dlg_register_window(dialog, "pause", binding);
+ dlg_register_buttons(dialog, "pause", buttons);
+
+ dlg_mouse_setbase(x, y);
+ nodelay(dialog, TRUE);
+
+ do {
+ (void) werase(dialog);
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+ dlg_print_autowrap(dialog, prompt, height, width);
+
+ dlg_draw_box(dialog,
+ height - 6, 2 + MARGIN,
+ 2 + MARGIN, width - 2 * (2 + MARGIN),
+ dialog_attr,
+ border_attr);
+
+ /*
+ * Clear the area for the progress bar by filling it with spaces
+ * in the title-attribute, and write the percentage with that
+ * attribute.
+ */
+ (void) wmove(dialog, height - 5, 4);
+ wattrset(dialog, title_attr);
+
+ for (i = 0; i < (width - 2 * (3 + MARGIN)); i++)
+ (void) waddch(dialog, ' ');
+
+ (void) wmove(dialog, height - 5, (width / 2) - 2);
+ (void) wprintw(dialog, "%3d", seconds);
+
+ /*
+ * Now draw a bar in reverse, relative to the background.
+ * The window attribute was useful for painting the background,
+ * but requires some tweaks to reverse it.
+ */
+ x = (seconds * (width - 2 * (3 + MARGIN))) / seconds_orig;
+ if ((title_attr & A_REVERSE) != 0) {
+ wattroff(dialog, A_REVERSE);
+ } else {
+ wattrset(dialog, A_REVERSE);
+ }
+ (void) wmove(dialog, height - 5, 4);
+ for (i = 0; i < x; i++) {
+ chtype ch = winch(dialog);
+ if (title_attr & A_REVERSE) {
+ ch &= ~A_REVERSE;
+ }
+ (void) waddch(dialog, ch);
+ }
+
+ dlg_draw_bottom_box(dialog);
+ mouse_mkbutton(height - 2, width / 2 - 4, 6, '\n');
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
+ (void) wrefresh(dialog);
+
+ for (step = 0;
+ (result == DLG_EXIT_UNKNOWN) && (step < 1000);
+ step += MY_TIMEOUT) {
+
+ napms(MY_TIMEOUT);
+ key = dlg_mouse_wgetch_nowait(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+
+ switch (key) {
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ dlg_clear(); /* fill the background */
+ dlg_del_window(dialog); /* delete this window */
+ refresh(); /* get it all onto the terminal */
+ goto retry;
+#endif
+ case DLGK_FIELD_NEXT:
+ button = dlg_next_button(buttons, button);
+ if (button < 0)
+ button = 0;
+ dlg_draw_buttons(dialog,
+ height - 2, 0,
+ buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_FIELD_PREV:
+ button = dlg_prev_button(buttons, button);
+ if (button < 0)
+ button = 0;
+ dlg_draw_buttons(dialog,
+ height - 2, 0,
+ buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_ENTER:
+ /* Do not use dlg_exit_buttoncode() since we want to return
+ * a cancel rather than ok if the timeout has not expired.
+ */
+ result = button ? DLG_EXIT_CANCEL : DLG_EXIT_OK;
+ break;
+ case DLGK_MOUSE(0):
+ result = DLG_EXIT_OK;
+ break;
+ case DLGK_MOUSE(1):
+ result = DLG_EXIT_CANCEL;
+ break;
+ case ERR:
+ break;
+ default:
+ result = DLG_EXIT_OK;
+ break;
+ }
+ }
+ } while ((result == DLG_EXIT_UNKNOWN) && (seconds-- > 0));
+
+ nodelay(dialog, FALSE);
+ curs_set(1);
+ dlg_mouse_free_regions();
+ dlg_del_window(dialog);
+ free(prompt);
+ return ((result == DLG_EXIT_UNKNOWN) ? DLG_EXIT_OK : result);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/POTFILES.in b/Build/source/utils/dialog/dialog-1.1-20080819/po/POTFILES.in
new file mode 100644
index 00000000000..48ea956a00b
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/POTFILES.in
@@ -0,0 +1,32 @@
+arrows.c
+buttons.c
+calendar.c
+checklist.c
+dialog.c
+dialog.h
+dlg_colors.h
+dlg_keys.c
+dlg_keys.h
+editbox.c
+formbox.c
+fselect.c
+guage.c
+inputbox.c
+inputstr.c
+menubox.c
+mixedform.c
+mixedgauge.c
+mouse.c
+mousewget.c
+msgbox.c
+pause.c
+progressbox.c
+rc.c
+tailbox.c
+textbox.c
+timebox.c
+trace.c
+ui_getc.c
+util.c
+version.c
+yesno.c
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/ar.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/ar.po
new file mode 100644
index 00000000000..7dbd72c3e52
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/ar.po
@@ -0,0 +1,111 @@
+# Arabic translation of Dialog.
+# This file is distributed under the same license as the dialog package.
+# Copyright (C) 2005 Thomas Dickey.
+# Abdulaziz Al-Arfaj <alarfaj0@yahoo.com>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog 1.0-20050116\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-07-21 00:22+0300\n"
+"Last-Translator: Abdulaziz Al-Arfaj <alarfaj0@yahoo.com>\n"
+"Language-Team: Arabic <support@arabeyes.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.3\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "نعم"
+
+#: buttons.c:393
+msgid "No"
+msgstr "لا"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "مواÙÙ‚"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "إلغاء"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr ""
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr ""
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr ""
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr ""
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr ""
+
+#: fselect.c:551
+msgid "Files"
+msgstr ""
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr ""
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr ""
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/be@latin.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/be@latin.po
new file mode 100644
index 00000000000..6a45d8d8533
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/be@latin.po
@@ -0,0 +1,109 @@
+# Dialog
+# Copyright 2003-2006,2007 # Thomas Dickey
+# Ihar Hrachyshka <ihar.hrachyshka@gmail.com>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-12-03 01:13+0200\n"
+"Last-Translator: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>\n"
+"Language-Team: Belarusian (Latin script) <translation-team-be-latin@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Tak"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Nie"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Anuluj"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "VYCHAD"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Dadatkova"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Dapamoha"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Miesiac"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Hod"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Źmiani nazvu"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Katalohi"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Fajły"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Paśpiachova"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Niaŭdała"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Projdziena"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "SkonÄana"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Pravierana"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Zroblena"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Abminuta"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "DziejniÄaje"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "Niama"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Ahulny prahres"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Å ukaj"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/bg.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/bg.po
new file mode 100644
index 00000000000..255776a0cb1
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/bg.po
@@ -0,0 +1,111 @@
+# Bulgarian translation of Dialog.
+# This file is distributed under the same license as the dialog package.
+# Copyright (C) 2005 Thomas Dickey.
+# Ognyan Kulev <ogi@fmi.uni-sofia.bg>, 2004.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog 1.0-20050116\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-09-13 09:02+0300\n"
+"Last-Translator: Ognyan Kulev <ogi@fmi.uni-sofia.bg>\n"
+"Language-Team: Bulgarian <dict@linux.zonebg.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Да"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Ðе"
+
+#: buttons.c:401
+msgid "OK"
+msgstr ""
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Отказ"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr ""
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr ""
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr ""
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr ""
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr ""
+
+#: fselect.c:551
+msgid "Files"
+msgstr ""
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr ""
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr ""
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/ca.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/ca.po
new file mode 100644
index 00000000000..985d2e609d8
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/ca.po
@@ -0,0 +1,110 @@
+# Catalan translation of Dialog.
+# Copyright © 2004, 2005, 2008 Free Software Foundation, Inc.
+# This file is distributed under the same licence as the dialog package.
+# Jordi Mallach <jordi@debian.org>, 2004, 2005, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-07-20 14:31-0400\n"
+"PO-Revision-Date: 2008-06-10 00:50+0200\n"
+"Last-Translator: Jordi Mallach <jordi@gnu.org>\n"
+"Language-Team: Catalan <ca@dodds.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Sí"
+
+#: buttons.c:393
+msgid "No"
+msgstr "No"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "D'acord"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Cancel·la"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "SURT"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Extra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Ajuda"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Mes"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Any"
+
+#: dialog.c:744
+msgid "Rename"
+msgstr "Canvia el nom"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Directoris"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Fitxers"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Ha tingut èxit"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Ha fallat"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Ha passat"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "S'ha completat"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Activat"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Fet"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Omès"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "En progrés"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "N/D"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Progrés general"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Cerca"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/cs.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/cs.po
new file mode 100644
index 00000000000..b4a40e97dec
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/cs.po
@@ -0,0 +1,108 @@
+# From: Martin Povolny <martin@solnet.cz>
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 0.9a-20010527\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-12-19 20:14-0500\n"
+"Last-Translator: Martin Povolny <martin@solnet.cz>\n"
+"Language-Team:\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Ano"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Ne"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Storno"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Konec"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr ""
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Měsíc"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Rok"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Adresáře"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Soubory"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Soubory"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+#, fuzzy
+msgid "Search"
+msgstr "Search"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/cy.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/cy.po
new file mode 100644
index 00000000000..39423edf952
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/cy.po
@@ -0,0 +1,110 @@
+# Dialog
+# Copyright 2003,2004 # Thomas Dickey
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-03-30 23:00+0100\n"
+"Last-Translator: Dafydd Harries <daf@muse.19inch.net>\n"
+"Language-Team: Welsh <cy@pengwyn.linux.org.uk>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Ie"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Na"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Iawn"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Diddymu"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "GADAEL"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Ychwanegol"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Cymorth"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Mis"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Blwyddyn"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Ailenwy"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Cyfeiriaduron"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Ffeiliau"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Ffeiliau"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+#, fuzzy
+msgid "Search"
+msgstr "Search"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/da.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/da.po
new file mode 100644
index 00000000000..bbb73ab9952
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/da.po
@@ -0,0 +1,109 @@
+# Dialog
+# Copyright 2001, # Thomas Dickey
+# Morten Brix Pedersen <morten@wtf.dk>, 2001-2005.
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2005-01-07 21:02+0200\n"
+"Last-Translator: Morten Brix Pedersen <morten@wtf.dk>\n"
+"Language-Team: Danish <dansk@klid.dk>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Ja"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Nej"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "O.K."
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Anullér"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "AFSLUT"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Ekstra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Hjælp"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "MÃ¥ned"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Ã…r"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Omdøb"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Mapper"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Filer"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Filer"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Søg"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/de.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/de.po
new file mode 100644
index 00000000000..871e2e79004
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/de.po
@@ -0,0 +1,111 @@
+# Dialog
+# Copyright 2001, # Thomas Dickey
+#
+# Michael Piefel <piefel@informatik.hu-berlin.de>, 2002.
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2002-05-09 17:56+0200\n"
+"Last-Translator: Michael Piefel <piefel@informatik.hu-berlin.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Ja"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Nein"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "VERLASSEN"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Hilfe"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Monat"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Jahr"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Bearbeiten"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Verzeichnisse"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Dateien"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Dateien"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+#, fuzzy
+msgid "Search"
+msgstr "Suche"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/dialog.pot b/Build/source/utils/dialog/dialog-1.1-20080819/po/dialog.pot
new file mode 100644
index 00000000000..0631e83aee5
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/dialog.pot
@@ -0,0 +1,109 @@
+# Dialog
+# Copyright 2003-2007,2008 # Thomas Dickey
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20080316\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr ""
+
+#: buttons.c:393
+msgid "No"
+msgstr ""
+
+#: buttons.c:401
+msgid "OK"
+msgstr ""
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr ""
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr ""
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr ""
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr ""
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr ""
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr ""
+
+#: fselect.c:551
+msgid "Files"
+msgstr ""
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr ""
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr ""
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/el.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/el.po
new file mode 100644
index 00000000000..3b87e8e6034
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/el.po
@@ -0,0 +1,107 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2002-06-05 10:00GMT+2\n"
+"Last-Translator: kromJx <kromJx@crosswinds.net>\n"
+"Language-Team: <i18ngr@hellug.gr>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Îαι"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Όχι"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "ΆκυÏο"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Έξοδος"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Βοήθεια"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Μήνας"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Έτος"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Φάκελοι"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "ΑÏχεία"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "ΑÏχεία"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+#, fuzzy
+msgid "Search"
+msgstr "Search"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/eo.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/eo.po
new file mode 100644
index 00000000000..fa3dbf31a99
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/eo.po
@@ -0,0 +1,109 @@
+# Esperanto translation of Dialog
+# Copyright (C) 2008 Felipe Castro
+# This file is distributed under the same license as the dialog package.
+# Felipe Castro <fefcas@gmail.com>, 2008
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-02-25 16:06-0500\n"
+"PO-Revision-Date: 2008-08-03 15:50-0300\n"
+"Last-Translator: Felipe Castro <fefcas@gmail.com>\n"
+"Language-Team: Esperanto <translation-team-eo@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:379
+msgid "Yes"
+msgstr "Jes"
+
+#: buttons.c:387
+msgid "No"
+msgstr "Ne"
+
+#: buttons.c:395
+msgid "OK"
+msgstr "Certe"
+
+#: buttons.c:403
+msgid "Cancel"
+msgstr "Rezigni"
+
+#: buttons.c:411
+msgid "EXIT"
+msgstr "ELIRI"
+
+#: buttons.c:419
+msgid "Extra"
+msgstr "Krome"
+
+#: buttons.c:427
+msgid "Help"
+msgstr "Helpo"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Monato"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Jaro"
+
+#: dialog.c:727
+msgid "Rename"
+msgstr "Renomigi"
+
+#: fselect.c:548
+msgid "Directories"
+msgstr "Dosierujoj"
+
+#: fselect.c:549
+msgid "Files"
+msgstr "Dosieroj"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Sukcesis"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Malsukcesis"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Pasite"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Kompletite"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Kontrolite"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Farite"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Preterpasite"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "Evoluado"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "N/A"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Tuta Evoluo"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Serĉi"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/es.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/es.po
new file mode 100644
index 00000000000..d8884a3ef6f
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/es.po
@@ -0,0 +1,110 @@
+# Mensajes en español para dialog.
+# Copyright (C) 2001, 2003, 2004 Thomas Dickey.
+# Santiago Vila Doncel <sanvila@unex.es>, 2001, 2003, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.0-20041219\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-12-21 17:06+0100\n"
+"Last-Translator: Santiago Vila Doncel <sanvila@unex.es>\n"
+"Language-Team: Spanish <es@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Sí"
+
+#: buttons.c:393
+msgid "No"
+msgstr "No"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Aceptar"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Salir"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Extra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Ayuda"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Mes"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Año"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Renombrar"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Directorios"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Ficheros"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Ficheros"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Buscar"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/et.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/et.po
new file mode 100644
index 00000000000..d8757d9f3d1
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/et.po
@@ -0,0 +1,110 @@
+# Dialog
+# Copyright 2001, Thomas Dickey
+# Copyright 2001, Ivar Smolin
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2001-09-08 00:05+0200\n"
+"Last-Translator: Ivar Smolin <okul@linux.ee>\n"
+"Language-Team: Estonian <et@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Jah"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Ei"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Tühista"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Lõpeta"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr ""
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Kuu"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Aasta"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Kataloogid"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Failid"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Failid"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+#, fuzzy
+msgid "Search"
+msgstr "Otsingu"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/eu.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/eu.po
new file mode 100644
index 00000000000..21944143af0
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/eu.po
@@ -0,0 +1,111 @@
+# translation of dialog-1.1.20070704.po to Euskara
+# Dialog
+# Copyright 2003,2004 # Thomas Dickey
+#
+# Piarres Beobide Egaña <pi@beobide.net>, 2004, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog-1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-09-20 00:01+0200\n"
+"Last-Translator: Piarres Beobide <pi@beobide.net>\n"
+"Language-Team: Basque <translation-team-eu@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Bai"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Ez"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Ados"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Utzi"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "IRTEN"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Gehigarria"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Laguntza"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Hilabetea"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Urtea"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Berizendatu"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Direktorioak"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Fitxategiak"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Lortua"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Huts eginda"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Pasata"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Osatua"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Egiaztatua"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Eginda"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Salto eginda"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "Aurrerakuntza"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "E/G"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Aurrerapen nagusia"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Bilaketa"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/fi.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/fi.po
new file mode 100644
index 00000000000..ab1f8bd6ada
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/fi.po
@@ -0,0 +1,111 @@
+# Finnish translation for dialog.
+# Copyright © 2005 Lauri Nurmi <lanurmi@iki.fi>
+# This file is distributed under the same license as the dialog package.
+# Lauri Nurmi <lanurmi@iki.fi>, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.0-rel20041222\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2005-03-07 19:15+0200\n"
+"Last-Translator: Lauri Nurmi <lanurmi@iki.fi>\n"
+"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Kyllä"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Ei"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Peru"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Poistu"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Painike"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Ohje"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Kuukausi"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Vuosi"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Nimeä"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Kansiot"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Tiedostot"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Tiedostot"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Etsi"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/fr.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/fr.po
new file mode 100644
index 00000000000..a121c21602f
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/fr.po
@@ -0,0 +1,110 @@
+# French translation of Dialog.
+# Copyright (C) 2001 Thomas Dickey.
+# Frédéric L. W. Meunier <0 @ pervalidus.net>, 2001.
+# François-Xavier Coudert <fxcoudert@gmail.com>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2008-03-28 23:14+0000\n"
+"Last-Translator: François-Xavier Coudert <fxcoudert@gmail.com>\n"
+"Language-Team: French <traduc@traduc.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Oui"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Non"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Accepter"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Annuler"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "SORTIR"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Extra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Aide"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Mois"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Année"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Renommer"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Répertoires"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Fichiers"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Succès"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Échec"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Passé"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Terminé"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Vérifié"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Fini"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Ignoré"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "En cours"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "N/A"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Avancement général"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Rechercher"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/ga.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/ga.po
new file mode 100644
index 00000000000..092a37f7453
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/ga.po
@@ -0,0 +1,108 @@
+# Dialog
+# Copyright 2003,2004 # Thomas Dickey
+# Kevin Patrick Scannell <scannell@SLU.EDU>, 2005, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-07-20 11:57-0500\n"
+"Last-Translator: Kevin Scannell <kscanne@gmail.com>\n"
+"Language-Team: Irish <gaeilge-gnulinux@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Tá"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Níl"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Cealaigh"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "SCOIR"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Breise"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Cabhair"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Mí"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Bliain"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Athainmnigh"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Comhadlanna"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Comhaid"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "D'éirigh leis"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Teipthe"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Ceadaithe"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Críochnaithe"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Deimhnithe"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Déanta"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Scipeáilte"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "Faoi Shiúl"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "N/A/F"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Dul Chun Cinn Iomlán"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Cuardaigh"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/gl.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/gl.po
new file mode 100644
index 00000000000..68552c7fa80
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/gl.po
@@ -0,0 +1,110 @@
+# This file is distributed under the same license as the dialog package.
+# Mensaxes en galego para dialog.
+# Copyright 2003-2006,2007 Thomas Dickey
+# Diego Pérez Montes <kabute@gulo.org>, 2008
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2008-05-13 23:57+0100\n"
+"Last-Translator: Diego Pérez Montes <kabute@gulo.org>\n"
+"Language-Team: Galician <proxecto@trasno.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Sí"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Non"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Aceptar"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "SAÃR"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Suplementario"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Axuda"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Mes"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Ano"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Renomear"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Directorios"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Ficheiros"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Conseguido"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Fallou"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Correcto"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Completado"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Seleccionado"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Feito"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Omitido"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "En Progreso"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "Non Dispoñible"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Progreso Total"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Procurar"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/hi.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/hi.po
new file mode 100644
index 00000000000..57459fe9cd3
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/hi.po
@@ -0,0 +1,112 @@
+# Hindi translation of Dialog.
+# This file is distributed under the same license as the dialog package.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-07-18 11:06+0200\n"
+"Last-Translator: Deepika Mangla <deepika.mangla@gmail.com>\n"
+"Language-Team: <elinks@knopper.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: 2\n"
+"X-Poedit-Language: Hindi\n"
+"X-Poedit-Country: INDIA\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "à€¹à€Ÿà€Â"
+
+#: buttons.c:393
+msgid "No"
+msgstr "à€šà€¹à¥€à€‚"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "à€ à¥€à€•"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "à€°à€Šà¥Âà€Š à€•à€°à¥‡à€‚"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "à€šà€¿à€°à¥Âà€—à€®"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "à€…à€€à€¿à€°à€¿à€•à¥Âà€€"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "à€®à€Šà€Š"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "à€®à€¹à¥€à€šà€Ÿ"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "à€µà€°à¥Âà€·"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "à€ªà¥Âà€šà€ƒà€šà€Ÿà€®à€•à€°à€£"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "à€šà€¿à€°à¥Âà€Šà¥‡à€¶à€¿à€•à€Ÿ"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "à€žà€‚à€šà€¿à€•à€Ÿ"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "à€žà€«à€²"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "à€žà€«à€²"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "à€ªà€Ÿà€ž"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "à€žà€®à¥Âà€ªà¥‚à€°à€¿à€€"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "à€…à€µà€°à¥Âà€Šà¥Âà€§"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "à€žà€«à€² "
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "à€›à¥‹à€¡à€Œ à€Šà€¿à€¯à€Ÿ"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "à€ªà¥Âà€°à€—à€€à€¿ à€®à¥‡à€‚ à€¹à¥ˆ"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "à€²à€Ÿà€—à¥‚ à€šà€¹à¥€à€‚"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "à€žà€®à€—à¥Âà€° à€ªà¥Âà€°à€—à€€à€¿"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "à€…à€šà¥Âà€žà€šà¥Âà€§à€Ÿà€š"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/hr.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/hr.po
new file mode 100644
index 00000000000..65248795e70
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/hr.po
@@ -0,0 +1,109 @@
+# Croatian translation of Dialog.
+# This file is distributed under the same license as the dialog package.
+# Copyright (C) 2005 Thomas Dickey.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog 1.0-20050116\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-07-25 14:52+0200\n"
+"Last-Translator: Krunoslav Gernhard <kruno@linux.hr>\n"
+"Language-Team: Croatian <lokalizacija@linux.hr>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Da"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Ne"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "U redu"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Otkaži"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr ""
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr ""
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr ""
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr ""
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr ""
+
+#: fselect.c:551
+msgid "Files"
+msgstr ""
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr ""
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr ""
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/hu.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/hu.po
new file mode 100644
index 00000000000..6975b92be3d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/hu.po
@@ -0,0 +1,111 @@
+# Dialog
+# Copyright 2003, # Thomas Dickey
+# Arpad Biro <biro_arpad@yahoo.com>, 2003
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.0-rel20041222\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2005-02-02 08:21+0100\n"
+"Last-Translator: Németh Csaba <csaba@sopron.hu>\n"
+"Language-Team: Hungarian <translation-team-hu@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.0.1\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Igen"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Nem"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Mégsem"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "KILÉPÉS"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Extra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Súgó"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Hónap"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Év"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Ãtnevezés"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Könyvtárak"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Fájlok"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Fájlok"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Keresés"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/id.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/id.po
new file mode 100644
index 00000000000..b9f2fce9c2d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/id.po
@@ -0,0 +1,110 @@
+# Indonesian translations for dialog package.
+# Copyright 2003-2006,2007 # Thomas Dickey.
+# This file is distributed under the same license as the dialog package.
+# Andhika Padmawan <andhika.padmawan@gmail.com>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-02-25 16:06-0500\n"
+"PO-Revision-Date: 2008-07-21 13:40+0700\n"
+"Last-Translator: Andhika Padmawan <andhika.padmawan@gmail.com>\n"
+"Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:379
+msgid "Yes"
+msgstr "Ya"
+
+#: buttons.c:387
+msgid "No"
+msgstr "Tidak"
+
+#: buttons.c:395
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:403
+msgid "Cancel"
+msgstr "Batal"
+
+#: buttons.c:411
+msgid "EXIT"
+msgstr "KELUAR"
+
+#: buttons.c:419
+msgid "Extra"
+msgstr "Ekstra"
+
+#: buttons.c:427
+msgid "Help"
+msgstr "Bantuan"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Bulan"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Tahun"
+
+#: dialog.c:727
+msgid "Rename"
+msgstr "Ganti Nama"
+
+#: fselect.c:548
+msgid "Directories"
+msgstr "Kamus"
+
+#: fselect.c:549
+msgid "Files"
+msgstr "Berkas"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Sukses"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Gagal"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Lulus"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Selesai"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Diperiksa"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Selesai"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Dilewati"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "Dalam Proses"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "Tak Tersedia"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Keseluruhan Proses"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Telusur"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/it.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/it.po
new file mode 100644
index 00000000000..6aad5d40023
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/it.po
@@ -0,0 +1,111 @@
+# Italian messages for dialog.
+# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+# This file is distributed under the same license as the dialog package.
+# Marco Colombo <m.colombo@ed.ac.uk>, 2005, 2007.
+# Marco Mariani <marcom@sferacarta.com>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-08-06 15:47+0100\n"
+"Last-Translator: Marco Colombo <m.colombo@ed.ac.uk>\n"
+"Language-Team: Italian <tp@lists.linux.it>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Sì"
+
+#: buttons.c:393
+msgid "No"
+msgstr "No"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Annulla"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Esci"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Extra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Aiuto"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Mese"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Anno"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Rinomina"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Cartelle"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "File"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Riuscito"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Fallito"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Superato"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Completato"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Controllato"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Fatto"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Saltato"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "In corso"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "N/A"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Progresso complessivo"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Ricerca"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/ja.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/ja.po
new file mode 100644
index 00000000000..9ab538ca6df
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/ja.po
@@ -0,0 +1,111 @@
+# dialog Japanese po file.
+# Copyright 2000, Thomas Dickey
+# This file is distributed under the same license as the dialog package.
+# Hirofumi Takeda <takepin@turbolinux.co.jp>, 2000.
+# Takeshi Hamasaki <hmatrjp@users.sourceforge.jp>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-07-27 18:05-0400\n"
+"PO-Revision-Date: 2008-07-24 00:12+0900\n"
+"Last-Translator: Takeshi Hamasaki <hmatrjp@users.sourceforge.jp>\n"
+"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=EUC-JP\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "¤Ï¤¤"
+
+#: buttons.c:393
+msgid "No"
+msgstr "¤¤¤¤¤¨"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "λ²ò"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "¼è¾Ã"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "½ªÎ»"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "³ÈÄ¥"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "¥Ø¥ë¥×"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "·î"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "ǯ"
+
+#: dialog.c:744
+msgid "Rename"
+msgstr "̾Á°Êѹ¹"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "¥Ç¥£¥ì¥¯¥È¥ê"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "¥Õ¥¡¥¤¥ë"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "À®¸ù"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "¼ºÇÔ"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "¥Ñ¥¹"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "´°Î»"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "³Îǧ½ªÎ»"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "½ªÎ»"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "¥¹¥­¥Ã¥×"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "½èÍýÃæ"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "̵¸ú"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Á´ÂΤοʹԾõ¶·"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Ä´ºº"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/ku.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/ku.po
new file mode 100644
index 00000000000..3f78769e709
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/ku.po
@@ -0,0 +1,112 @@
+# Dialog
+# Copyright 2003-2006,2007 # Thomas Dickey
+# This file is distributed under the same license as the dialog package.
+#
+# Erdal Ronahi <erdal.ronahi@gmail.com>, 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2008-04-25 16:51+0200\n"
+"Last-Translator: Erdal Ronahi <erdal.ronahi@gmail.com>\n"
+"Language-Team: Kurdish <translation-team-ku@ferheng.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KAider 0.1\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Erê"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Na"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "TEMAM"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Betal"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "DERKETIN"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Ekstra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Alîkarî"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Meh"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Sal"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Nav guherandin"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Peldank"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Pel"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Biserket"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Biserneket"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Derbas bû"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Temamkirî"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Kontrolkirî"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Xelas"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Derbaskirî"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "Didome"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "Tune"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Pêşketina Giştî"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Lêgerîn"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/lt.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/lt.po
new file mode 100644
index 00000000000..dd93625a27f
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/lt.po
@@ -0,0 +1,111 @@
+# translation of dialog-1.1.20070704 to Lithuanian
+# This file is distributed under the same license as the dialog package.
+#
+# Gintautas Miliauskas <gintas@akl.lt>, 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog-1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2008-05-14 02:51+0300\n"
+"Last-Translator: Gintautas Miliauskas <gintas@akl.lt>\n"
+"Language-Team: Lithuanian <komp_lt@konferencijos.lt>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Taip"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Ne"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Atmesti"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "IÅ EITI"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Papildoma"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Žinynas"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "MÄ—nuo"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Metai"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Pervadinti"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Aplankai"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Failai"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "SÄ—kminga"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "NesÄ—kminga"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "PraÄ—jo"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Baigta"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Patikrinta"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Baigta"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Peršokta"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "Vykdoma"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "N/d"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Bendras progresas"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Ieškoti"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/makefile.inn b/Build/source/utils/dialog/dialog-1.1-20080819/po/makefile.inn
new file mode 100644
index 00000000000..dab2964ba97
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/makefile.inn
@@ -0,0 +1,261 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# This file may be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = $(prefix)/@DATADIRNAME@
+localedir = $(datadir)/locale
+gnulocaledir = $(prefix)/share/locale
+gettextsrcdir = $(prefix)/share/gettext/po
+subdir = po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+DESTDIR = @DESTDIR@
+
+CC = @CC@
+GENCAT = @GENCAT@
+GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
+MSGMERGE = PATH=../src:$$PATH msgmerge
+
+DEFS = @DEFS@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+
+INCLUDES = -I.. -I$(top_srcdir)/intl
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+SOURCES = @INTLDIR_MAKE@ cat-id-tbl.c
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+DISTFILES = ChangeLog makefile.inn POTFILES.in $(PACKAGE).pot \
+stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+INSTOBJEXT = @INSTOBJEXT@
+
+.SUFFIXES:
+.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
+
+.c.o:
+ $(COMPILE) $<
+
+.po.pox:
+ $(MAKE) $(PACKAGE).pot
+ $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+.po.gmo:
+ file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
+ && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+ sed -f ../intl/po2msg.sed < $< > $*.msg \
+ && rm -f $@ && $(GENCAT) $@ $*.msg
+
+
+all: all-@USE_NLS@
+
+all-yes: $(SOURCES) $(CATALOGS)
+all-no:
+
+$(srcdir)/$(PACKAGE).pot: $(POTFILES)
+ $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
+ --add-comments --keyword=_ --keyword=N_ \
+ --files-from=$(srcdir)/POTFILES.in \
+ && test ! -f $(PACKAGE).po \
+ || ( rm -f $(srcdir)/$(PACKAGE).pot \
+ && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
+
+$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
+$(srcdir)/stamp-cat-id: $(PACKAGE).pot
+ rm -f cat-id-tbl.tmp
+ sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
+ | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
+ if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
+ rm cat-id-tbl.tmp; \
+ else \
+ echo cat-id-tbl.c changed; \
+ rm -f $(srcdir)/cat-id-tbl.c; \
+ mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
+ fi
+ cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
+
+
+install install-full: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+install-data-no: all
+install-data-yes: all
+ if test -r "$(MKINSTALLDIRS)"; then \
+ $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
+ else \
+ $(SHELL) $(top_srcdir)/mkdirs.sh $(DESTDIR)$(datadir); \
+ fi
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ case "$$cat" in \
+ *.gmo) destdir=$(gnulocaledir);; \
+ *) destdir=$(localedir);; \
+ esac; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \
+ if test -r "$(MKINSTALLDIRS)"; then \
+ $(MKINSTALLDIRS) $$dir; \
+ else \
+ $(SHELL) $(top_srcdir)/mkdirs.sh $$dir; \
+ fi; \
+ if test -r $$cat; then \
+ $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ else \
+ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ echo "installing $(srcdir)/$$cat as" \
+ "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ fi; \
+ if test -r $$cat.m; then \
+ $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ if test -r $(srcdir)/$$cat.m ; then \
+ $(INSTALL_DATA) $(srcdir)/$$cat.m \
+ $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $(srcdir)/$$cat as" \
+ "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ true; \
+ fi; \
+ fi; \
+ done
+ if test "$(PACKAGE)" = "gettext"; then \
+ if test -r "$(MKINSTALLDIRS)"; then \
+ $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ $(SHELL) $(top_srcdir)/mkdirs.sh $(DESTDIR)$(gettextsrcdir); \
+ fi; \
+ $(INSTALL_DATA) $(srcdir)/makefile.inn \
+ $(DESTDIR)$(gettextsrcdir)/makefile.inn; \
+ else \
+ : ; \
+ fi
+
+# Define this as empty until I find a useful application.
+installcheck:
+
+uninstall:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ done
+ rm -f $(gettextsrcdir)/po-makefile.inn
+
+check: all
+
+cat-id-tbl.o: ../intl/libgettext.h
+
+dvi info tags TAGS ID:
+
+mostlyclean:
+ rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f cat-id-tbl.c stamp-cat-id *.gmo
+ rm -f makefile makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f $(GMOFILES)
+
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: update-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ for file in $$dists; do \
+ ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+ || cp -p $(srcdir)/$$file $(distdir); \
+ done
+
+# GNU msgfmt -C option can also check for X/Open compat.
+check-po:
+ cd $(srcdir); \
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ echo "$$lang:"; \
+ $(MSGFMT) -f -c -v $$lang.po; \
+ done
+
+update-po: makefile
+ $(MAKE) $(PACKAGE).pot
+ PATH=`pwd`/../src:$$PATH; \
+ cd $(srcdir); \
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ mv $$lang.po $$lang.old.po; \
+ echo "$$lang:"; \
+ if $(MSGMERGE) -w 132 $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
+ rm -f $$lang.old.po; \
+ else \
+ echo "msgmerge for $$cat failed!"; \
+ rm -f $$lang.po; \
+ mv $$lang.old.po $$lang.po; \
+ fi; \
+ done
+
+POTFILES: POTFILES.in
+ ( if test 'x$(srcdir)' != 'x.'; then \
+ posrcprefix='$(top_srcdir)/'; \
+ else \
+ posrcprefix="../"; \
+ fi; \
+ rm -f $@-t $@ \
+ && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
+ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
+ | sed -e '$$s/\\$$//') > $@-t \
+ && chmod a-w $@-t \
+ && mv $@-t $@ )
+
+makefile: makefile.inn ../config.status POTFILES
+ cd .. \
+ && CONFIG_FILES=$(subdir)/$@.in:$(subdir)/$@.inn CONFIG_HEADERS= \
+ $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/mg.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/mg.po
new file mode 100644
index 00000000000..558754a4421
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/mg.po
@@ -0,0 +1,110 @@
+# Malagasy translation of Dialog.
+# This file is distributed under the same license as the dialog package.
+# Copyright (C) 2005 Thomas Dickey.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog 1.0-20050116\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-11-21 17:33+0100\n"
+"Last-Translator: Jaonary Rabarisoa <jaonary@ifrance.fr>\n"
+"Language-Team: <en@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.9.1\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Eny"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Tsia"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Ekena"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Ajanony"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr ""
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr ""
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr ""
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr ""
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr ""
+
+#: fselect.c:551
+msgid "Files"
+msgstr ""
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr ""
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr ""
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/mk.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/mk.po
new file mode 100644
index 00000000000..898e76e282d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/mk.po
@@ -0,0 +1,111 @@
+# Macedonian translation of Dialog.
+# This file is distributed under the same license as the dialog package.
+# Copyright (C) 2005 Thomas Dickey.
+# Georgi Stanojevski <glisha@gmail.com>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog 1.0-20050116\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-10-10 00:18+0200\n"
+"Last-Translator: Georgi Stanojevski <glisha@gmail.com>\n"
+"Language-Team: <ossm-members@hedona.on.net.mk>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.3.1\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Да"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Ðе"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Во ред"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Откажи"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr ""
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr ""
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr ""
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr ""
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr ""
+
+#: fselect.c:551
+msgid "Files"
+msgstr ""
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr ""
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr ""
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/ms.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/ms.po
new file mode 100644
index 00000000000..e3167c8af46
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/ms.po
@@ -0,0 +1,109 @@
+# Dialog Bahasa Melayu (Malay) (ms)
+# Copyright 2003,2004 # Thomas Dickey
+# Sharuzzaman Ahmat Raslan <sharuzzaman@myrealbox.com>, 2005, 2006, 2007
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-08-14 01:22+0800\n"
+"Last-Translator: Sharuzzaman Ahmat Raslan <sharuzzaman@myrealbox.com>\n"
+"Language-Team: Malay <translation-team-ms@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Ya"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Tidak"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Batal"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "KELUAR"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Ekstra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Bantuan"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Bulan"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Tahun"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Tukar nama"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Direktori"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Fail"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Berjaya"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Gagal"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Lulus"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Selesai"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Diperiksa"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Selesai"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Dilangkau"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "Sedang Dilaksanakan"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "Tiada"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Kemajuan Keseluruhan"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Cari"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/nb.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/nb.po
new file mode 100644
index 00000000000..2781d9992f0
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/nb.po
@@ -0,0 +1,108 @@
+# Dialog
+# Copyright 2003-2006,2007 # Thomas Dickey
+# Roy Hvaara <roy.hvaara@gmail.com>, 2008.
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2008-03-24 14:00+0100\n"
+"Last-Translator: Roy Hvaara <roy.hvaara@gmail.com>\n"
+"Language-Team: Norwegian Bokmaal <i18n-nb@lister.ping.uio.no>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Ja"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Nei"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Avbryt"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "AVSLUTT"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Ekstra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Hjelp"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "MÃ¥ned"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Ã…r"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Endre navn"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Mapper"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Filer"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Vellykktes"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Feilet"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Bestått"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Fullført"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Kontrollert"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Ferdig"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Ignorert"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "I gang"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "-"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Total fremdrift"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Søk"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/nl.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/nl.po
new file mode 100644
index 00000000000..d57099b9b66
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/nl.po
@@ -0,0 +1,112 @@
+# Translation of dialog-1.1.20070704 to Dutch.
+# Copyright 2003-2006,2007 # Thomas Dickey
+#
+# Jacques Weewer <j.weewer_at_chello.nl>, 2004.
+# Luk Claes <luk.claes@ugent.be>, 2005.
+# Benno Schulenberg <benno@vertaalt.nl>, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog-1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-10-08 12:42+0200\n"
+"Last-Translator: Benno Schulenberg <benno@vertaalt.nl>\n"
+"Language-Team: Dutch <vertaling@vrijschrift.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Ja"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Nee"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Annuleren"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Afsluiten"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Extra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Help"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Maand"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Jaar"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Hernoemen"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Mappen"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Bestanden"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Gelukt"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Mislukt"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Geslaagd"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Voltooid"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Gecontroleerd"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Klaar"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Overgeslagen"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "Bezig"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "Onbeschikbaar"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Voortgang"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Zoeken"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/pl.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/pl.po
new file mode 100644
index 00000000000..3301322c47d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/pl.po
@@ -0,0 +1,111 @@
+# translation of dialog.po to Polish
+# Jaroslaw Swierczynski <swiergot@intersec.pl>, 2003
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2003-06-21 17:07+0200\n"
+"Last-Translator: Jaroslaw Swierczynski <swiergot@intersec.pl>\n"
+"Language-Team: Polish <po@lists.intersec.pl>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.0.1\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Tak"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Nie"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Anuluj"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "WYJDŹ"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Ekstra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Pomoc"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "MiesiÄ…c"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Rok"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Zmień nazwę"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Katalogi"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Pliki"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Pliki"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+#, fuzzy
+msgid "Search"
+msgstr "Search"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/pt.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/pt.po
new file mode 100644
index 00000000000..4a06e012eda
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/pt.po
@@ -0,0 +1,111 @@
+# Portuguese translation of Dialog.
+# Copyright (C) 2001 Thomas Dickey.
+# Frédéric L. W. Meunier <0 @ pervalidus.net>, 2001.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog 0.9a-20020814\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2002-09-04 19:12-0300\n"
+"Last-Translator: Frédéric L. W. Meunier <0 @ pervalidus.net>\n"
+"Language-Team: Portuguese <pt @ li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Sim"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Não"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Aceitar"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Sair"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Ajuda"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Mês"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Ano"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Directorias"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Ficheiros"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Ficheiros"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+#, fuzzy
+msgid "Search"
+msgstr "Busca"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/pt_BR.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/pt_BR.po
new file mode 100644
index 00000000000..43ae541ada3
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/pt_BR.po
@@ -0,0 +1,111 @@
+# Brazilian Portuguese translation of Dialog.
+# Copyright (C) 2001 Thomas Dickey.
+# Frédéric L. W. Meunier <0 @ pervalidus.net>, 2001.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog 0.9a-20020814\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2002-09-04 19:12-0300\n"
+"Last-Translator: Frédéric L. W. Meunier <0 @ pervalidus.net>\n"
+"Language-Team: Brazilian Portuguese <ldp-br @ bazar.conectiva.com.br>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Sim"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Não"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Aceitar"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Cancelar"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Sair"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Ajuda"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Mês"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Ano"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Diretórios"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Arquivos"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Arquivos"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+#, fuzzy
+msgid "Search"
+msgstr "Busca"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/rm.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/rm.po
new file mode 100644
index 00000000000..d4d81977e47
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/rm.po
@@ -0,0 +1,113 @@
+# Rumantsch (Rhaeto-Romance) [rm] translation of Dialog.
+# This file is distributed under the same license as the dialog package.
+# Copyright (C) 2003-2004,2005 Thomas Dickey.
+# Florian Verdet _goto <fvgoto@linuxbourg.ch>, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.0-rel20041222\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2005-02-06 13:22+0100\n"
+"Last-Translator: Florian Verdet _goto <fvgoto@linuxbourg.ch>\n"
+"Language-Team: Rhaeto-Romance <gnu-rumantsch@guglielmtux.ch>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.2\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Schi"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Na"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Laschar star"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "SORTIR"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Extra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Agüd"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Mais"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "On"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Müdar nom"
+
+#: fselect.c:550
+#, fuzzy
+msgid "Directories"
+msgstr "Registers"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Datotecas"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Datotecas"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Tscherchar"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/ro.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/ro.po
new file mode 100644
index 00000000000..f680d05a30b
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/ro.po
@@ -0,0 +1,114 @@
+# Mesajele în limba română pentru dialog.
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# Acest fişier este distribuit sub aceeaşi licenţă ca şi pachetul dialog.
+# Laurentiu Buzdugan <lbuz@rolix.org>, 2005.
+#
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.0-rel20041222\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-07-20 14:31-0400\n"
+"PO-Revision-Date: 2005-01-20 12:00-0500\n"
+"Last-Translator: Laurentiu Buzdugan <lbuz@rolix.org>\n"
+"Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Da"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Nu"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Renunţă"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "TERMINÄ‚"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Extra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Ajutor"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Luna"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "An"
+
+#: dialog.c:744
+msgid "Rename"
+msgstr "RedenumeÅŸte"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Directoare"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "FiÅŸiere"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "FiÅŸiere"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Căutare"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/ru.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/ru.po
new file mode 100644
index 00000000000..dd5051ae400
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/ru.po
@@ -0,0 +1,114 @@
+# translation of ru.po to Russian
+# Dialog
+# Copyright 2003, # Thomas Dickey
+# Leonid Kanter <leon@asplinux.ru>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: ru\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-03-26 11:39+0200\n"
+"Last-Translator: Leonid Kanter <leon@asplinux.ru>\n"
+"Language-Team: Russian <ru@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.3.1\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Да"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Ðет"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Отмена"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Выход"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Дополнительно"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Справка"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "МеÑÑц"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Год"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Переименовать"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Каталоги"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Файлы"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Файлы"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+#, fuzzy
+msgid "Search"
+msgstr "ПоиÑк"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/rw.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/rw.po
new file mode 100644
index 00000000000..0aad78f1bea
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/rw.po
@@ -0,0 +1,126 @@
+# translation of dialog to Kinyarwanda.
+# Copyright (C) 2005 Free Software Foundation, Inc.
+# This file is distributed under the same license as the dialog package.
+# Steve Murphy <murf@e-tools.com>, 2005.
+# Steve performed initial rough translation from compendium built from translations provided by the following translators:
+# Philibert Ndandali <ndandali@yahoo.fr>, 2005.
+# Viateur MUGENZI <muvia1@yahoo.fr>, 2005.
+# Noëlla Mupole <s24211045@tuks.co.za>, 2005.
+# Carole Karema <karemacarole@hotmail.com>, 2005.
+# JEAN BAPTISTE NGENDAHAYO <ngenda_denis@yahoo.co.uk>, 2005.
+# Augustin KIBERWA <akiberwa@yahoo.co.uk>, 2005.
+# Donatien NSENGIYUMVA <ndonatienuk@yahoo.co.uk>, 2005.
+# Antoine Bigirimana <antoine@e-tools.com>, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.0-rel20041222\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2005-04-04 10:55-0700\n"
+"Last-Translator: Steven Michael Murphy <murf@e-tools.com>\n"
+"Language-Team: Kinyarwanda <translation-team-rw@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Yego"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Oya"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OKE"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Kureka"
+
+# #-#-#-#-# setup2.pot (PACKAGE VERSION) #-#-#-#-#
+# setup2/source\ui\app.src:STR_RESTART_BTN_NO.text
+# #-#-#-#-# setup2.pot (PACKAGE VERSION) #-#-#-#-#
+# setup2/source\ui\pages\phavefun.src:RESID_PAGE_PAGEHAVEFUN.STR_LOGOUT_BTN_NO.text
+#: buttons.c:417
+#, fuzzy
+msgid "EXIT"
+msgstr "Gusohoka"
+
+#: buttons.c:425
+#, fuzzy
+msgid "Extra"
+msgstr "Birenga"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Gufasha"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Ukwezi"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Umwaka"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Guhindura izina"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "ububiko bw'amaderese"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "amadosiye"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "amadosiye"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Gushaka"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/sq.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/sq.po
new file mode 100644
index 00000000000..b804bbbc5b7
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/sq.po
@@ -0,0 +1,110 @@
+# Albanian translation of Dialog.
+# This file is distributed under the same license as the dialog package.
+# Copyright (C) 2005 Thomas Dickey.
+# Elian Myftiu <elian@lycos.com>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Dialog 1.0-20050116\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-11-18 02:28+0100\n"
+"Last-Translator: Elian Myftiu <elian@lycos.com>\n"
+"Language-Team: Albanian <gnome-albanian-perkthyesit@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Po"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Jo"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "mirë"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Anullo"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Dal"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr ""
+
+#: buttons.c:433
+msgid "Help"
+msgstr ""
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr ""
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr ""
+
+#: dialog.c:741
+msgid "Rename"
+msgstr ""
+
+#: fselect.c:550
+msgid "Directories"
+msgstr ""
+
+#: fselect.c:551
+msgid "Files"
+msgstr ""
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr ""
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr ""
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/sr.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/sr.po
new file mode 100644
index 00000000000..9414692d6b5
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/sr.po
@@ -0,0 +1,110 @@
+# Serbian translation of `dialog'.
+# Copyright (C) 2005 Free Software Foundation, Inc.
+# This file is distributed under the same license as the `dialog' package.
+# Aleksandar Jelenak <jelenak@verizon.net>, 2005.
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.0-rel20041222\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2005-08-21 12:53-0400\n"
+"Last-Translator: Aleksandar Jelenak <jelenak@verizon.net>\n"
+"Language-Team: Serbian <gnu@prevod.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Да"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Ðе"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "У реду"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Поништи"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "ИЗЛÐЗ"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Додатно"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Помоћ"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "МеÑец"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Година"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Преименуј"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Директоријуми"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Датотеке"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Датотеке"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Претрага"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/sv.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/sv.po
new file mode 100644
index 00000000000..ef71d76b4f2
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/sv.po
@@ -0,0 +1,109 @@
+# Swedish translation of dialog.
+# Copyright 2003,2004,2005, 2007 # Thomas Dickey
+# Daniel Nylander <po@danielnylander.se>, 2005, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-07-23 00:02+0100\n"
+"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
+"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Ja"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Nej"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Avbryt"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "AVSLUTA"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Extra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Hjälp"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "MÃ¥nad"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Ã…r"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Byt namn"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Kataloger"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Filer"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Lyckades"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Misslyckades"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Klarades"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Färdig"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Kontrollerad"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Klar"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Hoppades över"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "Pågår"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "Inte tillgänglig"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Totalt förlopp"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Sök"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/th.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/th.po
new file mode 100644
index 00000000000..d3dcbf65a6f
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/th.po
@@ -0,0 +1,111 @@
+# Dialog
+# Copyright 2003-2006,2007 # Thomas Dickey
+# Seksan Poltree <seksan.poltree@gmail.com>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-11-22 19:23+0700\n"
+"Last-Translator: Seksan Poltree <seksan.poltree@gmail.com>\n"
+"Language-Team: Thai <seksan.poltree@gmail.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Thai\n"
+"X-Poedit-Country: THAILAND\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "ใช่"
+
+#: buttons.c:393
+msgid "No"
+msgstr "ไม่"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "ตà¸à¸¥à¸‡"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "ยà¸à¹€à¸¥à¸´à¸"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "ออà¸"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "เพิ่มเติม"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "ช่วยเหลือ"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "เดือน"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "ปี"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "เปลี่ยนชื่อ"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "ไดเร็à¸à¸—อรี่"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "ไฟล์"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "สำเร็จ"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "ล้มเหลว"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "ผ่าน"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "เสร็จสิ้น"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "à¸à¸²à¹€à¸„รื่องหมาย"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "เรียบร้อย"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "ข้าม"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "à¸à¸³à¸¥à¸±à¸‡à¸”ำเนินà¸à¸²à¸£"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "ไม่มีอยู่"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "ความà¸à¹‰à¸²à¸§à¸«à¸™à¹‰à¸²à¸—ั้งสิ้น"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "ค้นหา"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/tr.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/tr.po
new file mode 100644
index 00000000000..e6c052f302d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/tr.po
@@ -0,0 +1,112 @@
+# Turkish translation of dialog.
+# Copyright (C) 2005 dialog GNU GPL:
+# This file is distributed under the same license as the dialog package.
+# Abdullah Ulas <potkal@bioinformatics.org>, 2005.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.0-rel20041222\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2005-04-08 18:29+0300\n"
+"Last-Translator: Abdullah Ulas <potkal@bioinformatics.org>\n"
+"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Evet"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Hayır"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Tamam"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Ä°ptal"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "ÇIKIŞ"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Ekstra"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Yardım"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Ay"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Yıl"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Yeniden adlandır"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Dizinler"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Dosyalar"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Dosyalar"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Arama"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/uk.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/uk.po
new file mode 100644
index 00000000000..47269fe8030
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/uk.po
@@ -0,0 +1,113 @@
+# translation of uk.po to Ukrainian
+# Dialog
+# Copyright 2003, # Thomas Dickey
+# Eugeniy Meshcheryakov <eugen@univ.kiev.ua>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: uk\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2004-02-12 20:17+0200\n"
+"Last-Translator: Eugeniy Meshcheryakov <eugen@univ.kiev.ua>\n"
+"Language-Team: Ukrainian\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.0.2\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Так"
+
+#: buttons.c:393
+msgid "No"
+msgstr "ÐÑ–"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "Гаразд"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "СкаÑувати"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "ВИЙТИ"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Додатково"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Допомога"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "МіÑÑць"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Рік"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Перейменувати"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Каталоги"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Файли"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr ""
+
+#: mixedgauge.c:61
+#, fuzzy
+msgid "Failed"
+msgstr "Файли"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr ""
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr ""
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr ""
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr ""
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr ""
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr ""
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr ""
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr ""
+
+#: textbox.c:489
+#, fuzzy
+msgid "Search"
+msgstr "Search"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/vi.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/vi.po
new file mode 100644
index 00000000000..c88fa151f32
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/vi.po
@@ -0,0 +1,113 @@
+# Vietnamese Translation for Dialog.
+# Copyright 2003,2004,2005 Thomas Dickey (msgid)
+# Copyright © 2007 Free Software Foundation, Inc.
+# This file is distributed under the same license as the dialog-1.0-rel20041222 package.
+# Clytie Siddall <clytie@riverland.net.au>, 2005-2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-07-26 18:31+0930\n"
+"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
+"Language-Team: Vietnamese <vi-VN@googlegroups.com> \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: LocFactoryEditor 1.7b1\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Có"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Không"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "OK"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Thôi"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "THOÃT"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Thêm"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Trợ giúp"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Tháng"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Năm"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Thay tên"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Thư mục"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Tập tin"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Thành công"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Trượt"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Äá»—"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Hoàn toàn"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Äã kiểm tra"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Hoàn tất"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Bị bỠqua"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "Äang chạy"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "Không có"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Toàn tiến hành"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Tìm kiếm"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/wa.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/wa.po
new file mode 100644
index 00000000000..ac2a6f52564
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/wa.po
@@ -0,0 +1,110 @@
+# Translation of Dialog into the walloon language.
+# Copyright 2003-2006,2007 # Thomas Dickey
+#
+# Pablo Saratxaga <pablo@walon.org>, 2007.
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-08-29 18:24+0200\n"
+"Last-Translator: Pablo Saratxaga <pablo@walon.org>\n"
+"Language-Team: Walloon <linux-wa@walon.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.0.2\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "Oyi"
+
+#: buttons.c:393
+msgid "No"
+msgstr "Neni"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "'l est bon"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "Rinoncî"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "Moussî foû"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "Rawete"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "Aidance"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "Moes"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "Anêye"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "Rilomer"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "Ridants"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "Fitchîs"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "Succès"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "Berwete"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "Passé"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "Tot fwait"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "Verifyî"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "Fwait"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "Passé houte"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "En alaedje"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "N/D"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "Avançmint"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "Cweri"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/zh_CN.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/zh_CN.po
new file mode 100644
index 00000000000..a9707c0b247
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/zh_CN.po
@@ -0,0 +1,111 @@
+# Simplified Chinese translation for dialog.
+# Copyright 2003,2004 # Thomas Dickey
+# This file is distributed under the same license as the dialog package.
+# Meng Jie <zuxyhere@eastday.com>, 2005.
+# LI Daobing <lidaobing@gmail.com>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-08-20 07:25+0800\n"
+"Last-Translator: Meng Jie <zuxy.meng@gmail.com>\n"
+"Language-Team: Chinese (simplified) <translation-team-zh-cn@lists.sourceforge.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "是"
+
+#: buttons.c:393
+msgid "No"
+msgstr "å¦"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "确认"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "å–消"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "退出"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "附加"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "帮助"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "月"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "å¹´"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "é‡å‘½å"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "目录"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "文件"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "æˆåŠŸ"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "失败"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "已跳过"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "已完æˆ"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "已检查"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "完æˆ"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "跳过"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "进行中"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "N/A"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "整体进度"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "æœç´¢"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/po/zh_TW.po b/Build/source/utils/dialog/dialog-1.1-20080819/po/zh_TW.po
new file mode 100644
index 00000000000..ebfa74df60f
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/po/zh_TW.po
@@ -0,0 +1,111 @@
+# Traditional Chinese Messages for dialog.
+# Copyright (C) 2005 Free Software Foundation, Inc.
+# This file is distributed under the same license as the dialog package.
+# Wei-Lun Chao <chaoweilun@gmail.com>, 2005, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: dialog 1.1.20070704\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-06-18 18:26-0400\n"
+"PO-Revision-Date: 2007-12-19 23:39+0800\n"
+"Last-Translator: Wei-Lun Chao <chaoweilun@gmail.com>\n"
+"Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: buttons.c:385
+msgid "Yes"
+msgstr "是"
+
+#: buttons.c:393
+msgid "No"
+msgstr "å¦"
+
+#: buttons.c:401
+msgid "OK"
+msgstr "確定"
+
+#: buttons.c:409
+msgid "Cancel"
+msgstr "å–消"
+
+#: buttons.c:417
+msgid "EXIT"
+msgstr "離開"
+
+#: buttons.c:425
+msgid "Extra"
+msgstr "其他"
+
+#: buttons.c:433
+msgid "Help"
+msgstr "求助"
+
+#. Headline "Month"
+#: calendar.c:273
+msgid "Month"
+msgstr "月"
+
+#. Headline "Year"
+#: calendar.c:293
+msgid "Year"
+msgstr "å¹´"
+
+#: dialog.c:741
+msgid "Rename"
+msgstr "æ›´å"
+
+#: fselect.c:550
+msgid "Directories"
+msgstr "目錄"
+
+#: fselect.c:551
+msgid "Files"
+msgstr "檔案"
+
+#: mixedgauge.c:58
+msgid "Succeeded"
+msgstr "å·²æˆåŠŸ"
+
+#: mixedgauge.c:61
+msgid "Failed"
+msgstr "已失敗"
+
+#: mixedgauge.c:64
+msgid "Passed"
+msgstr "已傳éž"
+
+#: mixedgauge.c:67
+msgid "Completed"
+msgstr "已完æˆ"
+
+#: mixedgauge.c:70
+msgid "Checked"
+msgstr "已勾é¸"
+
+#: mixedgauge.c:73
+msgid "Done"
+msgstr "已完æˆ"
+
+#: mixedgauge.c:76
+msgid "Skipped"
+msgstr "已略éŽ"
+
+#: mixedgauge.c:79
+msgid "In Progress"
+msgstr "正在進行"
+
+#: mixedgauge.c:85
+msgid "N/A"
+msgstr "ä¸æ˜Ž"
+
+#: mixedgauge.c:193
+msgid "Overall Progress"
+msgstr "整體進度"
+
+#: textbox.c:489
+msgid "Search"
+msgstr "æœå°‹"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/progressbox.c b/Build/source/utils/dialog/dialog-1.1-20080819/progressbox.c
new file mode 100644
index 00000000000..5d4b6e4edf8
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/progressbox.c
@@ -0,0 +1,187 @@
+/*
+ * $Id: progressbox.c,v 1.7 2007/04/08 16:33:06 tom Exp $
+ *
+ * progressbox.c -- implements the progress box
+ *
+ * Copyright 2005 Valery Reznic
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#define MIN_HIGH (4)
+#define MIN_WIDE (10 + 2 * (2 + MARGIN))
+
+typedef struct {
+ DIALOG_CALLBACK obj;
+ WINDOW *text;
+ char line[MAX_LEN + 1];
+ int is_eof;
+} MY_OBJ;
+
+/*
+ * Return current line of text.
+ */
+static char *
+get_line(MY_OBJ * obj)
+{
+ FILE *fp = obj->obj.input;
+ int col = 0;
+ int j, tmpint, ch;
+
+ while (1) {
+ if ((ch = getc(fp)) == EOF) {
+ obj->is_eof = 1;
+ if (col) {
+ break;
+ } else {
+ return NULL;
+ }
+ }
+ if (ch == '\n')
+ break;
+ if (ch == '\r')
+ break;
+ if ((ch == TAB) && (dialog_vars.tab_correct)) {
+ tmpint = dialog_state.tab_len
+ - (col % dialog_state.tab_len);
+ for (j = 0; j < tmpint; j++) {
+ if (col < MAX_LEN)
+ obj->line[col] = ' ';
+ ++col;
+ }
+ } else {
+ obj->line[col] = ch;
+ ++col;
+ }
+ if (col >= MAX_LEN)
+ break;
+ }
+
+ obj->line[col] = '\0';
+
+ return obj->line;
+}
+
+/*
+ * Print a new line of text.
+ */
+static void
+print_line(MY_OBJ * obj, WINDOW *win, int row, int width)
+{
+ int i, y, x;
+ char *line = obj->line;
+
+ (void) wmove(win, row, 0); /* move cursor to correct line */
+ (void) waddch(win, ' ');
+#ifdef NCURSES_VERSION
+ (void) waddnstr(win, line, MIN((int) strlen(line), width - 2));
+#else
+ line[MIN((int) strlen(line), width - 2)] = '\0';
+ waddstr(win, line);
+#endif
+
+ getyx(win, y, x);
+ /* Clear 'residue' of previous line */
+ for (i = 0; i < width - x; i++)
+ (void) waddch(win, ' ');
+}
+
+/*
+ * Display text from a stdin in a scrolling window.
+ */
+int
+dialog_progressbox(const char *title, const char *cprompt, int height, int width)
+{
+ int i;
+ int x, y, thigh;
+ WINDOW *dialog, *text;
+ MY_OBJ *obj;
+ FILE *fd = dialog_state.pipe_input;
+ char *prompt = dlg_strclone(cprompt);
+
+ dlg_tab_correct_str(prompt);
+ dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MIN_WIDE);
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+ thigh = height - (2 * MARGIN);
+
+ dialog = dlg_new_window(height, width, y, x);
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_title(dialog, title);
+
+ if (*prompt != '\0') {
+ int y2, x2;
+
+ wattrset(dialog, dialog_attr);
+ dlg_print_autowrap(dialog, prompt, height, width);
+ getyx(dialog, y2, x2);
+ ++y2;
+ wmove(dialog, y2, MARGIN);
+ for (i = 0; i < getmaxx(dialog) - 2 * MARGIN; i++)
+ (void) waddch(dialog, dlg_boxchar(ACS_HLINE));
+ y += y2;
+ thigh -= y2;
+ }
+
+ /* Create window for text region, used for scrolling text */
+ text = dlg_sub_window(dialog,
+ thigh,
+ width - (2 * MARGIN),
+ y + MARGIN,
+ x + MARGIN);
+
+ (void) wrefresh(dialog);
+
+ (void) wmove(dialog, thigh, (MARGIN + 1));
+ (void) wnoutrefresh(dialog);
+
+ obj = dlg_calloc(MY_OBJ, 1);
+ assert_ptr(obj, "dialog_progressbox");
+
+ obj->obj.input = fd;
+ obj->obj.win = dialog;
+ obj->text = text;
+
+ dlg_attr_clear(text, thigh, getmaxx(text), dialog_attr);
+ for (i = 0; get_line(obj); i++) {
+ if (i < thigh) {
+ print_line(obj, text, i, width - (2 * MARGIN));
+ } else {
+ scrollok(text, TRUE);
+ scroll(text);
+ scrollok(text, FALSE);
+ print_line(obj, text, thigh - 1, width - (2 * MARGIN));
+ }
+ (void) wnoutrefresh(text);
+ (void) wrefresh(text);
+ if (obj->is_eof)
+ break;
+ }
+ dlg_unregister_window(text);
+ dlg_del_window(dialog);
+ free(prompt);
+ free(obj);
+
+ return DLG_EXIT_OK;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/rc.c b/Build/source/utils/dialog/dialog-1.1-20080819/rc.c
new file mode 100644
index 00000000000..e8d0dee5bfc
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/rc.c
@@ -0,0 +1,587 @@
+/*
+ * $Id: rc.c,v 1.43 2008/03/16 18:50:26 tom Exp $
+ *
+ * rc.c -- routines for processing the configuration file
+ *
+ * Copyright 2000-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors
+ * Savio Lam (lam836@cs.cuhk.hk)
+ */
+
+#include <dialog.h>
+
+#include <dlg_keys.h>
+
+#ifdef HAVE_COLOR
+#include <dlg_colors.h>
+
+/*
+ * For matching color names with color values
+ */
+static const color_names_st color_names[] =
+{
+#ifdef HAVE_USE_DEFAULT_COLORS
+ {"DEFAULT", -1},
+#endif
+ {"BLACK", COLOR_BLACK},
+ {"RED", COLOR_RED},
+ {"GREEN", COLOR_GREEN},
+ {"YELLOW", COLOR_YELLOW},
+ {"BLUE", COLOR_BLUE},
+ {"MAGENTA", COLOR_MAGENTA},
+ {"CYAN", COLOR_CYAN},
+ {"WHITE", COLOR_WHITE},
+}; /* color names */
+#define COLOR_COUNT (sizeof(color_names) / sizeof(color_names[0]))
+#endif /* HAVE_COLOR */
+
+#define GLOBALRC "/etc/dialogrc"
+#define DIALOGRC ".dialogrc"
+
+/* Types of values */
+#define VAL_INT 0
+#define VAL_STR 1
+#define VAL_BOOL 2
+
+/* Type of line in configuration file */
+typedef enum {
+ LINE_ERROR = -1,
+ LINE_EQUALS,
+ LINE_EMPTY
+} PARSE_LINE;
+
+/* number of configuration variables */
+#define VAR_COUNT (sizeof(vars) / sizeof(vars_st))
+
+/* check if character is white space */
+#define whitespace(c) (c == ' ' || c == TAB)
+
+/* check if character is string quoting characters */
+#define isquote(c) (c == '"' || c == '\'')
+
+/* get last character of string */
+#define lastch(str) str[strlen(str)-1]
+
+/*
+ * Configuration variables
+ */
+typedef struct {
+ const char *name; /* name of configuration variable as in DIALOGRC */
+ void *var; /* address of actual variable to change */
+ int type; /* type of value */
+ const char *comment; /* comment to put in "rc" file */
+} vars_st;
+
+/*
+ * This table should contain only references to dialog_state, since dialog_vars
+ * is reset specially in dialog.c before each widget.
+ */
+static const vars_st vars[] =
+{
+ {"aspect",
+ &dialog_state.aspect_ratio,
+ VAL_INT,
+ "Set aspect-ration."},
+
+ {"separate_widget",
+ &dialog_state.separate_str,
+ VAL_STR,
+ "Set separator (for multiple widgets output)."},
+
+ {"tab_len",
+ &dialog_state.tab_len,
+ VAL_INT,
+ "Set tab-length (for textbox tab-conversion)."},
+
+ {"visit_items",
+ &dialog_state.visit_items,
+ VAL_BOOL,
+ "Make tab-traversal for checklist, etc., include the list."},
+
+#ifdef HAVE_COLOR
+ {"use_shadow",
+ &dialog_state.use_shadow,
+ VAL_BOOL,
+ "Shadow dialog boxes? This also turns on color."},
+
+ {"use_colors",
+ &dialog_state.use_colors,
+ VAL_BOOL,
+ "Turn color support ON or OFF"},
+#endif /* HAVE_COLOR */
+}; /* vars */
+
+static int
+skip_whitespace(char *str, int n)
+{
+ while (whitespace(str[n]) && str[n] != '\0')
+ n++;
+ return n;
+}
+
+static int
+skip_keyword(char *str, int n)
+{
+ while (isalnum(UCH(str[n])) && str[n] != '\0')
+ n++;
+ return n;
+}
+
+static int
+find_vars(char *name)
+{
+ int result = -1;
+ unsigned i;
+
+ for (i = 0; i < VAR_COUNT; i++) {
+ if (dlg_strcmp(vars[i].name, name) == 0) {
+ result = i;
+ break;
+ }
+ }
+ return result;
+}
+
+#ifdef HAVE_COLOR
+static int
+find_color(char *name)
+{
+ int result = -1;
+ int i;
+ int limit = dlg_color_count();
+
+ for (i = 0; i < limit; i++) {
+ if (dlg_strcmp(dlg_color_table[i].name, name) == 0) {
+ result = i;
+ break;
+ }
+ }
+ return result;
+}
+
+/*
+ * Convert an attribute to a string representation like this:
+ *
+ * "(foreground,background,highlight)"
+ */
+static char *
+attr_to_str(char *str, int fg, int bg, int hl)
+{
+ int i;
+
+ strcpy(str, "(");
+ /* foreground */
+ for (i = 0; fg != color_names[i].value; i++) ;
+ strcat(str, color_names[i].name);
+ strcat(str, ",");
+
+ /* background */
+ for (i = 0; bg != color_names[i].value; i++) ;
+ strcat(str, color_names[i].name);
+
+ /* highlight */
+ strcat(str, hl ? ",ON)" : ",OFF)");
+
+ return str;
+}
+
+/*
+ * Extract the foreground, background and highlight values from an attribute
+ * represented as a string in this form:
+ *
+ * "(foreground,background,highlight)"
+ */
+static int
+str_to_attr(char *str, int *fg, int *bg, int *hl)
+{
+ int i = 0, get_fg = 1;
+ unsigned j;
+ char tempstr[MAX_LEN + 1], *part;
+
+ if (str[0] != '(' || lastch(str) != ')')
+ return -1; /* invalid representation */
+
+ /* remove the parenthesis */
+ strcpy(tempstr, str + 1);
+ lastch(tempstr) = '\0';
+
+ /* get foreground and background */
+
+ while (1) {
+ /* skip white space before fg/bg string */
+ i = skip_whitespace(tempstr, i);
+ if (tempstr[i] == '\0')
+ return -1; /* invalid representation */
+ part = tempstr + i; /* set 'part' to start of fg/bg string */
+
+ /* find end of fg/bg string */
+ while (!whitespace(tempstr[i]) && tempstr[i] != ','
+ && tempstr[i] != '\0')
+ i++;
+
+ if (tempstr[i] == '\0')
+ return -1; /* invalid representation */
+ else if (whitespace(tempstr[i])) { /* not yet ',' */
+ tempstr[i++] = '\0';
+
+ /* skip white space before ',' */
+ i = skip_whitespace(tempstr, i);
+ if (tempstr[i] != ',')
+ return -1; /* invalid representation */
+ }
+ tempstr[i++] = '\0'; /* skip the ',' */
+ for (j = 0; j < COLOR_COUNT && dlg_strcmp(part, color_names[j].name);
+ j++) ;
+ if (j == COLOR_COUNT) /* invalid color name */
+ return -1;
+ if (get_fg) {
+ *fg = color_names[j].value;
+ get_fg = 0; /* next we have to get the background */
+ } else {
+ *bg = color_names[j].value;
+ break;
+ }
+ } /* got foreground and background */
+
+ /* get highlight */
+
+ /* skip white space before highlight string */
+ i = skip_whitespace(tempstr, i);
+ if (tempstr[i] == '\0')
+ return -1; /* invalid representation */
+ part = tempstr + i; /* set 'part' to start of highlight string */
+
+ /* trim trailing white space from highlight string */
+ i = strlen(part) - 1;
+ while (whitespace(part[i]) && i > 0)
+ i--;
+ part[i + 1] = '\0';
+
+ if (!dlg_strcmp(part, "ON"))
+ *hl = TRUE;
+ else if (!dlg_strcmp(part, "OFF"))
+ *hl = FALSE;
+ else
+ return -1; /* invalid highlight value */
+
+ return 0;
+}
+#endif /* HAVE_COLOR */
+
+/*
+ * Check if the line begins with a special keyword; if so, return true while
+ * pointing params to its parameters.
+ */
+static int
+begins_with(char *line, const char *keyword, char **params)
+{
+ int i = skip_whitespace(line, 0);
+ int j = skip_keyword(line, i);
+
+ if ((j - i) == (int) strlen(keyword)) {
+ char save = line[j];
+ line[j] = 0;
+ if (!dlg_strcmp(keyword, line + i)) {
+ *params = line + skip_whitespace(line, j + 1);
+ return 1;
+ }
+ line[j] = save;
+ }
+
+ return 0;
+}
+
+/*
+ * Parse a line in the configuration file
+ *
+ * Each line is of the form: "variable = value". On exit, 'var' will contain
+ * the variable name, and 'value' will contain the value string.
+ *
+ * Return values:
+ *
+ * LINE_EMPTY - line is blank or comment
+ * LINE_EQUALS - line contains "variable = value"
+ * LINE_ERROR - syntax error in line
+ */
+static PARSE_LINE
+parse_line(char *line, char **var, char **value)
+{
+ int i = 0;
+
+ /* ignore white space at beginning of line */
+ i = skip_whitespace(line, i);
+
+ if (line[i] == '\0') /* line is blank */
+ return LINE_EMPTY;
+ else if (line[i] == '#') /* line is comment */
+ return LINE_EMPTY;
+ else if (line[i] == '=') /* variable names cannot start with a '=' */
+ return LINE_ERROR;
+
+ /* set 'var' to variable name */
+ *var = line + i++; /* skip to next character */
+
+ /* find end of variable name */
+ while (!whitespace(line[i]) && line[i] != '=' && line[i] != '\0')
+ i++;
+
+ if (line[i] == '\0') /* syntax error */
+ return LINE_ERROR;
+ else if (line[i] == '=')
+ line[i++] = '\0';
+ else {
+ line[i++] = '\0';
+
+ /* skip white space before '=' */
+ i = skip_whitespace(line, i);
+
+ if (line[i] != '=') /* syntax error */
+ return LINE_ERROR;
+ else
+ i++; /* skip the '=' */
+ }
+
+ /* skip white space after '=' */
+ i = skip_whitespace(line, i);
+
+ if (line[i] == '\0')
+ return LINE_ERROR;
+ else
+ *value = line + i; /* set 'value' to value string */
+
+ /* trim trailing white space from 'value' */
+ i = strlen(*value) - 1;
+ while (whitespace((*value)[i]) && i > 0)
+ i--;
+ (*value)[i + 1] = '\0';
+
+ return LINE_EQUALS; /* no syntax error in line */
+}
+
+/*
+ * Create the configuration file
+ */
+void
+dlg_create_rc(const char *filename)
+{
+ unsigned i;
+ FILE *rc_file;
+
+ if ((rc_file = fopen(filename, "wt")) == NULL)
+ dlg_exiterr("Error opening file for writing in dlg_create_rc().");
+
+ fprintf(rc_file, "#\n\
+# Run-time configuration file for dialog\n\
+#\n\
+# Automatically generated by \"dialog --create-rc <file>\"\n\
+#\n\
+#\n\
+# Types of values:\n\
+#\n\
+# Number - <number>\n\
+# String - \"string\"\n\
+# Boolean - <ON|OFF>\n"
+#ifdef HAVE_COLOR
+ "\
+# Attribute - (foreground,background,highlight?)\n"
+#endif
+ );
+
+ /* Print an entry for each configuration variable */
+ for (i = 0; i < VAR_COUNT; i++) {
+ fprintf(rc_file, "\n# %s\n", vars[i].comment);
+ switch (vars[i].type) {
+ case VAL_INT:
+ fprintf(rc_file, "%s = %d\n", vars[i].name,
+ *((int *) vars[i].var));
+ break;
+ case VAL_STR:
+ fprintf(rc_file, "%s = \"%s\"\n", vars[i].name,
+ (char *) vars[i].var);
+ break;
+ case VAL_BOOL:
+ fprintf(rc_file, "%s = %s\n", vars[i].name,
+ *((bool *) vars[i].var) ? "ON" : "OFF");
+ break;
+ }
+ }
+#ifdef HAVE_COLOR
+ for (i = 0; i < (unsigned) dlg_color_count(); ++i) {
+ char buffer[MAX_LEN + 1];
+
+ fprintf(rc_file, "\n# %s\n", dlg_color_table[i].comment);
+ fprintf(rc_file, "%s = %s\n", dlg_color_table[i].name,
+ attr_to_str(buffer,
+ dlg_color_table[i].fg,
+ dlg_color_table[i].bg,
+ dlg_color_table[i].hilite));
+ }
+#endif /* HAVE_COLOR */
+#if 1
+ dlg_dump_keys(rc_file);
+#endif
+
+ (void) fclose(rc_file);
+}
+
+/*
+ * Parse the configuration file and set up variables
+ */
+int
+dlg_parse_rc(void)
+{
+ int i;
+ int l = 1;
+ PARSE_LINE parse;
+ char str[MAX_LEN + 1];
+ char *var;
+ char *value;
+ char *tempptr;
+ int result = 0;
+ FILE *rc_file = 0;
+#if 1
+ char *params;
+#endif
+
+ /*
+ * At startup, dialog determines the settings to use as follows:
+ *
+ * a) if the environment variable $DIALOGRC is set, its value determines
+ * the name of the configuration file.
+ *
+ * b) if the file in (a) can't be found, use the file $HOME/.dialogrc
+ * as the configuration file.
+ *
+ * c) if the file in (b) can't be found, try using the GLOBALRC file.
+ * Usually this will be /etc/dialogrc.
+ *
+ * d) if the file in (c) cannot be found, use the compiled-in defaults.
+ */
+
+ /* try step (a) */
+ if ((tempptr = getenv("DIALOGRC")) != NULL)
+ rc_file = fopen(tempptr, "rt");
+
+ if (rc_file == NULL) { /* step (a) failed? */
+ /* try step (b) */
+ if ((tempptr = getenv("HOME")) != NULL
+ && strlen(tempptr) < MAX_LEN - (sizeof(DIALOGRC) + 3)) {
+ if (tempptr[0] == '\0' || lastch(tempptr) == '/')
+ sprintf(str, "%s%s", tempptr, DIALOGRC);
+ else
+ sprintf(str, "%s/%s", tempptr, DIALOGRC);
+ rc_file = fopen(str, "rt");
+ }
+ }
+
+ if (rc_file == NULL) { /* step (b) failed? */
+ /* try step (c) */
+ strcpy(str, GLOBALRC);
+ if ((rc_file = fopen(str, "rt")) == NULL)
+ return 0; /* step (c) failed, use default values */
+ }
+
+ /* Scan each line and set variables */
+ while ((result == 0) && (fgets(str, MAX_LEN, rc_file) != NULL)) {
+ if (*str == '\0' || lastch(str) != '\n') {
+ /* ignore rest of file if line too long */
+ fprintf(stderr, "\nParse error: line %d of configuration"
+ " file too long.\n", l);
+ result = -1; /* parse aborted */
+ break;
+ }
+
+ lastch(str) = '\0';
+ if (begins_with(str, "bindkey", &params)) {
+ dlg_parse_bindkey(params);
+ continue;
+ }
+ parse = parse_line(str, &var, &value); /* parse current line */
+
+ switch (parse) {
+ case LINE_EMPTY: /* ignore blank lines and comments */
+ break;
+ case LINE_EQUALS:
+ /* search table for matching config variable name */
+ if ((i = find_vars(var)) >= 0) {
+ switch (vars[i].type) {
+ case VAL_INT:
+ *((int *) vars[i].var) = atoi(value);
+ break;
+ case VAL_STR:
+ if (!isquote(value[0]) || !isquote(lastch(value))
+ || strlen(value) < 2) {
+ fprintf(stderr, "\nParse error: string value "
+ "expected at line %d of configuration "
+ "file.\n", l);
+ result = -1; /* parse aborted */
+ } else {
+ /* remove the (") quotes */
+ value++;
+ lastch(value) = '\0';
+ strcpy((char *) vars[i].var, value);
+ }
+ break;
+ case VAL_BOOL:
+ if (!dlg_strcmp(value, "ON"))
+ *((bool *) vars[i].var) = TRUE;
+ else if (!dlg_strcmp(value, "OFF"))
+ *((bool *) vars[i].var) = FALSE;
+ else {
+ fprintf(stderr, "\nParse error: boolean value "
+ "expected at line %d of configuration "
+ "file (found %s).\n", l, value);
+ result = -1; /* parse aborted */
+ }
+ break;
+ }
+#ifdef HAVE_COLOR
+ } else if ((i = find_color(var)) >= 0) {
+ int fg = 0;
+ int bg = 0;
+ int hl = 0;
+ if (str_to_attr(value, &fg, &bg, &hl) == -1) {
+ fprintf(stderr, "\nParse error: attribute "
+ "value expected at line %d of configuration "
+ "file.\n", l);
+ result = -1; /* parse aborted */
+ } else {
+ dlg_color_table[i].fg = fg;
+ dlg_color_table[i].bg = bg;
+ dlg_color_table[i].hilite = hl;
+ }
+ } else {
+#endif /* HAVE_COLOR */
+ fprintf(stderr, "\nParse error: unknown variable "
+ "at line %d of configuration file:\n\t%s\n", l, var);
+ result = -1; /* parse aborted */
+ }
+ break;
+ case LINE_ERROR:
+ fprintf(stderr, "\nParse error: syntax error at line %d of "
+ "configuration file.\n", l);
+ result = -1; /* parse aborted */
+ break;
+ }
+ l++; /* next line */
+ }
+
+ (void) fclose(rc_file);
+ return result;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/README b/Build/source/utils/dialog/dialog-1.1-20080819/samples/README
new file mode 100644
index 00000000000..91f668f014e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/README
@@ -0,0 +1,40 @@
+-- $Id: README,v 1.3 2007/01/11 22:52:19 tom Exp $
+
+You can set the environment-variable DIALOG to whatever program you
+want to check. Default is "dialog".
+
+Use "export DIALOG=/usr/bin/dialog" for sh or "setenv DIALOG ../dialog" for csh
+to test the /usr/bin/dialog program.
+
+-- Here is the original README for the samples directory.
+
+There is no documentation at the moment for cdialog 0.9a, but here are a
+small installer (copismall) for 'points' fido-like, that uses cdialog 0.9a.
+It can demonstrate some of the new features... run "copismall" paying
+attention because after asking for some things, it then installs and/or
+configures programs like as Inn, Ifmail, Smail to make the 'point'.
+It's in Italian language only at moment, but the code is bash......
+If you want look at other much professional products FREE realized with
+cdialog and that use much of the other new characteristics, look for one of
+the ComeOn Point Suites v1.1+. Makers are a sub-group of the ComeOn Linux
+Development Team... ComeOn Linux! follows GNU philosophy.
+
+Mail demarco_p@abramo.it to have the actual location of these Suites and
+of other free ComeOn Linux! software, or if you want more info about
+ComeOn Linux!
+
+To run the "ComeOn Point Installer! v0.9a.small", type:
+$ copismall
+
+Other external samples could be:
+
+copa - ComeOn Point Administrator! v0.8
+copm - ComeOn Point Maintainer! v0.2
+copi - ComeOn Point Installer! v0.9 (system-wide version of copi)
+coepi - ComeOn Expert Point Installer! v1.3 (Professional)
+
+cops - ComeOn Point Suite! v1.1
+copsp - ComeOn Point Suite Professional! v1.1
+
+coui - ComeOn UUCP Installer! v0.1 (makes dialup networks in a moment)
+
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar
new file mode 100755
index 00000000000..5ba8b2d2679
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar
@@ -0,0 +1,17 @@
+#!/bin/sh
+# $Id: calendar,v 1.4 2003/10/09 22:45:06 tom Exp $
+: ${DIALOG=dialog}
+
+exec 3>&1
+USERDATE=`$DIALOG --title "CALENDAR" --calendar "Please choose a date..." 0 0 7 7 1981 2>&1 1>&3`
+code=$?
+exec 3>&-
+
+case $code in
+ 0)
+ echo "Date entered: $USERDATE.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar-stdout b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar-stdout
new file mode 100755
index 00000000000..4562def6e59
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar-stdout
@@ -0,0 +1,14 @@
+#!/bin/sh
+# $Id: calendar-stdout,v 1.1 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+USERDATE=`$DIALOG --stdout --title "CALENDAR" --calendar "Please choose a date..." 0 0 7 7 1981`
+
+case $? in
+ 0)
+ echo "Date entered: $USERDATE.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar2
new file mode 100755
index 00000000000..0cbc323c723
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar2
@@ -0,0 +1,17 @@
+#!/bin/sh
+# $Id: calendar2,v 1.3 2003/10/09 22:45:06 tom Exp $
+: ${DIALOG=dialog}
+
+exec 3>&1
+USERDATE=`$DIALOG --title "CALENDAR" --calendar "Please choose a date..." 0 0 2>&1 1>&3`
+code=$?
+exec 3>&-
+
+case $code in
+ 0)
+ echo "Date entered: $USERDATE.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar2-stdout b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar2-stdout
new file mode 100755
index 00000000000..ab623e96159
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar2-stdout
@@ -0,0 +1,14 @@
+#!/bin/sh
+# $Id: calendar2-stdout,v 1.1 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+USERDATE=`$DIALOG --stdout --title "CALENDAR" --calendar "Please choose a date..." 0 0`
+
+case $? in
+ 0)
+ echo "Date entered: $USERDATE.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar3
new file mode 100755
index 00000000000..325cd6f5749
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar3
@@ -0,0 +1,21 @@
+#!/bin/sh
+# $Id: calendar3,v 1.4 2003/10/09 22:45:06 tom Exp $
+: ${DIALOG=dialog}
+
+exec 3>&1
+USERDATE=`$DIALOG --extra-button --extra-label "Hold" --help-button --title "CALENDAR" --calendar "Please choose a date..." 0 0 7 7 1981 2>&1 1>&3`
+code=$?
+exec 3>&-
+
+case $code in
+ 0)
+ echo "Date entered: $USERDATE.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "Help pressed.";;
+ 3)
+ echo "Hold pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar3-stdout b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar3-stdout
new file mode 100755
index 00000000000..1c44e9e63b1
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/calendar3-stdout
@@ -0,0 +1,18 @@
+#!/bin/sh
+# $Id: calendar3-stdout,v 1.1 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+USERDATE=`$DIALOG --extra-button --extra-label "Hold" --help-button --stdout --title "CALENDAR" --calendar "Please choose a date..." 0 0 7 7 1981`
+
+case $? in
+ 0)
+ echo "Date entered: $USERDATE.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "Help pressed.";;
+ 3)
+ echo "Hold pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist
new file mode 100755
index 00000000000..729bef76a25
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist
@@ -0,0 +1,42 @@
+#! /bin/sh
+# $Id: checklist,v 1.8 2004/12/20 00:14:24 tom Exp $
+: ${DIALOG=dialog}
+
+: ${DIALOG_OK=0}
+: ${DIALOG_CANCEL=1}
+: ${DIALOG_ESC=255}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --backtitle "No Such Organization" \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an apple." off \
+ "Dog" "No, that's not my dog." ON \
+ "Orange" "Yeah, that's juicy." off \
+ "Chicken" "Normally not a pet." off \
+ "Cat" "No, never put a dog and a cat together!" oN \
+ "Fish" "Cats like fish." On \
+ "Lemon" "You know how it tastes." on 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ $DIALOG_OK)
+ echo "'$choice' chosen.";;
+ $DIALOG_CANCEL)
+ echo "Cancel pressed.";;
+ $DIALOG_ESC)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected return code: $retval (ok would be $DIALOG_OK)";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist-8bit b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist-8bit
new file mode 100755
index 00000000000..755511e1d4c
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist-8bit
@@ -0,0 +1,44 @@
+#! /bin/sh
+# $Id: checklist-8bit,v 1.1 2004/12/19 16:47:52 tom Exp $
+: ${DIALOG=dialog}
+
+: ${DIALOG_OK=0}
+: ${DIALOG_CANCEL=1}
+: ${DIALOG_ESC=255}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+. ./testdata-8bit
+
+$DIALOG --backtitle "No Such Organization" \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "`./rotated-data 0 $SAMPLE`" "It's an `./rotated-data 0 $SAMPLE`." off \
+ "`./rotated-data 1 $SAMPLE`" "No, that's not my `./rotated-data 1 $SAMPLE`." ON \
+ "`./rotated-data 2 $SAMPLE`" "Yeah, that's `./rotated-data 2 $SAMPLE`." off \
+ "`./rotated-data 3 $SAMPLE`" "Normally not a `./rotated-data 3 $SAMPLE`." off \
+ "`./rotated-data 4 $SAMPLE`" "No, never put a `./rotated-data 4 $SAMPLE` there!" oN \
+ "`./rotated-data 5 $SAMPLE`" "Cats like `./rotated-data 5 $SAMPLE`." On \
+ "`./rotated-data 6 $SAMPLE`" "You `./rotated-data 6 $SAMPLE` how it is." on 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ $DIALOG_OK)
+ echo "'$choice' chosen.";;
+ $DIALOG_CANCEL)
+ echo "Cancel pressed.";;
+ $DIALOG_ESC)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected return code: $retval (ok would be $DIALOG_OK)";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist-utf8 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist-utf8
new file mode 100755
index 00000000000..f91f20c2bab
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist-utf8
@@ -0,0 +1,51 @@
+#! /bin/sh
+# $Id: checklist-utf8,v 1.4 2007/10/21 21:46:57 tom Exp $
+: ${DIALOG=dialog}
+
+: ${DIALOG_OK=0}
+: ${DIALOG_CANCEL=1}
+: ${DIALOG_ESC=255}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+case none"$LANG$LC_ALL$LC_CTYPE" in
+*UTF-8*)
+ ;;
+*)
+ echo "This script must be run in a UTF-8 locale"
+ exit 1
+ ;;
+esac
+
+$DIALOG --backtitle "No Such Organization" \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "APPLE" "It's an APPLE." off \
+ "DOG" "No, that's not my DOG." ON \
+ "ORANGE" "Yeah, that's JUICY." off \
+ "CHICKEN" "Normally not a PET." off \
+ "CAT" "No, never put a DOG and a CAT together!" oN \
+ "FISH" "Cats like FISH." On \
+ "LEMON" "You KNOW how it TASTES." on 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ $DIALOG_OK)
+ echo "'$choice' chosen.";;
+ $DIALOG_CANCEL)
+ echo "Cancel pressed.";;
+ $DIALOG_ESC)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected return code: $retval (ok would be $DIALOG_OK)";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist1
new file mode 100755
index 00000000000..4db17063963
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist1
@@ -0,0 +1,42 @@
+#! /bin/sh
+# $Id: checklist1,v 1.3 2004/12/20 00:14:24 tom Exp $
+: ${DIALOG=dialog}
+
+: ${DIALOG_OK=0}
+: ${DIALOG_CANCEL=1}
+: ${DIALOG_ESC=255}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --backtitle "No Such Organization" \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "" "It's an apple." off \
+ "Dog" "No, that's not my dog." ON \
+ "Orange" "Yeah, that's juicy." off \
+ "Chicken" "" off \
+ "Cat" "No, never put a dog and a cat together!" oN \
+ "Fish" "Cats like fish." On \
+ "Lemon" "You know how it tastes." on 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ $DIALOG_OK)
+ echo "'$choice' chosen.";;
+ $DIALOG_CANCEL)
+ echo "Cancel pressed.";;
+ $DIALOG_ESC)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected return code: $retval (ok would be $DIALOG_OK)";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist10 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist10
new file mode 100755
index 00000000000..fe30f2ea6a5
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist10
@@ -0,0 +1,40 @@
+#! /bin/sh
+# $Id: checklist10,v 1.2 2004/07/31 11:12:00 tom Exp $
+# zero-width column
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG \
+ --backtitle "No such organization" \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ Dialog "" on \
+ Readline "" off \
+ Gnome "" off \
+ Kde "" off \
+ Editor "" off \
+ Noninteractive "" on \
+ 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "'$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist2
new file mode 100755
index 00000000000..b2314a7039c
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist2
@@ -0,0 +1,40 @@
+#! /bin/sh
+# $Id: checklist2,v 1.4 2004/12/20 00:14:24 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --item-help --backtitle "No Such Organization" \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an apple." off "fruit" \
+ "Dog" "No, that's not my dog." ON "not a fruit" \
+ "Orange" "Yeah, that's juicy." off "fruit" \
+ "Chicken" "Normally not a pet." off "not a fruit" \
+ "Cat" "No, never put a dog and a cat together!" oN "not a fruit" \
+ "Fish" "Cats like fish." On "not a fruit" \
+ "Lemon" "You know how it tastes." on "the only one you wouldn't eat" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist3
new file mode 100755
index 00000000000..d7574a68bd6
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist3
@@ -0,0 +1,40 @@
+#! /bin/sh
+# $Id: checklist3,v 1.4 2004/12/20 00:14:24 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --item-help --backtitle "No Such Organization" \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an apple. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "fruit" \
+ "Dog" "No, that's not my dog. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ON "not a fruit" \
+ "Orange" "Yeah, that's juicy. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "fruit" \
+ "Chicken" "Normally not a pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "not a fruit" \
+ "Cat" "No, never put a dog and a cat together! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" oN "not a fruit" \
+ "Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
+ "Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist4 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist4
new file mode 100755
index 00000000000..434bdda5570
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist4
@@ -0,0 +1,40 @@
+#! /bin/sh
+# $Id: checklist4,v 1.5 2004/12/20 00:14:24 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --help-button --item-help --backtitle "No Such Organization" \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an apple. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "fruit" \
+ "Dog" "No, that's not my dog. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ON "not a fruit" \
+ "Orange" "Yeah, that's juicy. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "fruit" \
+ "Chicken" "Normally not a pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "not a fruit" \
+ "Cat" "No, never put a dog and a cat together! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" oN "not a fruit" \
+ "Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
+ "Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist5 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist5
new file mode 100755
index 00000000000..9f967290912
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist5
@@ -0,0 +1,41 @@
+#! /bin/sh
+# $Id: checklist5,v 1.4 2004/12/20 00:14:24 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --help-button --item-help --backtitle "No Such Organization" \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an apple. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "fruit" \
+ "Dog" "No, that's not my dog. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ON "not a fruit" \
+ "Orange" "Yeah, that's juicy. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "fruit" \
+ "Chicken" "Normally not a pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "not a fruit" \
+ "" "No such pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "not anything" \
+ "Cat" "No, never put a dog and a cat together! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" oN "not a fruit" \
+ "Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
+ "Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist6 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist6
new file mode 100755
index 00000000000..9a9a2ecbdb9
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist6
@@ -0,0 +1,42 @@
+#! /bin/sh
+# $Id: checklist6,v 1.4 2005/10/05 23:43:22 tom Exp $
+# example showing the --colors option
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --help-button --item-help --colors --backtitle "\Z1No Such\Zn Organization" \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+\Z4UP/DOWN\Zn arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an \Z1apple\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "fruit" \
+ "Dog" "No, that's not my dog. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ON "not a fruit" \
+ "Orange" "Yeah, that's juicy. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "fruit" \
+ "Chicken" "Normally not a pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "not a fruit" \
+ "" "No such pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "not anything" \
+ "Cat" "No, never put a dog and a cat together! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" oN "not a fruit" \
+ "Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
+ "Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist7 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist7
new file mode 100755
index 00000000000..24e54dd1232
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist7
@@ -0,0 +1,46 @@
+#! /bin/sh
+# $Id: checklist7,v 1.4 2005/10/05 23:43:22 tom Exp $
+# "checklist6" with --separate-output
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --help-button \
+ --item-help \
+ --colors \
+ --backtitle "\Z1No Such\Zn Organization" \
+ --separate-output \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+\Z4UP/DOWN\Zn arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an \Z1apple\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "fruit" \
+ "Dog" "No, that's not my dog. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ON "not a fruit" \
+ "Orange" "Yeah, that's juicy. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "fruit" \
+ "Chicken" "Normally not a pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "not a fruit" \
+ "" "No such pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off "not anything" \
+ "Cat" "No, never put a dog and a cat together! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" oN "not a fruit" \
+ "Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
+ "Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist8 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist8
new file mode 100755
index 00000000000..3f79aadc571
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist8
@@ -0,0 +1,45 @@
+#! /bin/sh
+# $Id: checklist8,v 1.3 2005/10/05 23:43:22 tom Exp $
+# "checklist7" without --item-help
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --help-button \
+ --colors \
+ --backtitle "\Z1No Such\Zn Organization" \
+ --separate-output \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+\Z4UP/DOWN\Zn arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an \Z1apple\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off \
+ "Dog" "No, that's not my dog. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ON \
+ "Orange" "Yeah, that's juicy. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off \
+ "Chicken" "Normally not a pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off \
+ "" "No such pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off \
+ "Cat" "No, never put a dog and a cat together! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" oN \
+ "Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On \
+ "Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist9 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist9
new file mode 100755
index 00000000000..f6700dcfd2b
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist9
@@ -0,0 +1,23 @@
+#! /bin/sh
+# $Id: checklist9,v 1.1 2004/03/13 19:25:43 tom Exp $
+# "checklist8" using --file
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --file checklist9.txt 2>$tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0|2)
+ echo "'$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist9.txt b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist9.txt
new file mode 100644
index 00000000000..cdb26522170
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/checklist9.txt
@@ -0,0 +1,21 @@
+--help-button \
+ --colors \
+ --backtitle "\Z1No Such\Zn Organization" \
+ --separate-output \
+ --title "CHECKLIST BOX" \
+ --checklist "Hi, this is a checklist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+\Z4UP/DOWN\Zn arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an \Z1apple\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off \
+ "Dog" "No, that's not my dog. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ON \
+ "Orange" "Yeah, that's juicy. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off \
+ "Chicken" "Normally not a pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off \
+ "" "No such pet. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" off \
+ "Cat" "No, never put a dog and a cat together! xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" oN \
+ "Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On \
+ "Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/admin.funcs b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/admin.funcs
new file mode 100755
index 00000000000..27800dc876f
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/admin.funcs
@@ -0,0 +1,200 @@
+#!/bin/bash
+# $Id: admin.funcs,v 1.2 2001/01/15 22:20:11 tom Exp $
+#
+# ComeOn Point Functions! v0.9.2
+# - usate da vari altri moduli ComeOn Point...
+#
+# AUTHOR: Beppe (beppe.dem@nsm.it)
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+# Args: source_file, domain, nldir
+install_nodelist() {
+
+ NODELIST="$1"
+ FOR_DOMAIN="$2"
+ NODEDIR="$3"
+
+ dialog --backtitle "$TITLE" --infobox "Installo la nodelist '$NODELIST' per il domain $FOR_DOMAIN, attendere prego..." 0 0
+
+ cp "$NODELIST" $NODEDIR/$FOR_DOMAIN.ndl
+ chown fnet.uucp $NODEDIR/$FOR_DOMAIN.ndl
+
+ echo "y" | su -l fnet -c "ifindex" >/dev/null
+}
+
+# Args: source, dest
+add_alias() {
+
+ SOURCE=$1
+ DEST=$2
+ ALIASES=/etc/aliases
+ ENTRY="`grep $SOURCE: $ALIASES`"
+
+ dialog --backtitle "$TITLE" --infobox "Creo un alias per redirigere le mail per $SOURCE a $DEST ..." 0 0
+
+ if [ ! "$ENTRY" ]
+ then
+ echo "$SOURCE: $DEST" >>$ALIASES
+ else
+ OLDDEST="`echo $ENTRY | cut -f2 -d:`"
+ mkstemp alias
+ sed /"$SOURCE:"/s/"$OLDDEST"/" $DEST"/ $ALIASES >$tmp_alias
+ cat $tmp_alias >$ALIASES
+ rm $tmp_alias
+ fi
+ mkaliases >/dev/null
+}
+
+# Args: Areas_pathname, newsgroup, area_ftn, description [, expire_days]
+# Returns: 1 - innd not running
+# 2 - already existing newsgroup
+# 3 - already existing ftn_area
+create_newsgroup() {
+
+ AREAS="$1"
+ NEWSGROUP="$2"
+ AREA="$3"
+ DESCRIPTION="$4"
+ EXPIRE_DAYS="$5"
+
+ NEWSGROUPS=~news/newsgroups
+ EXPIRECTL=~news/expire.ctl
+
+ dialog --backtitle "$TITLE" --infobox "Creo il newsgroup $NEWSGROUP per contenere i messaggi dell'area $AREA..." 0 0
+
+ if [ ! "`ps ax | grep ~news/etc/innd`" ]
+ then
+ return 1
+ fi
+
+ if [ "`cut $NEWSGROUPS -f1 | cut -f1 -d\ | grep -x $NEWSGROUP`" ]
+ then
+ return 2
+ fi
+
+ if [ "`cut $AREAS -f1 | cut -f1 -d\ | grep -x $AREA`" ]
+ then
+ return 3
+ fi
+
+ su -l news -c "bin/ctlinnd newgroup $NEWSGROUP" >/dev/null
+ echo -e "$NEWSGROUP\t$DESCRIPTION" >> $NEWSGROUPS
+ echo -e "$AREA\t$NEWSGROUP\t`echo $NEWSGROUP | cut -f1 -d.`" >> $AREAS
+
+ if [ "$EXPIRE_DAYS" ]; then
+ echo "$NEWSGROUP:A:2:$EXPIRE_DAYS:$EXPIRE_DAYS" >> $EXPIRECTL
+ fi
+
+ chown news.news $NEWSGROUPS $EXPIRECTL
+ chmod 440 $EXPIRECTL
+ chown fnet.uucp $AREAS
+}
+
+# Returns: 0 if ok, 1 if (innd not running), 2 if (no that newsgroup)
+# Args: Areas_pathname, newsgroup
+rmgroup() {
+
+ AREAS=$1
+ NEWSGR=$2
+ NEWSGROUPS=~news/newsgroups
+ EXPIRE=~news/expire.ctl
+
+ dialog --backtitle "$TITLE" --infobox "Elimino il newsgroup $NEWSGR ed i messaggi in esso contenuti, attendere prego. Questa operazione potrebbe durare alcuni minuti." 0 0
+
+ if [ ! "`ps x | grep ~news/etc/innd`" ]
+ then
+ return 1
+ fi
+
+ if [ ! "`cut -f1 $NEWSGROUPS | cut -f1 -d\ | grep -x $NEWSGR`" ]
+ then
+ return 2
+ else
+
+# Updating newsgroups file
+ if [ -f $NEWSGROUPS ]
+ then
+ mkstemp groups
+ mv $NEWSGROUPS $NEWSGROUPS~
+ grep -v $NEWSGR $NEWSGROUPS~ >$tmp_groups
+ mv $tmp_groups $NEWSGROUPS
+ else
+ :> $NEWSGROUPS
+ fi
+ chown news.news $NEWSGROUPS
+
+# Updating Areas file
+ if [ -f $AREAS ]
+ then
+ mkstemp areas
+ mv $AREAS $AREAS~
+ grep -v $NEWSGR $AREAS~ >$tmp_areas
+ mv $tmp_areas $AREAS
+ else
+ :> $AREAS
+ fi
+ chown fnet.uucp $AREAS
+
+# Updating expire.ctl file
+ if [ -f $EXPIRE ]
+ then
+ mkstemp expire
+ mv $EXPIRE $EXPIRE~
+ grep -v "$NEWSGR:" $EXPIRE~ >$tmp_expire
+ mv $tmp_expire $EXPIRE
+ else
+ :> $EXPIRE
+ fi
+ chown news.news $EXPIRE
+ chmod 444 $EXPIRE
+# Remove pending articles
+ echo -e "\n$NEWSGR:A:0:0:0" >>$EXPIRE
+ su -l news -c "bin/news.daily" >/dev/null
+ mkstemp expire
+ grep -v $NEWSGR $EXPIRE >$tmp_expire
+ mv $tmp_expire $EXPIRE
+ chown news.news $EXPIRE
+ chmod 444 $EXPIRE
+
+# Updating active file
+ su -l news -c "bin/ctlinnd rmgroup $NEWSGR" >/dev/null
+ fi
+}
+
+# Args: newsgroups_wildmat, days_to_keep
+set_expire_time() {
+
+ NEWSGROUP="$1"
+ KEEPDAYS="$2"
+ EXPIRE=~news/expire.ctl
+
+ dialog --backtitle "$TITLE" --infobox "Imposto a $KEEPDAYS il numero di giorni di mantenimento dei messaggi del newsgroup $NEWSGROUP..." 0 0
+
+ if [ ! -f $EXPIRE ]
+ then
+ :> $EXPIRE
+
+ elif [ "`cut $EXPIRE -s -f1 -d: | grep -x $NEWSGROUP`" ]
+ then
+ mkstemp expire
+ grep -v "$NEWSGROUP:" $EXPIRE >$tmp_expire
+ mv $tmp_expire $EXPIRE
+ fi
+ echo -e "\n$NEWSGROUP:A:2:$KEEPDAYS:$KEEPDAYS" >>$EXPIRE
+ chown news.news $EXPIRE
+ chmod 444 $EXPIRE
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/common.funcs b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/common.funcs
new file mode 100755
index 00000000000..04eca9a8400
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/common.funcs
@@ -0,0 +1,338 @@
+#
+# ComeOn Point Functions! v0.9.2
+# - usate da vari altri moduli ComeOn Point...
+#
+# AUTHOR: Beppe (beppe.dem@nsm.it)
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+save() {
+ if [ -f $1 ]
+ then
+ mv $1 $1~
+ fi
+}
+
+# Returns $PKG_TO_REMOVE
+find_incompatible_packages() {
+ dialog --backtitle "$TITLE" --infobox "Vediamo innanzitutto se c'e' qualche pacchetto di troppo ... ;-)" 0 0
+
+ PKG_TO_REMOVE=""
+ for i in sendmail smailcfg cnews
+ do
+ if [ -f /var/adm/packages/$i ]
+ then
+ PKG_TO_REMOVE="$PKG_TO_REMOVE $i"
+ fi
+ done
+}
+
+# Returns $PKG_TO_INSTALL
+find_necessary_packages() {
+ dialog --backtitle "$TITLE" --infobox "Controlliamo se manca qualche pacchetto..." 0 0
+
+ PKG_TO_INSTALL=""
+ for i in tcpip mailx inn
+ do
+ if [ ! -f /var/adm/packages/$i ]
+ then
+ PKG_TO_INSTALL="$PKG_TO_INSTALL $i"
+ fi
+ done
+}
+
+# Args: user, editor
+configure_trn() {
+ dialog --backtitle "$TITLE" --infobox "Configuro trn all'user $1..." 0 0
+
+ SHELL_USED="`basename \`cut /etc/passwd -f1,7 -d: | grep $1: | cut -f2 -d:\``"
+ USER_HOME="`cut /etc/passwd -f1,6 -d: | grep $1: | cut -f2 -d:`"
+ TRNRC="$USER_HOME/.trnrc"
+
+ case $SHELL_USED in
+ bash)
+ if [ -f $USER_HOME/.bash_profile ]
+ then
+ PROF=$USER_HOME/.bash_profile
+ else
+ PROF=$USER_HOME/.profile
+ fi;;
+ zsh)
+ PROF=$USER_HOME/.zprofile;;
+ *)
+ PROF=$USER_HOME/.profile;;
+ esac
+
+ if [ ! -f $PROF ]
+ then
+ :>$PROF
+ chown $1.mail $PROF
+ elif [ ! "`grep -x \". ~/.trnrc\" $PROF`" ]
+ then
+ echo -e "\n. ~/.trnrc" >>$PROF
+ fi
+
+ save $TRNRC
+
+ echo "EDITOR=\"$2\"" > $TRNRC
+ cat copi.trnrc >> $TRNRC
+ chown $1.mail $TRNRC
+}
+
+# Args: user, editor
+configure_elm() {
+ USER=$1
+ EDIT=$2
+
+ dialog --backtitle "$TITLE" --infobox "Configuro elm all'user $USER..." 0 0
+
+ USER_HOME="`cut /etc/passwd -f1,6 -d: | grep $USER: | cut -f2 -d:`"
+ DIRRC="$USER_HOME/.elm"
+ ELMRC="$DIRRC/elmrc"
+
+ mkdir -p $DIRRC -m 700
+ chown $USER.mail $USERHOME $DIRRC
+
+ save $ELMRC
+
+ cat <<EOF >$ELMRC
+#
+# .elm/elmrc - options file for the ELM mail system
+#
+# Generated by $PKTNAME for $USER
+#
+
+# For yes/no settings with ?, ON means yes, OFF means no
+
+# how to sort the alias list, "Name" by default
+### aliassortby = Name
+
+# name of editor to use for replies that have text
+alteditor = $EDIT
+
+# alternative addresses that I could receive mail from (usually a
+# forwarding mailbox) and don't want to have listed...
+### alternatives =
+
+# should the default be to delete messages we've marked for deletion?
+alwaysdelete = ON
+
+# should the default be to keep unread messages in the incoming mailbox?
+alwayskeep = ON
+
+# should the default be to store read messages to the "received" folder?
+alwaysstore = OFF
+
+# should we use the "->" rather than the inverse video bar?
+arrow = OFF
+
+# should the message disposition questions be displayed(ON) or
+# auto-answered(OFF) with the default answers when we resync or
+# change folders?
+ask = OFF
+
+# would you like to be asked for Carbon-Copies information each msg?
+askcc = OFF
+
+# attribution string for replies ('%s' is the author of original message)
+attribution = %s wrote:
+
+# automatically copy message being replied to into buffer?
+autocopy = ON
+
+# threshold for bouncing copies of remote uucp messages...
+# zero = disable function.
+### bounceback = 0
+
+# This is used to determine if the builtin pager should be used on some
+# messages even if you would usually use an external pager program.
+# There are two ways of determining whether the builtin pager should be
+# used. If you want any message that is shorter than "n" lines to use the
+# internal pager, set the parameter to "n". If you want the builtin
+# pager to be used if the message is "m" lines shorter than the number of
+# lines on your screen set the parameter to be "-m". Setting the
+# parameter to zero will result in the message always being sent through
+# your external pager.
+### builtinlines = -3
+
+# where to save calendar entries
+#calendar = /root/calendar
+
+# list of options that can be configured at the "o)ptions" screen
+configoptions = ^_cdefsopyv_am_un
+
+# Should elm always ask the user to confirm before it appends
+# messages to any existing file?
+# This is used for both folders in the user's mail directory
+# and ordinary files.
+confirmappend = OFF
+
+# Should elm always ask the user to confirm before it creates
+# any new files?
+# This is used for both folders in the user's mail directory
+# and ordinary files.
+confirmcreate = OFF
+
+# Should elm ask for confirmation before it appends a message
+# to an existing file that is not a folder in the user's Mail
+# directory?
+# This is used for ordinary files only and does not affect
+# folders in the user's mail directory.
+confirmfiles = OFF
+
+# Should elm ask for confirmation before it creates a new folder
+# in the user's Mail directory?
+# This is used only for folders in the user's mail directory and
+# does not affect ordinary files.
+confirmfolders = OFF
+
+# save a copy of all outbound messages?
+copy = ON
+
+# name of editor for ~e command (when editor="builtin")
+easyeditor = $EDIT
+
+# what editor to use ("none" means simulate Berkeley Mail)
+editor = $EDIT
+
+# the character to use in the builtin editor for entering commands
+### escape = ~
+
+# save outbound messages by login name of sender/recipient even if the
+# associated folder doesn't already exist?
+### forcename = OFF
+
+# do we want to be able to mail out AT&T Mail Forms?
+### forms = OFF
+
+# The full user name for outbound mail
+### fullname = $PKTNAME User
+
+# should we keep folders from which all messages are deleted?
+### keepempty = OFF
+
+# are we running on an HP terminal and want HOME, PREV, NEXT, etc...?
+### keypad = OFF
+
+# local ".signature" file to append to appropriate messages...
+localsignature = ~/.signature
+
+# where to save my mail to, default directory is "Mail"
+maildir = ~/Mail
+
+# should we display the three-line 'mini' menu?
+menu = ON
+
+# would you like a copy of a message you send to an alias you are on?
+### metoo = OFF
+
+# when using the page commands (+ - <NEXT> <PREV>) change the current
+# message pointer...?
+### movepage = OFF
+
+# just show the names when expanding aliases?
+names = OFF
+
+# when messages are copied into the outbound buffer, don't include headers?
+noheader = ON
+
+# program to use for displaying messages ('builtin' is recommended)
+### pager = builtin+
+
+# start up by pointing to the first new message received, if possible?
+### pointnew = ON
+
+# list of delivery precedences allowed, or empty to allow anything
+# precedence may be followed by optional ":priority" specification
+### precedences =
+
+# prefix sequence for indenting included message text in outgoing messages...
+prefix = _:>_
+
+# how to print a message ('%s' is the filename)
+### print = /bin/cat %s | /usr/bin/lpr
+
+# prompt for a command after the external pager exits?
+### promptafter = ON
+
+# Value by which message count is incremented while reading a new mailbox.
+# Setting this value to a number larger than one will speed up the time it
+# takes to read a large mailbox when using a slow terminal.
+### readmsginc = 1
+
+# where to save received messages to, default file is "=received"
+receivedmail = =received
+
+# remote ".signature" file to append to appropriate messages...
+remotesignature = ~/.signature
+
+# emulate the mailx message increment mode (only increment after
+# something has been 'done' to a message, either saved or deleted,
+# as opposed to simply each time something is touched)?
+### resolve = ON
+
+# save messages, incoming and outbound, by login name of sender/recipient?
+savename = ON
+
+# where to save copies of outgoing mail to, default file is "=sent"
+sentmail = =sent
+
+# The shell to use for shell escapes
+shell = /bin/sh
+
+# do we want dashes above signatures? (News 2.11 compatibility and convention)
+### sigdashes = ON
+
+# time in seconds which Elm will wait after displaying a transient message
+# and before erasing it. Can be 0 or positive integer.
+### sleepmsg = 2
+
+# are we running on an HP terminal and want softkeys available too?
+# (this implies "keypad=ON" too)
+### softkeys = OFF
+
+# how to sort folders, "Reverse Sent" by default
+### sortby = Reverse-Sent
+
+# Set the main prompt timeout for resynching...
+### timeout = 600
+
+# display message title when displaying pages of message?
+titles = ON
+
+# where to place temporary files, default directory is "/tmp"
+### tmpdir = /tmp/
+
+# are we good at it? 0=beginner, 1=intermediate, 2+ = expert!
+userlevel = 0
+
+# would you like to use termcap/terminfo ti/te entries?
+usetite = ON
+
+# name of editor for ~v command (when editor="builtin")
+visualeditor = $EDIT
+
+# enable the weedout list to be read?
+### weed = ON
+
+# what headers I DON'T want to see, ever.
+weedout = "*end-of-user-headers*"
+
+EOF
+
+ chmod 600 $ELMRC
+ chown $USER.mail $ELMRC
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.funcs b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.funcs
new file mode 100755
index 00000000000..7be4bdb4151
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.funcs
@@ -0,0 +1,1303 @@
+#!/bin/bash
+# $Id: copi.funcs,v 1.3 2001/01/15 22:24:26 tom Exp $
+# ComeOn Point Functions! v0.9.2
+# - usate da vari altri moduli ComeOn Point...
+#
+# AUTHOR: Beppe (beppe.dem@nsm.it)
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+HOST=`hostname`
+DOMAIN=`hostname -d`
+PKTNAME="ComeOn Point Installer!"
+COMEONDIR=/usr/lib/ComeOn
+
+AKASETUP=$COMEONDIR/point/.akasetup
+COPIUSER=$COMEONDIR/point/.copi.user
+EMSIFILE=$COMEONDIR/point/.emsi
+PNTSETUP=$COMEONDIR/point/.pntsetup
+
+mkstemp() {
+ eval 'tmp_'$1'=`tempfile 2>/dev/null` || tmp_'$1'=/tmp/'$1'$$'
+}
+
+# Args: [start_uid]
+# Returns: $FOUND_UID
+find_unused_uid() {
+
+ if [ $1 ]; then
+ FOUND_UID=$1
+ else
+ FOUND_UID=501
+ fi
+
+ while [ "`cut -f3 -d: /etc/passwd | grep -x $FOUND_UID`" ]
+ do
+ FOUND_UID=$[$FOUND_UID+1]
+ done
+}
+
+int2fido() {
+ _RETVAL="`echo $1 | cut -f3 -d. | cut -c2-`:\
+`echo $1 | cut -f2 -d. | cut -c2-`/\
+`echo $1 | cut -f1 -d. | cut -c2-`"
+}
+int2fidonet() {
+ _RETVAL="`echo $1 | cut -f3 -d. | cut -c2-`:\
+`echo $1 | cut -f2 -d. | cut -c2-`/\
+`echo $1 | cut -f1 -d. | cut -c2-`@\
+`echo $1 | cut -f4- -d.`"
+}
+fido2int() {
+ _RETVAL="f\
+`echo $1 | cut -f2 -d '/'`.n\
+`echo $1 | cut -f1 -d '/' | cut -f2 -d:`.z\
+`echo $1 | cut -f1 -d '/' | cut -f1 -d:`"
+}
+fidonet2int() {
+ _RETVAL="f\
+`echo $1 | cut -f2 -d/ | cut -f1 -d@`.n\
+`echo $1 | cut -f1 -d/ | cut -f2 -d:`.z\
+`echo $1 | cut -f1 -d/ | cut -f1 -d:`.\
+`echo $1 | cut -f2 -d@`"
+}
+fidonetpoint2int() {
+ _RETVAL="p\
+`echo $1 | cut -f2 -d. | cut -f1 -d@`.f\
+`echo $1 | cut -f2 -d/ | cut -f1 -d.`.n\
+`echo $1 | cut -f2 -d: | cut -f1 -d/`.z\
+`echo $1 | cut -f1 -d/ | cut -f1 -d:`.\
+`echo $1 | cut -f2 -d@`.org"
+}
+
+# Parameters: fqdn
+configure_loopback() {
+ dialog --backtitle "$TITLE" --infobox "Configuro la rete (in modo loopback)..." 0 0
+
+ FQDN=$1
+ HOST=`echo $FQDN | cut -f1 -d.`
+ DOMAIN=`echo $FQDN | cut -f2- -d.`
+
+ save /etc/hostname
+ echo $FQDN >/etc/HOSTNAME
+ export HOSTNAME=$FQDN
+ hostname $HOST
+
+ save /etc/rc.d/rc.inet1
+ cat <<EOF >/etc/rc.d/rc.inet1
+#! /bin/sh
+#
+# rc.inet1 This shell script boots up the base INET system.
+
+# Attach the loopback device.
+/sbin/ifconfig lo 127.0.0.1
+/sbin/route add -net 127.0.0.0
+
+# End of rc.inet1
+EOF
+ chmod 755 /etc/rc.d/rc.inet1
+
+
+ save /etc/networks
+ cat <<EOF >/etc/networks
+#
+# networks This file describes a number of netname-to-address
+# mappings for the TCP/IP subsystem. It is mostly
+# used at boot time, when no name servers are running.
+#
+
+loopback 127.0.0.0
+
+# End of networks.
+EOF
+ chmod 644 /etc/networks
+
+
+ save /etc/hosts
+ cat <<EOF >/etc/hosts
+#
+# hosts This file describes a number of hostname-to-address
+# mappings for the TCP/IP subsystem. It is mostly
+# used at boot time, when no name servers are running.
+# On small systems, this file can be used instead of a
+# "named" name server. Just add the names, addresses
+# and any aliases to this file...
+#
+# By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
+# should NEVER be named with the name of the machine. It causes problems
+# for some (stupid) programs, irc and reputedly talk. :^)
+#
+# But we (ComeOn Linux!) says that this is not valid for you, because
+# you resulted to have not a network at the installation time.
+
+# For loopbacking.
+127.0.0.1 localhost $FQDN $HOST
+
+# End of hosts.
+EOF
+ chmod 644 /etc/hosts
+
+ save /etc/resolv.conf
+ echo domain $DOMAIN >/etc/resolv.conf
+ chmod 644 /etc/resolv.conf
+
+ save /etc/host.conf
+ cat <<EOF >/etc/host.conf
+order hosts,bind
+multi on
+EOF
+ chmod 644 /etc/host.conf
+
+ /etc/rc.d/rc.inet1
+}
+
+# Private function, adds an user to a group. Args: user, group
+add_to_group() {
+
+ if [ ! "`groups \"$1\" | grep \" $2 \"`" ]
+ then
+ USERS="`grep \"$2:\" /etc/group | cut -s -f4 -d:`"
+
+ mkstemp group
+ if [ "$USERS" ]; then
+ sed "/$2:/s/:$USERS/:$USERS,$1/" /etc/group >$tmp_group
+ else
+ sed "/$2:/s/:/:$1/3" /etc/group >$tmp_group
+ fi
+
+ save /etc/group
+ mv $tmp_group /etc/group
+ fi
+}
+
+# Arguments: user, fullname
+add_postmaster() {
+ dialog --backtitle "$TITLE" --infobox "Creo l'user principale e/o ne adatto le informazioni..." 0 0
+
+ USER="$1"
+ NAME="$2"
+ HOMEDIR="/home/$USER"
+
+# echo "$USER" >$COPIUSER # you've to do this in any other location
+ ENTRY="`cut /etc/passwd -s -f1,2,5 -d: | grep $USER:`"
+ if [ "$ENTRY" ]
+ then
+ OLDNAME="`echo $ENTRY | cut -f3 -d:`"
+ PASW="`echo $ENTRY | cut -f2 -d:`"
+ if [ "$OLDNAME" != "$NAME" ]
+ then
+ mkstemp passwd
+ sed "/$USER:$PASW:/s/:$OLDNAME:/:$NAME:/" /etc/passwd >$tmp_passwd
+ save /etc/passwd
+ mv $tmp_passwd /etc/passwd
+ fi
+
+ add_to_group "$USER" mail
+ else
+ if [ -f /bin/bash ]; then USERSHELL=/bin/bash; else USERSHELL=""; fi
+ find_unused_uid
+ echo "$USER:*:$FOUND_UID:12:$NAME:$HOMEDIR:$USERSHELL" >>/etc/passwd
+ mkdir -p $HOMEDIR -m 755
+ chown $USER.mail $HOMEDIR
+ fi
+}
+
+comment_nntp_in_inetdconf() {
+ dialog --backtitle "$TITLE" --infobox "Commento la riga 'nntp' in /etc/inetd.conf..." 0 0
+
+ mkstemp inetd
+ sed "/in.nntpd/s/nntp/#&/" /etc/inetd.conf >$tmp_inetd
+ save /etc/inetd.conf
+ mv $tmp_inetd /etc/inetd.conf
+ killall -1 inetd
+}
+
+# Args: organization
+set_organization() {
+ dialog --backtitle "$TITLE" --infobox "Imposto l' origin..." 0 0
+
+ ORGANIZATION=/etc/organization
+ save $ORGANIZATION
+
+ NEW_ORGANIZATION="$1"
+ echo "$NEW_ORGANIZATION" >$ORGANIZATION
+}
+
+create_innconf_newsfeeds_distrib() {
+ dialog --backtitle "$TITLE" --infobox "Creo i files di configurazione principali di InterNet News (inn)..." 0 0
+
+# File: inn.conf
+ INNCONF=~news/inn.conf
+ save $INNCONF
+
+ cat <<EOF >$INNCONF
+## $Revision: 1.3 $
+## inn.conf -- inn configuration data
+## Format:
+## <parameter>:<whitespace><value>
+## Used by various programs and libinn. The following parameters are defined:
+## domain Local domain, without leading period.
+## fromhost What to put in the From line; default is FQDN
+## of the local host.
+## moderatormailer Where to mail moderated postings, if not found
+## in the moderators file; see moderators(5).
+## pathhost What to put in the Path and Xref headers; default
+## is FQDN of the local host.
+## organization If $ORGANIZATION doesn't exist. What to put in
+## the Organization header if blank.
+## server If $NNTPSERVER doesn't exist. Local NNTP server
+## host to connect to.
+##
+
+server: $HOST.$DOMAIN
+domain: $DOMAIN
+pathhost: $HOST
+EOF
+
+ chmod 444 $INNCONF
+ chown news.news $INNCONF
+
+
+# File: newsfeeds
+ NEWSFEEDS=~news/newsfeeds
+ save $NEWSFEEDS
+
+ echo -e "ME:*::\n" >$NEWSFEEDS
+
+ IAKA=1
+ OK=1
+ while [ "$OK" != 0 ]
+ do
+ AKA="`cut $AKASETUP -f$IAKA -d:`"
+ if [ ! "$AKA" ]
+ then
+ OK=0
+ else
+ if [ $IAKA != 1 ]
+ then
+ TMPAKA="`echo $AKA | cut -f-4 -d.`"
+ SENDCRON="$SENDCRON $TMPAKA"
+ echo -n "$TMPAKA/" >>$NEWSFEEDS
+ fi
+ TMPAKA="`echo $AKA | cut -f1-2 -d.`"
+ if [ $IAKA = 1 ]; then
+ SENDCRON="$SENDCRON $TMPAKA"
+ fi
+ echo -e "$TMPAKA\\" >>$NEWSFEEDS
+ echo -e "\t:!*,`echo $AKA | cut -f4 -d.`.*\\" >>$NEWSFEEDS
+ echo -e "\t:Tf,Wfb,B4096/1024:\n" >>$NEWSFEEDS
+ fi
+ IAKA=$[$IAKA+1]
+ done
+
+ chmod 444 $NEWSFEEDS
+ chown news.news $NEWSFEEDS
+
+
+# File: distrib.pats
+ DISTRIB=~news/distrib.pats
+ save $DISTRIB
+
+ IAKA=1
+ OK=1
+ while [ "$OK" != 0 ]; do
+ AKA="`cut $AKASETUP -f$IAKA -d:`"
+ IAKA=$[$IAKA+1]
+ if [ "$AKA" = "" ]; then
+ OK=0
+ else
+ DOM="`echo $AKA | cut -f4 -d.`"
+ echo "10:$DOM.*:$DOM" >>$DISTRIB
+ fi
+ done
+
+ chmod 444 $DISTRIB
+ chown news.news $DISTRIB
+}
+
+# Args: num_of_days
+create_expirectl() {
+ dialog --backtitle "$TITLE" --infobox "Imposto il periodo di transito dei messaggi..." 0 0
+
+ EXPIRECTL=~news/expire.ctl
+ save $EXPIRECTL
+
+ EXPIRE_DAYS=$1
+
+ echo -e "/remember/:14\n\n*:A:2:$EXPIRE_DAYS:$EXPIRE_DAYS" >$EXPIRECTL
+
+ chmod 440 $EXPIRECTL
+ chown news.news $EXPIRECTL
+}
+
+create_nnrpaccess() {
+ dialog --backtitle "$TITLE" --infobox "Rendo accessibili le news in lettura..." 0 0
+
+ NNRPACCESS=~news/nnrp.access
+ save $NNRPACCESS
+
+ cat <<EOF >$NNRPACCESS
+## $Revision: 1.3 $
+## nnrp.access - access file for on-campus NNTP sites
+## Format:
+## <host>:<perm>:<user>:<pass>:<groups>
+## Connecting host must be found in this file; the last match found is
+## used, so put defaults first.
+## <host> Wildcard name or IP address
+## <perm> R to read; P to post
+## <user> Username for authentication before posting
+## <pass> Password, for same reason
+## <groups> Newsgroup patterns that can be read or not read
+## To disable posting put a space in the <user> and <pass> fields, since
+## there is no way for client to enter one.
+##
+## Default is no access, no way to authentication, and no groups.
+# *:: -no- : -no- :!*
+## Foo, Incorporated, hosts have no password, can read anything.
+# *.foo.com:Read Post:::*
+
+*:: -no- : -no- :!*
+localhost.$DOMAIN:Read Post:::*
+$HOST.$DOMAIN:Read Post:::*
+
+EOF
+
+ chmod 440 $NNRPACCESS
+ chown news.news $NNRPACCESS
+}
+
+create_hostsnntp() {
+ dialog --backtitle "$TITLE" --infobox "Rendo accessibili le news in scrittura..." 0 0
+
+ HOSTSNNTP=~news/hosts.nntp
+ save $HOSTSNNTP
+
+ cat <<EOF >$HOSTSNNTP
+## $Revision: 1.3 $
+## hosts.nntp - names and addresses that feed us news
+## Format
+## <host>:
+## <host>:<password>
+## <host> can be a name or IP address; no wildcards. Any hosts not
+## listed here are handed off to nnrpd.
+
+$HOST.$DOMAIN:
+
+EOF
+
+ chmod 440 $HOSTSNNTP
+ chown news.news $HOSTSNNTP
+}
+
+create_dirs_and_files() {
+
+ CURMASK=`umask`
+ . ./copi.wheel
+ pushd /var/log >/dev/null
+ mkdir -p news -m 755; chown news.news news
+ cd /var/log/news; mkdir -p OLD -m 755; chown news.news OLD
+ cd /var/spool; mkdir -p news -m 775; chown news.news news
+ cd /var/spool/news; umask 02
+ mkdir -p out.going control junk in.coming
+ chown news.news out.going control junk in.coming
+ cd in.coming; mkdir -p bad tmp; chown news.news bad tmp; umask $CURMASK
+ ln -sf ~news /usr/local/lib/
+ ln -sf ~news/inews /usr/bin/
+ chmod 1777 /var/tmp
+
+ cd /var/spool
+ mkdir -p uucppublic
+ chown uucp.uucp uucppublic
+ chmod 1777 uucppublic
+
+ cd ~news
+ touch history history.dir history.pag errlog log
+ chown news.news history* log errlog
+ chmod 664 history* log errlog
+
+ save active
+ echo "control 0000000000 0000000001 y" > active
+ echo "junk 0000000000 0000000001 y" >> active
+ chown news.news active
+
+ save active.times
+ echo "control 814573260 usenet" > active.times
+ echo "junk 814573260 usenet" >> active.times
+ chown news.news active.times
+
+ save newsgroups
+ :>newsgroups
+ chown news.news newsgroups
+
+ popd >/dev/null
+}
+
+install_rcnews() {
+ dialog --backtitle "$TITLE" --infobox "Avvio l'InterNet News daemon (innd) e l'installo negli script di boot, attendere... attenzione che e' probabile che in questa fase non sia possibile entrare da un'altra VC come root." 0 0
+
+ RCLOCAL=/etc/rc.d/rc.local
+ RCNEWS=~news/etc/rc.news
+ RCLINE="`grep $RCNEWS $RCLOCAL`"
+
+ if [ ! "$RCLINE" -o `echo $RCLINE | cut -c1` = '#' ]
+ then
+ save $RCLOCAL
+ echo -e "\n$RCNEWS" >>$RCLOCAL
+ fi
+
+ cp copi.rcnews $RCNEWS
+ chmod 550 $RCNEWS
+ chown news.news $RCNEWS
+
+ if [ -f ~news/innd/innd.pid ]; then
+ su -l news -c "bin/ctlinnd shutdown x" >/dev/null
+ sleep 2 # wait for server to shutdown
+ fi
+
+ killall innd 2>/dev/null # make sure it's gone down
+ $RCNEWS
+}
+
+install_crontab_news() {
+ dialog --backtitle "$TITLE" --infobox "Imposto la crontab di news per l'automantenimento del sistema (cancellazione giornaliera dei messaggi vecchi et similia)..." 0 0
+
+
+ if [ -f $COPIUSER ]; then
+ POSTMST="`cat $COPIUSER`"
+ else
+ POSTMST="root"
+ fi
+
+ NEWSHOME=~news
+ save /var/spool/cron/crontabs/news
+ cat <<EOF | crontab - -u news
+#-------------------------------------------------------------------------------
+# /var/spool/cron/crontabs/news
+SHELL=/bin/sh
+#
+MAILTO=$POSTMST
+#
+#===============================================================================
+#
+# inn-1.4 (Inter Net News)
+#
+#===============================================================================
+#
+#-------------------------------------------------------------------------------
+# Daily housekeeping ... expires news and other things ...
+#-------------------------------------------------------------------------------
+#
+51 16 * * * $NEWSHOME/bin/news.daily < /dev/null
+#
+#-------------------------------------------------------------------------------
+# offer spooled news - that was spooled into the incoming directory when the
+# innd server wasn't available - again to the innd server.
+#-------------------------------------------------------------------------------
+#
+18 * * * * $NEWSHOME/rnews -U
+#
+#-------------------------------------------------------------------------------
+# send news batches to your fidonet(-like) news feeds
+#-------------------------------------------------------------------------------
+#
+49 16 * * * $NEWSHOME/send-ifmail$SENDCRON
+#
+#-------------------------------------------------------------------------------
+#
+EOF
+
+ echo $NEWSHOME/send-ifmail$SENDCRON >/etc/point.ifsend
+}
+
+# Private func
+# Args: dir_with_sources, bindir, cfgdir, logdir, version
+copi.ifmCfg() {
+
+ SRCDIR="$1"
+ BINDIR="$2"
+ CFGDIR="$3"
+ LOGDIR="$4"
+ VERSION="$5"
+ SOURCE="$SRCDIR/CONFIG"
+ CONFIGFILE="$CFGDIR/config"
+
+ cat <<EOF >$SOURCE
+# Compile-time configuration for ifmail FidoNet mailer and gateway
+COPYRIGHT = "Eugene G. Crosser, 1993-1995"
+VERSION = "$VERSION"
+
+# Main configuration file. This default may be overwritten by -I key.
+CONFIGFILE = $CONFIGFILE
+
+# Debug messages turned on by -x key are written here.
+# Some error messages may occationally appear here too.
+# This may be changed in the 'config' file.
+DEBUGFILE = "$LOGDIR/ifdebug"
+
+# Procession log. Usually gets several lines for each invocation.
+# Also look for error diagnostics here. If HAS_SYSLOG defined,
+# only stdout and stderr from the packers and unpackers go to this
+# file, while actual logging is done via syslog() calls.
+# This may be changed in the 'config' file.
+LOGFILE = "$LOGDIR/iflog"
+
+# Use syslog() facility codes for mail gate, news gate and ifcico.
+# Define -DHAS_SYSLOG (see below)
+#MAILLOG = LOG_MAIL
+MAILLOG = LOG_LOCAL0
+#NEWSLOG = LOG_NEWS
+NEWSLOG = LOG_LOCAL0
+#CICOLOG = LOG_UUCP
+CICOLOG = LOG_LOCAL0
+
+# Directory where UUCP lock files reside.
+#LOCKDIR = "/var/lock"
+LOCKDIR = "/var/spool/uucp"
+
+# Directory from which file requests are resolved.
+# This may be changed from the 'config' file.
+#PUBDIR = "/home/ftp/pub"
+PUBDIR = "/var/spool/uucppublic"
+
+# Compile-time system-dependant options.
+
+# If you specify "-DHAS_NDBM_H", ndbm calls will be used instead
+# of dbm ones, and the feature will be activated of Cnews log processing
+# to add entries to SEEN-BY if echo message is exported to several FTN
+# nodes by Cnews mechanism. This works with INN too.
+
+# If you specify "-DHAS_STATFS" or "-DHAS_STATVFS", statfs() (or statvfs()
+# respectivly) call will be used to check available disk space. For statfs()
+# call, you must also specify which .h file to use: "-DSTATFS_IN_VFS_H" or
+# "-DSTATFS_IN_STATFS_H" or "-DSTATFS_IN_STATVFS_H" or "-DSTATFS_IN_MOUNT_H".
+# For statvfs() call, statvfs.h is included.
+
+# define -DSCO_STYLE_STATFS if your statfs() call requires 4 arguments.
+
+# If you specify "-DHAS_SETSID", setsid() call is used to detach from the
+# control terminal. Otherwise setpgrp() call is used, and in this case you
+# may specify "-DBSD_SETPGRP" to use BSD-style call. Used in ifcico only.
+
+# If you specify "-DDONT_HAVE_TM_GMTOFF", timezone offset will be calculated
+# from the difference between the results of localtime() and gmtime() calls
+# instead of using tm_gmtoff field of struct tm.
+
+# If you specify "-DDONT_HAVE_GETOPT", local definitions for getopt will
+# be used (but not the function itself)
+
+# For ifcico, you must specify -DHAS_TERMIOS_H (preffered), -DHAS_TERMIO_H
+# or -DHAS_SGTTY_H to use POSIX-y, SysV-ish of BSD-ish terminal control.
+
+# in SVR4 you should specify -DHAS_DIAL (and maybe -DHAS_DIAL_H) to use
+# dial() library function instead of regular open(). Lock files are
+# not used in this case.
+
+# for uucp lock files, you must specify either -DASCII_LOCKFILES or
+# -DBINARY_LOCKFILES
+
+# define -DHAS_FSYNC if there is a fsync() system call (to update .flo
+# files)
+
+# define -DPARANOID if you want iftoss to deny packets with wrong password.
+
+# define -DRELAXED if you want iftoss to accept packets that are not
+# addressed to your node.
+
+# define -DFORCEINTL if you want ifmail to create ^aINTL even if this is
+# not an inter-zone netmail.
+
+# define -DNEED_UUCPFROM if your MTA needs a uucp "From" line in mail.
+
+# define -DHAS_TCP if you want ifmail to be able to originate outgoing
+# connections over TCP/IP (socket library needed)
+
+# define -DHAS_TERM if you want ifmail to be able to originate outgoing
+# connections over TERM (TCP "extention", client.a needed)
+
+# define -DHAS_REGEX_H or -DHAS_LIBGEN_H if you have either of these
+# header files for regular expression handlers.
+
+# define -DHAS_SYSLOG to use syslog() instead of logging to files.
+# Files are necessary anyway, external programs' stdout and stderr
+# are redirected there.
+
+# define -DNEED_BSY if you want ifpack and ifcico to create .bsy
+# files preventing simultaneous processing of the same node.
+
+# define -DNEED_FORK if your system is uncapable of getting rid of the
+# control terminal unless you are running not as a group leader.
+
+# define -DREGEX_NEED_CARET if your re_comp/re_exec require that the
+# mask starts with a '^' to match the beginning of the string.
+
+# as of June 1994, FreeBSD has a nasty bug in the kernel lseek() code:
+# if you make lseek() to a point before the start of the file, it
+# succeeds and the writing point becomes negative. Fortunately,
+# subsequent write()s fail :-). To overwork this, define
+# -DNEGATIVE_SEEK_BUG, this will add an extra fseek() to restore
+# zero writing point where necessary.
+
+# define -DNEED_TRAP if you want debugging information when the programs
+# are aborted with segmentation fault etc. Currently tested and works
+# only with Linux, and only with newer kernels (1.1.20+)
+
+# define -DSLAVE_SENDS_NAK_TOO if you have problems answering incoming
+# EMSI sessions originated by FrontDoor. FrontDoor does not follow
+# EMSI specifications when originating calls, this is a workaround.
+
+# define -DDONT_HAVE_DIRENT if there is no working opendir()/readdir()
+# etc. in your libc. You will aso need to add "dirent.o" to the NEEDED
+# (see below).
+
+# Linux:
+OPTS = -DHAS_STATFS -DSTATFS_IN_VFS_H -DHAS_SETSID -DHAS_NDBM_H \\
+ -DDONT_HAVE_TM_GMTOFF -DHAS_TERMIOS_H -DASCII_LOCKFILES \\
+ -DHAS_FSYNC -DHAS_IOCTL_H -DHAS_REGEX_H -DHAS_TCP \\
+ -DFORCEINTL -DHAS_SYSLOG -DNEED_UUCPFROM -DNEED_BSY \\
+ -DREGEX_NEED_CARET -DNEED_TRAP -DSLAVE_SENDS_NAK_TOO \\
+ -DNEED_FORK -DLESS_RFC_KLUDGES
+
+# 386BSD:
+#OPTS = -DHAS_STATFS -DSTATFS_IN_MOUNT_H -DHAS_SETSID -DHAS_NDBM_H \\
+ -DHAS_TERMIOS_H -DASCII_LOCKFILES -DHAS_FSYNC -DHAS_IOCTL_H \\
+ -DHAS_REGEX_H -DHAS_TCP -DHAS_SYSLOG -DNEED_UUCPFROM \\
+ -DNEED_BSY -DNEED_FORK -DNEGATIVE_SEEK_BUG \\
+ -DREGEX_NEED_CARET
+
+# SVR4:
+#OPTS = -DHAS_STATVFS -DDONT_HAVE_TM_GMTOFF -DHAS_SETSID -DHAS_NDBM_H \\
+ -DHAS_TERMIOS_H -DHAS_DIAL -DHAS_DIAL_H -DASCII_LOCKFILES \\
+ -DHAS_FSYNC -DHAS_IOCTL_H -DHAS_LIBGEN_H -DHAS_TCP \\
+ -DHAS_SYSLOG -DREGEX_NEED_CARET
+# SunOS:
+#OPTS = -DHAS_STATFS -DSTATFS_IN_VFS_H -DHAS_SETSID -DHAS_NDBM_H \\
+ -DDONT_HAVE_GETOPT -DHAS_TERMIOS_H -DASCII_LOCKFILES \\
+ -DHAS_FSYNC -DHAS_TCP -DHAS_SYSLOG \\
+ -DREGEX_NEED_CARET
+
+# SCO Unix 3.2v4.2
+#OPTS = -DHAS_STATFS -DSTATFS_IN_STATFS_H -DSCO_STYLE_STATFS \\
+ -DHAS_TERMIOS_H -DDONT_HAVE_TM_GMTOFF -DDO_NEED_TIME \\
+ -DDONT_HAVE_GETOPT -DASCII_LOCKFILES -DHAS_IOCTL_H \\
+ -DHAS_TCP -DHAS_SYSLOG \\
+ -DREGEX_NEED_CARET
+
+# ISC Unix 3.2 v3.0
+#OPTS = -DHAS_STATFS -DSTATFS_IN_STATFS_H -DHAS_TERMIO_H \\
+ -DDONT_HAVE_TM_GMTOFF -DDONT_HAVE_GETOPT \\
+ -DASCII_LOCKFILES -DHAS_IOCTL_H -DSCO_STYLE_STATFS \\
+ -DUSE_POLL -DHAS_NET_ERRNO_H -DSHORT_PID_T \\
+ -DHAS_TCP -DHAS_SYSLOG \\
+ -DREGEX_NEED_CARET
+# On ISC, if you are suing gcc, you can run into a trouble with sscanf()
+# function. It appears that sscanf(string,"%d.%d",&int1,&int2) where
+# string is a constant segfaults unless you specify "-fwritable-strings"
+# to gcc. I would say that this is a bug in ISC libc. If nessecary,
+# add this to the defines above. If you have ISC version 4.0 or later,
+# you can add "-posix", remove "-DSHORT_PID_T" and specify "-DHAS_TERMIOS"
+# to get benefit of posix terminal control.
+
+# for make install, where to put binaries and what owner to set
+BINDIR = $BINDIR
+OWNER = fnet
+GROUP = uucp
+MODE = 0711
+SMODE = 4711
+
+INSTALL = install
+RANLIB = ranlib
+#RANLIB = touch
+SHELL = /bin/sh
+ECHO = echo -e
+CC = gcc
+YACC = bison -y
+#YACC = yacc
+LEX = flex
+#LEX = lex
+AWK = awk
+TAR = tar
+
+#CFLAGS = -g -Wall
+# Linux, 386BSD, SunOS:
+CFLAGS = -O2 -Wall -m486 -s
+# SVR4:
+#CFLAGS = -O -Xa
+
+LDFLAGS = -s
+
+# For LIBS, you may need to add "-lfl" if you are using flex 2.4.x
+# If you need TERM also add e.g. "/usr/src/term112/client.a"
+
+# Linux
+LIBS = -ldbm
+# SunOS:
+#LIBS =
+# 386BSD:
+#LIBS = -lgdbm -lgnuregex
+# SVR4
+#LIBS = -ldbm -lform -lnsl -lsocket -lc -L/usr/ucblib -lucb
+# SCO
+#LIBS = -ldbm -lsocket -lintl
+# ISC
+#LIBS = -lcposix -lmalloc -ldbm -linet -lPW
+
+INCLUDES = -I\${INCDIR}
+# ISC
+#INCLUDES = -I/usr/include/rpcsvc -I\${INCDIR}
+
+# What programs are absent at your system?
+#NEEDED = strcasestr.o strncasecmp.o strcasecmp.o rename.o mkdir.o usleep.o \\
+ regexpr.o
+# Linux
+NEEDED =
+# SVR4
+#NEEDED = regexpr.o
+# SCO
+#NEEDED = strcasestr.o strncasecmp.o strcasecmp.o usleep.o regexpr.o
+# SunOS and 386BSD
+#NEEDED = signal.o
+# ISC
+#NEEDED = usleep.o regexpr.o vsyslog.o
+EOF
+
+}
+
+# Args: package.tgz, bin_dir, cfg_dir, log_dir, version, where_to_put_src
+install_ifmail() {
+ dialog --backtitle "$TITLE" --infobox "Installo e compilo Ifmail..." 0 0
+
+ AKAPRI="`cut $AKASETUP -f1 -d:`"
+ int2fido $AKAPRI
+ AKAPRIFTN=$_RETVAL
+
+ if [ -f $COPIUSER ]
+ then
+ POST="`cat $COPIUSER`"
+ else
+ POST=root
+ fi
+
+ TGZ="$1"
+ BINDIR="$2"
+ CFGDIR="$3"
+ LOGDIR="$4"
+ VERSION="$5"
+ SRC="$6"
+
+###################################################
+## passwd e group
+####################################
+
+ if [ "`cut /etc/passwd -f1 -d: | grep -x fnet`" ]
+ then
+ mkstemp passwd
+ grep -v "fnet:" /etc/passwd >$tmp_passwd
+ save /etc/passwd
+ mv $tmp_passwd /etc/passwd
+ fi
+
+ find_unused_uid 92
+ echo "fnet:*:$FOUND_UID:14:Fidonet Gate:$BINDIR:" >>/etc/passwd
+
+
+####################################################
+#### dirs and files
+###################################
+ mkdir -p $CFGDIR $LOGDIR /var/spool/ifmail/{BAK,nl.d} $BINDIR/magic
+ chown fnet.uucp $BINDIR{,/magic} $CFGDIR $LOGDIR /var/spool/ifmail/{,BAK,nl.d}
+ touch $LOGDIR/{ifdebug,iflog,sysiflog,TheLog}
+ chown fnet.uucp $LOGDIR/{ifdebug,iflog,sysiflog,TheLog}
+
+##########################################################################
+#### COMPILAZIONE
+####################################
+
+ SRC="$SRC/`tar zxvf $TGZ -C $SRC | head -1`"
+# ora in $SRC c'e' il path completo dei source Ifmail
+
+ copi.ifmCfg $SRC $BINDIR $CFGDIR $LOGDIR $VERSION
+ patch -N -d $SRC <ifpatch 2>/dev/null
+ make clean -C $SRC
+ make -C $SRC
+##########################################################################
+#### INSTALLAZIONE
+####################################
+ make install -C $SRC
+}
+
+
+# Args: bin_dir, cfg_dir, log_dir, passwords
+# note: passwords are colon-separated (":")
+configure_ifmail() {
+ dialog --backtitle "$TITLE" --infobox "Configuro Ifmail..." 0 0
+
+ BINDIR=$1
+ CFGDIR=$2
+ LOGDIR=$3
+ PASSWDS=$4
+
+ SPD="` cut $EMSIFILE -f1`"
+ SYSNAME="` cut $EMSIFILE -f2`"
+ LOCATION="` cut $EMSIFILE -f3`"
+ COMPLETE_PHONE="` cut $EMSIFILE -f4`"
+ INTERCOUNTRYPREF="`cut $EMSIFILE -f5`"
+ LONG_DIST_PREFIX="`cut $EMSIFILE -f6`"
+ NODEFLAGS="` cut $EMSIFILE -f7`"
+ DIALSTRING="` cut $EMSIFILE -f8`"
+ SYSOP="` cut $EMSIFILE -f9`"
+
+ COUNTRYPREF="`echo $COMPLETE_PHONE | cut -f1 -d'-'`"
+ PREF="` echo $COMPLETE_PHONE | cut -f2 -d'-'`"
+ PHONE="` echo $COMPLETE_PHONE | cut -f3 -d'-'`"
+
+ FNETCFG=$CFGDIR/config
+ AREAS=$CFGDIR/Areas
+
+ POINTS="`cat $PNTSETUP`"
+ POST="`cat $COPIUSER`"
+ AKAPRI="`cut $AKASETUP -f1 -d:`"
+ int2fido "$AKAPRI"
+ AKAPRIFTN="$_RETVAL"
+
+#invece di "cp $SRC/misc/inn/send-ifmail ~news"
+#-----------------------------------------------------------------------------
+ cp copi.sendifm1 ~news/send-ifmail
+ cat <<EOF >>~news/send-ifmail
+-p"$BINDIR/ifnews %s" \\
+EOF
+ cat copi.sendifm2 >>~news/send-ifmail
+
+ chmod 550 ~news/send-ifmail
+ chown news.news ~news/send-ifmail
+
+#invece di "cp $SRC/misc/contrib/ifreq $BINDIR"
+#-----------------------------------------------------------------------------
+ cp copi.ifreq1 $BINDIR/ifreq
+ cat <<EOF >>$BINDIR/ifreq
+# ifcico-config-file:
+\$config = "$CFGDIR/config";
+
+# change this to the default node, where requests should go to.
+\$node = "$AKAPRIFTN";
+EOF
+ cat copi.ifreq2 >>$BINDIR/ifreq
+
+ chmod 755 $BINDIR/ifreq
+ chown fnet.uucp $BINDIR/ifreq
+
+#invece di "cp $SRC/misc/contrib/ifman $BINDIR"
+#-----------------------------------------------------------------------------
+ cp copi.ifman1 $BINDIR/ifman
+ cat <<EOF >>$BINDIR/ifman
+\$cfgfile="$CFGDIR/config"; # where the config is
+\$ifowner="fnet"; # who is the owner of the ifmail
+
+EOF
+ cat copi.ifman2 >>$BINDIR/ifman
+
+ chmod 755 $BINDIR/ifman
+ chown fnet.uucp $BINDIR/ifman
+
+#invece di "cp $SRC/misc/contrib/ifpoll $BINDIR"
+#-----------------------------------------------------------------------------
+ cp copi.ifpoll1 $BINDIR/ifpoll
+ cat <<EOF >>$BINDIR/ifpoll
+FIDOPATH=$BINDIR
+LOGPATH=$LOGDIR
+
+# sysop of fido stuff
+IFCICO_SYSOP=$POST
+
+# my boss node (default address to poll)
+NODE=$AKAPRI
+EOF
+ cat copi.ifpoll2 >> $BINDIR/ifpoll
+
+ chmod 755 $BINDIR/ifpoll
+ chown fnet.uucp $BINDIR/ifpoll
+
+
+#########################################################
+##### se in syslog.conf non c'e' "local0.*", lo aggiunge
+################################
+
+ SYSLOG="`grep \"local0.* \" /etc/syslog.conf`"
+ SYSCHECK_A="`echo \"$SYSLOG\" | cut -f1 | grep -x \"local0.*\"`"
+ SYSCHECK_B="`echo \"$SYSLOG\" | cut -f2- | grep $LOGDIR/sysiflog`"
+ MYSYSLOG="local0.*\t\t\t\t\t$LOGDIR/sysiflog"
+
+ if [ ! "$SYSCHECK_A" -o ! "$SYSCHECK_B" ]
+ then
+ echo -e "\n# For ifmail" >> /etc/syslog.conf
+ echo -e "$MYSYSLOG" >>/etc/syslog.conf
+ killall -1 syslogd
+ fi
+
+
+########################
+ save $AREAS
+ :> $AREAS
+ chown fnet.uucp $AREAS
+
+ save $FNETCFG
+ cat <<EOF >$FNETCFG
+# Configuration file for ifmail (ifgate+ifcico) package by Eugene Crosser
+# Compile-time default name of this file may be overridden by -I key.
+#
+# Lines with the first nonblank character '#' are comments.
+#
+# Log file name. Overrides compile-time default.
+logfile $LOGDIR/iflog
+
+# Debug file name. Overrides compile-time default.
+debugfile $LOGDIR/ifdebug
+
+# Debugging verbosity level (is overidden by -x key). Default is 0.
+# WARNING: if >0 your messages will go in /tmp/ifmail !!!!!!!!!!!!!!!!!!
+verbose 0
+
+# The first is the main address:
+EOF
+#----------------------------
+
+ AKA="any"
+ IAKA=0
+ while [ "$AKA" ]
+ do
+ IAKA=$[$IAKA+1]
+ AKA="`cut $AKASETUP -f$IAKA -d:`"
+ if [ "$AKA" ]
+ then
+ int2fidonet $AKA
+ AKAFTN="`echo $_RETVAL | cut -f1 -d.`"
+ echo "# aka for `echo $AKAFTN | cut -f2 -d '@'`" >> $FNETCFG
+
+ POINT="`echo $POINTS | cut -f$IAKA -d:`"
+
+ AKAFTN="`echo $AKAFTN | cut -f1 -d '@'`.$POINT@`echo $AKAFTN | cut -f2 -d '@'`"
+
+ echo "address $AKAFTN" >> $FNETCFG
+ fi
+ done
+
+#----------------------------
+ cat <<EOF >>$FNETCFG
+
+# Passwords for nodes. Not checked by iftoss (unless -DPARANOID specified
+# at compile-time), checked by ifcico.
+# Inserted into outgoing mail packets, EMSI and yoohoo packets.
+EOF
+#----------------------------
+
+ AKA="any"
+ IAKA=0
+ while [ "$AKA" ]
+ do
+ IAKA=$[$IAKA+1]
+ AKA="`cut $AKASETUP -f$IAKA -d:`"
+ if [ "$AKA" ]
+ then
+ int2fido $AKA
+ AKAFTN=$_RETVAL
+
+ PASSWD="`echo $PASSWDS | cut -f$IAKA -d:`"
+ if [ "$PASSWD" ]
+ then
+ echo "password $AKAFTN $PASSWD" >> $FNETCFG
+ fi
+ fi
+ done
+
+#----------------------------
+ cat <<EOF >>$FNETCFG
+
+# Include config extention file (here: file with real passwords).
+# Includes may be nested. If the nesting is cyclic, the program cycles too.
+# You are warned.
+# include $CFGDIR/passwds
+
+# System alias file - try to fetch ftn-style aliases from there.
+# If "from" address of a message from FidoNet matches _right_ side
+# of some entry in sysalias file, then the Reply-To: header is created
+# in the RFC message with the name part taken from the left side of the
+# sysalis entry and domain part taken from myfqdn (below). E.g., if a
+# fidonet message comes from "John Smith of 1:234/567.89@fidonet" and
+# there is an entry in the sysalias file:
+# "jsmith: John.Smith@p89.f567.n234.z1.fidonet.org"
+# and fqdn value is "pccross.msk.su", then the resulting message will
+# contain a line: "Reply-To: jsmith@pccross.msk.su".
+sysalias /etc/aliases
+
+# This host fully qualified domain name to add to the alias above
+myfqdn `hostname -f`
+
+# Directory for incoming packets/files:
+inbound /var/spool/ifmail/inb
+# Directories for "listed" and "protected" sessions
+listinbound /var/spool/ifmail/inb
+protinbound /var/spool/ifmail/inb
+
+# Directory for outgoing packets (default domain and zone):
+# other zones will be like "/var/spool/ifmail/outb.003",
+# other domains will be like "/var/spool/ifmail/<domain>.<zone>"
+outbound /var/spool/ifmail/outb
+
+# Directory from which the file requests are satisfied
+public /var/spool/uucppublic
+
+# Directory with executables to satisfy "magic" file requests
+# if requested a file present in this directory, it will be
+# executed and stdout sent to the remote system. It is dangerous!
+# You are warned.
+magic $BINDIR/magic
+
+# Primary nodelist (serves "outbound" directory and domain from the
+# first "address" statement). Name expanded with ".NNN" if neccessary.
+nodelist /var/spool/ifmail/nl.d/`cut $AKASETUP -f1 -d: | cut -f4 -d.`.ndl
+
+# Secondary nodelists and nodelists for other domains.
+# use directory name from the first "nodelist" statement.
+# filename originating address
+EOF
+#----------------------------
+
+ AKA="any"
+ IAKA=0
+ while [ "$AKA" ]
+ do
+ IAKA=$[$IAKA+1]
+ AKA="`cut $AKASETUP -f$IAKA -d:`"
+ if [ "$AKA" ]
+ then
+ int2fidonet $AKA
+ AKAFTN="`echo $_RETVAL | cut -f1 -d.`"
+ echo -e "nodelist `echo $AKAFTN | cut -f2 -d '@'`.ndl\t$AKAFTN" >> $FNETCFG
+ fi
+ done
+
+#----------------------------
+ cat <<EOF >>$FNETCFG
+
+# domain translations, just context substitution. Leading dot recommended.
+# May contain '@'-sign too. First matching used.
+# NOTE: If you specify at least one domtrans line, there will be _NO_
+# default for fidonet <--> fidonet.org. Don't forget to specify it
+# explicitly as a last line.
+# FTN side Internet side
+#domtrans f720.n335.z2.fidonet.org giuda.deis.unical.it
+#domtrans .fidonet .fidonet.org
+
+# Automatically updated alias database. If omitted or inaccessible,
+# ^aREPLYADDR and ^aREPLYTO kludges are generated in fido messages.
+database /var/spool/ifmail/ifdbm
+
+# Sequencer file (used to generate unique IDs)
+sequencer /var/spool/ifmail/seq
+
+# Areas file (format: "AREA newsgroup distribution")
+areas $CFGDIR/Areas
+
+# Bad groups prefixes - do not pass to fido if appear in Newsgroups header
+# This is NOT the same as "!news.group" in the cnews "sys" file.
+# badgroup relcom.ads.
+# badgroup relcom.commerce.
+
+# Maximum allowed number of groups in the Newsgroups header, article will
+# not be gated if exeeds. If zero or umitted - no limit.
+# maxgroup 5
+
+# Internet -> FidoNet (outgoing) character mapping table (a la mapchan)
+# outtab $BINDIR/outkoi8alt
+
+# FidoNet -> Internet (incoming) character mapping table
+# intab $BINDIR/outaltkoi8
+
+# Toss program, used by ifunpack
+iftoss $BINDIR/iftoss
+
+EOF
+
+ cat copi.ifmcfg2 >>$FNETCFG
+
+ if [ $[$[SPD] > $[19200]] = 1 ]; then
+ SPDLOCK="L38400"
+ elif [ $[$[SPD] > $[9600]] = 1 ]; then
+ SPDLOCK="L19200"
+ elif [ $[$[SPD] > $[2400]] = 1 ]; then
+ SPDLOCK="9600"
+ elif [ $[$[SPD] > $[1200]] = 1 ]; then
+ SPDLOCK="2400"
+ elif [ $[$[SPD] > $[300]] = 1 ]; then
+ SPDLOCK="1200"
+ else
+ SPDLOCK="300"
+ fi
+
+ echo "ModemPort modem:$SPDLOCK" >>$FNETCFG
+ cat copi.ifmcfg5 >>$FNETCFG
+
+ echo "PhoneTrans $COUNTRYPREF-$PREF- /" >>$FNETCFG
+ echo "PhoneTrans $COUNTRYPREF- / $LONG_DIST_PREFIX" >>$FNETCFG
+ echo "PhoneTrans / $INTERCOUNTRYPREF" >>$FNETCFG
+ echo "ModemReset ATZ\r" >>$FNETCFG
+ echo "ModemDial \d$DIALSTRING\T\r" >>$FNETCFG
+
+ cat copi.ifmcfg4 >>$FNETCFG
+
+ echo "Name $SYSNAME" >>$FNETCFG
+ echo "Location $LOCATION" >>$FNETCFG
+ echo "SysOp $SYSOP" >>$FNETCFG
+ echo "Phone $COUNTRYPREF-$PREF-$PHONE" >>$FNETCFG
+ echo "Speed $SPD" >>$FNETCFG
+ echo "Flags $NODEFLAGS" >>$FNETCFG
+
+ chown fnet.uucp $FNETCFG
+}
+
+# Args: cfg_dir
+configure_smail() {
+ dialog --backtitle "$TITLE" --infobox "Configuro Smail..." 0 0
+
+ USER="`cat $COPIUSER`"
+ FNETHOME=~fnet
+
+ SMAIL=$1
+ SMAILCONF=$SMAIL/config
+ ALIASES=$SMAIL/aliases
+ DIRECTORS=$SMAIL/directors
+ ROUTERS=$SMAIL/routers
+ TRANSPORTS=$SMAIL/transports
+ FTNPATHS=$SMAIL/ftnpaths
+
+# File: config
+ save $SMAILCONF
+
+ cat <<EOF >$SMAILCONF
+#
+# smail configuration for $HOST.$DOMAIN
+# (see smail(5) man page for details and other options)
+#
+hostnames=$HOST:$HOST.$DOMAIN
+domains=$DOMAIN
+postmaster=$USER
+smtp_banner="\$primary_name Linux Smail\$version #\$compile_num ready at \$date"
+spool_mode=0600
+received_field="Received: \\
+ \${if def:sender_host \\
+ {from \$sender_host by \$primary_name \\
+ \${if def:sender_proto: with \$sender_proto}\\
+ \n\t(Linux Smail\$version #\$compile_num) }\\
+ else{by \$primary_name \${if def:sender_proto:with \$sender_proto }\\
+ (Linux Smail\$version #\$compile_num)\n\t}}\\
+ id \$message_id; \$spool_date"
+trusted_users=root:uucp:daemon:fnet
+EOF
+
+
+# File: routers
+ save $ROUTERS
+
+ cat <<EOF >$ROUTERS
+ifmail: driver=pathalias,
+ transport=ifmail;
+
+ file=ftnpaths,
+ proto=lsearch,
+ domain=ftn:org
+EOF
+
+
+# File: transports
+ save $TRANSPORTS
+
+ cat <<EOF >$TRANSPORTS
+local: driver = appendfile,
+ return_path,
+ local,
+ from,
+ unix_from_hack;
+
+ file = /var/spool/mail/\${lc:user},
+ group = mail,
+ mode = 0660,
+ suffix = "\n",
+ append_as_user
+
+ifmail: driver=pipe,
+ from,
+ -received,
+ max_addrs=5,
+ max_chars=200;
+
+ pipe_as_sender,
+ cmd="$FNETHOME/ifmail -r\$host \$((\${strip:user})\$)"
+
+EOF
+
+
+# File: directors
+ save $DIRECTORS
+
+
+# File: aliases
+ for i in $ALIASES /etc/aliases /usr/lib/aliases
+ do
+ if [ ! -L $i -a -f $i ]
+ then
+ mv $i $i~
+ fi
+ done
+
+ USERNAME="`cut /etc/passwd -f1,5 -d: | grep $USER: | cut -f2 -d: | sed y/\" \"/./`"
+ echo "news: $USER" >> $ALIASES
+ echo "usenet: $USER" >> $ALIASES
+ echo "$USERNAME: $USER" >> $ALIASES
+
+ ln -sf $ALIASES /etc/
+ ln -sf $ALIASES /usr/lib/
+
+ cd $SMAIL # is this necessary?? E-mail me if you know,please
+ mkaliases >/dev/null
+
+# File: ftnpaths
+ save $FTNPATHS
+
+ OK=1
+ IAKA=1
+ while [ $OK != 0 ]; do
+ AKA="`cut $AKASETUP -f$IAKA -d:`"
+ IAKA=$[$IAKA+1]
+ if [ ! "$AKA" ]; then
+ OK=0
+ else
+ echo -e ".`echo $AKA | cut -f4 -d.`\t\t$AKA!%s" >>$FTNPATHS
+ fi
+ done
+
+
+# misc section
+
+ chmod 1775 /var/spool/mail
+ chgrp mail /var/spool/mail
+
+ cd $SMAIL
+ touch forward
+ /usr/lib/smail/mkdbm forward
+
+# reload sendmail
+ killall sendmail 2>/dev/null
+ /usr/sbin/sendmail -bd -q15m # if inetd handles smtp port, this will not load
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifman1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifman1
new file mode 100755
index 00000000000..3e271a532e2
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifman1
@@ -0,0 +1,29 @@
+#! /usr/bin/perl
+#
+# This is a utility script to manipulate Fidonet-related issues
+# using Eugene Crosser's ifmail package
+#
+# Version 0.1
+#
+# (C) Michael Bravo and The Communication Tube, 1994
+#
+# You can do whatever you want with this script. I take no responsibility
+# whatsoever in anything related to this script. If you make some useful
+# additions to this, please think of sending them to me so I could partake
+# of your wisdom.
+#
+# This script was written to help attaching and requesting files from the
+# commandline, much like you do with Squish under DOS or OS/2. It is certainly
+# not perfect - I used it as an exercise in Perl. It also probably lacks
+# some other useful features, like ability to specify trunc/sent or kill/sent
+# attributes etc etc. If you really want this or some other features
+# implemented, write me at mbravo@tctube.spb.su or mbravo@octopus.spb.su
+# and I will try to do what I can.
+#
+# Note - files don't get copied to any spool dir, so if you move attached
+# files somewhere, they won't get sent.
+#
+# This script is supposed to read ifmail's config to determine where outbound
+# directory and logfile are. The only two parameters to modify in most cases
+# are below.
+
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifman2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifman2
new file mode 100755
index 00000000000..0b6dbb77ded
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifman2
@@ -0,0 +1,137 @@
+if ( getpwuid($<) ne $ifowner ) { print "You must be owner of ifmail\n"; exit 1; }
+
+if ( (@ARGV < 3) || $ARGV[0] eq "-?" || $ARGV[0] eq "-h" ) {
+ &usage;
+}
+
+$ARGV[0] =~ tr/A-Z/a-z/;
+$ARGV[3] =~ tr/A-Z/a-z/;
+
+&parsecfg;
+
+if ( $logfile ne "" ) {
+ open(LOG, ">>".$logfile) || die "Can't open logfile";
+}
+
+if (substr($ARGV[1], 0, 1) ne "/") {
+ $cwd=`pwd`;
+ chop $cwd;
+ $ARGV[1] = $cwd."/".$ARGV[1];
+}
+
+if ($ARGV[3] eq "" || $ARGV[3] eq "normal") {
+ $flavour = 'f';
+} elsif ($ARGV[3] eq "crash") {
+ $flavour = 'c';
+} elsif ($ARGV[3] eq "hold") {
+ $flavour = 'h';
+} else {
+ print "Unknown flavour, assuming normal\n";
+ $flavour = 'f';
+}
+
+if ($ARGV[0] eq "send") {
+ &attach($ARGV[1], $ARGV[2]);
+} elsif ($ARGV[0] eq "get") {
+ &request($ARGV[1], $ARGV[2]);
+} else {
+ print "Unknown command, try ifman -h\n";
+ exit 1;
+}
+
+close(LOG);
+
+exit 0;
+
+#######################################################################
+
+sub attach {
+ local($fspec, $address) = @_;
+
+ $floname = &resolve($address);
+
+ open(FLO, ">>".$outbound."/".$floname) || die "Can't open flo-file $outbound/$floname";
+ open(FIND, "find $fspec -print |") || die "Can't generate list of files";
+
+ if ( eof(FIND) ) {
+ print "No matching files, nothing to send\n";
+ exit 1;
+ }
+
+ while (<FIND>) {
+
+ chop;
+ $datestamp = `date \"+%D %T\"`;
+ chop $datestamp;
+ printf LOG "%s %s %s\n", $datestamp, $$, "ifman: sending $_ to $address";
+ printf FLO "%s\n", $_;
+ }
+
+ close(FLO);
+ close(FIND);
+}
+
+sub request {
+ local($fspec, $address) = @_;
+
+ $reqname = &resolve($address);
+
+ $reqname =~ s/\.[fch]lo/\.req/;
+
+ open(REQ, ">>".$outbound."/".$reqname) || die "Can't open req-file";
+
+ $datestamp = `date \"+%D %T\"`;
+ chop $datestamp;
+ printf LOG "%s %s %s\n", $datestamp, $$, "ifman: requesting $fspec from $address";
+ printf REQ "%s\n", $fspec;
+
+ close(REQ);
+}
+
+sub resolve {
+ local($addr) = @_;
+
+ if ( index($addr, ":") >=0 ) {
+ print "I cannot resolve addresses with zones!\n";
+ exit 1;
+ } elsif ( index($addr, "/") == -1 ) {
+ print "Not a valid address!\n";
+ exit 1;
+ }
+
+ ($net, $node, $point) = split(/\/|\./, $addr);
+
+ if ( defined $point ) {
+ $pointdir = sprintf("%04x%04x.pnt", $net, $node);
+ if ( ! -e $outbound."/".$pointdir ) {
+ mkdir ($outbound."/".$pointdir, 0755) || die "Can't create point directory";
+ }
+ $flo = sprintf("0000%04x.%01slo", $point, $flavour);
+ return $pointdir."/".$flo;
+ } else {
+ $flo = sprintf("%04x%04x.%01slo", $net, $node, $flavour);
+ return $flo;
+ }
+}
+
+sub usage {
+ print "ifmail manager script\n";
+ print "usage: ifman <cmd> <filespec> <address> [flavour]\n";
+ print " commands: send, get\n";
+ print " flavours: normal, crash, hold. Default is normal.\n";
+ print "Only 2d addresses with points are supported - no zones!\n";
+ exit 1;
+}
+
+sub parsecfg {
+ open(CFG, $cfgfile) || die "Can't open ifmail config file";
+
+ while (<CFG>) {
+ chop;
+ if (/^#/) { next; }
+ if (/^outbound\s+(\S+)/) { $outbound = $1; }
+ if (/^logfile\s+(\S+)/) { $logfile = $1; }
+ }
+
+ close(CFG);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg2
new file mode 100755
index 00000000000..c8a8c03d664
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg2
@@ -0,0 +1,68 @@
+# Transport programs for mail and news, used by iftoss
+sendmail /usr/lib/sendmail -f $F $T
+rnews /usr/lib/news/rnews
+
+# Unpackers, used by ifunpack.
+# $F expands to archieve file name
+unzip /usr/bin/unzip -oq $F
+unarj /usr/bin/unarj e $F
+#unarc /usr/bin/unpack $F
+unzoo /usr/bin/zoo -extract $F
+unlzh /usr/bin/lharc -x $F
+
+# Packer program, used by ifpack
+# $F expands to archieve file name, $P - to list of packet names
+packer /usr/bin/zip $F $P
+
+# Maximum arcmail file size, will start new arcmail file if exceeds
+maxfsize 65000
+
+# Maximum packet size, ifmail/ifnews will start new packet if exeeds.
+# .out files are NOT created if nonzero specified, you must run ifpack
+# to make packets out. (unimplemented)
+maxpsize 65000
+
+# cnews log file and (temporary) database for seen-bys
+newslog /usr/lib/news/log
+msgidbm /tmp/ifmsgids
+
+# From this line on, values may be prefixed by a logical expression in
+# round brackets. Operators are: '!', '&', '|', 'Xor'.
+# Possible elements are:
+# - Nodelist flags (like "CM", "MNP", "V32" etc.)
+# - speed <operator> <numeric>
+# where <operator> is '=', '!=', '<', '>', '<=', '>='
+# - address <wildcard>
+# where <wildcard> is an (possibly incomplete) fidonet address,
+# e.g. "5020/*"
+# - time <interval>[,<interval>,...]
+# where <interval> is a day spec. with optional time spec., e.g.
+# Wk2000-0900,Sat1800-0000,Sun
+# - phone <prefix>
+# e.g. "phone 7-095-"
+
+# Dialing parameters
+# of multiple "ModemPort", "ModemReset", "ModemDial", "ModemHangup" lines,
+# first matching is used.
+# of multiple "PhoneTrans", "ModemConnect", "ModemError" lines, all matching
+# are used.
+# In send and expect strings, following substitutions are made:
+# \\ '\' character
+# \r carriage return (0x0d)
+# \n new line (0x0a)
+# \t tab (0x09)
+# \b backspace (0x08)
+# \s space (0x20)
+# \NNN (where N is an octal digit) - character with octal code NNN
+# \d 1 second delay (send strings only)
+# \p 1/4 second pause (send strings only)
+# \T translated telephone no. (send strings only)
+# \D untranslated telephone no. (send strings only)
+
+# ModemPort present a blank-separated list of ports with possible speed
+# extention (separated by colon); if speed is prefixed with 'L', it is
+# a "locked" port speed, otherwise it is a maximum speed to be set, while
+# actual speed is taken from the nodelist. If speed is omitted (or set
+# to zero), previous port speed is not changed.
+#ModemPort (time Any0000-0900,Sat,Sun) ttyS0
+#ModemPort cua0:L38400
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg4 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg4
new file mode 100755
index 00000000000..4cb7a75b1fc
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg4
@@ -0,0 +1,30 @@
+ModemHangup +++ATH\r
+ModemOK OK
+ModemConnect CONNECT
+ModemError BUSY
+ModemError NO\sCARRIER
+ModemError NO\sDIAL
+ModemError RING\r
+ModemError ERROR
+
+# Call options (time, address and nodelist flag dependant)
+# All matching are applied in the order they are specified.
+# Possible options are "[No]Call", "[No]Hold", "[No]PUA", "[No]EMSI",
+# "[No]WaZOO", "[No]Freqs", "[No]Zmodem", "[No]ZedZap", "[No]Janus",
+# "[No]Hydra". Here, WaZOO stands for YooHoo/2U2 handshake, not for
+# the transfer scheme. FTS-0001 handshake and DietIFNA scheme cannot
+# be disallowed (because they are mandatory by standart). "Hold"
+# means really hold "hold" type packets and files: do not send them
+# if our system initiated the session, "NoHold" means send "hold"
+# packets when our system initiated the session. "NoPUA" stands for
+# "No PickUp All", i.e. PUP ("Pick Up Primary"). NoCall means do not
+# perform outbound call. This flag has no effect on the nodes
+# explicitly specified in the command line.
+# Default options are "everything allowed".
+# options ((!CM) & time Any0700-0200) Nocall
+#options (time Any0900-2100 & ! address 2:5020/*) Nocall
+
+# EMSI data for this node
+# From this line on values CANNOT be prefixed with logical expression
+# For now, escaping of '}' and ']' unimplemented, try to avoid these
+# characters please!
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg5 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg5
new file mode 100755
index 00000000000..8221c1cf160
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifmcfg5
@@ -0,0 +1,14 @@
+
+# PhoneTrans lines provide rules to change phone prefixes to make local
+# or long-distance calls. In the example below, my country code is 7,
+# and local dialing area is 095. From the numbers starting with "7-095-"
+# the prefix is stripped and the 7-digit remainder is dialed. For
+# the numbers starting with "7-" but not with "7-095-", the country prefix
+# "7-" is stripped and the long-distance dialing prefix "8W" substituted.
+# For the numbers not matching any of the above, international
+# call is performed: international dialing prefix "8W10" is prepended
+# to the unmodified 11-digit number. Generally, the syntax is:
+# "PhoneTrans <what-to-strip> / <what-to-substitute-instead>"
+#PhoneTrans 7-095- /
+#PhoneTrans 7- / 8W
+#PhoneTrans / 8W10
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifpoll1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifpoll1
new file mode 100755
index 00000000000..812c8e9cd0d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifpoll1
@@ -0,0 +1,9 @@
+#!/bin/sh
+# ver 0.7
+# ifpoll, poll my boss node or the node given as argument 1
+#
+# i start this shell script every day by crond, but you can
+# start it also by hand :) start it as the owner of ifcico.
+# rasca, berlin 1993 (Rasca Gmelch, 2:2410/305.4)
+#
+# where "ifcico" and "ifpack" reside
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifpoll2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifpoll2
new file mode 100755
index 00000000000..216bff08583
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifpoll2
@@ -0,0 +1,107 @@
+
+# Packets backup directory - You have to CREATE this directory
+BAK=/var/spool/ifmail/BAK
+
+# logfile of ifcico
+IFLOG=/var/log/ifmail/sysiflog
+
+# log archive
+IFLOGARC=/var/log/ifmail/TheLog
+
+# owner of "ifcico"
+IFCICO_OWNER=fnet
+
+# how often should i try to call NODE?
+MaxTry=30
+
+# delay between outgoing calls in seconds
+DELAY=10
+
+# where to log processing - file or tty/console
+INFO_TTY=/dev/console
+
+# Lets backup the log and use a new one
+if [ -e $IFLOG ]; then
+ echo Rearranging logs...
+ cat $IFLOG >> $IFLOGARC
+ cp /dev/null $IFLOG
+fi
+
+echo "`date \"+%b %d %T\"` ifpoll[$$]: starting" # >> $INFO_TTY
+
+# remember me, not to run as root..
+#
+if [ `whoami` != "$IFCICO_OWNER" ]; then
+ echo "*** run $0 as the owner of ifcico ***"
+ echo "`date \"+%b %d %T\"` ifpoll[$$]: wrong uid (rc 2)" # >> $INFO_TTY
+ exit 2
+fi
+
+# argv[1] is the optional node to call
+#
+if [ "$1" != "" ]; then
+ if [ "$1" = "-?" ] || [ "$1" = "-h" ]; then
+ echo "usage: ifpoll [<node>]"
+ exit 3
+ else
+ NODE=$1
+ fi
+fi
+
+# let's pack the fido stuff..
+#
+$FIDOPATH/ifpack
+
+# loop until ifcico could connect the node or MaxTry is encountered
+#
+i=1; errlv=1
+while let 'i <= MaxTry' && let 'errlv != 0'
+do
+ echo -n "`date \"+%b %d %T\"` ifpoll[$$]: $i. try ($NODE) " # >> $INFO_TTY
+ #
+ # start ifcico in master mode ..
+ #
+ $FIDOPATH/ifcico -r 1 $NODE
+ errlv=$?
+ if [ $errlv != "0" ]; then
+ echo "failed" # >> $INFO_TTY
+ if [ $i != $MaxTry ]; then
+ sleep $DELAY
+ fi
+ let i=i+1
+ else
+ echo "ok :)" # >> $INFO_TTY
+ fi
+done
+
+# if the poll was fine, unpacking..
+#
+if [ $errlv = "0" ]; then
+ echo "`date \"+%b %d %T\"` ifpoll[$$]: unpacking.. " # >> $INFO_TTY
+ cp -f /var/spool/ifmail/inb/*.* $BAK
+ $FIDOPATH/ifunpack
+ # add here some additional lines for processing tic files or
+ # incoming file-lists or simular..
+else
+ # write me a mail about the failed poll
+ tail --lines=20 $IFLOG | elm -s "ifpoll: failed" $IFCICO_SYSOP >/dev/null
+fi
+
+echo "`date \"+%b %d %T\"` ifpoll[$$]: finished (rc $errlv)" # >> $INFO_TTY
+
+# Collect some infos...
+echo ""
+echo "*** Outgoing File Transfer Stats: ***"
+grep sent $IFLOG
+echo "*** Incoming File Transfer Stats: ***"
+grep received $IFLOG
+echo ""
+
+echo "---->> New mail: <<-----"
+grep echomail $IFLOG
+echo "---->> Personal mail: <<-----"
+grep "mail from" $IFLOG
+echo ""
+
+# return the errorlevel of ifcico
+exit $errlv
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifreq1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifreq1
new file mode 100755
index 00000000000..637293954bd
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifreq1
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+$ver = "0.4";
+#
+# this perl script is designed for the ifmail package by eugene grosser.
+#
+# request a file (first argument) from a fido-node (second argument),
+# don't forget to quote if you use wildcards, e.g.:
+
+# ifreq 'files*' 2:2410/305
+# or
+# ifreq 'files newfile' 2:2410/305
+#
+# this perl script does only add an entry to the corresponding flo-file,
+# the mailer ifcico is not started!
+#
+# rasca, berlin 1994 (rasca@marie.physik.tu-berlin.de, 2:2410/305.4)
+#
+# multi-zone support added by
+# Roland Rosenfeld 15.05.1994 (roland@p13.flokiste.fido.de, 2:2450/300.13)
+
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifreq2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifreq2
new file mode 100755
index 00000000000..9ee78ff73fe
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.ifreq2
@@ -0,0 +1,68 @@
+# this is the base directory, where the req-files are stored and the
+# default outbound
+$flo_path = "/var/spool/ifmail";
+$outbound = "/outb"; # don't be confused, it means "/var/spool/ifmail/outb"
+
+# end of configuration #############################################
+
+# main()
+#
+if ((@ARGV < 1) || @ARGV > 2 || $ARGV[0] eq "-?") {
+ &usage;
+} elsif ($ARGV[1] ne "") {
+ $node = $ARGV[1];
+}
+$file = $ARGV[0];
+
+if (! ($node =~ /\d+:\d+\/\d+/)) {
+ die "Wrong address: $node!!!";
+}
+
+($zone, $netnode) = split (/:/, $node);
+$reqfile = sprintf("%04x%04x", split(/\//, $netnode));
+
+if ($reqfile eq "00000000") {
+ print ("can't resolve the fido address \"$node\"\n");
+ &usage;
+} else {
+ if ( $zone == 2 ) {
+ $reqfile = $flo_path . $outbound . "/" . $reqfile . ".req";
+ } elsif ( $zone < 7 ) {
+ $reqfile = $flo_path . $outbound . ".00$zone/" . $reqfile . ".req";
+ } else {
+ $outbound = "";
+ open (CONFIG, "< $config") || die "can't open $config";
+ while ($_ = <CONFIG>) {
+ if ( /^address.*$zone:.*\@(\w*)/ ) { $outbound = $1; }
+ }
+ if ( $outbound eq "" ) {
+ die "No Zone $zone found in $config";
+ }
+ $reqfile = $flo_path . "/$outbound/" . $reqfile . ".req";
+ }
+
+ # seperate the file names of the first argument
+ @files = split (/\s+/, $ARGV[0]);
+
+ # open the flofile for appending
+ open(FLOFILE, ">>" . $reqfile) || die "can't open $reqfile";
+ while (@files) {
+ print (FLOFILE shift(@files), "\n");
+ }
+ close(FLOFILE);
+
+ print ("--- fido request $ver ---------------------------\n");
+ print ("requesting \"$file\" from fido-node $node\n");
+ print ("--- executing ifstat .. ------------------------\n");
+ system("ifstat");
+}
+
+#
+# subroutine "usage"
+#
+sub usage {
+ printf ("--- fido request %s -------------\n", $ver);
+ printf ("usage: ifreq <file> [<3-d address>]\n");
+ printf ("e.g. : ifreq FILES 2:2410/305\n");
+ exit 1;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.rcnews b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.rcnews
new file mode 100755
index 00000000000..957a272ee49
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.rcnews
@@ -0,0 +1,79 @@
+#! /bin/sh
+## $Revision: 1.1 $
+## News boot script.
+
+## =()<. @<_PATH_SHELLVARS>@>()=
+. /usr/lib/news/innshellvars
+
+## Pick ${INND} or ${INNDSTART}
+WHAT=${INNDSTART}
+## Set to true or false
+DOINNWATCH=false
+MAIL="${MAILCMD} -s 'Boot-time Usenet warning on `hostname`' ${NEWSMASTER}"
+
+## RFLAG is set below; set FLAGS as appropriate.
+RFLAG=""
+FLAGS="-i0 -c0"
+
+## Clean shutdown?
+if [ -f ${SERVERPID} ] ; then
+ ( echo 'INND: PID file exists -- unclean shutdown!' >/dev/console )
+ RFLAG="-r"
+fi
+
+if [ ! -f ${NEWSLIB}/.news.daily ] ; then
+ echo 'No .news.daily file; need to run news.daily?' | eval ${MAIL}
+else
+ case `find ${NEWSLIB} -name .news.daily -mtime +1 -print 2>/dev/null` in
+ "")
+ ;;
+ *)
+ echo 'Old .news.daily file; need to run news.daily?' | eval ${MAIL}
+ ;;
+ esac
+fi
+
+## Active file recovery.
+if [ ! -s ${ACTIVE} ] ; then
+ if [ -s ${NEWACTIVE} ] ; then
+ mv ${NEWACTIVE} ${ACTIVE}
+ else
+ if [ -s ${OLDACTIVE} ] ; then
+ cp ${OLDACTIVE} ${ACTIVE}
+ else
+ ( echo 'INND: No active file!' >/dev/console )
+ exit 1
+ fi
+ fi
+ RFLAG="-r"
+ # You might want to rebuild the DBZ database, too:
+ #echo "cd ${NEWSLIB} \
+ # && makehistory -r \
+ # && mv history.n.dir history.dir \
+ # && mv history.n.pag history.pag" | su ${NEWSUSER}
+fi
+
+## Remove temporary batchfiles and lock files.
+( cd ${BATCH} && rm -f bch* )
+( cd ${LOCKS} && rm -f LOCK* )
+( cd ${TEMPSOCKDIR} && rm -f ${TEMPSOCK} )
+rm -f ${NEWSCONTROL} ${NNTPCONNECT} ${SERVERPID}
+
+## Start the show.
+( echo 'Starting innd.' >/dev/console )
+eval ${WHAT} ${RFLAG} ${FLAGS}
+
+# Gee, looks like lisp, doesn't it?
+${DOINNWATCH} && {
+ echo "( ( sleep 60 ; ${INNWATCH} ) & )" | su ${NEWSUSER}
+}
+
+RMFILE=${MOST_LOGS}/expire.rm
+if [ -s ${MOST_LOGS}/expire.rm ] ; then
+ ( echo "Removing articles from pre-downtime expire run." >/dev/console )
+ (
+ echo 'System shut down during expire. Unlinking articles listed in'
+ echo ${RMFILE}
+ ) | eval ${MAIL}
+ echo "${NEWSBIN}/expirerm ${RMFILE}" | su ${NEWSUSER} &
+fi
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.sendifm1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.sendifm1
new file mode 100755
index 00000000000..564b9c60533
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.sendifm1
@@ -0,0 +1,74 @@
+#! /bin/sh
+## $Revision: 1.1 $
+## SH script to send UUCP batches out.
+
+## =()<. @<_PATH_SHELLVARS>@>()=
+. ~news/innshellvars
+
+PROGNAME=`basename $0`
+LOCK=${LOCKS}/LOCK.${PROGNAME}
+LOG=${MOST_LOGS}/${PROGNAME}.log
+
+MAXJOBS=200
+UUXFLAGS="- -r -gd"
+
+## Start logging.
+test ! -f ${LOG} && touch ${LOG}
+chmod 0660 ${LOG}
+exec >>${LOG} 2>&1
+echo "${PROGNAME}: [$$] begin `date`"
+cd ${BATCH}
+
+## Anyone else there?
+trap 'rm -f ${LOCK} ; exit 1' 1 2 3 15
+shlock -p $$ -f ${LOCK} || {
+ echo "${PROGNAME}: [$$] locked by [`cat ${LOCK}`]"
+ exit 0
+}
+
+## Who are we sending to?
+if [ -n "$1" ] ; then
+ LIST="$*"
+else
+ LIST=`ls /usr/spool/news/out.going|egrep "f[0-9]*.n[0-9]*$"`
+fi
+
+case ${HAVE_UUSTAT} in
+DONT)
+ TEMP=${TMPDIR}/uuq$$
+ uuq -h |tr -d : >${TEMP}
+ ;;
+esac
+
+## Do the work...
+
+for SITE in ${LIST}; do
+
+ ## See if any data is ready for host.
+ BATCHFILE=${SITE}.uucp
+ if [ -f ${SITE}.work ] ; then
+ cat ${SITE}.work >>${BATCHFILE}
+ rm -f ${SITE}.work
+ fi
+ mv ${SITE} ${SITE}.work
+ ctlinnd -s -t30 flush ${SITE} || continue
+ cat ${SITE}.work >>${BATCHFILE}
+ rm -f ${SITE}.work
+ if [ ! -s ${BATCHFILE} ] ; then
+ echo "${PROGNAME}: [$$] no articles for ${SITE}"
+ rm -f ${BATCHFILE}
+ continue
+ fi
+
+ ## Get the compression flags.
+ echo "${PROGNAME}: [$$] begin ${SITE}"
+ case "${SITE}" in
+ phreak)
+ COMPRESS="compress"
+ ;;
+ *)
+ COMPRESS="gzip"
+ ;;
+ esac
+
+ time batcher \
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.sendifm2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.sendifm2
new file mode 100755
index 00000000000..1a34a1fabbc
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.sendifm2
@@ -0,0 +1,15 @@
+ ${SITE} ${BATCHFILE}
+
+ echo "${PROGNAME}: [$$] end ${SITE}"
+done
+
+case ${HAVE_UUSTAT} in
+DONT)
+ rm -f ${TEMP}
+ ;;
+esac
+
+## Remove the lock file.
+rm -f ${LOCK}
+
+echo "${PROGNAME}: [$$] end `date`"
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.trnrc b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.trnrc
new file mode 100644
index 00000000000..7be596f74db
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.trnrc
@@ -0,0 +1,13 @@
+TRNINIT="-x -e -X -F\" :> \""
+HIDELINE="^X-FTN"
+NEWSHEADER="Newsgroups: %(%F=^\$?%C:%F)
+Subject: %(%S=^\$?%\"\n\nSubject: \":%S)
+%(%R=^\$?:References: %R
+)Sender:
+Distribution: %(%i=^\$?%\"\nDistribution: \":%D)
+Organization: %o
+X-Comment-To: %f\n\n"
+ATTRIBUTION="%f writes:\n"
+YOUSAID="In article %i \n of newsgroup %C you write about \"%s\":\n"
+MAILCALL="(New Mail)"
+export NEWSHEADER HIDELINE TRNINIT ATTRIBUTION MAILCALL YOUSAID EDITOR
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.wheel b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.wheel
new file mode 100755
index 00000000000..567e559a5ab
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/copi.wheel
@@ -0,0 +1,54 @@
+#!/bin/bash
+# $Id: copi.wheel,v 1.2 2001/01/15 22:26:33 tom Exp $
+
+mkstemp size
+dialog --print-maxsize 2>$tmp_size
+ROWS="`cut $tmp_size -f1 -d, | cut -f2 -d:`"
+COLS="`cut $tmp_size -f2 -d,`"
+rm $tmp_size
+
+# Takes an integer, multiplies it for COLS, divides for 132
+scalex() {
+ echo $[$1*$COLS/132]
+}
+scaley() {
+ echo $[$1*$ROWS/60]
+}
+
+dialog --backtitle "$TITLE" --no-shadow \
+--begin `scaley 27` `scalex 98` --infobox "pushd /var/log >/dev/null" 0 0 --and-widget \
+--begin `scaley 35` `scalex 95` --infobox "mkdir -p news -m 755" 0 0 --and-widget \
+--begin `scaley 45` `scalex 86` --infobox "chown news.news news" 0 0 --and-widget \
+--begin `scaley 48` `scalex 78` --infobox "cd /var/log/news" 0 0 --and-widget \
+--begin `scaley 51` `scalex 61` --infobox "mkdir -p OLD -m 755" 0 0 --and-widget \
+--begin `scaley 52` `scalex 47` --infobox "chown news.news OLD" 0 0 --and-widget \
+--begin `scaley 51` `scalex 40` --infobox "cd /var/spool" 0 0 --and-widget \
+--begin `scaley 48` `scalex 25` --infobox "mkdir -p news -m 775" 0 0 --and-widget \
+--begin `scaley 42` `scalex 13` --infobox "chown news.news news" 0 0 --and-widget \
+--begin `scaley 35` `scalex 4` --infobox "cd /var/spool/news" 0 0 --and-widget \
+--begin `scaley 27` `scalex 2` --infobox "CURMASK=`umask`" 0 0 --and-widget \
+--begin `scaley 19` `scalex 4` --infobox "umask 02" 0 0 --and-widget \
+--begin `scaley 11` `scalex 13` --infobox "mkdir -p out.going control junk in.coming" 0 0 --and-widget \
+--begin `scaley 5` `scalex 25` --infobox "chown news.news out.going control junk in.coming" 0 0 --and-widget \
+--begin `scaley 2` `scalex 37` --infobox "cd in.coming" 0 0 --and-widget \
+--begin `scaley 1` `scalex 46` --infobox "mkdir -p bad tmp" 0 0 --and-widget \
+--begin `scaley 2` `scalex 61` --infobox "chown news.news bad tmp" 0 0 --and-widget \
+--begin `scaley 5` `scalex 76` --infobox "umask $CURMASK" 0 0 --and-widget \
+--begin `scaley 11` `scalex 87` --infobox "ln -sf ~news /usr/local/lib/" 0 0 --and-widget \
+--begin `scaley 18` `scalex 95` --infobox "ln -sf ~news/inews /usr/bin/" 0 0 --and-widget \
+--begin `scaley 26` `scalex 97` --infobox "chmod 1777 /var/tmp" 0 0 --and-widget \
+--begin `scaley 34` `scalex 95` --infobox "cd ~news" 0 0 --and-widget \
+--begin `scaley 42` `scalex 87` --infobox "touch history history.dir history.pag errlog log" 0 0 --and-widget \
+--begin `scaley 47` `scalex 76` --infobox "chown news.news history* log errlog" 0 0 --and-widget \
+--sleep 1 --infobox "Creating spooling and logging directories and files..." 0 0 --and-widget \
+--begin `scaley 51` `scalex 78` --infobox "chmod 664 history* log errlog" 0 0 --and-widget \
+--begin `scaley 52` `scalex 60` --infobox "echo \"control 0000000000 0000000001 y\" > active" 0 0 --and-widget \
+--begin `scaley 51` `scalex 42` --infobox "echo \"junk 0000000000 0000000001 y\" >> active" 0 0 --and-widget \
+--begin `scaley 48` `scalex 26` --infobox "chown news.news active" 0 0 --and-widget \
+--begin `scaley 42` `scalex 13` --infobox "echo \"control 814573260 usenet\" > active.times" 0 0 --and-widget \
+--begin `scaley 35` `scalex 4` --infobox "echo \"junk 814573260 usenet\" >> active.times" 0 0 --and-widget \
+--begin `scaley 27` `scalex 2` --infobox "chown news.news active.times" 0 0 --and-widget \
+--begin `scaley 19` `scalex 4` --infobox ":>newsgroups" 0 0 --and-widget \
+--begin `scaley 11` `scalex 12` --infobox "chown news.news newsgroups" 0 0 --and-widget \
+--begin `scaley 6` `scalex 25` --infobox "popd >/dev/null" 0 0
+sleep 1
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/ifpatch b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/ifpatch
new file mode 100644
index 00000000000..1e7c7ee510e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copifuncs/ifpatch
@@ -0,0 +1,101 @@
+--- ifgate/message.c.orig Mon Jul 24 15:17:47 1995
++++ ifgate/message.c Mon Jul 24 15:18:00 1995
+@@ -48,12 +48,26 @@
+ if (!strcasecmp(msg->key,"X-UUCP-From")) return 0;
+ if (!strcasecmp(msg->key,"X-Body-Start")) return 0;
+ if (!strncasecmp(msg->key,"X-FTN-",6)) return 0;
+- if (!strcasecmp(msg->key,"Path")) return isftnpath(msg->val)?0:1;
++ if (!strcasecmp(msg->key,"Path"))
++
++#ifdef LESS_RFC_KLUDGES
++ return 0;
++#else
++ return isftnpath(msg->val)?0:1;
++#endif
++
+ if (!strcasecmp(msg->key,"Newsgroups")) return newsmode?0:2;
+ if (!strcasecmp(msg->key,"Xref")) return 0;
+ if (!strcasecmp(msg->key,"Return-Receipt-To")) return 1;
+ if (!strcasecmp(msg->key,"Received")) return newsmode?0:2;
+- if (!strcasecmp(msg->key,"From")) return ftnorigin?0:2;
++ if (!strcasecmp(msg->key,"From"))
++
++#ifdef LESS_RFC_KLUDGES
++ return 0;
++#else
++ return ftnorigin?0:2;
++#endif
++
+ if (!strcasecmp(msg->key,"To"))
+ {
+ if (newsmode) return 0;
+@@ -66,7 +80,14 @@
+ }
+ if (!strcasecmp(msg->key,"Cc")) return 2;
+ if (!strcasecmp(msg->key,"Bcc")) return 2;
+- if (!strcasecmp(msg->key,"Reply-To")) return 2;
++ if (!strcasecmp(msg->key,"Reply-To"))
++
++#ifdef LESS_RFC_KLUDGES
++ return 0;
++#else
++ return 2;
++#endif
++
+ if (!strcasecmp(msg->key,"Lines")) return 0;
+ if (!strcasecmp(msg->key,"Date")) return 0;
+ if (!strcasecmp(msg->key,"Subject"))
+@@ -77,8 +98,22 @@
+ if (!strcasecmp(msg->key,"Organization")) return removeorg?0:1;
+ if (!strcasecmp(msg->key,"Comment-To")) return 0;
+ if (!strcasecmp(msg->key,"X-Comment-To")) return 0;
+- if (!strcasecmp(msg->key,"Keywords")) return 2;
+- if (!strcasecmp(msg->key,"Summary")) return 2;
++ if (!strcasecmp(msg->key,"Keywords"))
++
++#ifdef LESS_RFC_KLUDGES
++ return 0;
++#else
++ return 2;
++#endif
++
++ if (!strcasecmp(msg->key,"Summary"))
++
++#ifdef LESS_RFC_KLUDGES
++ return 0;
++#else
++ return 2;
++#endif
++
+ if (!strcasecmp(msg->key,"MIME-Version")) return removemime?0:1;
+ if (!strcasecmp(msg->key,"Content-Type")) return removemime?0:1;
+ if (!strcasecmp(msg->key,"Content-Length")) return removemime?0:1;
+@@ -86,8 +121,26 @@
+ if (!strcasecmp(msg->key,"Content-Name")) return 2;
+ if (!strcasecmp(msg->key,"Content-Description")) return 2;
+ if (!strcasecmp(msg->key,"Message-ID")) return ftnorigin?0:1;
+- if (!strcasecmp(msg->key,"References")) return removeref?0:1;
+- if (!strcasecmp(msg->key,"Distribution")) return ftnorigin?0:1;
++ if (!strcasecmp(msg->key,"References"))
++
++#ifdef LESS_RFC_KLUDGES
++ return 0;
++#else
++ return removeref?0:1;
++#endif
++
++ if (!strcasecmp(msg->key,"Distribution"))
++
++#ifdef LESS_RFC_KLUDGES
++ return 0;
++#else
++ return ftnorigin?0:1;
++#endif
++
++#ifdef LESS_RFC_KLUDGES
++ if (!strcasecmp(msg->key,"NNTP-Posting-Host")) return 0;
++#endif
++
+ /*if (!strcasecmp(msg->key,"")) return ;*/
+ return 1;
+ }
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/copismall b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copismall
new file mode 100755
index 00000000000..8158b8e9b4a
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/copismall
@@ -0,0 +1,296 @@
+#!/bin/bash
+# $Id: copismall,v 1.5 2003/08/15 19:34:18 tom Exp $
+#
+# ComeOn Point Installer! v0.9a.small (small version for cdialog v0.9a)
+# - installa il point in modo visuale e auto-detecting. Versione light.
+#
+# AUTHOR: Beppe (beppe.dem@nsm.it)
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+# THIS IS NOT THE ORIGINAL VERSION!!!! This files was adequate to be
+# a demo for cdialog v0.9a+. However it doesn't include all its features.
+# Look for one of the free ComeOn Linux! tools to have a complete
+# demo of cdialog. ComeOn Linux! follows the GNU philosophy.
+# Send peacefully a mail to demarco_p@abramo.it for more info.
+
+: ${DIALOG=dialog}
+
+#COMEONDIR=/usr/lib/ComeOn
+#POINTDIR=$COMEONDIR/point
+POINTDIR=`pwd`
+
+AKASETUP=$POINTDIR/.akasetup
+PNTSETUP=$POINTDIR/.pntsetup
+EMSIFILE=$POINTDIR/.emsi
+COPIUSER=$POINTDIR/.copi.user
+COPIVER=v0.9a.small
+TITLE="ComeOn Point Installer! $COPIVER -+- (c) 1996 ComeOn Linux!"
+
+#FUNCSVER=v0.9.2
+#FUNCSDIR=$POINTDIR/funcs-$FUNCSVER
+FUNCSDIR=$POINTDIR/copifuncs
+
+#COPIDIR=$POINTDIR/copi-$COPIVER
+#. $COPIDIR/copishellvars
+
+#POINTVER="v1.1" # ComeOn Point version
+
+if [ $LOGNAME != root ]
+then
+ $DIALOG --backtitle "$TITLE" --title "Error!" --beep --msgbox "Questo programma per funzionare correttamente deve essere avviato dall'amministratore di sistema (root)." 0 0
+ exit
+fi
+
+
+$DIALOG --backtitle "$TITLE" --title "Are you sure?" --cr-wrap --msgbox "Questo installer procedera' in modalita'
+auto-detect all'installazione del point.
+Premi <Enter> per iniziare o <Esc> per uscire. " 0 0
+
+if [ $? = 1 -o $? = 255 ]; then
+ exit
+fi
+
+
+pushd $FUNCSDIR >/dev/null
+. ./copi.funcs
+. ./common.funcs
+. ./admin.funcs
+
+###############################################################################
+find_incompatible_packages
+
+if [ "$PKG_TO_REMOVE" ]
+then
+ $DIALOG --backtitle "$TITLE" --beep --title "Problem detected" --msgbox "Attenzione, prima di poter continuare bisogna avviare pkgtool e rimuovere i seguenti packages: $PKG_TO_REMOVE." 0 0
+ exit
+fi
+
+###############################################################################
+mkstemp dialog
+
+find_necessary_packages
+
+if [ "$PKG_TO_INSTALL" ]
+then
+ echo -n "Attenzione, prima di poter continuare bisogna avviare setup ed installare i seguenti packages dai disk sets N (quelli del Networking): $PKG_TO_INSTALL." >$tmp_dialog
+
+ if [ "`echo $PKG_TO_INSTALL | grep tcpip`" ]
+ then
+ echo -n " Ricordarsi poi di effettuare lo shutdown per rendere effettive le modifiche." >>$tmp_dialog
+ fi
+
+ $DIALOG --backtitle "$TITLE" --beep --title "Problem detected" --msgbox "`cat $tmp_dialog`" 0 0
+
+ rm $tmp_dialog
+ exit
+fi
+
+###############################################################################
+mkstemp smailp
+
+SMAILTGZ=""
+if [ ! -d /usr/lib/smail ]
+then
+ $DIALOG --backtitle "$TITLE" --title "Smail not found" --inputbox "Bisogna installare Smail, per cui inserire il percorso completo di dove trovarne i binari compressi" 0 0 "/cdrom/sunsite/system/Mail/delivery/smail-linuxbin-3.1.29.1.tar.gz" 2>$tmp_smailp
+ SMAILTGZ="`cat $tmp_smailp`"
+ rm $tmp_smailp
+ while [ ! -f "$SMAILTGZ" ]
+ do
+ $DIALOG --backtitle "$TITLE" --beep --title "Archive not found" --inputbox "Percorso di file \"$SMAILTGZ\" non valido, controllarne la correttezza." 0 0 "/cdrom/sunsite/system/Mail/delivery/smail-linuxbin-3.1.29.1.tar.gz" 2>$tmp_smailp
+ SMAILTGZ="`cat $tmp_smailp`"
+ rm $tmp_smailp
+ done
+fi
+
+###############################################################################
+mkstemp target
+mkstemp asetup
+mkstemp psetup
+
+AKA=""
+while [ ! "$AKA" ]
+do
+ $DIALOG --backtitle "$TITLE" --title "Primary address" --inputbox "Inserire il proprio address principale, completo di point e di domain. Il poll sara' effettuato per default dal boss corrispondente." 0 0 "2:335/722.7@fidonet" 2>$tmp_target
+ AKAFTN="`cat $tmp_target`"
+ rm $tmp_target
+ fidonetpoint2int $AKAFTN
+ AKA="$_RETVAL"
+done
+echo -n "`echo $AKA | cut -f2- -d.`:" >$tmp_asetup
+echo -n "`echo $AKA | cut -f1 -d. | cut -c2-`:" >$tmp_psetup
+AKASFTN="$AKAFTN"
+AKAS="$AKA"
+while [ "$AKAFTN" ]
+do
+ $DIALOG --backtitle "$TITLE" --title "AKAs" --inputbox "Inserire un eventuale address secondario, oppure lasciare la riga vuota per proseguire. Attenzione: nel caso si abbiano piu' indirizzi sulla stessa rete, bisognera' configurare solo uno di questi. Gli indirizzi correntemente definiti sono: $AKASFTN" 0 0 2>$tmp_target
+ AKAFTN="`cat $tmp_target`"
+ rm $tmp_target
+ if [ "$AKAFTN" ]
+ then
+ fidonetpoint2int $AKAFTN
+ AKA="$_RETVAL"
+ if [ "`echo $AKAS | grep \".\`echo $AKA | cut -f5 -d.\`.\"`" ]
+ then
+ $DIALOG --backtitle "$TITLE" --beep --title "Invalid address" --msgbox "Non si possono avere piu' indirizzi sullo stesso dominio (net)." 0 0
+ else
+ AKASFTN="$AKASFTN $AKAFTN"
+ AKAS="$AKAS $AKA"
+ echo -n "`echo $AKA | cut -f2- -d.`:" >>$tmp_asetup
+ echo -n "`echo $AKA | cut -f1 -d. | cut -c2-`:" >>$tmp_psetup
+ fi
+ fi
+done
+echo ":" >>$tmp_asetup
+echo ":" >>$tmp_psetup
+save $AKASETUP
+save $PNTSETUP
+mv $tmp_asetup $AKASETUP
+mv $tmp_psetup $PNTSETUP
+
+###############################################################################
+mkstemp hostnm
+
+$DIALOG --backtitle "$TITLE" --title "Hostname" --inputbox "Inserire l'hostname di questo computer qualora si abbia una rete gia' configurata, altrimenti inventarne uno fittizio da assegnare e questa macchina verra' configurata per il loopback." 0 0 "quark.comeon.org" 2>$tmp_hostnm
+NEW_HOSTNAME="`cat $tmp_hostnm`"
+rm $tmp_hostnm
+
+###############################################################################
+mkstemp master
+
+$DIALOG --backtitle "$TITLE" --title "Point admin" --inputbox "Scegliere l'user principale per la gestione e l'uso del point. Se l'user non esiste, verra' creato. Se esiste, ne verranno adattate le informazioni quali nome, gruppi, etc." 0 0 "beppe" --and-widget --title "Insert SysOp's name" --inputbox "Inserire nome e cognome del gestore ed utilizzatore principale del point (il proprio nome)." 0 0 "Giuseppe De Marco" --and-widget --title "Choose editor" --inputbox "Scegliere l'editor da usare per scrivere i messaggi" 0 0 "vim" 2>$tmp_master
+POST_USER="`cut $tmp_master -f1`"
+POST_NAME="`cut $tmp_master -f2`"
+POST_EDIT="`cut $tmp_master -f3`"
+rm $tmp_master
+save $COPIUSER
+echo $POST_USER >$COPIUSER
+
+###############################################################################
+mkstemp expire
+mkstemp origin
+
+$DIALOG --backtitle "$TITLE" --title "Origin" --inputbox "Scegliere l'Origin del sistema" 9 60 "$POST_USER's linux box" 2>$tmp_origin
+NEW_ORIGIN="`cat $tmp_origin`"
+rm $tmp_origin
+
+$DIALOG --backtitle "$TITLE" --title "News expiring" --inputbox "Decidere per quanti giorni i messaggi echomail (le news) dovranno transitare sul sistema prima di venire cancellati automaticamente da news.daily. Inserire never se si vuole che non vengano mai cancellati. Sono ammesse cifre decimali (i.e. 25.5). Notare comunque che il valore qui inserito e' quello di default, ma per ogni singola area (newsgroup) sara' possibile specificare poi un valore appropriato." 0 0 "30" 2>$tmp_expire
+KEEPDAYS="`cat $tmp_expire`"
+rm $tmp_expire
+
+###############################################################################
+mkstemp dialer
+mkstemp ifmail
+mkstemp mailvr
+mkstemp passwd
+
+IFMAILTGZ=""
+IFMAILVERS=""
+if [ ! -d /usr/lib/ifmail -o ! -d /etc/ifmail -o ! -d /var/log/ifmail -o ! -f /usr/lib/ifmail/ifcico ]
+then
+ $DIALOG --backtitle "$TITLE" --title "ifmail not found" --inputbox "Inserire il percorso COMPLETO dei sorgenti compressi di ifmail che verranno decompressi in /usr/src e compilati." 0 0 "/cdrom/sunsite/system/Mail/transport/ifmail-2.8b.tar.gz" 2>$tmp_ifmail
+ IFMAILTGZ="`cat $tmp_ifmail`"
+ rm $tmp_ifmail
+ while [ ! -f "$IFMAILTGZ" ]
+ do
+ $DIALOG --backtitle "$TITLE" --beep --title "invalid filename" --inputbox "Percorso di file \"$IFMAILTGZ\" non valido, controllarne la correttezza." 0 0 "/cdrom/sunsite/system/Mail/transport/ifmail-2.8b.tar.gz" 2>$tmp_ifmail
+ IFMAILTGZ="`cat $tmp_ifmail`"
+ rm $tmp_ifmail
+ done
+
+ $DIALOG --backtitle "$TITLE" --title "ifmail version" --inputbox "Specificare la versione di ifmail" 0 0 "2.8b" 2>$tmp_mailvr
+ IFMAILVERS="`cat $tmp_mailvr` + ComeOn Point $POINTVER"
+ rm $tmp_mailvr
+fi
+
+IAKA=1
+PASSW=""
+AKA="`cut $AKASETUP -f$IAKA -d:`"
+while [ "$AKA" ]
+do
+ int2fido $AKA
+ AKAFTN="$_RETVAL"
+ $DIALOG --backtitle "$TITLE" --title "Password" --inputbox "Specificare la password di sessione e per i pacchetti per il nodo $AKAFTN -- attenzione che alcuni mailers accettano solo passwords da 8 caratteri in maiuscolo!!" 0 0 "MYPASSWD" 2>$tmp_passwd
+ PASSW="$PASSW`cat $tmp_passwd`:"
+ rm $tmp_passwd
+ IAKA=$[$IAKA+1]
+ AKA="`cut $AKASETUP -f$IAKA -d:`"
+done
+PASSW="$PASSW:"
+
+$DIALOG --backtitle "$TITLE" \
+--title "Modem speed" --inputbox "Specificare la velocita' del proprio modem (che sta su /dev/modem)" 0 0 "16800" --and-widget \
+--title "System name" --inputbox "Specificare il nome del sistema per il pacchetto EMSI" 0 0 "`cat $COPIUSER`'s linux point" --and-widget \
+--title "Location" --inputbox "Inserire la localita' fisica in cui risiede il sistema" 0 0 "Catanzaro, Italy - Europe" --and-widget \
+--title "Phone number" --inputbox "Inserire il proprio numero di telefono in formato internazionale, cioe' completo di doppio prefisso (xx-yyy-zzzzzz)" 0 0 "39-961-31997" --and-widget \
+--title "International call prefix" --inputbox "Specificare il prefisso da comporre per poter effettuare una chiamata internazionale (se ci si trova in Italia ad es. bisogna inserire 00)" 0 0 "00" --and-widget \
+--title "Long-distance call prefix" --inputbox "Specificare il prefisso da comporre per poter effettuare una chiamata interurbana in ambito nazionale, che verra' sostituito al prefisso della propria nazione quando incontrato in nodelist (per l'Italia ad es. bisogna inserire 0, che sostituira' il 39)" 0 0 "0" --and-widget \
+--title "Pointlist flags" --inputbox "Inserire eventuali flags stile pointlist per il pacchetto EMSI" 0 0 "MO,V32B,V42B,ZYX" --and-widget \
+--title "Modem dialing" --inputbox "Inserire la stringa da inviare al modem per comporre un numero telefonico" 0 0 "ATDT" 2>$tmp_dialer
+
+echo -en "\t$POST_NAME\t\t" >>$tmp_dialer
+save $EMSIFILE
+mv $tmp_dialer $EMSIFILE
+
+###############################################################################
+
+if [ -d /etc/smail ]
+then
+ SMAILCFGDIR=/etc/smail
+else
+ SMAILCFGDIR=/usr/lib/smail
+fi
+
+###############################################################################
+
+$DIALOG --backtitle "$TITLE" --title "First step completed!" --msgbox "OK, ora ho tutte le informazioni necessarie per poter installare il point. Da qui in poi faro' tutto da solo, quindi ci si puo' tranquillamente andare a prendere un caffe'. :-)" 0 0
+
+###############################################################################
+
+killall sendmail 2>/dev/null
+if [ $SMAILTGZ ]; then tar zxvf $SMAILTGZ -C / >/dev/null; fi
+/usr/sbin/sendmail -bd -q15m
+
+if [ ! "`ping -c1 $NEW_HOSTNAME | grep \"1 packets received\"`" ]; then
+ configure_loopback $NEW_HOSTNAME
+fi
+
+add_postmaster "$POST_USER" "$POST_NAME"
+add_alias "$POST_NAME" "$POST_USER"
+configure_trn "$POST_USER" "$POST_EDIT"
+configure_elm "$POST_USER" "$POST_EDIT"
+
+comment_nntp_in_inetdconf
+set_organization "$NEW_ORIGIN"
+create_innconf_newsfeeds_distrib
+create_expirectl $KEEPDAYS
+create_nnrpaccess
+create_hostsnntp
+create_dirs_and_files
+install_rcnews
+install_crontab_news
+if [ $IFMAILTGZ ]; then
+ install_ifmail "$IFMAILTGZ" /usr/lib/ifmail /etc/ifmail /var/log/ifmail "$IFMAILVERS" /usr/src
+fi
+configure_ifmail /usr/lib/ifmail /etc/ifmail /var/log/ifmail "$PASSW"
+configure_smail $SMAILCFGDIR
+
+###############################################################################
+$DIALOG --backtitle "$TITLE" \
+--title "-=[ Enjoy! ]=-" --msgbox "Il point e' stato installato con successo!" 0 0 --and-widget \
+--msgbox "trn (il newsreader, per leggere/scrivere gli echomail) ed elm (il mailreader, per leggere/scrivere i netmail) sono gia' stati configurati per l'user $POST_USER." 0 0
+
+popd >/dev/null
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/debian.rc b/Build/source/utils/dialog/dialog-1.1-20080819/samples/debian.rc
new file mode 100644
index 00000000000..f624dba846e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/debian.rc
@@ -0,0 +1,117 @@
+# $Id: debian.rc,v 1.4 2005/12/01 01:18:57 tom Exp $
+# Run-time configuration file for dialog, matches Debian color scheme.
+# (these are the default values for dialog)
+
+# Set aspect-ration.
+aspect = 0
+
+# Set separator (for multiple widgets output).
+separate_widget = ""
+
+# Set tab-length (for textbox tab-conversion).
+tab_len = 0
+
+# Make tab-traversal for checklist, etc., include the list.
+visit_items = OFF
+
+# Shadow dialog boxes? This also turns on color.
+use_shadow = ON
+
+# Turn color support ON or OFF
+use_colors = ON
+
+# Screen color
+screen_color = (CYAN,BLUE,ON)
+
+# Shadow color
+shadow_color = (BLACK,BLACK,ON)
+
+# Dialog box color
+dialog_color = (BLACK,WHITE,OFF)
+
+# Dialog box title color
+title_color = (BLUE,WHITE,ON)
+
+# Dialog box border color
+border_color = (WHITE,WHITE,ON)
+
+# Active button color
+button_active_color = (WHITE,BLUE,ON)
+
+# Inactive button color
+button_inactive_color = (BLACK,WHITE,OFF)
+
+# Active button key color
+button_key_active_color = (WHITE,BLUE,ON)
+
+# Inactive button key color
+button_key_inactive_color = (RED,WHITE,OFF)
+
+# Active button label color
+button_label_active_color = (YELLOW,BLUE,ON)
+
+# Inactive button label color
+button_label_inactive_color = (BLACK,WHITE,ON)
+
+# Input box color
+inputbox_color = (BLACK,WHITE,OFF)
+
+# Input box border color
+inputbox_border_color = (BLACK,WHITE,OFF)
+
+# Search box color
+searchbox_color = (BLACK,WHITE,OFF)
+
+# Search box title color
+searchbox_title_color = (BLUE,WHITE,ON)
+
+# Search box border color
+searchbox_border_color = (WHITE,WHITE,ON)
+
+# File position indicator color
+position_indicator_color = (BLUE,WHITE,ON)
+
+# Menu box color
+menubox_color = (BLACK,WHITE,OFF)
+
+# Menu box border color
+menubox_border_color = (WHITE,WHITE,ON)
+
+# Item color
+item_color = (BLACK,WHITE,OFF)
+
+# Selected item color
+item_selected_color = (WHITE,BLUE,ON)
+
+# Tag color
+tag_color = (BLUE,WHITE,ON)
+
+# Selected tag color
+tag_selected_color = (YELLOW,BLUE,ON)
+
+# Tag key color
+tag_key_color = (RED,WHITE,OFF)
+
+# Selected tag key color
+tag_key_selected_color = (RED,BLUE,ON)
+
+# Check box color
+check_color = (BLACK,WHITE,OFF)
+
+# Selected check box color
+check_selected_color = (WHITE,BLUE,ON)
+
+# Up arrow color
+uarrow_color = (GREEN,WHITE,ON)
+
+# Down arrow color
+darrow_color = (GREEN,WHITE,ON)
+
+# Item help-text color
+itemhelp_color = (WHITE,BLACK,OFF)
+
+# Active form text color
+form_active_text_color = (WHITE,BLUE,ON)
+
+# Form text color
+form_text_color = (WHITE,CYAN,ON)
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/dialog.py b/Build/source/utils/dialog/dialog-1.1-20080819/samples/dialog.py
new file mode 100644
index 00000000000..db66fd7f2f4
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/dialog.py
@@ -0,0 +1,353 @@
+# $Id: dialog.py,v 1.3 2004/09/21 00:52:15 tom Exp $
+# Module: dialog.py
+# Copyright (c) 2000 Robb Shecter <robb@acm.org>
+# All rights reserved.
+# This source is covered by the GNU GPL.
+#
+# This module is a Python wrapper around the Linux "dialog" utility
+# by Savio Lam and Stuart Herbert. My goals were to make dialog as
+# easy to use from Python as possible. The demo code at the end of
+# the module is a good example of how to use it. To run the demo,
+# execute:
+#
+# python dialog.py
+#
+# This module has one class in it, "Dialog". An application typically
+# creates an instance of it, and possibly sets the background title option.
+# Then, methods can be called on it for interacting with the user.
+#
+# I wrote this because I want to use my 486-33 laptop as my main
+# development computer (!), and I wanted a way to nicely interact with the
+# user in console mode. There are apparently other modules out there
+# with similar functionality, but they require the Python curses library.
+# Writing this module from scratch was easier than figuring out how to
+# recompile Python with curses enabled. :)
+#
+# One interesting feature is that the menu and selection windows allow
+# *any* objects to be displayed and selected, not just strings.
+#
+# TO DO:
+# Add code so that the input buffer is flushed before a dialog box is
+# shown. This would make the UI more predictable for users. This
+# feature could be turned on and off through an instance method.
+# Drop using temporary files when interacting with 'dialog'
+# (it's possible -- I've already tried :-).
+# Try detecting the terminal window size in order to make reasonable
+# height and width defaults. Hmmm - should also then check for
+# terminal resizing...
+# Put into a package name to make more reusable - reduce the possibility
+# of name collisions.
+#
+# NOTES:
+# there is a bug in (at least) Linux-Mandrake 7.0 Russian Edition
+# running on AMD K6-2 3D that causes core dump when 'dialog'
+# is running with --gauge option;
+# in this case you'll have to recompile 'dialog' program.
+#
+# Modifications:
+# Jul 2000, Sultanbek Tezadov (http://sultan.da.ru)
+# Added:
+# - 'gauge' widget *)
+# - 'title' option to some widgets
+# - 'checked' option to checklist dialog; clicking "Cancel" is now
+# recognizable
+# - 'selected' option to radiolist dialog; clicking "Cancel" is now
+# recognizable
+# - some other cosmetic changes and improvements
+#
+
+import os
+from tempfile import mktemp
+from string import split
+from time import sleep
+
+#
+# Path of the dialog executable
+#
+DIALOG = os.getenv("DIALOG");
+if DIALOG is None:
+ DIALOG="../dialog";
+
+class Dialog:
+ def __init__(self):
+ self.__bgTitle = '' # Default is no background title
+
+
+ def setBackgroundTitle(self, text):
+ self.__bgTitle = '--backtitle "%s"' % text
+
+
+ def __perform(self, cmd):
+ """Do the actual work of invoking dialog and getting the output."""
+ fName = mktemp()
+ rv = os.system('%s %s %s 2> %s' % (DIALOG, self.__bgTitle, cmd, fName))
+ f = open(fName)
+ output = f.readlines()
+ f.close()
+ os.unlink(fName)
+ return (rv, output)
+
+
+ def __perform_no_options(self, cmd):
+ """Call dialog w/out passing any more options. Needed by --clear."""
+ return os.system(DIALOG + ' ' + cmd)
+
+
+ def __handleTitle(self, title):
+ if len(title) == 0:
+ return ''
+ else:
+ return '--title "%s" ' % title
+
+
+ def yesno(self, text, height=10, width=30, title=''):
+ """
+ Put a Yes/No question to the user.
+ Uses the dialog --yesno option.
+ Returns a 1 or a 0.
+ """
+ (code, output) = self.__perform(self.__handleTitle(title) +\
+ '--yesno "%s" %d %d' % (text, height, width))
+ return code == 0
+
+
+ def msgbox(self, text, height=10, width=30, title=''):
+ """
+ Pop up a message to the user which has to be clicked
+ away with "ok".
+ """
+ self.__perform(self.__handleTitle(title) +\
+ '--msgbox "%s" %d %d' % (text, height, width))
+
+
+ def infobox(self, text, height=10, width=30):
+ """Make a message to the user, and return immediately."""
+ self.__perform('--infobox "%s" %d %d' % (text, height, width))
+
+
+ def inputbox(self, text, height=10, width=30, init='', title=''):
+ """
+ Request a line of input from the user.
+ Returns the user's input or None if cancel was chosen.
+ """
+ (c, o) = self.__perform(self.__handleTitle(title) +\
+ '--inputbox "%s" %d %d "%s"' % (text, height, width, init))
+ try:
+ return o[0]
+ except IndexError:
+ if c == 0: # empty string entered
+ return ''
+ else: # canceled
+ return None
+
+
+ def textbox(self, filename, height=20, width=60, title=None):
+ """Display a file in a scrolling text box."""
+ if title is None:
+ title = filename
+ self.__perform(self.__handleTitle(title) +\
+ ' --textbox "%s" %d %d' % (filename, height, width))
+
+
+ def menu(self, text, height=15, width=54, list=[]):
+ """
+ Display a menu of options to the user. This method simplifies the
+ --menu option of dialog, which allows for complex arguments. This
+ method receives a simple list of objects, and each one is assigned
+ a choice number.
+ The selected object is returned, or None if the dialog was canceled.
+ """
+ menuheight = height - 8
+ pairs = map(lambda i, item: (i + 1, item), range(len(list)), list)
+ choices = reduce(lambda res, pair: res + '%d "%s" ' % pair, pairs, '')
+ (code, output) = self.__perform('--menu "%s" %d %d %d %s' %\
+ (text, height, width, menuheight, choices))
+ try:
+ return list[int(output[0]) - 1]
+ except IndexError:
+ return None
+
+
+ def checklist(self, text, height=15, width=54, list=[], checked=None):
+ """
+ Returns a list of the selected objects.
+ Returns an empty list if nothing was selected.
+ Returns None if the window was canceled.
+ checked -- a list of boolean (0/1) values; len(checked) must equal
+ len(list).
+ """
+ if checked is None:
+ checked = [0]*len(list)
+ menuheight = height - 8
+ triples = map(
+ lambda i, item, onoff, fs=('off', 'on'): (i + 1, item, fs[onoff]),
+ range(len(list)), list, checked)
+ choices = reduce(lambda res, triple: res + '%d "%s" %s ' % triple,
+ triples, '')
+ (c, o) = self.__perform('--checklist "%s" %d %d %d %s' %\
+ (text, height, width, menuheight, choices))
+ try:
+ output = o[0]
+ indexList = map(lambda x: int(x[1:-1]), split(output))
+ objectList = filter(lambda item, list=list, indexList=indexList:
+ list.index(item) + 1 in indexList,
+ list)
+ return objectList
+ except IndexError:
+ if c == 0: # Nothing was selected
+ return []
+ return None # Was canceled
+
+
+ def radiolist(self, text, height=15, width=54, list=[], selected=0):
+ """
+ Return the selected object.
+ Returns empty string if no choice was selected.
+ Returns None if window was canceled.
+ selected -- the selected item (must be between 1 and len(list)
+ or 0, meaning no selection).
+ """
+ menuheight = height - 8
+ triples = map(lambda i, item: (i + 1, item, 'off'),
+ range(len(list)), list)
+ if selected:
+ i, item, tmp = triples[selected - 1]
+ triples[selected - 1] = (i, item, 'on')
+ choices = reduce(lambda res, triple: res + '%d "%s" %s ' % triple,
+ triples, '')
+ (c, o) = self.__perform('--radiolist "%s" %d %d %d %s' %\
+ (text, height, width, menuheight, choices))
+ try:
+ return list[int(o[0]) - 1]
+ except IndexError:
+ if c == 0:
+ return ''
+ return None
+
+
+ def clear(self):
+ """
+ Clear the screen. Equivalent to the dialog --clear option.
+ """
+ self.__perform_no_options('--clear')
+
+
+ def scrollbox(self, text, height=20, width=60, title=''):
+ """
+ This is a bonus method. The dialog package only has a function to
+ display a file in a scrolling text field. This method allows any
+ string to be displayed by first saving it in a temp file, and calling
+ --textbox.
+ """
+ fName = mktemp()
+ f = open(fName, 'w')
+ f.write(text)
+ f.close()
+ self.__perform(self.__handleTitle(title) +\
+ '--textbox "%s" %d %d' % (fName, height, width))
+ os.unlink(fName)
+
+
+ def gauge_start(self, perc=0, text='', height=8, width=54, title=''):
+ """
+ Display gauge output window.
+ Gauge normal usage (assuming that there is an instace of 'Dialog'
+ class named 'd'):
+ d.gauge_start()
+ # do something
+ d.gauge_iterate(10) # passed throgh 10%
+ # ...
+ d.gauge_iterate(100, 'any text here') # work is done
+ d.stop_gauge() # clean-up actions
+ """
+ cmd = self.__handleTitle(title) +\
+ '--gauge "%s" %d %d %d' % (text, height, width, perc)
+ cmd = '%s %s %s 2> /dev/null' % (DIALOG, self.__bgTitle, cmd)
+ self.pipe = os.popen(cmd, 'w')
+ #/gauge_start()
+
+
+ def gauge_iterate(self, perc, text=''):
+ """
+ Update percentage point value.
+
+ See gauge_start() function above for the usage.
+ """
+ if text:
+ text = 'XXX\n%d\n%s\nXXX\n' % (perc, text)
+ else:
+ text = '%d\n' % perc
+ self.pipe.write(text)
+ self.pipe.flush()
+ #/gauge_iterate()
+
+
+ def gauge_stop(self):
+ """
+ Finish previously started gauge.
+
+ See gauge_start() function above for the usage.
+ """
+ self.pipe.close()
+ #/gauge_stop()
+
+
+
+#
+# DEMO APPLICATION
+#
+if __name__ == '__main__':
+ """
+ This demo tests all the features of the class.
+ """
+ d = Dialog()
+ d.setBackgroundTitle('dialog.py demo')
+
+ d.infobox(
+ "One moment... Just wasting some time here to test the infobox...")
+ sleep(3)
+
+ if d.yesno("Do you like this demo?"):
+ d.msgbox("Excellent! Here's the source code:")
+ else:
+ d.msgbox("Send your complaints to /dev/null")
+
+ d.textbox("dialog.py")
+
+ name = d.inputbox("What's your name?", init="Snow White")
+ fday = d.menu("What's your favorite day of the week?",
+ list=["Monday", "Tuesday", "Wednesday", "Thursday",
+ "Friday (The best day of all)", "Saturday", "Sunday"])
+ food = d.checklist("What sandwich toppings do you like?",
+ list=["Catsup", "Mustard", "Pesto", "Mayonaise", "Horse radish",
+ "Sun-dried tomatoes"], checked=[0,0,0,1,1,1])
+ sand = d.radiolist("What's your favorite kind of sandwich?",
+ list=["Hamburger", "Hotdog", "Burrito", "Doener", "Falafel",
+ "Bagel", "Big Mac", "Whopper", "Quarter Pounder",
+ "Peanut Butter and Jelly", "Grilled cheese"], selected=4)
+
+ # Prepare the message for the final window
+ bigMessage = "Here are some vital statistics about you:\n\nName: " + name +\
+ "\nFavorite day of the week: " + fday +\
+ "\nFavorite sandwich toppings:\n"
+ for topping in food:
+ bigMessage = bigMessage + " " + topping + "\n"
+ bigMessage = bigMessage + "Favorite sandwich: " + str(sand)
+
+ d.scrollbox(bigMessage)
+
+ #<># Gauge Demo
+ d.gauge_start(0, 'percentage: 0', title='Gauge Demo')
+ for i in range(1, 101):
+ if i < 50:
+ msg = 'percentage: %d' % i
+ elif i == 50:
+ msg = 'Over 50%'
+ else:
+ msg = ''
+ d.gauge_iterate(i, msg)
+ sleep(0.1)
+ d.gauge_stop()
+ #<>#
+
+ d.clear()
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/dselect b/Build/source/utils/dialog/dialog-1.1-20080819/samples/dselect
new file mode 100755
index 00000000000..e85dbf8298e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/dselect
@@ -0,0 +1,21 @@
+#!/bin/sh
+# $Id: dselect,v 1.1 2006/12/27 01:11:08 tom Exp $
+: ${DIALOG=dialog}
+
+exec 3>&1
+FILE=`$DIALOG --title "Please choose a directory" --dselect $HOME/ 14 48 2>&1 1>&3`
+code=$?
+exec 3>&-
+
+case $code in
+ 0)
+ echo "\"$FILE\" chosen";;
+ 1)
+ echo "Button 1 (Cancel) pressed";;
+ 2)
+ echo "Button 2 (Help) pressed";;
+ 3)
+ echo "Button 3 (Extra) pressed";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox b/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox
new file mode 100755
index 00000000000..425d0bd9313
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox
@@ -0,0 +1,55 @@
+#!/bin/sh
+# $Id: editbox,v 1.6 2007/01/10 23:24:44 tom Exp $
+: ${DIALOG=dialog}
+
+input=`tempfile 2>/dev/null` || input=/tmp/input$$
+output=`tempfile 2>/dev/null` || output=/tmp/test$$
+trap "rm -f $input $output" 0 1 2 5 15
+
+cat << EOF > $input
+Hi, this is an edit box. It can be used to edit text from a file.
+
+It's like a simple text editor, with these keys implemented:
+
+PGDN - Move down one page
+PGUP - Move up one page
+DOWN - Move down one line
+UP - Move up one line
+DELETE - Delete the current character
+BACKSPC - Delete the previous character
+
+Unlike Xdialog, it does not do these:
+
+CTRL C - Copy text
+CTRL V - Paste text
+
+Because dialog normally uses TAB for moving between fields,
+this editbox uses CTRL/V as a literal-next character. You
+can enter TAB characters by first pressing CTRL/V. This
+example contains a few tab characters.
+
+It supports the mouse - but only for positioning in the editbox,
+or for clicking on buttons. Your terminal (emulator) may support
+cut/paste.
+
+Try to input some text below:
+
+EOF
+
+$DIALOG --title "EDIT BOX" \
+ --fixed-font --editbox $input 0 0 2>$output
+
+case $? in
+ 0)
+ diff -c $input $output
+ echo "OK"
+ ;;
+ 1)
+ echo "Button 1 (Cancel) pressed";;
+ 2)
+ echo "Button 2 (Help) pressed";;
+ 3)
+ echo "Button 3 (Extra) pressed";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox-utf8 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox-utf8
new file mode 100755
index 00000000000..6a005327f17
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox-utf8
@@ -0,0 +1,56 @@
+#!/bin/sh
+# $Id: editbox-utf8,v 1.1 2007/01/12 00:09:21 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+case none"$LANG$LC_ALL$LC_CTYPE" in
+*UTF-8*)
+ ;;
+*)
+ echo "This script must be run in a UTF-8 locale"
+ exit 1
+ ;;
+esac
+
+input=`tempfile 2>/dev/null` || input=/tmp/input$$
+output=`tempfile 2>/dev/null` || output=/tmp/test$$
+trap "rm -f $input $output" 0 1 2 5 15
+
+cat << EOF > $input
+Hi, this is a edit box. You can use this to
+allow the user to enter or modify free-form text.
+
+Try it now!
+
+ ----------- --------------------------------
+ Choose Description of the OS you like
+ ----------- --------------------------------
+ Linux The Great Unix Clone for 386/486
+ NetBSD Another free Unix Clone for 386/486
+ OS/2 IBM OS/2
+ WIN NT Microsoft Windows NT
+ PCDOS IBM PC DOS
+ MSDOS Microsoft DOS
+ ----------- --------------------------------
+ ----------- --------------------------------
+EOF
+
+$DIALOG --title "EDIT BOX" \
+ --fixed-font --editbox $input 0 0 2>$output
+
+case $? in
+ 0)
+ diff -c $input $output
+ echo "OK"
+ ;;
+ 1)
+ echo "Button 1 (Cancel) pressed";;
+ 2)
+ echo "Button 2 (Help) pressed";;
+ 3)
+ echo "Button 3 (Extra) pressed";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox2
new file mode 100755
index 00000000000..891f6d6eed1
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox2
@@ -0,0 +1,58 @@
+#!/bin/sh
+# $Id: editbox2,v 1.1 2007/01/12 00:26:37 tom Exp $
+# example with extra- and help-buttons
+: ${DIALOG=dialog}
+
+input=`tempfile 2>/dev/null` || input=/tmp/input$$
+output=`tempfile 2>/dev/null` || output=/tmp/test$$
+trap "rm -f $input $output" 0 1 2 5 15
+
+cat << EOF > $input
+Hi, this is an edit box. It can be used to edit text from a file.
+
+It's like a simple text editor, with these keys implemented:
+
+PGDN - Move down one page
+PGUP - Move up one page
+DOWN - Move down one line
+UP - Move up one line
+DELETE - Delete the current character
+BACKSPC - Delete the previous character
+
+Unlike Xdialog, it does not do these:
+
+CTRL C - Copy text
+CTRL V - Paste text
+
+Because dialog normally uses TAB for moving between fields,
+this editbox uses CTRL/V as a literal-next character. You
+can enter TAB characters by first pressing CTRL/V. This
+example contains a few tab characters.
+
+It supports the mouse - but only for positioning in the editbox,
+or for clicking on buttons. Your terminal (emulator) may support
+cut/paste.
+
+Try to input some text below:
+
+EOF
+
+$DIALOG --title "EDIT BOX" \
+ --extra-button \
+ --help-button \
+ --fixed-font --editbox $input 0 0 2>$output
+
+case $? in
+ 0)
+ diff -c $input $output
+ echo "OK"
+ ;;
+ 1)
+ echo "Button 1 (Cancel) pressed";;
+ 2)
+ echo "Button 2 (Help) pressed";;
+ 3)
+ echo "Button 3 (Extra) pressed";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox3
new file mode 100755
index 00000000000..5522430514f
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/editbox3
@@ -0,0 +1,31 @@
+#!/bin/sh
+# $Id: editbox3,v 1.1 2007/09/24 00:12:24 tom Exp $
+# example with extra- and help-buttons
+: ${DIALOG=dialog}
+
+input=`tempfile 2>/dev/null` || input=/tmp/input$$
+output=`tempfile 2>/dev/null` || output=/tmp/test$$
+trap "rm -f $input $output" 0 1 2 5 15
+
+cat << EOF > $input
+EOF
+
+$DIALOG --title "EDIT BOX" \
+ --extra-button \
+ --help-button \
+ --fixed-font --editbox $input 0 0 2>$output
+
+case $? in
+ 0)
+ diff -c $input $output
+ echo "OK"
+ ;;
+ 1)
+ echo "Button 1 (Cancel) pressed";;
+ 2)
+ echo "Button 2 (Help) pressed";;
+ 3)
+ echo "Button 3 (Extra) pressed";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1
new file mode 100755
index 00000000000..daa8a9d20ae
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1
@@ -0,0 +1,67 @@
+#! /bin/sh
+# $Id: form1,v 1.8 2005/12/05 23:27:23 tom Exp $
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --backtitle "$backtitle" \
+ --form "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 10 0 \
+ "UID:" 2 1 "$uid" 2 10 8 0 \
+ "GID:" 3 1 "$gid" 3 10 8 0 \
+ "HOME:" 4 1 "$home" 4 10 40 0 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ echo "Button 2 (Help) pressed."
+ exit
+ ;;
+ 3)
+ echo "Button 3 (Extra) pressed."
+ exit
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-both b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-both
new file mode 100755
index 00000000000..555d5ff5fbb
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-both
@@ -0,0 +1,68 @@
+#! /bin/sh
+# $Id: form1-both,v 1.1 2005/12/05 23:27:50 tom Exp $
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --extra-button --help-button \
+ --backtitle "$backtitle" \
+ --form "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 10 0 \
+ "UID:" 2 1 "$uid" 2 10 8 0 \
+ "GID:" 3 1 "$gid" 3 10 8 0 \
+ "HOME:" 4 1 "$home" 4 10 40 0 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ echo "Button 2 (Help) pressed."
+ exit
+ ;;
+ 3)
+ echo "Button 3 (Extra) pressed."
+ exit
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-extra b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-extra
new file mode 100755
index 00000000000..94315cbd90a
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-extra
@@ -0,0 +1,68 @@
+#! /bin/sh
+# $Id: form1-extra,v 1.1 2005/12/05 23:27:50 tom Exp $
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --extra-button \
+ --backtitle "$backtitle" \
+ --form "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 10 0 \
+ "UID:" 2 1 "$uid" 2 10 8 0 \
+ "GID:" 3 1 "$gid" 3 10 8 0 \
+ "HOME:" 4 1 "$home" 4 10 40 0 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ echo "Button 2 (Help) pressed."
+ exit
+ ;;
+ 3)
+ echo "Button 3 (Extra) pressed."
+ exit
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-help b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-help
new file mode 100755
index 00000000000..733c6de8c4c
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-help
@@ -0,0 +1,68 @@
+#! /bin/sh
+# $Id: form1-help,v 1.1 2005/12/05 23:27:50 tom Exp $
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --help-button \
+ --backtitle "$backtitle" \
+ --form "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 10 0 \
+ "UID:" 2 1 "$uid" 2 10 8 0 \
+ "GID:" 3 1 "$gid" 3 10 8 0 \
+ "HOME:" 4 1 "$home" 4 10 40 0 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ echo "Button 2 (Help) pressed."
+ exit
+ ;;
+ 3)
+ echo "Button 3 (Extra) pressed."
+ exit
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-utf8 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-utf8
new file mode 100755
index 00000000000..2ffe04251dd
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form1-utf8
@@ -0,0 +1,77 @@
+#! /bin/sh
+# $Id: form1-utf8,v 1.2 2008/08/20 00:32:49 tom Exp $
+: ${DIALOG=dialog}
+
+case none"$LANG$LC_ALL$LC_CTYPE" in
+*UTF-8*)
+ ;;
+*)
+ echo "This script must be run in a UTF-8 locale"
+ exit 1
+ ;;
+esac
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="DOG"
+home=/usr/home/$user
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --backtitle "$backtitle" \
+ --insecure \
+ --form "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 10 0 \
+ "UID:" 2 1 "$uid" 2 10 8 0 \
+ "GID:" 3 1 "$gid" 3 10 8 0 \
+ "HOME:" 4 1 "$home" 4 10 40 0 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ echo "Button 2 (Help) pressed."
+ exit
+ ;;
+ 3)
+ echo "Button 3 (Extra) pressed."
+ exit
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/form2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form2
new file mode 100755
index 00000000000..48d8e287121
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form2
@@ -0,0 +1,83 @@
+#! /bin/sh
+# $Id: form2,v 1.5 2004/09/12 22:37:31 tom Exp $
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --backtitle "$backtitle" \
+ --form "Here is a possible piece of a configuration program." \
+0 0 10 \
+ "1 Username:" 1 1 "$user" 1 12 10 10 \
+ "1 UID:" 2 1 "$uid" 2 12 10 10 \
+ "1 GID:" 3 1 "$gid" 3 12 10 10 \
+ "1 HOME:" 4 1 "$home" 4 12 10 10 \
+ "2 Username:" 5 1 "$user" 5 12 10 10 \
+ "2 UID:" 6 1 "$uid" 6 12 10 10 \
+ "2 GID:" 7 1 "$gid" 7 12 10 10 \
+ "2 HOME:" 8 1 "$home" 8 12 10 10 \
+ "3 Username:" 9 1 "$user" 9 12 10 10 \
+ "3 UID:" 10 1 "$uid" 10 12 10 10 \
+ "3 GID:" 11 1 "$gid" 11 12 10 10 \
+ "3 HOME:" 12 1 "$home" 12 12 10 10 \
+ "4 Username:" 13 1 "$user" 13 12 10 10 \
+ "4 UID:" 14 1 "$uid" 14 12 10 10 \
+ "4 GID:" 15 1 "$gid" 15 12 10 10 \
+ "4 HOME:" 16 1 "$home" 16 12 10 10 \
+ "5 Username:" 17 1 "$user" 17 12 10 10 \
+ "5 UID:" 18 1 "$uid" 18 12 10 10 \
+ "5 GID:" 19 1 "$gid" 19 12 10 10 \
+ "5 HOME:" 20 1 "$home" 20 12 10 10 \
+ "6 Username:" 21 1 "$user" 21 12 10 10 \
+ "6 UID:" 22 1 "$uid" 22 12 10 10 \
+ "6 GID:" 23 1 "$gid" 23 12 10 10 \
+ "6 HOME:" 24 1 "$home" 24 12 10 10 \
+ "7 Username:" 25 1 "$user" 25 12 10 10 \
+ "7 UID:" 26 1 "$uid" 26 12 10 10 \
+ "7 GID:" 27 1 "$gid" 27 12 10 10 \
+ "7 HOME:" 28 1 "$home" 28 12 10 10 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 0 0
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/form3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form3
new file mode 100755
index 00000000000..8992dead946
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form3
@@ -0,0 +1,68 @@
+#! /bin/sh
+# $Id: form3,v 1.2 2004/09/12 22:37:40 tom Exp $
+# form1 with --help-button
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --help-button \
+ --backtitle "$backtitle" \
+ --form "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 10 0 \
+ "UID:" 2 1 "$uid" 2 10 8 0 \
+ "GID:" 3 1 "$gid" 3 10 8 0 \
+ "HOME:" 4 1 "$home" 4 10 40 0 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Help data:\n\
+$show" 10 40
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/form4 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form4
new file mode 100755
index 00000000000..40b1f40b421
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form4
@@ -0,0 +1,69 @@
+#! /bin/sh
+# $Id: form4,v 1.2 2004/09/12 22:37:50 tom Exp $
+# form3 with --item-help
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --help-button \
+ --item-help \
+ --backtitle "$backtitle" \
+ --form "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 10 0 "Login name" \
+ "UID:" 2 1 "$uid" 2 10 8 0 "User ID" \
+ "GID:" 3 1 "$gid" 3 10 8 0 "Group ID" \
+ "HOME:" 4 1 "$home" 4 10 40 0 "User's home-directory" \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Help data:\n\
+$show" 10 40
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/form5 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form5
new file mode 100755
index 00000000000..c8716214cc9
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form5
@@ -0,0 +1,70 @@
+#! /bin/sh
+# $Id: form5,v 1.2 2004/09/12 22:37:57 tom Exp $
+# form4 with --help-status
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --help-status \
+ --help-button \
+ --item-help \
+ --backtitle "$backtitle" \
+ --form "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 10 0 "Login name" \
+ "UID:" 2 1 "$uid" 2 10 8 0 "User ID" \
+ "GID:" 3 1 "$gid" 3 10 8 0 "Group ID" \
+ "HOME:" 4 1 "$home" 4 10 40 0 "User's home-directory" \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Help data:\n\
+$show" 10 40
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/form6 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form6
new file mode 100755
index 00000000000..f68dece5769
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/form6
@@ -0,0 +1,70 @@
+#! /bin/sh
+# $Id: form6,v 1.1 2005/02/07 00:14:52 tom Exp $
+# form4 with --help-status
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --help-status \
+ --help-button \
+ --item-help \
+ --backtitle "$backtitle" \
+ --form "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 -9 9 "Login name" \
+ "UID:" 2 1 "$uid" 2 10 8 0 "User ID" \
+ "GID:" 3 1 "$gid" 3 10 8 0 "Group ID" \
+ "HOME:" 4 1 "$home" 4 10 40 0 "User's home-directory" \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Help data:\n\
+$show" 10 40
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect
new file mode 100755
index 00000000000..5aea3ec53d8
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect
@@ -0,0 +1,21 @@
+#!/bin/sh
+# $Id: fselect,v 1.6 2005/12/07 01:55:53 tom Exp $
+: ${DIALOG=dialog}
+
+exec 3>&1
+FILE=`$DIALOG --title "Please choose a file" --fselect $HOME/ 14 48 2>&1 1>&3`
+code=$?
+exec 3>&-
+
+case $code in
+ 0)
+ echo "\"$FILE\" chosen";;
+ 1)
+ echo "Button 1 (Cancel) pressed";;
+ 2)
+ echo "Button 2 (Help) pressed";;
+ 3)
+ echo "Button 3 (Extra) pressed";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect-stdout b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect-stdout
new file mode 100755
index 00000000000..a4fe2449210
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect-stdout
@@ -0,0 +1,14 @@
+#!/bin/sh
+# $Id: fselect-stdout,v 1.1 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+FILE=`$DIALOG --stdout --title "Please choose a file" --fselect $HOME/ 14 48`
+
+case $? in
+ 0)
+ echo "\"$FILE\" chosen";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect1
new file mode 100755
index 00000000000..50ced70ba0d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect1
@@ -0,0 +1,26 @@
+#!/bin/sh
+# $Id: fselect1,v 1.4 2003/10/09 22:45:06 tom Exp $
+: ${DIALOG=dialog}
+
+FILE=$HOME
+for n in .cshrc .profile .bashrc
+do
+ if test -f $HOME/$n ; then
+ FILE=$HOME/$n
+ break
+ fi
+done
+
+exec 3>&1
+FILE=`$DIALOG --title "Please choose a file" --fselect $FILE 14 48 2>&1 1>&3`
+code=$?
+exec 3>&-
+
+case $code in
+ 0)
+ echo "\"$FILE\" chosen";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect1-stdout b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect1-stdout
new file mode 100755
index 00000000000..c8e3018d5dc
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect1-stdout
@@ -0,0 +1,23 @@
+#!/bin/sh
+# $Id: fselect1-stdout,v 1.1 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+FILE=$HOME
+for n in .cshrc .profile .bashrc
+do
+ if test -f $HOME/$n ; then
+ FILE=$HOME/$n
+ break
+ fi
+done
+
+FILE=`$DIALOG --stdout --title "Please choose a file" --fselect $FILE 14 48`
+
+case $? in
+ 0)
+ echo "\"$FILE\" chosen";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect2
new file mode 100755
index 00000000000..066eaf5e260
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect2
@@ -0,0 +1,17 @@
+#!/bin/sh
+# $Id: fselect2,v 1.3 2003/10/09 22:45:06 tom Exp $
+: ${DIALOG=dialog}
+
+exec 3>&1
+FILE=`$DIALOG --title "Please choose a file" --fselect $HOME/ 0 0 2>&1 1>&3`
+code=$?
+exec 3>&-
+
+case $code in
+ 0)
+ echo "\"$FILE\" chosen";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect2-stdout b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect2-stdout
new file mode 100755
index 00000000000..3673519d113
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/fselect2-stdout
@@ -0,0 +1,14 @@
+#!/bin/sh
+# $Id: fselect2-stdout,v 1.1 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+FILE=`$DIALOG --stdout --title "Please choose a file" --fselect $HOME/ 0 0`
+
+case $? in
+ 0)
+ echo "\"$FILE\" chosen";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge b/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge
new file mode 100755
index 00000000000..8261678103a
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge
@@ -0,0 +1,21 @@
+#!/bin/sh
+# $Id: gauge,v 1.4 2008/07/22 23:47:46 tom Exp $
+: ${DIALOG=dialog}
+
+PCT=10
+(
+while test $PCT != 100
+do
+cat <<EOF
+XXX
+$PCT
+The new\n\
+message ($PCT percent)
+XXX
+EOF
+PCT=`expr $PCT + 10`
+sleep 1
+done
+) |
+
+$DIALOG --title "GAUGE" --gauge "Hi, this is a gauge widget" 20 70 0
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge0 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge0
new file mode 100755
index 00000000000..c540fac5ba8
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge0
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $Id: gauge0,v 1.4 2008/07/22 23:48:30 tom Exp $
+: ${DIALOG=dialog}
+
+PCT=10
+(
+sleep 1
+while test $PCT != 110
+do
+cat <<EOF
+XXX
+$PCT
+The new\n\
+message ($PCT percent)
+XXX
+EOF
+PCT=`expr $PCT + 10`
+sleep 1
+done
+) |
+
+$DIALOG --title "GAUGE" --gauge "Hi, this is a gauge widget" 0 0 0
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge0-input-fd b/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge0-input-fd
new file mode 100755
index 00000000000..dde176fdc04
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge0-input-fd
@@ -0,0 +1,26 @@
+#!/bin/sh
+# $Id: gauge0-input-fd,v 1.2 2008/07/22 23:49:26 tom Exp $
+# modified "gauge0" script to use "--input-fd" option.
+: ${DIALOG=dialog}
+
+exec 3<&0
+PCT=10
+(
+sleep 1
+while test $PCT != 110
+do
+cat <<EOF
+XXX
+$PCT
+The new\n\
+message ($PCT percent)
+XXX
+EOF
+PCT=`expr $PCT + 10`
+sleep 1
+done
+) |
+
+$DIALOG --title "GAUGE" --input-fd 3 --gauge "Hi, this is a gauge widget" 0 0 0
+
+exec 3<&-
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge2
new file mode 100755
index 00000000000..a7ab51c766c
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge2
@@ -0,0 +1,27 @@
+#!/bin/sh
+# $Id: gauge2,v 1.4 2008/07/22 23:46:04 tom Exp $
+# The original dialog program assumed the first line after the first "XXX"
+# was a percentage value (compare with "gauge" script).
+: ${DIALOG=dialog}
+
+(echo "10" ; sleep 2 ;
+
+cat <<"EOF"
+XXX
+The new
+\n
+message
+XXX
+20
+EOF
+sleep 2;
+
+echo "75" ; sleep 1
+echo "100") | \
+
+$DIALOG --title "GAUGE" --gauge "Hi, this is a gauge widget" 10 40 0
+
+if [ "$?" = 255 ] ; then
+ echo ""
+ echo "Box closed !"
+fi
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge3
new file mode 100755
index 00000000000..93b0041fcef
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/gauge3
@@ -0,0 +1,21 @@
+#!/bin/sh
+# $Id: gauge3,v 1.3 2008/07/22 23:48:56 tom Exp $
+: ${DIALOG=dialog}
+
+(
+sleep 1
+for n in 0 1 2 3 4 5 4 3 2 1 0
+do
+PCT=`expr $n \* $n \* 4`
+cat <<EOF
+XXX
+$PCT
+The new\n\
+message ($PCT percent)
+XXX
+EOF
+sleep 1
+done
+) |
+
+$DIALOG --title "GAUGE" --gauge "Hi, this is a gauge widget" 10 70 0
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox
new file mode 100755
index 00000000000..bf6993fe89d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox
@@ -0,0 +1,20 @@
+#! /bin/sh
+# $Id: infobox,v 1.5 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+left=10
+unit="seconds"
+while test $left != 0
+do
+
+$DIALOG --sleep 1 \
+ --title "INFO BOX" \
+ --infobox "Hi, this is an information box. It is
+different from a message box: it will
+not pause waiting for input after displaying
+the message. The pause here is only introduced
+by the sleep command within dialog.
+You have $left $unit to read this..." 10 52
+left=`expr $left - 1`
+test $left = 1 && unit="second"
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox1
new file mode 100755
index 00000000000..61e4cb8edf9
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox1
@@ -0,0 +1,20 @@
+#! /bin/sh
+# $Id: infobox1,v 1.1 2004/09/19 20:26:42 tom Exp $
+: ${DIALOG=dialog}
+
+left=10
+unit="seconds"
+while test $left != 0
+do
+
+sleep 1
+$DIALOG --title "INFO BOX" \
+ --infobox "Hi, this is an information box. It is
+different from a message box: it will
+not pause waiting for input after displaying
+the message. The pause here is only introduced
+by a sleep command in the shell script.
+You have $left $unit to read this..." 10 52
+left=`expr $left - 1`
+test $left = 1 && unit="second"
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox2
new file mode 100755
index 00000000000..cfc3b05ca8e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox2
@@ -0,0 +1,20 @@
+#! /bin/sh
+# $Id: infobox2,v 1.2 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+left=10
+unit="seconds"
+while test $left != 0
+do
+
+$DIALOG --sleep 1 \
+ --title "INFO BOX" \
+ --infobox "Hi, this is an information box. It is
+different from a message box: it will
+not pause waiting for input after displaying
+the message. The pause here is only introduced
+by the sleep command within dialog.
+You have $left $unit to read this..." 0 0
+left=`expr $left - 1`
+test $left = 1 && unit="second"
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox3
new file mode 100755
index 00000000000..145b6403dbc
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox3
@@ -0,0 +1,21 @@
+#! /bin/sh
+# $Id: infobox3,v 1.2 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+left=10
+unit="seconds"
+while test $left != 0
+do
+
+$DIALOG --sleep 1 \
+ --begin 5 0 \
+ --title "INFO BOX" \
+ --infobox "Hi, this is an information box. It is
+different from a message box: it will
+not pause waiting for input after displaying
+the message. The pause here is only introduced
+by the sleep command within dialog.
+You have $left $unit to read this..." 0 0
+left=`expr $left - 1`
+test $left = 1 && unit="second"
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox4 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox4
new file mode 100755
index 00000000000..e364070bc3a
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox4
@@ -0,0 +1,21 @@
+#! /bin/sh
+# $Id: infobox4,v 1.2 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+left=10
+unit="seconds"
+while test $left != 0
+do
+
+$DIALOG --sleep 1 \
+ --begin 0 5 \
+ --title "INFO BOX" \
+ --infobox "Hi, this is an information box. It is
+different from a message box: it will
+not pause waiting for input after displaying
+the message. The pause here is only introduced
+by the sleep command within dialog.
+You have $left $unit to read this..." 0 0
+left=`expr $left - 1`
+test $left = 1 && unit="second"
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox5 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox5
new file mode 100755
index 00000000000..ffdff6aba05
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox5
@@ -0,0 +1,38 @@
+#! /bin/sh
+# $Id: infobox5,v 1.2 2003/08/15 19:40:37 tom Exp $
+# get rid of all flickering by constructing a script unroll the loop, leaving
+# us in curses-mode until we're done counting.
+: ${DIALOG=dialog}
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+left=10
+unit="seconds"
+last='\'
+
+cat >>$tempfile <<EOF
+$DIALOG $last
+EOF
+
+while test $left != 0
+do
+
+cat >>$tempfile <<EOF
+ --sleep 1 \
+ --begin 0 5 \
+ --title "INFO BOX" \
+ --infobox "Hi, this is an information box. It is
+different from a message box: it will
+not pause waiting for input after displaying
+the message. The pause here is only introduced
+by the sleep command within dialog.
+You have $left $unit to read this..." 0 0 $last
+EOF
+
+left=`expr $left - 1`
+test $left = 1 && unit="second"
+done
+
+echo >>$tempfile
+
+. $tempfile
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox6 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox6
new file mode 100755
index 00000000000..e1d6f53ea75
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/infobox6
@@ -0,0 +1,40 @@
+#! /bin/sh
+# $Id: infobox6,v 1.2 2003/08/15 19:40:37 tom Exp $
+# get rid of all flickering by constructing a script unroll the loop, leaving
+# us in curses-mode until we're done counting.
+#
+# a little fancier than infobox5, this moves the widget at each step.
+: ${DIALOG=dialog}
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+left=10
+unit="seconds"
+last='\'
+
+cat >>$tempfile <<EOF
+$DIALOG $last
+EOF
+
+while test $left != 0
+do
+
+cat >>$tempfile <<EOF
+ --sleep 1 \
+ --begin $left `expr $left + 5` \
+ --title "INFO BOX" $last
+ --infobox "Hi, this is an information box. It is
+different from a message box: it will
+not pause waiting for input after displaying
+the message. The pause here is only introduced
+by the sleep command within dialog.
+You have $left $unit to read this..." 0 0 $last
+EOF
+
+left=`expr $left - 1`
+test $left = 1 && unit="second"
+done
+
+echo >>$tempfile
+
+. $tempfile
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox
new file mode 100755
index 00000000000..b74125e84db
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox
@@ -0,0 +1,32 @@
+#!/bin/sh
+# $Id: inputbox,v 1.6 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --title "INPUT BOX" --clear \
+ --inputbox "Hi, this is an input dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:" 16 51 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-both b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-both
new file mode 100755
index 00000000000..c5294e7bcc7
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-both
@@ -0,0 +1,38 @@
+#!/bin/sh
+# $Id: inputbox-both,v 1.1 2005/12/05 23:13:59 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --title "INPUT BOX" --clear \
+ --extra-button \
+ --help-button \
+ --inputbox "Hi, this is an input dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:" 16 51 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Button 1 (Cancel) pressed.";;
+ 2)
+ echo "Button 2 (Help) pressed.";;
+ 3)
+ echo "Button 3 (Extra) pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-extra b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-extra
new file mode 100755
index 00000000000..72b796a80c4
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-extra
@@ -0,0 +1,37 @@
+#!/bin/sh
+# $Id: inputbox-extra,v 1.1 2005/12/05 23:16:24 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --title "INPUT BOX" --clear \
+ --extra-button \
+ --inputbox "Hi, this is an input dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:" 16 51 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Button 1 (Cancel) pressed.";;
+ 2)
+ echo "Button 2 (Help) pressed.";;
+ 3)
+ echo "Button 3 (Extra) pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-help b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-help
new file mode 100755
index 00000000000..a0fe032a99b
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox-help
@@ -0,0 +1,37 @@
+#!/bin/sh
+# $Id: inputbox-help,v 1.1 2005/12/05 23:15:16 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --title "INPUT BOX" --clear \
+ --help-button \
+ --inputbox "Hi, this is an input dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:" 16 51 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Button 1 (Cancel) pressed.";;
+ 2)
+ echo "Button 2 (Help) pressed.";;
+ 3)
+ echo "Button 3 (Extra) pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox1
new file mode 100755
index 00000000000..22c43ef44f9
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox1
@@ -0,0 +1,34 @@
+#!/bin/sh
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --cr-wrap \
+ --title "INPUT BOX" --clear \
+ --inputbox \
+"Hi, this is an input dialog box. You can use
+this to ask questions that require the user
+to input a string as the answer. You can
+input strings of length longer than the
+width of the input box, in that case, the
+input field will be automatically scrolled.
+You can use BACKSPACE to correct errors.
+
+Try entering your name below:" 0 0 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox2
new file mode 100755
index 00000000000..41be14e6e41
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox2
@@ -0,0 +1,32 @@
+#!/bin/sh
+# $Id: inputbox2,v 1.4 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --title "INPUT BOX" --clear \
+ --inputbox "Hi, this is an input dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:" 16 51 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox3
new file mode 100755
index 00000000000..4b37af6faa1
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox3
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $Id: inputbox3,v 1.2 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --nocancel \
+ --title "INPUT BOX" --clear \
+ --inputbox "Hi, this is an input dialog box. You can use \n\
+this to ask questions that require the user \n\
+to input a string as the answer. You can \n\
+input strings of length longer than the \n\
+width of the input box, in that case, the \n\
+input field will be automatically scrolled. \n\
+You can use BACKSPACE to correct errors. \n\n\
+Try entering your name below:" 16 51 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox4 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox4
new file mode 100755
index 00000000000..d0a5231d7d2
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox4
@@ -0,0 +1,31 @@
+#!/bin/sh
+# $Id: inputbox4,v 1.3 2004/09/12 22:38:08 tom Exp $
+# An example which does not use temporary files, as suggested by Cary Evans:
+: ${DIALOG=dialog}
+
+exec 3>&1
+RESULT=`$DIALOG --title "INPUT BOX" --clear \
+ --inputbox "Hi, this is an input dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:" 16 51 2>&1 1>&3`
+retval=$?
+exec 3>&-
+
+case $retval in
+ 0)
+ echo "Input string is $RESULT";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -n "$RESULT" ; then
+ echo "$RESULT"
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox5 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox5
new file mode 100755
index 00000000000..41ab24088b1
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox5
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $Id: inputbox5,v 1.2 2003/08/15 19:40:37 tom Exp $
+# use --output-fd to write to a different output than stderr
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --title "INPUT BOX" --clear --output-fd 4 \
+ --inputbox "Hi, this is an input dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:" 16 51 4> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-8bit b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-8bit
new file mode 100755
index 00000000000..901f799feae
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-8bit
@@ -0,0 +1,29 @@
+#!/bin/sh
+# $Id: inputbox6-8bit,v 1.1 2004/12/19 16:19:34 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+. ./testdata-8bit
+
+$DIALOG \
+--title `printf "$SAMPLE"` \
+--inputbox `printf "$SAMPLE"` \
+10 40 `printf "$SAMPLE"` 2>$tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is \"`cat $tempfile`\"";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-utf8 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-utf8
new file mode 100755
index 00000000000..2a8d6c33e81
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox6-utf8
@@ -0,0 +1,36 @@
+#!/bin/sh
+# $Id: inputbox6-utf8,v 1.2 2008/03/16 13:58:54 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+case none"$LANG$LC_ALL$LC_CTYPE" in
+*UTF-8*)
+ ;;
+*)
+ echo "This script must be run in a UTF-8 locale"
+ exit 1
+ ;;
+esac
+
+$DIALOG \
+--title `printf "\xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a"` \
+--inputbox `printf "\xe3\x81\x82\xe3\x81\x84\xe3\x81\x86\xe3\x81\x88\xe3\x81\x8a"` \
+10 20 "D.O.G" 2>$tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is \"`cat $tempfile`\"";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox7 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox7
new file mode 100755
index 00000000000..220cfce344d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputbox7
@@ -0,0 +1,40 @@
+#!/bin/sh
+# $Id: inputbox7,v 1.3 2004/09/12 22:38:38 tom Exp $
+# An example which produces two widget outputs.
+: ${DIALOG=dialog}
+
+MSG='Hi, this is an input dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:'
+
+# separate with a line-break (newline)
+SEP='
+'
+
+exec 3>&1
+RESULT=`$DIALOG --title "INPUT BOX" --clear --separate-widget "$SEP" \
+ --inputbox "$MSG" 16 51 \
+ --title "ANOTHER INPUT BOX" \
+ --inputbox "$MSG" 16 51 \
+2>&1 1>&3`
+retval=$?
+exec 3>&-
+
+case $retval in
+ 0)
+ echo "Input string is $RESULT";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -n "$RESULT" ; then
+ echo "$RESULT"
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu
new file mode 100755
index 00000000000..8dc9a88e1b2
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu
@@ -0,0 +1,59 @@
+#! /bin/bash
+# $Id: inputmenu,v 1.6 2004/09/19 17:59:14 tom Exp $
+# 2002 - written by Tobias Rittweiler <tobrit@freebits.de>
+: ${DIALOG=dialog}
+
+user="$USER" ; uid="$UID" ;
+gid="$GROUPS" ; home="$HOME" ;
+
+while [ ${returncode:-99} -ne 1 -a ${returncode:-99} -ne 250 ]; do
+ exec 3>&1
+ value=$("$DIALOG" --clear --ok-label "Create" \
+ --backtitle "An Example for the use of --inputmenu:" \
+ --inputmenu "Originally I designed --inputmenu for a \
+configuration purpose. Here is a possible piece of a configuration program. \
+" 20 50 10 \
+"Username:" "$user" \
+"UID:" "$uid" \
+"GID:" "$gid" \
+"HOME:" "$home" \
+2>&1 1>&3 )
+ returncode=$?
+ exec 3>&-
+ case $returncode in
+ 1)
+ "$DIALOG" --clear --backtitle "An Example for the use of --inputmenu:" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0) break;;
+ 1) returncode=99;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" --clear --backtitle "An Example for the use of --inputmenu:" \
+ --msgbox "useradd \n\
+ -d $home \n\
+ -u $uid \n\
+ -g $gid \n\
+ $user" 10 40
+ ;;
+ 3)
+ value="${value:8:${#value}}"
+ tag="${value%:*}"
+ item="${value#*: }"
+
+ case "$tag" in
+ Username) user="$item";;
+ UID) uid="$item";;
+ GID) gid="$item";;
+ HOME) home="$item";;
+ esac
+ ;;
+
+ 255)
+ echo "ESC pressed."
+ break
+ ;;
+
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu-stdout b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu-stdout
new file mode 100755
index 00000000000..2d5993deaa5
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu-stdout
@@ -0,0 +1,52 @@
+#! /bin/bash
+# $Id: inputmenu-stdout,v 1.4 2005/02/06 22:51:23 tom Exp $
+# 2002 - written by Tobias Rittweiler <tobrit@freebits.de>
+: ${DIALOG=dialog}
+
+user="$USER" ; uid="$UID" ;
+gid="$GROUPS" ; home="$HOME" ;
+
+while [ ${returncode:-99} -ne 1 -a ${returncode:-99} -ne 250 ]; do
+ value="$("$DIALOG" --stdout --clear --ok-label "Create" \
+ --backtitle "An Example for the use of --inputmenu:" \
+ --inputmenu "Originally I designed --inputmenu for a \
+configuration purpose. Here is a possible piece of a configuration program.
+" 20 50 10 "Username:" "$user" "UID:" "$uid" "GID:" "$gid" "HOME:" "$home")"
+ returncode=$?
+ case $returncode in
+ 1)
+ "$DIALOG" --clear --backtitle "An Example for the use of --inputmenu:" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0) break;;
+ 1) returncode=99;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" --clear --backtitle "An Example for the use of --inputmenu:" \
+ --msgbox "useradd \n\
+ -d $home \n\
+ -u $uid \n\
+ -g $gid \n\
+ $user" 10 40
+ ;;
+ 3)
+ value="${value:8:${#value}}"
+ tag="${value%:*}"
+ item="${value#*: }"
+
+ case "$tag" in
+ Username) user="$item";;
+ UID) uid="$item";;
+ GID) gid="$item";;
+ HOME) home="$item";;
+ esac
+ ;;
+
+ 255)
+ echo "ESC pressed."
+ break
+ ;;
+
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu1
new file mode 100755
index 00000000000..48f9a820cc6
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu1
@@ -0,0 +1,84 @@
+#! /bin/sh
+# $Id: inputmenu1,v 1.4 2004/09/19 17:59:14 tom Exp $
+#
+# "inputmenu" rewritten into Bourne shell.
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --inputmenu:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --clear --ok-label "Create" \
+ --backtitle "$backtitle" \
+ --inputmenu "Originally I designed --inputmenu for a \
+configuration purpose. Here is a possible piece of a configuration program." \
+20 50 10 \
+ "Username:" "$user" \
+ "UID:" "$uid" \
+ "GID:" "$gid" \
+ "HOME:" "$home" \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --msgbox "useradd \n\
+ -d $home \n\
+ -u $uid \n\
+ -g $gid \n\
+ $user" 10 40
+ ;;
+ 3)
+ tag=`echo "$value" |sed -e 's/^RENAMED //' -e 's/:.*//'`
+ item=`echo "$value" |sed -e 's/^.*:[ ]*//' -e 's/[ ]*$//'`
+
+ case "$tag" in
+ Username)
+ user="$item"
+ ;;
+ UID)
+ uid="$item"
+ ;;
+ GID)
+ gid="$item"
+ ;;
+ HOME)
+ home="$item"
+ ;;
+ esac
+ ;;
+
+ 255)
+ echo "ESC pressed."
+ break
+ ;;
+
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu2
new file mode 100755
index 00000000000..7a37dce42c7
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu2
@@ -0,0 +1,96 @@
+#! /bin/sh
+# $Id: inputmenu2,v 1.4 2004/09/19 17:59:14 tom Exp $
+#
+# "inputmenu1" with defaultitem, help-button.
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --inputmenu:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+defaultitem="Username:"
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --clear --ok-label "Create" \
+ --backtitle "$backtitle" \
+ --help-button \
+ --help-label "Script" \
+ --default-item "$defaultitem" \
+ --inputmenu "Originally I designed --inputmenu for a \
+configuration purpose. Here is a possible piece of a configuration program." \
+20 60 10 \
+ "Username:" "$user" \
+ "UID:" "$uid" \
+ "GID:" "$gid" \
+ "HOME:" "$home" \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+ case $returncode in
+ 2)
+ "$DIALOG" \
+ --textbox "$0" 0 0
+ ;;
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --msgbox "useradd \n\
+ -d $home \n\
+ -u $uid \n\
+ -g $gid \n\
+ $user" 10 40
+ ;;
+ 3)
+ tag=`echo "$value" |sed -e 's/^RENAMED //' -e 's/:.*/:/'`
+ item=`echo "$value" |sed -e 's/^.*:[ ]*//' -e 's/[ ]*$//'`
+
+ case "$tag" in
+ Username:)
+ user="$item"
+ ;;
+ UID:)
+ uid="$item"
+ ;;
+ GID:)
+ gid="$item"
+ ;;
+ HOME:)
+ home="$item"
+ ;;
+ *)
+ tag=
+ ;;
+ esac
+ test -n "$tag" && defaultitem="$tag"
+ ;;
+
+ 255)
+ echo "ESC pressed."
+ break
+ ;;
+
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu3
new file mode 100755
index 00000000000..dd6d25ceec4
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu3
@@ -0,0 +1,105 @@
+#! /bin/sh
+# $Id: inputmenu3,v 1.6 2004/12/19 23:18:53 tom Exp $
+#
+# "inputmenu1" with defaultitem, help-button and item-help.
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --inputmenu:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+defaultitem="Username:"
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --clear --ok-label "Create" \
+ --backtitle "$backtitle" \
+ --help-button \
+ --help-label "Script" \
+ --default-item "$defaultitem" \
+ --item-help \
+ --inputmenu "Originally I designed --inputmenu for a \
+configuration purpose. Here is a possible piece of a configuration program." \
+20 60 10 \
+ "Username:" "$user" "User login-name" \
+ "UID:" "$uid" "User-ID (number)" \
+ "GID:" "$gid" "Group-ID (number)" \
+ "HOME:" "$home" "User's home-directory" \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ case $value in
+ HELP*)
+ "$DIALOG" \
+ --textbox "$0" 0 0
+ ;;
+ *)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --msgbox "useradd \n\
+ -d $home \n\
+ -u $uid \n\
+ -g $gid \n\
+ $user" 10 40
+ ;;
+ esac
+ ;;
+ 2)
+ "$DIALOG" \
+ --textbox "$0" 0 0
+ ;;
+ 3)
+ tag=`echo "$value" |sed -e 's/^RENAMED //' -e 's/:.*/:/'`
+ item=`echo "$value" |sed -e 's/^.*:[ ]*//' -e 's/[ ]*$//'`
+
+ case "$tag" in
+ Username:)
+ user="$item"
+ ;;
+ UID:)
+ uid="$item"
+ ;;
+ GID:)
+ gid="$item"
+ ;;
+ HOME:)
+ home="$item"
+ ;;
+ *)
+ tag=
+ ;;
+ esac
+ test -n "$tag" && defaultitem="$tag"
+ ;;
+
+ 255)
+ echo "ESC pressed."
+ break
+ ;;
+
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu4 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu4
new file mode 100755
index 00000000000..f2a12eb1fcd
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/inputmenu4
@@ -0,0 +1,85 @@
+#! /bin/sh
+# $Id: inputmenu4,v 1.4 2004/09/19 17:59:14 tom Exp $
+#
+# "inputmenu1" with a different label for the extra-button
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --inputmenu:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --clear --ok-label "Create" \
+ --extra-label "Edit" \
+ --backtitle "$backtitle" \
+ --inputmenu "Originally I designed --inputmenu for a \
+configuration purpose. Here is a possible piece of a configuration program." \
+20 50 10 \
+ "Username:" "$user" \
+ "UID:" "$uid" \
+ "GID:" "$gid" \
+ "HOME:" "$home" \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --msgbox "useradd \n\
+ -d $home \n\
+ -u $uid \n\
+ -g $gid \n\
+ $user" 10 40
+ ;;
+ 3)
+ tag=`echo "$value" |sed -e 's/^RENAMED //' -e 's/:.*//'`
+ item=`echo "$value" |sed -e 's/^.*:[ ]*//' -e 's/[ ]*$//'`
+
+ case "$tag" in
+ Username)
+ user="$item"
+ ;;
+ UID)
+ uid="$item"
+ ;;
+ GID)
+ gid="$item"
+ ;;
+ HOME)
+ home="$item"
+ ;;
+ esac
+ ;;
+
+ 255)
+ echo "ESC pressed."
+ break
+ ;;
+
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/FDISK.TEST b/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/FDISK.TEST
new file mode 100644
index 00000000000..2ad568a62d7
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/FDISK.TEST
@@ -0,0 +1,28 @@
+
+Disk /dev/hda: 14 heads, 62 sectors, 1018 cylinders
+Units = cylinders of 868 * 512 bytes
+
+ Device Boot Begin Start End Blocks Id System
+/dev/hda1 1 1 3 1271 a OS/2 Boot Manager
+/dev/hda2 4 4 287 123256 6 DOS 16-bit >=32M
+/dev/hda3 * 288 288 649 157108 83 Linux native
+/dev/hda4 650 650 1018 160146 83 Linux native
+
+Disk /dev/sda: 64 heads, 32 sectors, 511 cylinders
+Units = cylinders of 2048 * 512 bytes
+
+ Device Boot Begin Start End Blocks Id System
+/dev/sda1 1 1 21 21488 82 Linux swap
+/dev/sda2 22 22 511 501760 83 Linux native
+
+Disk /dev/sdb: 64 heads, 32 sectors, 4106 cylinders
+Units = cylinders of 2048 * 512 bytes
+
+ Device Boot Begin Start End Blocks Id System
+/dev/sdb1 1 1 201 205808 83 Linux native
+/dev/sdb2 202 202 402 205824 83 Linux native
+/dev/sdb3 403 403 603 205824 83 Linux native
+/dev/sdb4 604 604 4106 3587072 5 Extended
+/dev/sdb5 604 604 1803 1228784 83 Linux native
+/dev/sdb6 1024 1804 3003 1228784 83 Linux native
+/dev/sdb7 2048 3004 4106 1129456 83 Linux native
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/makefile.in b/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/makefile.in
new file mode 100644
index 00000000000..3dcdc09ba2c
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/makefile.in
@@ -0,0 +1,35 @@
+# $Id: makefile.in,v 1.1 2000/10/08 17:22:53 tom Exp $
+# template makefile for DIALOG sample 'install'
+#
+SHELL = /bin/sh
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+srcdir = @srcdir@
+top_builddir = ../..
+
+DESTDIR =
+bindir = $(DESTDIR)@bindir@
+
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@ @DEFS@ -I$(top_builddir) -I$(srcdir)/../.. -I. -I$(srcdir)
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
+CC = @CC@
+LDFLAGS = @LDFLAGS@
+LIBS = -L../.. -ldialog @LIBS@
+RANLIB = @RANLIB@
+
+RM = rm -f
+
+all: setup
+
+setup: setup.o
+ $(CC) -o $@ setup.o $(LIBS)
+
+clean:
+ rm -f *.o setup
+
+test: setup
+ ./setup
+
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/setup.c b/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/setup.c
new file mode 100644
index 00000000000..ae569813e86
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/setup.c
@@ -0,0 +1,371 @@
+/* Copyright (C) 1995 Florian La Roche */
+/* Who wants to help coding? I don't like doing this... */
+
+/* You can just start setup as normal user and see how far it is coded
+ right now. This will do a fake installation and won't actually chnage
+ any data on your computer. */
+
+/* TODO: write a good package selection code
+ change functions to return better error code
+ */
+
+/* Show an extra text-box with the contents of all external commands,
+ before they are executed. So you can abort the installation, if any
+ wrong commands are to be executed. (So don't format wrong partition.) */
+#define VERBOSE 1
+
+/* If defined, don't actually execute any comands and don't actually modify
+ any files. So you can test any possible installation without doing any
+ damage to your computer.
+ The file FDISK.TEST is used instead of real "fdisk -l" output, so that
+ it can be started as normal user. */
+#define DEBUG_THIS 1
+
+#include <dialog.h>
+
+/* max length of a partition name like e.g. '/dev/hda1' */
+#define MAX_DEV_NAME 25
+
+/* max number of possible Linux/Swap/MsDos partitions */
+#define MAX_PARTS 20
+
+char *progname = NULL;
+
+static void
+error(const char *s)
+{
+ fprintf(stderr, "%s: %s\n", progname, s);
+ exit(1);
+}
+
+static int
+my_system(const char *s,...)
+{
+ int ret, i;
+ va_list ap;
+ char sh[200];
+
+ va_start(ap, s);
+ vsprintf(sh, s, ap);
+ va_end(ap);
+
+#ifdef VERBOSE
+ i = dialog_msgbox("I will run the following command:", sh, 10, 65, 1);
+ dialog_clear();
+#ifdef DEBUG_THIS
+ return 0;
+#endif
+#endif
+ ret = system(sh);
+ if (!(ret >> 8))
+ return 0;
+ i = dialog_msgbox("Error-Exit on the following command:",
+ sh, 12, 73, 1);
+ dialog_clear();
+ return 1;
+}
+
+/* We support to install from DOS/Linux-partitions. */
+enum partition_type {
+ MsDos,
+ Linux,
+ Swap
+};
+
+struct partition {
+ enum partition_type type;
+ char name[MAX_DEV_NAME];
+ int blocks;
+ int flag;
+} partitions[MAX_PARTS];
+int num_partition = 0;
+int num_linux = 0;
+int num_swap = 0;
+int num_msdos = 0;
+
+static int
+get_line(char *line, int size, FILE * f)
+{
+ char *ptr = line;
+ int c;
+
+ if (feof(f))
+ return -1;
+ while (size-- && ((c = getc(f)) != EOF) && (c != '\n'))
+ *ptr++ = c;
+ *ptr++ = '\0';
+ return (int) (ptr - line);
+}
+
+static void
+read_partitions(void)
+{
+ FILE *f;
+ char line[200];
+ int length;
+#ifndef DEBUG_THIS
+ int ret = system("fdisk -l 2>/dev/null 1>/tmp/fdisk.output");
+ if ((ret >> 8) != 0) {
+ error("fdisk didn't run");
+ }
+ if ((f = fopen("/tmp/fdisk.output", "r")) == NULL)
+#else
+ if ((f = fopen("FDISK.TEST", "r")) == NULL)
+#endif
+ error("cannot read fdisk output");
+
+ while (num_partition <= MAX_PARTS
+ && (length = get_line(line, 200, f)) >= 0) {
+ if (strncmp(line, "/dev/", 5) == 0) {
+ int n = 0;
+ char *s = line + 5;
+ char *t = partitions[num_partition].name;
+ strcpy(t, "/dev/");
+ t += 5;
+ while (n < MAX_DEV_NAME && *s != '\0'
+ && !isspace((unsigned char) *s)) {
+ *t++ = *s++;
+ n++;
+ }
+ *t = '\0';
+ /* Read the size of the partition. */
+ t = line + 37;
+ while (isspace((unsigned char) *t))
+ t++;
+ partitions[num_partition].blocks = atoi(t);
+ if (strstr(line, "Linux native")) {
+ partitions[num_partition].type = Linux;
+ num_partition++;
+ num_linux++;
+ } else if (strstr(line, "Linux swap")) {
+ partitions[num_partition].type = Swap;
+ num_partition++;
+ num_swap++;
+ } else if (strstr(line, "DOS")) {
+ partitions[num_partition].type = MsDos;
+ num_partition++;
+ num_msdos++;
+ }
+ }
+ }
+ fclose(f);
+#ifndef DEBUG_THIS
+ unlink("/tmp/fdisk.output");
+#endif
+}
+
+static int
+select_partition(const char *title, const char *prompt, int y, int x)
+{
+ int i, num, ret;
+ char info[MAX_PARTS][40];
+ char *items[MAX_PARTS * 2];
+ int num_pa[MAX_PARTS];
+
+ num = 0;
+ for (i = 0; i < num_partition; i++) {
+ if (partitions[i].type == Linux) {
+ items[num * 2] = partitions[i].name;
+ sprintf(info[num], "Linux partition with %d blocks",
+ partitions[i].blocks);
+ items[num * 2 + 1] = info[num];
+ num_pa[num] = i;
+ num++;
+ }
+ }
+ ret = dialog_menu(title, prompt, y + num, x, num, num, items);
+ dialog_clear();
+ if (ret >= 0) /* item selected */
+ ret = num_pa[ret];
+ return ret;
+}
+
+static int
+select_install_partition(void)
+{
+ return select_partition("Select Install Partition",
+ "\\nWhere do you want to install Linux?\\n", 9, 60);
+}
+
+static int
+select_source_partition(void)
+{
+ return select_partition("Select Source Partition",
+ "\\nOn which partition is the source?\\n", 9, 60);
+}
+
+const char *null = ">/dev/null 2>/dev/null";
+const char *install_partition = NULL;
+
+static void
+extract_packages(const char *source_path)
+{
+#ifndef DEBUG_THIS
+ FILE *f;
+#endif
+
+ if (my_system("mkdir -p /install/var/installed/packages %s", null))
+ return;
+ if (my_system("cd /install; for i in /source%s/*.tgz; do "
+ "tar xzplvvkf $i >> var/installed/packages/base "
+ "2>>var/installed/packages/ERROR; done", source_path))
+ return;
+#ifndef DEBUG_THIS
+ if ((f = fopen("/install/etc/fstab", "w")) == NULL) {
+ /* i = */ dialog_msgbox("Error", "Cannot write /etc/fstab",
+ 12, 40, 1);
+ return;
+ }
+ fprintf(f, "%s / ext2 defaults 1 1\n", install_partition);
+ fprintf(f, "none /proc proc defaults 0 2\n");
+ /* XXX write swap-partitions */
+ fclose(f);
+#endif
+}
+
+static void
+install_premounted(void)
+{
+ extract_packages("");
+}
+
+static void
+install_harddisk(void)
+{
+ const char *name;
+ int part, ret;
+
+ if ((part = select_source_partition()) <= -1)
+ return;
+ name = partitions[part].name;
+
+ if (my_system("mount -t ext2 %s /source %s", name, null))
+ return;
+ ret = dialog_inputbox("Path in partition",
+ "Please enter the directory in which the "
+ "source files are.", 13, 50, "", FALSE);
+ dialog_clear();
+ if (ret != 0)
+ return;
+ /* XXX strdup */
+ extract_packages(strdup(dialog_input_result));
+ if (my_system("umount /source %s", null))
+ return;
+}
+
+static void
+install_nfs(void)
+{
+ if (my_system("ifconfig eth0 134.96.81.36 netmask 255.255.255.224 "
+ "broadcast 134.96.81.63 %s", null))
+ return;
+ if (my_system("route add -net 134.96.81.32 %s", null))
+ return;
+ if (my_system("mount -t nfs 134.96.81.38:"
+ "/local/ftp/pub/linux/ELF.binary/tar /source %s", null))
+ return;
+ extract_packages("/base");
+ if (my_system("umount /source %s", null))
+ return;
+ if (my_system("ifconfig eth0 down %s", null))
+ return;
+}
+
+static void
+main_install(void)
+{
+ int part, ret;
+ const char *name;
+ char *items1[] =
+ {
+ "1", "Harddisk Install",
+ "2", "Network Install(NFS)",
+ "3", "Premounted on /source"
+ };
+
+ if (num_linux == 0) {
+ /* XXX */
+ return;
+ }
+ if ((part = select_install_partition()) <= -1)
+ return;
+ install_partition = name = partitions[part].name;
+ if (my_system("mke2fs %s %s", name, null))
+ return;
+ if (my_system("mount -t ext2 %s /install %s", name, null))
+ return;
+ ret = dialog_menu("Choose install medium",
+ "\\nPlease say from where you want to install.\\n",
+ 12, 62, 3, 3, items1);
+ dialog_clear();
+ switch (ret) {
+ case 0:
+ install_harddisk();
+ break;
+ case 1:
+ install_nfs();
+ break;
+ case 2:
+ install_premounted();
+ break;
+ case -2: /* cancel */
+ case -1:
+ break; /* esc */
+ }
+ if (my_system("umount /install %s", null))
+ return;
+}
+
+int
+main(int argc, char **argv)
+{
+ int stop = 0;
+ int ret;
+ char *items1[] =
+ {
+ "1", "Display a help text",
+ "2", "Start an installation",
+ "3", "Exit to the shell"
+ };
+
+ progname = argv[0];
+
+ read_partitions();
+ if (num_linux == 0) {
+ printf("\n\nPlease start \"fdisk\" or \"cfdisk\" and create a"
+ "\nnative Linux-partition to install Linux on.\n\n");
+ exit(1);
+ }
+
+ init_dialog();
+
+ while (!stop) {
+ ret = dialog_menu("Linux Install Utility",
+ "\\nCopyright (C) 1995 Florian La Roche\\n"
+ "\\nPre-Alpha version, be careful, read the doc!!!"
+ "\\nemail: florian@jurix.jura.uni-sb.de, "
+ "flla@stud.uni-sb.de\\n",
+ 15, 64, 3, 3, items1);
+ dialog_clear();
+ switch (ret) {
+ case 0:
+ ret = dialog_textbox("Help Text",
+ "setup.help", 20, 70);
+ dialog_clear();
+ break;
+ case 1:
+ main_install();
+ break;
+ case 2:
+ stop = 1;
+ break;
+ case -2: /* cancel */
+ case -1:
+ stop = 1; /* esc */
+ }
+ }
+ end_dialog();
+ printf("\nExecute \"reboot\" to restart your computer...\n");
+
+ exit(0);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/setup.help b/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/setup.help
new file mode 100644
index 00000000000..7ac8369d4e6
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/install/setup.help
@@ -0,0 +1,49 @@
+At the moment, only installation from a harddisk
+is supported. All commands are shown to you on
+the screen before executing. This is just to make
+sure that nothing bad is done to your harddisk :-)
+
+You can also select to install from a premounted dir.
+Then the "tar/base" directory must be mounted on
+"/install", so that all tar-packages from the basic
+stuff are in "/install/*.tgz". (So you could be able
+to install via NFS...)
+
+Good luck...,
+anyone wants to help programming this tool?,
+
+Florian La Roche
+
+Contents:
+=========
+- overview about what "setup" does.
+- creating a Linux-partition before starting "setup"
+- about lilo
+- how to use "setup", what keys are supported
+
+What does "setup" do on my computer?
+====================================
+Setup will ask you for a partition on your harddisk,
+where you would like to have Linux installed.
+You can then choose to install this distribution from
+your local harddisk or via network (NFS).
+setup will install a very basic system.
+At the end, you can install lilo, the Linux Loader.
+Rebooting your computer with this little linux system
+and then runing the setup-program on it, will give
+the possibility to install more packages.
+
+Creating a Linux-partition:
+===========================
+To install this Linux distribution, you need to
+create an extra partition on your harddisk for
+Linux.
+
+What is lilo and how should I install it?
+=========================================
+Read the lilo-documentation for this...
+
+
+
+Florian La Roche
+
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/killall b/Build/source/utils/dialog/dialog-1.1-20080819/samples/killall
new file mode 100755
index 00000000000..9d233f0a92d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/killall
@@ -0,0 +1,13 @@
+#! /bin/sh
+# $Id: killall,v 1.2 2004/09/17 19:56:18 tom Exp $
+# Linux has a program that does this correctly.
+for prog in $*
+do
+ pid=`ps -a |fgrep $prog |fgrep -v fgrep|sed -e 's/^[ ]*//' -e 's/ .*//' `
+ if test -n "$pid" ; then
+ echo killing pid=$pid, $prog
+ kill -1 $pid || \
+ kill -15 $pid || \
+ kill -9 $pid
+ fi
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/listing b/Build/source/utils/dialog/dialog-1.1-20080819/samples/listing
new file mode 100755
index 00000000000..71d85aa6df9
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/listing
@@ -0,0 +1,8 @@
+#!/bin/sh
+# $Id: listing,v 1.2 2007/05/28 12:40:36 tom Exp $
+while true
+do
+ls -lrt
+date
+sleep 1
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox
new file mode 100755
index 00000000000..2b12970a35e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox
@@ -0,0 +1,36 @@
+#!/bin/sh
+# $Id: menubox,v 1.4 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --clear --title "MENU BOX" \
+ --menu "Hi, this is a menu box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the UP/DOWN arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+number keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "Linux" "The Great Unix Clone for 386/486" \
+ "NetBSD" "Another free Unix Clone for 386/486" \
+ "OS/2" "IBM OS/2" \
+ "WIN NT" "Microsoft Windows NT" \
+ "PCDOS" "IBM PC DOS" \
+ "MSDOS" "Microsoft DOS" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+
+case $retval in
+ 0)
+ echo "'$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox-8bit b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox-8bit
new file mode 100755
index 00000000000..8c876c86aed
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox-8bit
@@ -0,0 +1,38 @@
+#!/bin/sh
+# $Id: menubox-8bit,v 1.1 2004/12/19 16:55:17 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+. ./testdata-8bit
+
+$DIALOG --clear --title "MENU BOX" \
+ --menu "Hi, this is a menu box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the UP/DOWN arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+number keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "`./rotated-data 0 $SAMPLE`" "The Great Unix Clone for 386/486" \
+ "`./rotated-data 1 $SAMPLE`" "Another free Unix Clone for 386/486" \
+ "`./rotated-data 2 $SAMPLE`" "IBM OS/2" \
+ "`./rotated-data 3 $SAMPLE`" "Microsoft Windows NT" \
+ "`./rotated-data 4 $SAMPLE`" "IBM PC DOS" \
+ "`./rotated-data 5 $SAMPLE`" "Microsoft DOS" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+
+case $retval in
+ 0)
+ echo "'$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox-utf8 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox-utf8
new file mode 100755
index 00000000000..bc8294456d6
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox-utf8
@@ -0,0 +1,45 @@
+#!/bin/sh
+# $Id: menubox-utf8,v 1.2 2007/10/21 21:46:17 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+case none"$LANG$LC_ALL$LC_CTYPE" in
+*UTF-8*)
+ ;;
+*)
+ echo "This script must be run in a UTF-8 locale"
+ exit 1
+ ;;
+esac
+
+$DIALOG --clear --title "MENU BOX" \
+ --menu "Hi, this is a menu box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the UP/DOWN arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+number keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "Linux" "The Great Unix Clone for 386/486" \
+ "NetBSD" "Another free Unix Clone for 386/486" \
+ "OS/2" "IBM OS/2" \
+ "WIN NT" "Microsoft Windows NT" \
+ "PCDOS" "IBM PC DOS" \
+ "MSDOS" "Microsoft DOS" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+
+case $retval in
+ 0)
+ echo "'$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox1
new file mode 100755
index 00000000000..fc1c9a6c3e0
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox1
@@ -0,0 +1,39 @@
+#!/bin/sh
+# $Id: menubox1,v 1.2 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --default-item "OS/2" --clear --title "MENU BOX" \
+ --menu "Hi, this is a menu box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the UP/DOWN arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+number keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "Linux" "The Great Unix Clone for 386/486" \
+ "NetBSD" "Another free Unix Clone for 386/486" \
+ "OS/2" "IBM OS/2" \
+ "WIN NT" "Microsoft Windows NT" \
+ "PCDOS" "IBM PC DOS" \
+ "MSDOS" "Microsoft DOS" 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "`cat $tempfile` chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox10 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox10
new file mode 100755
index 00000000000..039a3bf0bc1
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox10
@@ -0,0 +1,35 @@
+#!/bin/sh
+# $Id: menubox10,v 1.1 2004/07/31 11:04:04 tom Exp $
+# zero-width column
+: ${DIALOG=dialog}
+
+exec 3>&1
+value=`$DIALOG --backtitle "Debian Configuration" \
+ --title "Configuring debconf" \
+ --default-item Dialog \
+ --menu "Packages that use debconf for co" 19 50 6 \
+ Dialog "" \
+ Readline "" \
+ Gnome "" \
+ Kde "" \
+ Editor "" \
+ Noninteractive "" \
+2>&1 1>&3`
+retval=$?
+exec 3>&-
+
+case $retval in
+ 0)
+ echo "$value chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "Help pressed ($value)";;
+ 255)
+ if test -n "$value" ; then
+ echo "$value"
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox2
new file mode 100755
index 00000000000..f998f00a397
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox2
@@ -0,0 +1,39 @@
+#!/bin/sh
+# $Id: menubox2,v 1.2 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --default-item "MSDOS" --clear --title "MENU BOX" \
+ --menu "Hi, this is a menu box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the UP/DOWN arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+number keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "Linux" "The Great Unix Clone for 386/486" \
+ "NetBSD" "Another free Unix Clone for 386/486" \
+ "OS/2" "IBM OS/2" \
+ "WIN NT" "Microsoft Windows NT" \
+ "PCDOS" "IBM PC DOS" \
+ "MSDOS" "Microsoft DOS" 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "`cat $tempfile` chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox3
new file mode 100755
index 00000000000..dfdb5a295b6
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox3
@@ -0,0 +1,40 @@
+#!/bin/sh
+# $Id: menubox3,v 1.3 2004/12/19 23:18:53 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --clear --item-help --title "MENU BOX" \
+ --menu "Hi, this is a menu box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the UP/DOWN arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+number keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "Linux" "The Great Unix Clone for 386/486" "Why use Linux?" \
+ "NetBSD" "Another free Unix Clone for 386/486" "Or NetBSD?" \
+ "OS/2" "IBM OS/2" "aka \"Warp\"" \
+ "WIN NT" "Microsoft Windows NT" "hmm" \
+ "PCDOS" "IBM PC DOS" "clone of a clone" \
+ "MSDOS" "Microsoft DOS" "DOS: Disk Operating System, originally for an IBM contract, hence using the same jargon" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox4 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox4
new file mode 100755
index 00000000000..266f36dc6d5
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox4
@@ -0,0 +1,40 @@
+#!/bin/sh
+# $Id: menubox4,v 1.3 2004/12/19 23:18:53 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --clear --item-help --title "MENU BOX" \
+ --menu "Hi, this is a menu box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the UP/DOWN arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+number keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "Linux" "The Great Unix Clone for 386/486 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "Why use Linux?" \
+ "NetBSD" "Another free Unix Clone for 386/486 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "Or NetBSD?" \
+ "OS/2" "IBM OS/2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "aka \"Warp\"" \
+ "WIN NT" "Microsoft Windows NT xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "hmm" \
+ "PCDOS" "IBM PC DOS xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "clone of a clone" \
+ "MSDOS" "Microsoft DOS xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "DOS: Disk Operating System, originally for an IBM contract, hence using the same jargon" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox5 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox5
new file mode 100755
index 00000000000..044e8578a81
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox5
@@ -0,0 +1,43 @@
+#!/bin/sh
+# $Id: menubox5,v 1.4 2004/12/19 23:18:53 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --clear --help-button --item-help --title "MENU BOX" \
+ --menu "Hi, this is a menu box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the UP/DOWN arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+number keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "Linux" "The Great Unix Clone for 386/486 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "Why use Linux?" \
+ "NetBSD" "Another free Unix Clone for 386/486 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "Or NetBSD?" \
+ "OS/2" "IBM OS/2 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "aka \"Warp\"" \
+ "WIN NT" "Microsoft Windows NT xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "hmm" \
+ "WIN 2K" "Microsoft Windows 2000 xxxxxxxxxxxxxxxxxxxxxxxxxxxx" "hmm" \
+ "WIN XP" "Microsoft Windows XP (son of Windows 95) xxxxxxxxxx" "hmm" \
+ "WIN 95" "Microsoft Windows 95 (son of MSDOS) xxxxxxxxxxxxxxx" "hmm" \
+ "PCDOS" "IBM PC DOS xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "clone of a clone" \
+ "MSDOS" "Microsoft DOS xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" "DOS: Disk Operating System, originally for an IBM contract, hence using the same jargon" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox6 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox6
new file mode 100755
index 00000000000..1d8496b096d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox6
@@ -0,0 +1,41 @@
+#!/bin/sh
+# $Id: menubox6,v 1.3 2004/12/19 23:18:53 tom Exp $
+# example showing the --colors option
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --clear --item-help --title "MENU BOX" --colors \
+ --menu "Hi, this is a \Zumenu\Zn box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the \Z4UP/DOWN\Zn arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+\Z2number\Zn keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "Linux" "The Great Unix Clone for \Zu386/486" "Why use \ZbLinux?" \
+ "NetBSD" "Another free Unix Clone for \Zu386/486" "Or \ZbNetBSD?" \
+ "OS/2" "IBM OS/2" "aka \"Warp\"" \
+ "WIN NT" "Microsoft Windows NT" "hmm" \
+ "PCDOS" "IBM PC \ZrDOS" "clone of a clone" \
+ "MSDOS" "Microsoft \ZrDOS" "\ZbDOS\Zn: \Zb\Z3D\Znisk \Zb\Z3O\Znperating \Zb\Z3S\Znystem, originally for an IBM contract, hence using the same jargon" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox7 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox7
new file mode 100755
index 00000000000..376e97fd42c
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox7
@@ -0,0 +1,44 @@
+#!/bin/sh
+# $Id: menubox7,v 1.4 2006/01/18 00:19:03 tom Exp $
+# example with --extra-button
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --clear --item-help --extra-button --extra-label "Choice" \
+ --title "MENU BOX" \
+ --menu "Hi, this is a menu box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the UP/DOWN arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+number keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "Linux" "The Great Unix Clone for 386/486" "Why use Linux?" \
+ "NetBSD" "Another free Unix Clone for 386/486" "Or NetBSD?" \
+ "OS/2" "IBM OS/2" "aka \"Warp\"" \
+ "WIN NT" "Microsoft Windows NT" "hmm" \
+ "PCDOS" "IBM PC DOS" "clone of a clone" \
+ "MSDOS" "Microsoft DOS" "DOS: Disk Operating System, originally for an IBM contract, hence using the same jargon" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 3)
+ echo "Extra (Choice) chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox8 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox8
new file mode 100755
index 00000000000..e4efe71efff
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox8
@@ -0,0 +1,43 @@
+#!/bin/sh
+# $Id: menubox8,v 1.3 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+exec 3>&1
+value=`$DIALOG --help-button \
+ --default-item "MSDOS" \
+ --clear \
+ --title "MENU BOX" \
+ --menu "Hi, this is a menu box. You can use this to \n\
+present a list of choices for the user to \n\
+choose. If there are more items than can fit \n\
+on the screen, the menu will be scrolled. \n\
+You can use the UP/DOWN arrow keys, the first \n\
+letter of the choice as a hot key, or the \n\
+number keys 1-9 to choose an option.\n\
+Try it now!\n\n\
+ Choose the OS you like:" 20 51 4 \
+ "Linux" "The Great Unix Clone for 386/486" \
+ "NetBSD" "Another free Unix Clone for 386/486" \
+ "OS/2" "IBM OS/2" \
+ "WIN NT" "Microsoft Windows NT" \
+ "PCDOS" "IBM PC DOS" \
+ "MSDOS" "Microsoft DOS" \
+2>&1 1>&3`
+retval=$?
+exec 3>&-
+
+case $retval in
+ 0)
+ echo "$value chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "Help pressed ($value)";;
+ 255)
+ if test -n "$value" ; then
+ echo "$value"
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox9 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox9
new file mode 100755
index 00000000000..9f46a16bebb
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/menubox9
@@ -0,0 +1,39 @@
+#!/bin/sh
+# $Id: menubox9,v 1.1 2003/09/23 23:02:08 tom Exp $
+: ${DIALOG=dialog}
+
+exec 3>&1
+value=`$DIALOG --help-button \
+ --clear \
+ --title "Select Linux installation partition:" \
+ --menu \
+"Please select a partition from the following list to use for your \
+root (/) Linux partition." 13 70 5 \
+"/dev/hda2" "Linux native 30724312K" \
+"/dev/hda4" "Linux native 506047K" \
+"/dev/hdb1" "Linux native 4096543K" \
+"/dev/hdb2" "Linux native 2586465K" \
+"---" "(add none, continue with setup)" \
+"---" "(add none, continue with setup)" \
+"---" "(add none, continue with setup)" \
+"---" "(add none, continue with setup)" \
+"---" "(add none, continue with setup)" \
+2>&1 1>&3`
+retval=$?
+exec 3>&-
+
+case $retval in
+ 0)
+ echo "$value chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "Help pressed ($value)";;
+ 255)
+ if test -n "$value" ; then
+ echo "$value"
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/mixedform b/Build/source/utils/dialog/dialog-1.1-20080819/samples/mixedform
new file mode 100755
index 00000000000..7ab4594e430
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/mixedform
@@ -0,0 +1,60 @@
+#! /bin/sh
+# $Id: mixedform,v 1.2 2007/02/17 14:53:43 tom Exp $
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --mixedform:"
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+returncode=$?
+exec 3>&1
+value=`$DIALOG --title "Mixed form demonstration" --ok-label "Submit" \
+ --backtitle "$backtitle" \
+ --insecure \
+ --mixedform "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username :" 1 1 "Kiran" 1 20 10 0 2 \
+ "Password :" 2 1 "" 2 20 8 0 1 \
+ "Retype Password :" 3 1 "" 3 20 8 0 1 \
+ "HOME :" 4 1 "Cisco" 4 20 40 0 0 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ echo "Button 2 (Help) pressed."
+ exit
+ ;;
+ 3)
+ echo "Button 3 (Extra) pressed."
+ exit
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/mixedform2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/mixedform2
new file mode 100755
index 00000000000..8c88d3d8fc2
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/mixedform2
@@ -0,0 +1,60 @@
+#! /bin/sh
+# $Id: mixedform2,v 1.1 2007/02/17 15:48:19 tom Exp $
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --mixedform:"
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+returncode=$?
+exec 3>&1
+value=`$DIALOG --title "Mixed form demonstration" --ok-label "Submit" \
+ --backtitle "$backtitle" \
+ --insecure \
+ --mixedform "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username :" 1 1 "Kiran" 1 20 10 0 2 \
+ "Password :" 2 1 "pass" 2 20 8 0 3 \
+ "Retype Password :" 3 1 "pass" 3 20 8 0 3 \
+ "HOME :" 4 1 "Cisco" 4 20 40 0 2 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ echo "Button 2 (Help) pressed."
+ exit
+ ;;
+ 3)
+ echo "Button 3 (Extra) pressed."
+ exit
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/mixedgauge b/Build/source/utils/dialog/dialog-1.1-20080819/samples/mixedgauge
new file mode 100755
index 00000000000..2f1dadeedfa
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/mixedgauge
@@ -0,0 +1,24 @@
+#! /bin/sh
+# $Id: mixedgauge,v 1.4 2007/02/26 23:10:30 tom Exp $
+: ${DIALOG=dialog}
+background="An Example of --mixedgauge usage"
+
+for i in 5 10 20 30 40 50 60 70 80 90 100
+do
+$DIALOG --backtitle "$background" \
+ --title "Mixed gauge demonstration" \
+ --mixedgauge "This is a prompt message,\nand this is the second line." \
+ 0 0 33 \
+ "Process one" "0" \
+ "Process two" "1" \
+ "Process three" "2" \
+ "Process four" "3" \
+ "" "8" \
+ "Process five" "5" \
+ "Process six" "6" \
+ "Process seven" "7" \
+ "Process eight" "4" \
+ "Process nine" "-$i"
+# break
+sleep 1
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox
new file mode 100755
index 00000000000..eba369ffd8e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox
@@ -0,0 +1,15 @@
+#!/bin/sh
+# $Id: msgbox,v 1.3 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "MESSAGE BOX" --clear \
+ --msgbox "Hi, this is a simple message box. You can use this to \
+ display any message you like. The box will remain until \
+ you press the ENTER key." 10 41
+
+case $? in
+ 0)
+ echo "OK";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox-help b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox-help
new file mode 100755
index 00000000000..ed5ec3f4165
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox-help
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $Id: msgbox-help,v 1.1 2005/12/05 23:59:24 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "MESSAGE BOX" --clear \
+ --help-button \
+ --msgbox "Hi, this is a simple message box. You can use this to \
+ display any message you like. The box will remain until \
+ you press the ENTER key." 10 41
+
+case $? in
+ 0)
+ echo "OK";;
+ 1)
+ echo "Button 1 (Cancel) pressed.";;
+ 2)
+ echo "Button 2 (Help) pressed.";;
+ 3)
+ echo "Button 3 (Extra) pressed.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox1
new file mode 100755
index 00000000000..c889d19b7ff
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox1
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $Id: msgbox1,v 1.5 2004/06/06 13:40:58 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "MESSAGE BOX" --clear \
+ --msgbox "Hi, this is a simple message box. You can use this to
+ display any message you like. The box will remain until
+ you press the ENTER key. This box is being displayed
+ with dialogs default aspect ratio of 9." 0 0
+test $? = 255 && exit
+
+$DIALOG --aspect 12 --title "MESSAGE BOX aspect=12" --clear \
+ --msgbox "Hi, this is a simple message box. You can use this to
+ display any message you like. The box will remain until
+ you press the ENTER key. This box is being displayed
+ with an aspect ratio of 12." 0 0
+test $? = 255 && exit
+
+$DIALOG --aspect 6 --title "MESSAGE BOX aspect=6" --clear \
+ --msgbox "Hi, this is a simple message box. You can use this to
+ display any message you like. The box will remain until
+ you press the ENTER key. This box is being displayed
+ with an aspect ratio of 6." 0 0
+test $? = 255 && exit
+
+$DIALOG --aspect 6 --cr-wrap --title "MESSAGE BOX aspect=6 with --cr-wrap" \
+ --clear --msgbox "\
+ Hi, this is a simple
+ message box. You can
+ use this to display any
+ message you like.
+The box will remain until you press the ENTER key. This box is being displayed with an aspect ratio of 6, and using --cr-wrap.\n" 0 0
+test $? = 255 && exit
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox2
new file mode 100755
index 00000000000..7a656a1fd0e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox2
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $Id: msgbox2,v 1.3 2004/06/06 13:42:26 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "MESSAGE BOX" --trim \
+ --msgbox "Hi, this is a simple message box. You can use this to
+ display any message you like. The box will remain until
+ you press the ENTER key. This box is being displayed
+ with dialogs default aspect ratio of 9." 0 0
+test $? = 255 && exit
+
+$DIALOG --aspect 12 --title "MESSAGE BOX aspect=12" --trim \
+ --msgbox "Hi, this is a simple message box. You can use this to
+ display any message you like. The box will remain until
+ you press the ENTER key. This box is being displayed
+ with an aspect ratio of 12." 0 0
+test $? = 255 && exit
+
+$DIALOG --aspect 6 --title "MESSAGE BOX aspect=6" --trim \
+ --msgbox "Hi, this is a simple message box. You can use this to
+ display any message you like. The box will remain until
+ you press the ENTER key. This box is being displayed
+ with an aspect ratio of 6." 0 0
+test $? = 255 && exit
+
+$DIALOG --aspect 6 --cr-wrap --title "MESSAGE BOX aspect=6 with --cr-wrap" \
+ --trim --msgbox "\
+ Hi, this is a simple
+ message box. You can
+ use this to display any
+ message you like.
+The box will remain until you press the ENTER key. This box is being displayed with an aspect ratio of 6, and using --cr-wrap.\n" 0 0
+test $? = 255 && exit
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox3
new file mode 100755
index 00000000000..fedc30a5046
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox3
@@ -0,0 +1,21 @@
+#!/bin/sh
+# $Id: msgbox3,v 1.3 2004/06/05 17:19:10 tom Exp $
+: ${DIALOG=dialog}
+
+width=35
+while test $width != 61
+do
+$DIALOG --title "MESSAGE BOX (width $width)" --clear --no-collapse \
+ --msgbox "\
+ H H EEEEE L L OOO
+ H H E L L O O
+ HHHHH EEEEE L L O O
+ H H E L L O O
+ H H EEEEE LLLLL LLLLL OOO
+
+Hi, this is a simple message box. You can use this to \
+display any message you like. The box will remain until \
+you press the ENTER key." 15 $width
+test $? = 255 && break
+width=`expr $width + 1`
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-8bit b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-8bit
new file mode 100755
index 00000000000..d3192266847
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-8bit
@@ -0,0 +1,34 @@
+#!/bin/sh
+# $Id: msgbox4-8bit,v 1.1 2004/12/19 17:02:40 tom Exp $
+: ${DIALOG=dialog}
+
+: ${DIALOG_OK=0}
+: ${DIALOG_CANCEL=1}
+: ${DIALOG_ESC=255}
+
+. ./testdata-8bit
+
+width=30
+while test $width != 61
+do
+$DIALOG --title "MESSAGE BOX (width $width)" --no-collapse --colors \
+ --msgbox "\
+This sample uses characters which are non-printing in POSIX locale.
+
+\Z1`./rotated-data 0 $SAMPLE` \Z2`./rotated-data 1 $SAMPLE` \Z3`./rotated-data 2 $SAMPLE` \Z4`./rotated-data 3 $SAMPLE`\Zn
+
+Hi, this is a simple message box. You can use this to \
+display any message you like. The box will remain until \
+you press the ENTER key." 22 $width
+retval=$?
+
+case $retval in
+ $DIALOG_CANCEL)
+ echo "Cancel pressed.";exit;;
+ $DIALOG_ESC)
+ echo "ESC pressed.";exit;;
+esac
+
+width=`expr $width + 1`
+
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-eucjp b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-eucjp
new file mode 100755
index 00000000000..044df41edfe
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-eucjp
@@ -0,0 +1,24 @@
+#!/bin/sh
+# $Id: msgbox4-eucjp,v 1.2 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+width=35
+while test $width != 61
+do
+$DIALOG --title "MESSAGE BOX (width $width)" --clear --no-collapse \
+ --msgbox "\
+This sample is written in EUC-JP.
+There are several checking points:
+(1) whether the fullwidth characters are displayed well or not,
+(2) whether the width of characters are evaluated properly, and
+(3) whether the character at line-folding is lost or not.
+
+¤¢¤¤¤¦¤¨¤ª¤«¤­¤¯¤±¤³¤µ¤·¤¹¤»¤½¤¿¤Á¤Ä¤Æ¤È¤Ê¤Ë¤Ì¤Í¤Î
+£±£²£³£´£µ£¶£·£¸£¹£°£±£²£³£´£µ£¶£·£¸£¹£°£±£²£³£´£µ
+£Á£Â£Ã£Ä£Å£Æ£Ç£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù
+
+Hi, this is a simple message box. You can use this to \
+display any message you like. The box will remain until \
+you press the ENTER key." 22 $width
+width=`expr $width + 1`
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-utf8 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-utf8
new file mode 100755
index 00000000000..7082ac4767d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox4-utf8
@@ -0,0 +1,47 @@
+#!/bin/sh
+# $Id: msgbox4-utf8,v 1.6 2004/12/19 16:27:15 tom Exp $
+: ${DIALOG=dialog}
+
+: ${DIALOG_OK=0}
+: ${DIALOG_CANCEL=1}
+: ${DIALOG_ESC=255}
+
+case none"$LANG$LC_ALL$LC_CTYPE" in
+*UTF-8*)
+ ;;
+*)
+ echo "This script must be run in a UTF-8 locale"
+ exit 1
+ ;;
+esac
+
+width=30
+while test $width != 61
+do
+$DIALOG --title "MESSAGE BOX (width $width)" --no-collapse \
+ --msgbox "\
+This sample is written in UTF-8.
+There are several checking points:
+(1) whether the fullwidth characters are displayed well or not,
+(2) whether the width of characters are evaluated properly, and
+(3) whether the character at line-folding is lost or not.
+
+ã‚ã„ã†ãˆãŠã‹ããã‘ã“ã•ã—ã™ã›ããŸã¡ã¤ã¦ã¨ãªã«ã¬ã­ã®
+123456789ï¼ï¼‘23456789ï¼ï¼‘2345
+ABCDEFGHIJKLMNOPQRSTUVWXY
+
+Hi, this is a simple message box. You can use this to \
+display any message you like. The box will remain until \
+you press the ENTER key." 22 $width
+retval=$?
+
+case $retval in
+ $DIALOG_CANCEL)
+ echo "Cancel pressed.";exit;;
+ $DIALOG_ESC)
+ echo "ESC pressed.";exit;;
+esac
+
+width=`expr $width + 1`
+
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox5 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox5
new file mode 100755
index 00000000000..a4aa359ebfd
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox5
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $Id: msgbox5,v 1.1 2004/06/05 17:19:43 tom Exp $
+# this differs from msgbox3 by making a window small enough to force scrolling.
+: ${DIALOG=dialog}
+
+width=35
+while test $width != 61
+do
+$DIALOG --title "MESSAGE BOX (width $width)" --clear --no-collapse \
+ --msgbox "\
+ H H EEEEE L L OOO
+ H H E L L O O
+ HHHHH EEEEE L L O O
+ H H E L L O O
+ H H EEEEE LLLLL LLLLL OOO
+
+Hi, this is a simple message box. You can use this to \
+display any message you like. The box will remain until \
+you press the ENTER key." 10 $width
+test $? = 255 && break
+width=`expr $width + 1`
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox6 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox6
new file mode 100755
index 00000000000..5db644d99c9
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox6
@@ -0,0 +1,16 @@
+#!/bin/sh
+# $Id: msgbox6,v 1.1 2004/11/18 00:57:40 tom Exp $
+# this differs from msgbox3 by making a window small enough to force scrolling.
+: ${DIALOG=dialog}
+
+width=35
+while test $width != 61
+do
+$DIALOG --title "MESSAGE BOX (width $width)" --clear \
+ --msgbox "\
+ a b c d e f g h j i j k l m n o p q r s t u v w x y z
+ A B C D E F G H J I J K L M N O P Q R S T U V W X Y Z
+" 10 $width
+test $? = 255 && break
+width=`expr $width + 1`
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox6a b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox6a
new file mode 100755
index 00000000000..1d5238cceae
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/msgbox6a
@@ -0,0 +1,16 @@
+#!/bin/sh
+# $Id: msgbox6a,v 1.1 2004/11/18 00:59:17 tom Exp $
+# this differs from msgbox3 by making a window small enough to force scrolling.
+: ${DIALOG=dialog}
+
+width=35
+while test $width != 61
+do
+$DIALOG --title "MESSAGE BOX (width $width)" --clear \
+ --msgbox "\
+ .a .b .c .d .e .f .g .h .j .i .j .k .l .m .n .o .p .q .r .s .t .u .v .w .x .y .z
+ .A .B .C .D .E .F .G .H .J .I .J .K .L .M .N .O .P .Q .R .S .T .U .V .W .X .Y .Z
+" 10 $width
+test $? = 255 && break
+width=`expr $width + 1`
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/password b/Build/source/utils/dialog/dialog-1.1-20080819/samples/password
new file mode 100755
index 00000000000..4bc549bcd23
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/password
@@ -0,0 +1,32 @@
+#!/bin/sh
+# $Id: password,v 1.2 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --title "INPUT BOX" --clear \
+ --passwordbox "Hi, this is an password dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:" 16 51 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/password1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/password1
new file mode 100755
index 00000000000..7144f2e6c99
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/password1
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $Id: password1,v 1.1 2003/11/26 22:25:03 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --title "INPUT BOX" --clear \
+ --insecure \
+ --passwordbox "Hi, this is an password dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:" 16 51 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/password2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/password2
new file mode 100755
index 00000000000..ef9d9168963
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/password2
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $Id: password2,v 1.1 2003/11/26 22:37:29 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --title "INPUT BOX" --clear \
+ --insecure \
+ --passwordbox "Hi, this is an password dialog box. You can use \n
+this to ask questions that require the user \n
+to input a string as the answer. You can \n
+input strings of length longer than the \n
+width of the input box, in that case, the \n
+input field will be automatically scrolled. \n
+You can use BACKSPACE to correct errors. \n\n
+Try entering your name below:" 16 51 stupid 2> $tempfile
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Input string is `cat $tempfile`";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ if test -s $tempfile ; then
+ cat $tempfile
+ else
+ echo "ESC pressed."
+ fi
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/passwordform1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/passwordform1
new file mode 100755
index 00000000000..1c0a8e71c46
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/passwordform1
@@ -0,0 +1,68 @@
+#! /bin/sh
+# $Id: passwordform1,v 1.1 2005/12/08 01:03:29 tom Exp $
+: ${DIALOG=dialog}
+
+backtitle="An Example for the use of --form:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="$USER"
+home="$HOME"
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --backtitle "$backtitle" \
+ --insecure \
+ --passwordform "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 10 0 \
+ "UID:" 2 1 "$uid" 2 10 8 0 \
+ "GID:" 3 1 "$gid" 3 10 8 0 \
+ "HOME:" 4 1 "$home" 4 10 40 0 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ echo "Button 2 (Help) pressed."
+ exit
+ ;;
+ 3)
+ echo "Button 3 (Extra) pressed."
+ exit
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/passwordform1-utf8 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/passwordform1-utf8
new file mode 100755
index 00000000000..cc45fe47408
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/passwordform1-utf8
@@ -0,0 +1,77 @@
+#! /bin/sh
+# $Id: passwordform1-utf8,v 1.2 2008/08/20 00:32:34 tom Exp $
+: ${DIALOG=dialog}
+
+case none"$LANG$LC_ALL$LC_CTYPE" in
+*UTF-8*)
+ ;;
+*)
+ echo "This script must be run in a UTF-8 locale"
+ exit 1
+ ;;
+esac
+
+backtitle="An Example for the use of --passwordform:"
+
+ids=`id|sed -e 's/([^)]*)//g'`
+uid=`echo "$ids" | sed -e 's/^uid=//' -e 's/ .*//'`
+gid=`echo "$ids" | sed -e 's/^.* gid=//' -e 's/ .*//'`
+
+user="DOG"
+home=/usr/home/$user
+
+returncode=0
+while test $returncode != 1 && test $returncode != 250
+do
+exec 3>&1
+value=`$DIALOG --ok-label "Submit" \
+ --backtitle "$backtitle" \
+ --insecure \
+ --passwordform "Here is a possible piece of a configuration program." \
+20 50 0 \
+ "Username:" 1 1 "$user" 1 10 10 0 \
+ "UID:" 2 1 "$uid" 2 10 8 0 \
+ "GID:" 3 1 "$gid" 3 10 8 0 \
+ "HOME:" 4 1 "$home" 4 10 40 0 \
+2>&1 1>&3`
+returncode=$?
+exec 3>&-
+
+show=`echo "$value" |sed -e 's/^/ /'`
+
+ case $returncode in
+ 1)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" \
+ --yesno "Really quit?" 10 30
+ case $? in
+ 0)
+ break
+ ;;
+ 1)
+ returncode=99
+ ;;
+ esac
+ ;;
+ 0)
+ "$DIALOG" \
+ --clear \
+ --backtitle "$backtitle" --no-collapse --cr-wrap \
+ --msgbox "Resulting data:\n\
+$show" 10 40
+ ;;
+ 2)
+ echo "Button 2 (Help) pressed."
+ exit
+ ;;
+ 3)
+ echo "Button 3 (Extra) pressed."
+ exit
+ ;;
+ *)
+ echo "Return code was $returncode"
+ exit
+ ;;
+ esac
+done
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/pause b/Build/source/utils/dialog/dialog-1.1-20080819/samples/pause
new file mode 100755
index 00000000000..6e4fc2af78c
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/pause
@@ -0,0 +1,16 @@
+#!/bin/sh
+# $Id: pause,v 1.1 2004/12/20 00:41:12 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "PAUSE" --pause "Hi, this is a pause widget" 20 70 10
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Timeout expired.";;
+ 1)
+ echo "Cancel pressed.";;
+ *)
+ echo "Unexpected return code: $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/pause-help b/Build/source/utils/dialog/dialog-1.1-20080819/samples/pause-help
new file mode 100755
index 00000000000..631394e8cf7
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/pause-help
@@ -0,0 +1,24 @@
+#!/bin/sh
+# $Id: pause-help,v 1.1 2005/12/06 00:02:52 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "PAUSE" \
+ --help-button \
+ --pause "Hi, this is a pause widget" 20 70 10
+
+retval=$?
+
+case $retval in
+ 0)
+ echo "Timeout expired.";;
+ 1)
+ echo "Button 1 (Cancel) pressed.";;
+ 2)
+ echo "Button 2 (Help) pressed.";;
+ 3)
+ echo "Button 3 (Extra) pressed.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected return code: $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/progress b/Build/source/utils/dialog/dialog-1.1-20080819/samples/progress
new file mode 100755
index 00000000000..82a72bb9b3e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/progress
@@ -0,0 +1,19 @@
+#!/bin/sh
+# $Id: progress,v 1.1 2006/01/18 23:32:18 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+ls -1 >$tempfile
+(
+while true
+do
+read text
+test -z "$text" && break
+ls -ld "$text"
+sleep 1
+done <$tempfile
+) |
+
+$DIALOG --title "PROGRESS" --progressbox 20 70
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/progress2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/progress2
new file mode 100755
index 00000000000..0865738fedf
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/progress2
@@ -0,0 +1,19 @@
+#!/bin/sh
+# $Id: progress2,v 1.1 2006/01/18 23:35:05 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+ls -1 >$tempfile
+(
+while true
+do
+read text
+test -z "$text" && break
+ls -ld "$text"
+sleep 1
+done <$tempfile
+) |
+
+$DIALOG --title "PROGRESS" --progressbox "This is a detailed description\nof the progress-box." 20 70
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist b/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist
new file mode 100755
index 00000000000..f11dc5d1b1b
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist
@@ -0,0 +1,36 @@
+#! /bin/sh
+# $Id: radiolist,v 1.8 2004/12/20 00:14:24 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --backtitle "No Such Organization" \
+ --title "RADIOLIST BOX" --clear \
+ --radiolist "Hi, this is a radiolist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an apple." off \
+ "Dog" "No, that's not my dog." ON \
+ "Orange" "Yeah, that's juicy." off \
+ "Chicken" "Normally not a pet." off \
+ "Cat" "No, never put a dog and a cat together!" off \
+ "Fish" "Cats like fish." off \
+ "Lemon" "You know how it tastes." off 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "'$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist10 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist10
new file mode 100755
index 00000000000..087137dfa8e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist10
@@ -0,0 +1,40 @@
+#! /bin/sh
+# $Id: radiolist10,v 1.1 2004/07/31 11:12:10 tom Exp $
+# zero-width column
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG \
+ --backtitle "No such organization" \
+ --title "RADIOLIST BOX" \
+ --radiolist "Hi, this is a radiolist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ Dialog "" on \
+ Readline "" off \
+ Gnome "" off \
+ Kde "" off \
+ Editor "" off \
+ Noninteractive "" on \
+ 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "'$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist2
new file mode 100755
index 00000000000..743857186d9
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist2
@@ -0,0 +1,38 @@
+#! /bin/sh
+# $Id: radiolist2,v 1.3 2004/12/20 00:14:24 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --ok-label Okay \
+ --cancel-label 'Give Up' \
+ --backtitle "No Such Organization" \
+ --title "RADIOLIST BOX" --clear \
+ --radiolist "Hi, this is a radiolist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an apple." off \
+ "Dog" "No, that's not my dog." ON \
+ "Orange" "Yeah, that's juicy." off \
+ "Chicken" "Normally not a pet." off \
+ "Cat" "No, never put a dog and a cat together!" off \
+ "Fish" "Cats like fish." off \
+ "Lemon" "You know how it tastes." off 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "'$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist3
new file mode 100755
index 00000000000..0f79ab4eeb0
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist3
@@ -0,0 +1,42 @@
+#! /bin/sh
+# $Id: radiolist3,v 1.4 2004/12/20 00:14:24 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --item-help --ok-label Okay \
+ --cancel-label 'Give Up' \
+ --backtitle "No Such Organization" \
+ --title "RADIOLIST BOX" --clear \
+ --radiolist "Hi, this is a radiolist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an apple." off "Hint: this grows in a tree" \
+ "Dog" "No, that's not my dog." ON "Hint: this likes trees" \
+ "Orange" "Yeah, that's juicy." off "Hint: this is green when picked" \
+ "Chicken" "Normally not a pet." off "Hint: not often in trees" \
+ "Cat" "No, never put a dog and a cat together!" off "Hint: may be found in trees" \
+ "Fish" "Cats like fish." off "Hint: usually not close to cats" \
+ "Lemon" "You know how it tastes." off "Hint: like an orange" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist4 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist4
new file mode 100755
index 00000000000..dca07ad9b9d
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/radiolist4
@@ -0,0 +1,42 @@
+#! /bin/sh
+# $Id: radiolist4,v 1.4 2004/12/20 00:14:24 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+$DIALOG --help-button --help-label "Hints" --item-help --ok-label Okay \
+ --cancel-label 'Give Up' \
+ --backtitle "No Such Organization" \
+ --title "RADIOLIST BOX" --clear \
+ --radiolist "Hi, this is a radiolist box. You can use this to \n\
+present a list of choices which can be turned on or \n\
+off. If there are more items than can fit on the \n\
+screen, the list will be scrolled. You can use the \n\
+UP/DOWN arrow keys, the first letter of the choice as a \n\
+hot key, or the number keys 1-9 to choose an option. \n\
+Press SPACE to toggle an option on/off. \n\n\
+ Which of the following are fruits?" 20 61 5 \
+ "Apple" "It's an apple." off "Hint: this grows in a tree" \
+ "Dog" "No, that's not my dog." ON "Hint: this likes trees" \
+ "Orange" "Yeah, that's juicy." off "Hint: this is green when picked" \
+ "Chicken" "Normally not a pet." off "Hint: not often in trees" \
+ "Cat" "No, never put a dog and a cat together!" off "Hint: may be found in trees" \
+ "Fish" "Cats like fish." off "Hint: usually not close to cats" \
+ "Lemon" "You know how it tastes." off "Hint: like an orange" 2> $tempfile
+
+retval=$?
+
+choice=`cat $tempfile`
+case $retval in
+ 0)
+ echo "OK '$choice' chosen.";;
+ 1)
+ echo "Cancel pressed.";;
+ 2)
+ echo "HELP '$choice' chosen.";;
+ 255)
+ echo "ESC pressed.";;
+ *)
+ echo "Unexpected code $retval";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/rotated-data b/Build/source/utils/dialog/dialog-1.1-20080819/samples/rotated-data
new file mode 100755
index 00000000000..dc407144e7e
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/rotated-data
@@ -0,0 +1,23 @@
+#!/bin/sh
+# $Id: rotated-data,v 1.1 2004/12/19 16:43:47 tom Exp $
+# Rotate the second parameter's data by the given shift count.
+if test $# != 0
+then
+ case $1 in
+ [1-9]*)
+ left=$1
+ next=`expr $left + 1`
+ shift 1
+ ;;
+ *)
+ left=1
+ next=2
+ ;;
+ esac
+ char=`echo "$@" | cut -b -${left}`
+ data=`echo "$@" | cut -b ${next}-`
+
+ printf "%s%s\n" $data $char
+else
+ echo
+fi
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/slackware.rc b/Build/source/utils/dialog/dialog-1.1-20080819/samples/slackware.rc
new file mode 100644
index 00000000000..9942db6e1cf
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/slackware.rc
@@ -0,0 +1,124 @@
+# $Id: slackware.rc,v 1.6 2005/12/01 01:20:16 tom Exp $
+# Run-time configuration file for dialog, matches Slackware color scheme.
+#
+# Types of values:
+#
+# Number - <number>
+# String - "string"
+# Boolean - <ON|OFF>
+# Attribute - (foreground,background,highlight?)
+
+# Set aspect-ration.
+aspect = 0
+
+# Set separator (for multiple widgets output).
+separate_widget = ""
+
+# Set tab-length (for textbox tab-conversion).
+tab_len = 0
+
+# Make tab-traversal for checklist, etc., include the list.
+visit_items = OFF
+
+# Shadow dialog boxes? This also turns on color.
+use_shadow = ON
+
+# Turn color support ON or OFF
+use_colors = ON
+
+# Screen color
+screen_color = (WHITE,BLUE,OFF)
+
+# Shadow color
+shadow_color = (WHITE,BLACK,OFF)
+
+# Dialog box color
+dialog_color = (BLACK,CYAN,OFF)
+
+# Dialog box title color
+title_color = (YELLOW,CYAN,ON)
+
+# Dialog box border color
+border_color = (CYAN,CYAN,ON)
+
+# Active button color
+button_active_color = (WHITE,BLUE,ON)
+
+# Inactive button color
+button_inactive_color = (BLACK,CYAN,OFF)
+
+# Active button key color
+button_key_active_color = (WHITE,BLUE,ON)
+
+# Inactive button key color
+button_key_inactive_color = (RED,CYAN,OFF)
+
+# Active button label color
+button_label_active_color = (WHITE,BLUE,ON)
+
+# Inactive button label color
+button_label_inactive_color = (BLACK,CYAN,ON)
+
+# Input box color
+inputbox_color = (BLUE,WHITE,OFF)
+
+# Input box border color
+inputbox_border_color = (CYAN,CYAN,ON)
+
+# Search box color
+searchbox_color = (YELLOW,WHITE,ON)
+
+# Search box title color
+# FIXME
+searchbox_title_color = (WHITE,WHITE,ON)
+
+# Search box border color
+searchbox_border_color = (RED,WHITE,OFF)
+
+# File position indicator color
+position_indicator_color = (RED,CYAN,OFF)
+
+# Menu box color
+menubox_color = (BLACK,CYAN,OFF)
+
+# Menu box border color
+menubox_border_color = (CYAN,CYAN,ON)
+
+# Item color
+item_color = (BLACK,CYAN,OFF)
+
+# Selected item color
+item_selected_color = (WHITE,BLUE,OFF)
+
+# Tag color
+tag_color = (YELLOW,CYAN,ON)
+
+# Selected tag color
+tag_selected_color = (WHITE,BLUE,OFF)
+
+# Tag key color
+tag_key_color = (RED,CYAN,OFF)
+
+# Selected tag key color
+tag_key_selected_color = (RED,BLUE,ON)
+
+# Check box color
+check_color = (BLACK,CYAN,OFF)
+
+# Selected check box color
+check_selected_color = (WHITE,CYAN,ON)
+
+# Up arrow color
+uarrow_color = (GREEN,CYAN,ON)
+
+# Down arrow color
+darrow_color = (GREEN,CYAN,ON)
+
+# Item help-text color
+itemhelp_color = (WHITE,BLACK,OFF)
+
+# Active form text color
+form_active_text_color = (BLUE,WHITE,OFF)
+
+# Form text color
+form_text_color = (CYAN,BLUE,ON)
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/sourcemage.rc b/Build/source/utils/dialog/dialog-1.1-20080819/samples/sourcemage.rc
new file mode 100644
index 00000000000..bf187ea5e6c
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/sourcemage.rc
@@ -0,0 +1,123 @@
+# $Id: sourcemage.rc,v 1.3 2005/12/01 01:20:45 tom Exp $
+# Run-time configuration file for dialog, matches SourceMage color scheme.
+#
+# Types of values:
+#
+# Number - <number>
+# String - "string"
+# Boolean - <ON|OFF>
+# Attribute - (foreground,background,highlight?)
+
+# Set aspect-ration.
+aspect = 0
+
+# Set separator (for multiple widgets output).
+separate_widget = ""
+
+# Set tab-length (for textbox tab-conversion).
+tab_len = 0
+
+# Make tab-traversal for checklist, etc., include the list.
+visit_items = OFF
+
+# Shadow dialog boxes? This also turns on color.
+use_shadow = ON
+
+# Turn color support ON or OFF
+use_colors = ON
+
+# Screen color
+screen_color = (RED,BLACK,ON)
+
+# Shadow color
+shadow_color = (BLACK,BLACK,ON)
+
+# Dialog box color
+dialog_color = (BLACK,WHITE,OFF)
+
+# Dialog box title color
+title_color = (RED,WHITE,ON)
+
+# Dialog box border color
+border_color = (WHITE,WHITE,ON)
+
+# Active button color
+button_active_color = (WHITE,RED,ON)
+
+# Inactive button color
+button_inactive_color = (BLACK,WHITE,OFF)
+
+# Active button key color
+button_key_active_color = (WHITE,RED,ON)
+
+# Inactive button key color
+button_key_inactive_color = (RED,WHITE,OFF)
+
+# Active button label color
+button_label_active_color = (RED,RED,ON)
+
+# Inactive button label color
+button_label_inactive_color = (BLACK,WHITE,ON)
+
+# Input box color
+inputbox_color = (BLACK,WHITE,OFF)
+
+# Input box border color
+inputbox_border_color = (BLACK,WHITE,OFF)
+
+# Search box color
+searchbox_color = (BLACK,WHITE,OFF)
+
+# Search box title color
+searchbox_title_color = (RED,WHITE,ON)
+
+# Search box border color
+searchbox_border_color = (WHITE,WHITE,ON)
+
+# File position indicator color
+position_indicator_color = (RED,WHITE,ON)
+
+# Menu box color
+menubox_color = (BLACK,WHITE,OFF)
+
+# Menu box border color
+menubox_border_color = (WHITE,WHITE,ON)
+
+# Item color
+item_color = (BLACK,WHITE,OFF)
+
+# Selected item color
+item_selected_color = (WHITE,RED,ON)
+
+# Tag color
+tag_color = (RED,WHITE,ON)
+
+# Selected tag color
+tag_selected_color = (RED,RED,ON)
+
+# Tag key color
+tag_key_color = (RED,WHITE,ON)
+
+# Selected tag key color
+tag_key_selected_color = (WHITE,RED,ON)
+
+# Check box color
+check_color = (BLACK,WHITE,OFF)
+
+# Selected check box color
+check_selected_color = (WHITE,RED,ON)
+
+# Up arrow color
+uarrow_color = (RED,WHITE,ON)
+
+# Down arrow color
+darrow_color = (RED,WHITE,ON)
+
+# Item help-text color
+itemhelp_color = (WHITE,BLACK,OFF)
+
+# Active form text color
+form_active_text_color = (BLACK,WHITE,OFF)
+
+# Form text color
+form_text_color = (RED,BLACK,ON)
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/suse.rc b/Build/source/utils/dialog/dialog-1.1-20080819/samples/suse.rc
new file mode 100644
index 00000000000..233157d94ad
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/suse.rc
@@ -0,0 +1,126 @@
+# $Id: suse.rc,v 1.2 2007/02/25 17:49:12 tom Exp $
+# Run-time configuration file for dialog, matches SuSE color scheme.
+#
+# Types of values:
+#
+# Number - <number>
+# String - "string"
+# Boolean - <ON|OFF>
+# Attribute - (foreground,background,highlight?)
+
+# Set aspect-ration.
+aspect = 0
+
+# Set separator (for multiple widgets output).
+separate_widget = ""
+
+# Set tab-length (for textbox tab-conversion).
+tab_len = 0
+
+# Make tab-traversal for checklist, etc., include the list.
+visit_items = OFF
+
+# Shadow dialog boxes? This also turns on color.
+use_shadow = OFF
+
+# Turn color support ON or OFF
+use_colors = OFF
+
+# Screen color
+screen_color = (CYAN,BLUE,ON)
+
+# Shadow color
+shadow_color = (BLACK,BLACK,OFF)
+
+# Dialog box color
+dialog_color = (BLACK,WHITE,OFF)
+
+# Dialog box title color
+title_color = (YELLOW,WHITE,ON)
+
+# Dialog box border color
+border_color = (WHITE,WHITE,ON)
+
+# Active button color
+button_active_color = (WHITE,BLUE,ON)
+
+# Inactive button color
+button_inactive_color = (BLACK,WHITE,OFF)
+
+# Active button key color
+button_key_active_color = (WHITE,BLUE,ON)
+
+# Inactive button key color
+button_key_inactive_color = (RED,WHITE,OFF)
+
+# Active button label color
+button_label_active_color = (YELLOW,BLUE,ON)
+
+# Inactive button label color
+button_label_inactive_color = (BLACK,WHITE,ON)
+
+# Input box color
+inputbox_color = (BLACK,WHITE,OFF)
+
+# Input box border color
+inputbox_border_color = (BLACK,WHITE,OFF)
+
+# Search box color
+searchbox_color = (BLACK,WHITE,OFF)
+
+# Search box title color
+searchbox_title_color = (YELLOW,WHITE,ON)
+
+# Search box border color
+searchbox_border_color = (WHITE,WHITE,ON)
+
+# File position indicator color
+position_indicator_color = (YELLOW,WHITE,ON)
+
+# Menu box color
+menubox_color = (BLACK,WHITE,OFF)
+
+# Menu box border color
+menubox_border_color = (WHITE,WHITE,ON)
+
+# Item color
+item_color = (BLACK,WHITE,OFF)
+
+# Selected item color
+item_selected_color = (WHITE,BLUE,ON)
+
+# Tag color
+tag_color = (YELLOW,WHITE,ON)
+
+# Selected tag color
+tag_selected_color = (YELLOW,BLUE,ON)
+
+# Tag key color
+tag_key_color = (RED,WHITE,OFF)
+
+# Selected tag key color
+tag_key_selected_color = (RED,BLUE,ON)
+
+# Check box color
+check_color = (BLACK,WHITE,OFF)
+
+# Selected check box color
+check_selected_color = (WHITE,BLUE,ON)
+
+# Up arrow color
+uarrow_color = (GREEN,WHITE,ON)
+
+# Down arrow color
+darrow_color = (GREEN,WHITE,ON)
+
+# Item help-text color
+itemhelp_color = (WHITE,BLACK,OFF)
+
+# Active form text color
+form_active_text_color = (WHITE,BLUE,ON)
+
+# Form text color
+form_text_color = (WHITE,CYAN,ON)
+
+# Readonly form item color
+form_item_readonly_color = (CYAN,WHITE,ON)
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailbox b/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailbox
new file mode 100755
index 00000000000..e6b91c4be4f
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailbox
@@ -0,0 +1,18 @@
+#!/bin/sh
+# $Id: tailbox,v 1.3 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+./killall listing
+./listing >listing.out &
+
+$DIALOG --title "TAIL BOX" \
+ --tailbox listing.out 24 70
+
+case $? in
+ 0)
+ echo "OK";;
+ 255)
+ echo "ESC pressed.";;
+esac
+
+./killall listing
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg b/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg
new file mode 100755
index 00000000000..3ce938065de
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $Id: tailboxbg,v 1.5 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+./killall listing
+./listing >listing.out &
+
+$DIALOG --title "TAIL BOX" \
+ --no-kill \
+ --tailboxbg listing.out 24 70 2>$tempfile
+
+# wait a while for the background process to run
+sleep 10
+
+# now kill it
+kill -3 `cat $tempfile` 2>&1 >/dev/null 2>/dev/null
+
+# ...and the process that is making the listing
+./killall listing
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg1 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg1
new file mode 100755
index 00000000000..685e4d06d41
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg1
@@ -0,0 +1,32 @@
+#!/bin/sh
+# $Id: tailboxbg1,v 1.5 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+./killall listing
+./listing >listing.out &
+
+$DIALOG --title "TAIL BOXES" \
+ --begin 10 10 --tailboxbg listing.out 8 58 \
+ --and-widget \
+ --begin 15 15 --tailboxbg listing.out 8 58 \
+ --and-widget \
+ --begin 3 10 --msgbox "Press OK " 5 30 \
+ 2>$tempfile
+
+# The --and-widget causes a tab to be emitted, but our example will only
+# write one number to stderr.
+pid=`cat $tempfile |sed -e 's/ //g'`
+if test -n "$pid" ; then
+# wait a while for the background process to run
+sleep 10
+
+# now kill it
+kill -3 $pid 2>&1 >/dev/null 2>/dev/null
+echo "killed [$pid]"
+fi
+
+# ...and the process that is making the listing
+./killall listing
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg2
new file mode 100755
index 00000000000..820601cbdc2
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/tailboxbg2
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $Id: tailboxbg2,v 1.5 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+./killall listing
+./listing >listing.out &
+
+$DIALOG --title "TAIL BOXES" \
+ --no-kill \
+ --begin 10 10 --tailboxbg listing.out 8 58 \
+ --and-widget \
+ --begin 15 15 --tailboxbg listing.out 8 58 \
+ --and-widget \
+ --begin 3 10 --msgbox "Press OK " 5 30 \
+ 2>$tempfile
+
+# The --and-widget causes a tab to be emitted, but our example will only
+# write one number to stderr.
+pid=`cat $tempfile |sed -e 's/ //g'`
+if test -n "$pid" ; then
+# wait a while for the background process to run
+sleep 10
+
+# now kill it
+kill -3 $pid 2>&1 >/dev/null 2>/dev/null
+echo "killed [$pid]"
+fi
+
+# ...and the process that is making the listing
+./killall listing
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/testdata-8bit b/Build/source/utils/dialog/dialog-1.1-20080819/samples/testdata-8bit
new file mode 100755
index 00000000000..7810f9e34f2
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/testdata-8bit
@@ -0,0 +1,39 @@
+#!/bin/sh
+# $Id: testdata-8bit,v 1.1 2004/12/19 16:19:12 tom Exp $
+
+# Select one of the "SAMPLE=" lines, to test handling of characters which
+# are nonprinting in a POSIX locale:
+
+case .$1 in
+ # C1 controls
+.8)
+ SAMPLE="€‚ƒ„…†‡ˆ‰Š‹ŒŽ"
+ ;;
+.9)
+ SAMPLE="‘’“”•–—˜™š›œžŸ"
+ ;;
+
+# Latin-1
+.[aA])
+ SAMPLE=" ¡¢£¤¥¦§¨©ª«¬­®¯"
+ ;;
+.[bB])
+ SAMPLE="°±²³´µ¶·¸¹º»¼½¾¿"
+ ;;
+.[cC])
+ SAMPLE="ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ"
+ ;;
+.[dD])
+ SAMPLE="ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß"
+ ;;
+.[eE])
+ SAMPLE="àáâãäåæçèéêëìíîï"
+ ;;
+.[fF])
+ SAMPLE="ðñòóôõö÷øùúûüýþÿ"
+ ;;
+*)
+ # C0 controls (except a few which are always treated specially by curses):
+ SAMPLE=" "
+ ;;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox b/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox
new file mode 100755
index 00000000000..0b30ce3d682
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox
@@ -0,0 +1,53 @@
+#!/bin/sh
+# $Id: textbox,v 1.7 2005/12/07 01:02:47 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+cat << EOF > $tempfile
+Hi, this is a text dialog box. It can be used to display text from a file.
+The file should not contain any 'tab' characters, so you should 'expand'
+the file first if it contains 'tab' characters.
+
+It's like a simple text file viewer, with these keys implemented:
+
+PGDN/SPACE - Move down one page
+PGUP/'b' - Move up one page
+ENTER/DOWN/'j' - Move down one line
+UP/'k' - Move up one line
+LEFT/'h' - Scroll left
+RIGHT/'l' - Scroll right
+'0' - Move to beginning of line
+HOME/'g' - Move to beginning of file
+END/'G' - Move to end of file
+'/' - Forward search
+'?' - Backward search
+'n' - Repeat last search (forward)
+'N' - Repeat last search (backward)
+
+
+The following is a sample text file:
+
+
+EOF
+
+TEXT=/usr/share/common-licenses/GPL
+test -f $TEXT || TEXT=../COPYING
+
+cat $TEXT | expand >> $tempfile
+
+$DIALOG --clear --title "TEXT BOX" --textbox "$tempfile" 22 77
+
+case $? in
+ 0)
+ echo "OK";;
+ 1)
+ echo "Button 1 (Cancel) pressed";;
+ 2)
+ echo "Button 2 (Help) pressed";;
+ 3)
+ echo "Button 3 (Extra) pressed";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox.txt b/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox.txt
new file mode 100644
index 00000000000..3aaec0f8e5c
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox.txt
@@ -0,0 +1,24 @@
+Hi, this is a text dialog box. It can be used to display text from a file.
+The file should not contain any 'tab' characters, so you should 'expand'
+the file first if it contains 'tab' characters.
+
+It's like a simple text file viewer, with these keys implemented:
+
+PGDN/SPACE - Move down one page
+PGUP/'b' - Move up one page
+ENTER/DOWN/'j' - Move down one line
+UP/'k' - Move up one line
+LEFT/'h' - Scroll left
+RIGHT/'l' - Scroll right
+'0' - Move to beginning of line
+HOME/'g' - Move to beginning of file
+END/'G' - Move to end of file
+'/' - Forward search
+'?' - Backward search
+'n' - Repeat last search (forward)
+'N' - Repeat last search (backward)
+
+
+The following is a sample text file:
+
+
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox2
new file mode 100755
index 00000000000..c3098c1d403
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox2
@@ -0,0 +1,53 @@
+#!/bin/sh
+# $Id: textbox2,v 1.3 2005/12/07 01:03:22 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+cat << EOF > $tempfile
+Hi, this is a text dialog box. It can be used to display text from a file.
+The file should not contain any 'tab' characters, so you should 'expand'
+the file first if it contains 'tab' characters.
+
+It's like a simple text file viewer, with these keys implemented:
+
+PGDN/SPACE - Move down one page
+PGUP/'b' - Move up one page
+ENTER/DOWN/'j' - Move down one line
+UP/'k' - Move up one line
+LEFT/'h' - Scroll left
+RIGHT/'l' - Scroll right
+'0' - Move to beginning of line
+HOME/'g' - Move to beginning of file
+END/'G' - Move to end of file
+'/' - Forward search
+'?' - Backward search
+'n' - Repeat last search (forward)
+'N' - Repeat last search (backward)
+
+
+The following is a sample text file:
+
+
+EOF
+
+TEXT=/usr/share/common-licenses/GPL
+test -f $TEXT || TEXT=../COPYING
+
+cat $TEXT | expand >> $tempfile
+
+$DIALOG --clear --title "TEXT BOX" --textbox "$tempfile" 0 0
+
+case $? in
+ 0)
+ echo "OK";;
+ 1)
+ echo "Button 1 (Cancel) pressed";;
+ 2)
+ echo "Button 2 (Help) pressed";;
+ 3)
+ echo "Button 3 (Extra) pressed";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox3
new file mode 100755
index 00000000000..bf4803dd3ab
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/textbox3
@@ -0,0 +1,29 @@
+#!/bin/sh
+# $Id: textbox3,v 1.1 2005/12/05 22:07:56 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+trap "rm -f $tempfile" 0 1 2 5 15
+
+TEXT=/usr/share/common-licenses/GPL
+test -f $TEXT || TEXT=../COPYING
+
+cat textbox.txt | expand > $tempfile
+cat $TEXT | expand >> $tempfile
+
+$DIALOG --clear --title "TEXT BOX" \
+ --extra-button \
+ --textbox "$tempfile" 22 77
+
+case $? in
+ 0)
+ echo "Button 0 (OK) pressed.";;
+ 1)
+ echo "Button 1 (Cancel) pressed.";;
+ 2)
+ echo "Button 2 (Help) pressed.";;
+ 3)
+ echo "Button 3 (Extra) pressed.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox b/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox
new file mode 100755
index 00000000000..7ebfb79ac03
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox
@@ -0,0 +1,17 @@
+#!/bin/sh
+# $Id: timebox,v 1.4 2003/10/09 22:45:06 tom Exp $
+: ${DIALOG=dialog}
+
+exec 3>&1
+USERTIME=`$DIALOG --title "TIMEBOX" --timebox "Please set the time..." 0 0 12 34 56 2>&1 1>&3`
+code=$?
+exec 3>&-
+
+case $code in
+ 0)
+ echo "Time entered: $USERTIME.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox-stdout b/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox-stdout
new file mode 100755
index 00000000000..82ba27671ca
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox-stdout
@@ -0,0 +1,14 @@
+#!/bin/sh
+# $Id: timebox-stdout,v 1.1 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+USERTIME=`$DIALOG --stdout --title "TIMEBOX" --timebox "Please set the time..." 0 0 12 34 56`
+
+case $? in
+ 0)
+ echo "Time entered: $USERTIME.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox2
new file mode 100755
index 00000000000..50f8d21153a
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox2
@@ -0,0 +1,17 @@
+#!/bin/sh
+# $Id: timebox2,v 1.3 2003/10/09 22:45:06 tom Exp $
+: ${DIALOG=dialog}
+
+exec 3>&1
+USERTIME=`$DIALOG --title "TIMEBOX" --timebox "Please set the time..." 0 0 2>&1 1>&3`
+code=$?
+exec 3>&-
+
+case $code in
+ 0)
+ echo "Time entered: $USERTIME.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox2-stdout b/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox2-stdout
new file mode 100755
index 00000000000..52205289711
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/timebox2-stdout
@@ -0,0 +1,14 @@
+#!/bin/sh
+# $Id: timebox2-stdout,v 1.1 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+USERTIME=`$DIALOG --stdout --title "TIMEBOX" --timebox "Please set the time..." 0 0`
+
+case $? in
+ 0)
+ echo "Time entered: $USERTIME.";;
+ 1)
+ echo "Cancel pressed.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/wheel b/Build/source/utils/dialog/dialog-1.1-20080819/samples/wheel
new file mode 100755
index 00000000000..720171b74fe
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/wheel
@@ -0,0 +1,63 @@
+#!/bin/sh
+# $Id: wheel,v 1.4 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
+
+TITLE="This screen was taken from ComeOn Point Installer! v0.9 by ComeOn Linux!"
+
+$DIALOG --print-maxsize 2>$tempfile
+ROWS="`cut $tempfile -f1 -d, | cut -f2 -d:`"
+COLS="`cut $tempfile -f2 -d,`"
+rm $tempfile
+
+# account for widest labels
+COLS=`expr $COLS - 30`
+
+# Takes an integer, multiplies it for COLS, divides for 132
+scalex() {
+ echo $[$1*$COLS/132]
+}
+scaley() {
+ echo $[$1*$ROWS/60]
+}
+
+$DIALOG --backtitle "$TITLE" --no-shadow \
+--begin `scaley 27` `scalex 98` --infobox "pushd /var/log >/dev/null" 0 0 --and-widget \
+--begin `scaley 35` `scalex 95` --infobox "mkdir -p news -m 755" 0 0 --and-widget \
+--begin `scaley 45` `scalex 86` --infobox "chown news.news news" 0 0 --and-widget \
+--begin `scaley 48` `scalex 78` --infobox "cd /var/log/news" 0 0 --and-widget \
+--begin `scaley 51` `scalex 61` --infobox "mkdir -p OLD -m 755" 0 0 --and-widget \
+--begin `scaley 52` `scalex 47` --infobox "chown news.news OLD" 0 0 --and-widget \
+--begin `scaley 51` `scalex 40` --infobox "cd /var/spool" 0 0 --and-widget \
+--begin `scaley 48` `scalex 25` --infobox "mkdir -p news -m 775" 0 0 --and-widget \
+--begin `scaley 42` `scalex 13` --infobox "chown news.news news" 0 0 --and-widget \
+--begin `scaley 35` `scalex 4` --infobox "cd /var/spool/news" 0 0 --and-widget \
+--begin `scaley 27` `scalex 2` --infobox "CURMASK=`umask`" 0 0 --and-widget \
+--begin `scaley 19` `scalex 4` --infobox "umask 02" 0 0 --and-widget \
+--begin `scaley 11` `scalex 13` --infobox "mkdir -p out.going control junk in.coming" 0 0 --and-widget \
+--begin `scaley 5` `scalex 25` --infobox "chown news.news out.going control junk in.coming" 0 0 --and-widget \
+--begin `scaley 2` `scalex 37` --infobox "cd in.coming" 0 0 --and-widget \
+--begin `scaley 1` `scalex 46` --infobox "mkdir -p bad tmp" 0 0 --and-widget \
+--begin `scaley 2` `scalex 61` --infobox "chown news.news bad tmp" 0 0 --and-widget \
+--begin `scaley 5` `scalex 76` --infobox "umask $CURMASK" 0 0 --and-widget \
+--begin `scaley 11` `scalex 87` --infobox "ln -sf ~news /usr/local/lib/" 0 0 --and-widget \
+--begin `scaley 18` `scalex 95` --infobox "ln -sf ~news/inews /usr/bin/" 0 0 --and-widget \
+--begin `scaley 26` `scalex 97` --infobox "chmod 1777 /var/tmp" 0 0 --and-widget \
+--begin `scaley 34` `scalex 95` --infobox "cd ~news" 0 0 --and-widget \
+--begin `scaley 42` `scalex 87` --infobox "touch history history.dir history.pag errlog log" 0 0 --and-widget \
+--begin `scaley 47` `scalex 76` --infobox "chown news.news history* log errlog" 0 0 --and-widget \
+--infobox "Creating spooling and logging directories and files..." 0 0 --and-widget \
+--begin `scaley 51` `scalex 78` --infobox "chmod 664 history* log errlog" 0 0 --and-widget \
+--begin `scaley 52` `scalex 60` --infobox "echo \"control 0000000000 0000000001 y\" > active" 0 0 --and-widget \
+--begin `scaley 51` `scalex 42` --infobox "echo \"junk 0000000000 0000000001 y\" >> active" 0 0 --and-widget \
+--begin `scaley 48` `scalex 26` --infobox "chown news.news active" 0 0 --and-widget \
+--begin `scaley 42` `scalex 13` --infobox "echo \"control 814573260 usenet\" > active.times" 0 0 --and-widget \
+--begin `scaley 35` `scalex 4` --infobox "echo \"junk 814573260 usenet\" >> active.times" 0 0 --and-widget \
+--begin `scaley 27` `scalex 2` --infobox "chown news.news active.times" 0 0 --and-widget \
+--begin `scaley 19` `scalex 4` --infobox ":>newsgroups" 0 0 --and-widget \
+--begin `scaley 11` `scalex 12` --infobox "chown news.news newsgroups" 0 0 --and-widget \
+--sleep 2 --begin `scaley 6` `scalex 25` --infobox "popd >/dev/null" 0 0 --and-widget \
+--beep --msgbox "ComeOn Linux! :-)" 0 0 --and-widget \
+--begin 2 0 --title "/var/adm/debug. This is running while that down runs also" --tailboxbg /var/adm/debug 6 80 --and-widget \
+--begin 8 0 --title "/var/adm/messages. It tails the file in multitasking with /var/adm/debug" --tailbox /var/adm/messages -1 -1
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/whiptail.rc b/Build/source/utils/dialog/dialog-1.1-20080819/samples/whiptail.rc
new file mode 100644
index 00000000000..47d5032a733
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/whiptail.rc
@@ -0,0 +1,116 @@
+# $Id: whiptail.rc,v 1.2 2005/12/01 01:21:31 tom Exp $
+# Run-time configuration file for dialog, matches whiptail's color scheme.
+
+# Set aspect-ration.
+aspect = 0
+
+# Set separator (for multiple widgets output).
+separate_widget = ""
+
+# Set tab-length (for textbox tab-conversion).
+tab_len = 0
+
+# Make tab-traversal for checklist, etc., include the list.
+visit_items = ON
+
+# Shadow dialog boxes? This also turns on color.
+use_shadow = ON
+
+# Turn color support ON or OFF
+use_colors = ON
+
+# Screen color
+screen_color = (YELLOW,BLUE,ON)
+
+# Shadow color
+shadow_color = (BLACK,BLACK,ON)
+
+# Dialog box color
+dialog_color = (BLACK,WHITE,OFF)
+
+# Dialog box title color
+title_color = (RED,WHITE,ON)
+
+# Dialog box border color
+border_color = (WHITE,WHITE,ON)
+
+# Active button color
+button_active_color = (WHITE,RED,ON)
+
+# Inactive button color
+button_inactive_color = (BLACK,WHITE,OFF)
+
+# Active button key color
+button_key_active_color = (WHITE,RED,ON)
+
+# Inactive button key color
+button_key_inactive_color = (BLACK,WHITE,OFF)
+
+# Active button label color
+button_label_active_color = (WHITE,RED,ON)
+
+# Inactive button label color
+button_label_inactive_color = (BLACK,WHITE,ON)
+
+# Input box color
+inputbox_color = (BLACK,WHITE,OFF)
+
+# Input box border color
+inputbox_border_color = (BLACK,WHITE,OFF)
+
+# Search box color
+searchbox_color = (BLACK,WHITE,OFF)
+
+# Search box title color
+searchbox_title_color = (RED,WHITE,ON)
+
+# Search box border color
+searchbox_border_color = (WHITE,WHITE,ON)
+
+# File position indicator color
+position_indicator_color = (RED,WHITE,ON)
+
+# Menu box color
+menubox_color = (YELLOW,BLUE,OFF)
+
+# Menu box border color
+menubox_border_color = (YELLOW,BLUE,ON)
+
+# Item color
+item_color = (YELLOW,BLUE,OFF)
+
+# Selected item color
+item_selected_color = (YELLOW,BLUE,ON)
+
+# Tag color
+tag_color = (YELLOW,BLUE,ON)
+
+# Selected tag color
+tag_selected_color = (YELLOW,BLUE,ON)
+
+# Tag key color
+tag_key_color = (YELLOW,BLUE,OFF)
+
+# Selected tag key color
+tag_key_selected_color = (WHITE,BLUE,ON)
+
+# Check box color
+check_color = (YELLOW,BLUE,OFF)
+
+# Selected check box color
+check_selected_color = (YELLOW,BLUE,ON)
+
+# Up arrow color
+uarrow_color = (YELLOW,BLUE,ON)
+
+# Down arrow color
+darrow_color = (YELLOW,BLUE,ON)
+
+# Item help-text color
+itemhelp_color = (WHITE,BLACK,OFF)
+
+# Active form text color
+form_active_text_color = (WHITE,BLUE,ON)
+
+# Form text color
+form_text_color = (WHITE,CYAN,ON)
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno
new file mode 100755
index 00000000000..0432acbe837
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $Id: yesno,v 1.3 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "YES/NO BOX" --clear \
+ --yesno "Hi, this is a yes/no dialog box. You can use this to ask \
+ questions that have an answer of either yes or no. \
+ BTW, do you notice that long lines will be automatically \
+ wrapped around so that they can fit in the box? You can \
+ also control line breaking explicitly by inserting \
+ 'backslash n' at any place you like, but in this case, \
+ auto wrap around will be disabled and you will have to \
+ control line breaking yourself." 15 61
+
+case $? in
+ 0)
+ echo "Yes chosen.";;
+ 1)
+ echo "No chosen.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno-both b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno-both
new file mode 100755
index 00000000000..68860dc0ecd
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno-both
@@ -0,0 +1,32 @@
+#!/bin/sh
+# $Id: yesno-both,v 1.1 2005/12/05 21:15:54 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "YES/NO/MAYBE BOX" \
+ --clear \
+ --ok-label "Next" \
+ --no-label "Cancel" \
+ --extra-label "Previous" --extra-button \
+ --help-button \
+ --yesno "Hi, this is a yes/no dialog box with its labels changed. \
+ You can use this to ask \
+ questions that have an answer of either yes or no (or maybe). \
+ BTW, do you notice that long lines will be automatically \
+ wrapped around so that they can fit in the box? You can \
+ also control line breaking explicitly by inserting \
+ 'backslash n' at any place you like, but in this case, \
+ auto wrap around will be disabled and you will have to \
+ control line breaking yourself." 15 61
+
+case $? in
+ 0)
+ echo "Next chosen.";;
+ 1)
+ echo "Cancel chosen.";;
+ 2)
+ echo "Help pressed.";;
+ 3)
+ echo "Previous pressed.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno-extra b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno-extra
new file mode 100755
index 00000000000..8876ac614f7
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno-extra
@@ -0,0 +1,31 @@
+#!/bin/sh
+# $Id: yesno-extra,v 1.1 2005/12/05 21:16:29 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "YES/NO/MAYBE BOX" \
+ --clear \
+ --ok-label "Next" \
+ --no-label "Cancel" \
+ --extra-label "Previous" --extra-button \
+ --yesno "Hi, this is a yes/no dialog box with its labels changed. \
+ You can use this to ask \
+ questions that have an answer of either yes or no (or maybe). \
+ BTW, do you notice that long lines will be automatically \
+ wrapped around so that they can fit in the box? You can \
+ also control line breaking explicitly by inserting \
+ 'backslash n' at any place you like, but in this case, \
+ auto wrap around will be disabled and you will have to \
+ control line breaking yourself." 15 61
+
+case $? in
+ 0)
+ echo "Next chosen.";;
+ 1)
+ echo "Cancel chosen.";;
+ 2)
+ echo "Help pressed.";;
+ 3)
+ echo "Previous pressed.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno-help b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno-help
new file mode 100755
index 00000000000..e14ecfa57bc
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno-help
@@ -0,0 +1,26 @@
+#!/bin/sh
+# $Id: yesno-help,v 1.1 2005/12/05 21:04:27 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "YES/NO BOX" --clear --help-button \
+ --yesno "Hi, this is a yes/no dialog box. You can use this to ask \
+ questions that have an answer of either yes or no. \
+ BTW, do you notice that long lines will be automatically \
+ wrapped around so that they can fit in the box? You can \
+ also control line breaking explicitly by inserting \
+ 'backslash n' at any place you like, but in this case, \
+ auto wrap around will be disabled and you will have to \
+ control line breaking yourself." 15 61
+
+case $? in
+ 0)
+ echo "Yes chosen.";;
+ 1)
+ echo "No chosen.";;
+ 2)
+ echo "Help pressed.";;
+ 3)
+ echo "Extra pressed.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno2 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno2
new file mode 100755
index 00000000000..a6553336112
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno2
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $Id: yesno2,v 1.3 2005/12/05 21:00:00 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --title "YES/NO BOX" \
+ --yesno "Hi, this is a yes/no dialog box. You can use this to ask \
+questions that have an answer of either yes or no. \
+BTW, do you notice that long lines will be automatically \
+wrapped around so that they can fit in the box? You can \
+also control line breaking explicitly by inserting \
+'backslash n' at any place you like, but in this case, \
+auto wrap around will be disabled and you will have to \
+control line breaking yourself." 0 0
+
+case $? in
+ 0)
+ echo "Yes chosen.";;
+ 1)
+ echo "No chosen.";;
+ 255)
+ echo "ESC pressed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno3 b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno3
new file mode 100755
index 00000000000..a16dfe9220a
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/samples/yesno3
@@ -0,0 +1,22 @@
+#!/bin/sh
+# $Id: yesno3,v 1.2 2003/08/15 19:40:37 tom Exp $
+: ${DIALOG=dialog}
+
+$DIALOG --timeout 20 --title "YES/NO BOX" \
+ --yesno "Hi, this is a yes/no dialog box. You can use this to ask \
+questions that have an answer of either yes or no. \
+BTW, do you notice that long lines will be automatically \
+wrapped around so that they can fit in the box? You can \
+also control line breaking explicitly by inserting \
+'backslash n' at any place you like, but in this case, \
+auto wrap around will be disabled and you will have to \
+control line breaking yourself." 0 0
+
+case $? in
+ 0)
+ echo "Yes chosen.";;
+ 1)
+ echo "No chosen.";;
+ 255)
+ echo "Box closed.";;
+esac
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/tailbox.c b/Build/source/utils/dialog/dialog-1.1-20080819/tailbox.c
new file mode 100644
index 00000000000..298dbfc5858
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/tailbox.c
@@ -0,0 +1,364 @@
+/*
+ * $Id: tailbox.c,v 1.52 2007/05/14 23:07:11 tom Exp $
+ *
+ * tailbox.c -- implements the tail box
+ *
+ * Copyright 2000-2006,2007 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors
+ * Pasquale De Marco (demarco_p@abramo.it)
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+typedef struct {
+ DIALOG_CALLBACK obj;
+ WINDOW *text;
+ const char **buttons;
+ int hscroll;
+ int old_hscroll;
+ char line[MAX_LEN + 1];
+} MY_OBJ;
+
+/*
+ * Return current line of text.
+ */
+static char *
+get_line(MY_OBJ * obj)
+{
+ FILE *fp = obj->obj.input;
+ int col = -(obj->hscroll);
+ int j, tmpint, ch;
+
+ do {
+ if (((ch = getc(fp)) == EOF) && !feof(fp))
+ dlg_exiterr("Error moving file pointer in get_line().");
+ else if (!feof(fp) && (ch != '\n')) {
+ if ((ch == TAB) && (dialog_vars.tab_correct)) {
+ tmpint = dialog_state.tab_len
+ - ((col + obj->hscroll) % dialog_state.tab_len);
+ for (j = 0; j < tmpint; j++) {
+ if (col >= 0 && col < MAX_LEN)
+ obj->line[col] = ' ';
+ ++col;
+ }
+ } else {
+ if (col >= 0)
+ obj->line[col] = ch;
+ ++col;
+ }
+ if (col >= MAX_LEN)
+ break;
+ }
+ } while (!feof(fp) && (ch != '\n'));
+
+ if (col < 0)
+ col = 0;
+ obj->line[col] = '\0';
+
+ return obj->line;
+}
+
+/*
+ * Print a new line of text.
+ */
+static void
+print_line(MY_OBJ * obj, WINDOW *win, int row, int width)
+{
+ int i, y, x;
+ char *line = get_line(obj);
+
+ (void) wmove(win, row, 0); /* move cursor to correct line */
+ (void) waddch(win, ' ');
+#ifdef NCURSES_VERSION
+ (void) waddnstr(win, line, MIN((int) strlen(line), width - 2));
+#else
+ line[MIN((int) strlen(line), width - 2)] = '\0';
+ waddstr(win, line);
+#endif
+
+ getyx(win, y, x);
+ /* Clear 'residue' of previous line */
+ for (i = 0; i < width - x; i++)
+ (void) waddch(win, ' ');
+}
+
+/*
+ * Go back 'target' lines in text file. BUFSIZ has to be in 'size_t' range.
+ */
+static void
+last_lines(MY_OBJ * obj, int target)
+{
+ FILE *fp = obj->obj.input;
+ int inx;
+ int count = 0;
+ char buf[BUFSIZ + 1];
+ size_t size_to_read;
+ size_t offset = 0;
+ long fpos = 0;
+
+ if (fseek(fp, 0, SEEK_END) == -1
+ || (fpos = ftell(fp)) < 0)
+ dlg_exiterr("Error moving file pointer in last_lines().");
+
+ if (fpos != 0) {
+ ++target;
+ for (;;) {
+ if (fpos >= BUFSIZ) {
+ size_to_read = (size_t) BUFSIZ;
+ } else {
+ size_to_read = ((size_t) fpos);
+ }
+ fpos -= size_to_read;
+ if (fseek(fp, fpos, SEEK_SET) == -1)
+ dlg_exiterr("Error moving file pointer in last_lines().");
+ (void) fread(buf, size_to_read, 1, fp);
+ if (ferror(fp))
+ dlg_exiterr("Error reading file in last_lines().");
+
+ offset += size_to_read;
+ for (inx = size_to_read - 1; inx >= 0; --inx) {
+ if (buf[inx] == '\n') {
+ if (++count > target)
+ break;
+ offset = inx + 1;
+ }
+ }
+
+ if (count > target) {
+ break;
+ } else if (fpos == 0) {
+ offset = 0;
+ break;
+ }
+ }
+
+ if (fseek(fp, fpos + offset, SEEK_SET) == -1)
+ dlg_exiterr("Error moving file pointer in last_lines().");
+ }
+}
+
+/*
+ * Print a new page of text.
+ */
+static void
+print_page(MY_OBJ * obj, int height, int width)
+{
+ int i;
+
+ for (i = 0; i < height; i++) {
+ print_line(obj, obj->text, i, width);
+ }
+ (void) wnoutrefresh(obj->text);
+}
+
+static void
+print_last_page(MY_OBJ * obj)
+{
+ int high = getmaxy(obj->obj.win) - (2 * MARGIN + (obj->obj.bg_task ? 1 : 3));
+ int wide = getmaxx(obj->text);
+
+ last_lines(obj, high);
+ print_page(obj, high, wide);
+}
+
+static void
+repaint_text(MY_OBJ * obj)
+{
+ int cur_y, cur_x;
+
+ getyx(obj->obj.win, cur_y, cur_x);
+ obj->old_hscroll = obj->hscroll;
+ print_last_page(obj);
+ (void) wmove(obj->obj.win, cur_y, cur_x); /* Restore cursor position */
+ wrefresh(obj->obj.win);
+}
+
+static bool
+handle_my_getc(DIALOG_CALLBACK * cb, int ch, int fkey, int *result)
+{
+ MY_OBJ *obj = (MY_OBJ *) cb;
+ bool done = FALSE;
+
+ if (!fkey && dlg_char_to_button(ch, obj->buttons) == 0) {
+ ch = DLGK_ENTER;
+ fkey = TRUE;
+ }
+
+ if (fkey) {
+ switch (ch) {
+ case DLGK_ENTER:
+ *result = DLG_EXIT_OK;
+ done = TRUE;
+ break;
+ case DLGK_BEGIN: /* Beginning of line */
+ obj->hscroll = 0;
+ break;
+ case DLGK_GRID_LEFT: /* Scroll left */
+ if (obj->hscroll > 0) {
+ obj->hscroll -= 1;
+ }
+ break;
+ case DLGK_GRID_RIGHT: /* Scroll right */
+ if (obj->hscroll < MAX_LEN)
+ obj->hscroll += 1;
+ break;
+ default:
+ beep();
+ break;
+ }
+ if ((obj->hscroll != obj->old_hscroll))
+ repaint_text(obj);
+ } else {
+ switch (ch) {
+ case ERR:
+ ch = getc(cb->input);
+ (void) ungetc(ch, cb->input);
+ if ((ch != EOF) || (obj->hscroll != obj->old_hscroll)) {
+ repaint_text(obj);
+ }
+ break;
+ case ESC:
+ done = TRUE;
+ *result = DLG_EXIT_ESC;
+ break;
+ default:
+ beep();
+ break;
+ }
+ }
+
+ return !done;
+}
+
+/*
+ * Display text from a file in a dialog box, like in a "tail -f".
+ */
+int
+dialog_tailbox(const char *title, const char *file, int height, int width, int bg_task)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_BEGIN, '0' ),
+ DLG_KEYS_DATA( DLGK_BEGIN, KEY_BEG ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, 'H' ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, 'h' ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, KEY_LEFT ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, 'L' ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, 'l' ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, KEY_RIGHT ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+ int fkey;
+ int x, y, result, thigh;
+ WINDOW *dialog, *text;
+ const char **buttons = 0;
+ MY_OBJ *obj;
+ FILE *fd;
+
+ /* Open input file for reading */
+ if ((fd = fopen(file, "rb")) == NULL)
+ dlg_exiterr("Can't open input file in dialog_tailbox().");
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+ dlg_auto_sizefile(title, file, &height, &width, 2, 12);
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+ thigh = height - ((2 * MARGIN) + (bg_task ? 0 : 2));
+
+ dialog = dlg_new_window(height, width, y, x);
+
+ dlg_mouse_setbase(x, y);
+
+ /* Create window for text region, used for scrolling text */
+ text = dlg_sub_window(dialog,
+ thigh,
+ width - (2 * MARGIN),
+ y + MARGIN,
+ x + MARGIN);
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ if (!bg_task) {
+ buttons = dlg_exit_label();
+ dlg_draw_buttons(dialog, height - (2 * MARGIN), 0, buttons, FALSE,
+ FALSE, width);
+ }
+
+ (void) wmove(dialog, thigh, (MARGIN + 1));
+ (void) wnoutrefresh(dialog);
+
+ obj = dlg_calloc(MY_OBJ, 1);
+ assert_ptr(obj, "dialog_tailbox");
+
+ obj->obj.input = fd;
+ obj->obj.win = dialog;
+ obj->obj.handle_getc = handle_my_getc;
+ obj->obj.keep_bg = bg_task && dialog_vars.cant_kill;
+ obj->obj.bg_task = bg_task;
+ obj->text = text;
+ obj->buttons = buttons;
+ dlg_add_callback(&(obj->obj));
+
+ dlg_register_window(dialog, "tailbox", binding);
+ dlg_register_buttons(dialog, "tailbox", buttons);
+
+ /* Print last page of text */
+ dlg_attr_clear(text, thigh, getmaxx(text), dialog_attr);
+ repaint_text(obj);
+
+ if (bg_task) {
+ result = DLG_EXIT_OK;
+ } else {
+ int ch;
+ do {
+ ch = dlg_getc(dialog, &fkey);
+#ifdef KEY_RESIZE
+ if (fkey && ch == KEY_RESIZE) {
+ /* reset data */
+ height = old_height;
+ width = old_width;
+ /* repaint */
+ dlg_clear();
+ dlg_del_window(dialog);
+ refresh();
+ dlg_mouse_free_regions();
+ goto retry;
+ }
+#endif
+ }
+ while (handle_my_getc(&(obj->obj), ch, fkey, &result));
+ }
+ dlg_mouse_free_regions();
+ return result;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/textbox.c b/Build/source/utils/dialog/dialog-1.1-20080819/textbox.c
new file mode 100644
index 00000000000..fa60aa714eb
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/textbox.c
@@ -0,0 +1,961 @@
+/*
+ * $Id: textbox.c,v 1.92 2007/07/04 20:28:07 tom Exp $
+ *
+ * textbox.c -- implements the text box
+ *
+ * Copyright 2000-2006,2007 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors:
+ * Savio Lam (lam836@cs.cuhk.hk)
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#define PAGE_LENGTH (height - 4)
+#define PAGE_WIDTH (width - 2)
+
+typedef struct {
+ DIALOG_CALLBACK obj;
+ WINDOW *text;
+ const char **buttons;
+ int hscroll;
+ char line[MAX_LEN + 1];
+ int fd;
+ long file_size;
+ long fd_bytes_read;
+ long bytes_read;
+ long buffer_len;
+ bool begin_reached;
+ bool buffer_first;
+ bool end_reached;
+ long page_length; /* lines on the page which is shown */
+ long in_buf; /* ending index into buf[] for page */
+ char *buf;
+} MY_OBJ;
+
+static long
+lseek_obj(MY_OBJ * obj, long offset, int mode)
+{
+ long fpos;
+ if ((fpos = lseek(obj->fd, offset, mode)) == -1) {
+ switch (mode) {
+ case SEEK_CUR:
+ dlg_exiterr("Cannot get file position");
+ break;
+ case SEEK_END:
+ dlg_exiterr("Cannot seek to end of file");
+ break;
+ case SEEK_SET:
+ dlg_exiterr("Cannot set file position to %ld", offset);
+ break;
+ }
+ }
+ return fpos;
+}
+
+static long
+ftell_obj(MY_OBJ * obj)
+{
+ return lseek_obj(obj, 0, SEEK_CUR);
+}
+
+static char *
+xalloc(long size)
+{
+ char *result = dlg_malloc(char, size);
+ assert_ptr(result, "xalloc");
+ return result;
+}
+
+/*
+ * read_high() substitutes read() for tab->spaces conversion
+ *
+ * buffer_len, fd_bytes_read, bytes_read are modified
+ * buf is allocated
+ *
+ * fd_bytes_read is the effective number of bytes read from file
+ * bytes_read is the length of buf, that can be different if tab_correct
+ */
+static void
+read_high(MY_OBJ * obj, size_t size_read)
+{
+ char *buftab, ch;
+ int i = 0, j, n, tmpint;
+ long begin_line;
+
+ /* Allocate space for read buffer */
+ buftab = xalloc(size_read + 1);
+
+ if ((obj->fd_bytes_read = read(obj->fd, buftab, size_read)) != -1) {
+
+ buftab[obj->fd_bytes_read] = '\0'; /* mark end of valid data */
+
+ if (dialog_vars.tab_correct) {
+
+ /* calculate bytes_read by buftab and fd_bytes_read */
+ obj->bytes_read = begin_line = 0;
+ for (j = 0; j < obj->fd_bytes_read; j++)
+ if (buftab[j] == TAB)
+ obj->bytes_read += dialog_state.tab_len
+ - ((obj->bytes_read - begin_line)
+ % dialog_state.tab_len);
+ else if (buftab[j] == '\n') {
+ obj->bytes_read++;
+ begin_line = obj->bytes_read;
+ } else
+ obj->bytes_read++;
+
+ if (obj->bytes_read > obj->buffer_len) {
+ if (obj->buffer_first)
+ obj->buffer_first = FALSE; /* disp = 0 */
+ else {
+ free(obj->buf);
+ }
+
+ obj->buffer_len = obj->bytes_read;
+
+ /* Allocate space for read buffer */
+ obj->buf = xalloc(obj->buffer_len + 1);
+ }
+
+ } else {
+ if (obj->buffer_first) {
+ obj->buffer_first = FALSE;
+
+ /* Allocate space for read buffer */
+ obj->buf = xalloc(size_read + 1);
+ }
+
+ obj->bytes_read = obj->fd_bytes_read;
+ }
+
+ j = 0;
+ begin_line = 0;
+ while (j < obj->fd_bytes_read)
+ if (((ch = buftab[j++]) == TAB) && (dialog_vars.tab_correct != 0)) {
+ tmpint = (dialog_state.tab_len
+ - ((int) ((long) i - begin_line) % dialog_state.tab_len));
+ for (n = 0; n < tmpint; n++)
+ obj->buf[i++] = ' ';
+ } else {
+ if (ch == '\n')
+ begin_line = i + 1;
+ obj->buf[i++] = ch;
+ }
+
+ obj->buf[i] = '\0'; /* mark end of valid data */
+
+ }
+ if (obj->bytes_read == -1)
+ dlg_exiterr("Error reading file");
+ free(buftab);
+}
+
+static long
+find_first(MY_OBJ * obj, char *buffer, long length)
+{
+ long recount = obj->page_length;
+ long result = 0;
+
+ while (length > 0) {
+ if (buffer[length] == '\n') {
+ if (--recount < 0) {
+ result = length;
+ break;
+ }
+ }
+ --length;
+ }
+ return result;
+}
+
+static long
+tabize(MY_OBJ * obj, long val, long *first_pos)
+{
+ long fpos;
+ long i, count, begin_line;
+ char *buftab;
+
+ if (!dialog_vars.tab_correct)
+ return val;
+
+ fpos = ftell_obj(obj);
+
+ lseek_obj(obj, fpos - obj->fd_bytes_read, SEEK_SET);
+
+ /* Allocate space for read buffer */
+ buftab = xalloc(val + 1);
+
+ if ((read(obj->fd, buftab, val)) == -1)
+ dlg_exiterr("Error reading file in tabize().");
+
+ begin_line = count = 0;
+ if (first_pos != 0)
+ *first_pos = 0;
+
+ for (i = 0; i < val; i++) {
+ if ((first_pos != 0) && (count >= val)) {
+ *first_pos = find_first(obj, buftab, i);
+ break;
+ }
+ if (buftab[i] == TAB)
+ count += dialog_state.tab_len
+ - ((count - begin_line) % dialog_state.tab_len);
+ else if (buftab[i] == '\n') {
+ count++;
+ begin_line = count;
+ } else
+ count++;
+ }
+
+ lseek_obj(obj, fpos, SEEK_SET);
+ free(buftab);
+ return count;
+}
+/*
+ * Return current line of text.
+ * 'page' should point to start of current line before calling, and will be
+ * updated to point to start of next line.
+ */
+static char *
+get_line(MY_OBJ * obj)
+{
+ int i = 0;
+ long fpos;
+
+ obj->end_reached = FALSE;
+ while (obj->buf[obj->in_buf] != '\n') {
+ if (obj->buf[obj->in_buf] == '\0') { /* Either end of file or end of buffer reached */
+ fpos = ftell_obj(obj);
+
+ if (fpos < obj->file_size) { /* Not end of file yet */
+ /* We've reached end of buffer, but not end of file yet, so
+ * read next part of file into buffer
+ */
+ read_high(obj, BUF_SIZE);
+ obj->in_buf = 0;
+ } else {
+ if (!obj->end_reached)
+ obj->end_reached = TRUE;
+ break;
+ }
+ } else if (i < MAX_LEN)
+ obj->line[i++] = obj->buf[obj->in_buf++];
+ else {
+ if (i == MAX_LEN) /* Truncate lines longer than MAX_LEN characters */
+ obj->line[i++] = '\0';
+ obj->in_buf++;
+ }
+ }
+ if (i <= MAX_LEN)
+ obj->line[i] = '\0';
+ if (!obj->end_reached)
+ obj->in_buf++; /* move past '\n' */
+
+ return obj->line;
+}
+
+static bool
+match_string(MY_OBJ * obj, char *string)
+{
+ char *match = get_line(obj);
+ return strstr(match, string) != 0;
+}
+
+/*
+ * Go back 'n' lines in text file. Called by dialog_textbox().
+ * 'in_buf' will be updated to point to the desired line in 'buf'.
+ */
+static void
+back_lines(MY_OBJ * obj, long n)
+{
+ int i;
+ long fpos;
+ long val_to_tabize;
+
+ obj->begin_reached = FALSE;
+ /* We have to distinguish between end_reached and !end_reached since at end
+ * of file, the line is not ended by a '\n'. The code inside 'if'
+ * basically does a '--in_buf' to move one character backward so as to
+ * skip '\n' of the previous line */
+ if (!obj->end_reached) {
+ /* Either beginning of buffer or beginning of file reached? */
+
+ if (obj->in_buf == 0) {
+ fpos = ftell_obj(obj);
+
+ if (fpos > obj->fd_bytes_read) { /* Not beginning of file yet */
+ /* We've reached beginning of buffer, but not beginning of file
+ * yet, so read previous part of file into buffer. Note that
+ * we only move backward for BUF_SIZE/2 bytes, but not BUF_SIZE
+ * bytes to avoid re-reading again in print_page() later
+ */
+ /* Really possible to move backward BUF_SIZE/2 bytes? */
+ if (fpos < BUF_SIZE / 2 + obj->fd_bytes_read) {
+ /* No, move less than */
+ lseek_obj(obj, 0, SEEK_SET);
+ val_to_tabize = fpos - obj->fd_bytes_read;
+ } else { /* Move backward BUF_SIZE/2 bytes */
+ lseek_obj(obj, -(BUF_SIZE / 2 + obj->fd_bytes_read), SEEK_CUR);
+ val_to_tabize = BUF_SIZE / 2;
+ }
+ read_high(obj, BUF_SIZE);
+
+ obj->in_buf = tabize(obj, val_to_tabize, (long *) 0);
+
+ } else { /* Beginning of file reached */
+ obj->begin_reached = TRUE;
+ return;
+ }
+ }
+ obj->in_buf--;
+ if (obj->buf[obj->in_buf] != '\n')
+ /* Something's wrong... */
+ dlg_exiterr("Internal error in back_lines().");
+ }
+
+ /* Go back 'n' lines */
+ for (i = 0; i < n; i++) {
+ do {
+ if (obj->in_buf == 0) {
+ fpos = ftell_obj(obj);
+
+ if (fpos > obj->fd_bytes_read) {
+ /* Really possible to move backward BUF_SIZE/2 bytes? */
+ if (fpos < BUF_SIZE / 2 + obj->fd_bytes_read) {
+ /* No, move less than */
+ lseek_obj(obj, 0, SEEK_SET);
+ val_to_tabize = fpos - obj->fd_bytes_read;
+ } else { /* Move backward BUF_SIZE/2 bytes */
+ lseek_obj(obj, -(BUF_SIZE / 2 + obj->fd_bytes_read), SEEK_CUR);
+ val_to_tabize = BUF_SIZE / 2;
+ }
+ read_high(obj, BUF_SIZE);
+
+ obj->in_buf = tabize(obj, val_to_tabize, (long *) 0);
+
+ } else { /* Beginning of file reached */
+ obj->begin_reached = TRUE;
+ return;
+ }
+ }
+ } while (obj->buf[--(obj->in_buf)] != '\n');
+ }
+ obj->in_buf++;
+}
+
+/*
+ * Print a new line of text.
+ */
+static void
+print_line(MY_OBJ * obj, int row, int width)
+{
+ if (wmove(obj->text, row, 0) != ERR) {
+ int i, y, x;
+ char *line = get_line(obj);
+ const int *cols = dlg_index_columns(line);
+ const int *indx = dlg_index_wchars(line);
+ int limit = dlg_count_wchars(line);
+ int first = 0;
+ int last = limit;
+
+ if (width > getmaxx(obj->text))
+ width = getmaxx(obj->text);
+ --width; /* for the leading ' ' */
+
+ for (i = 0; i <= limit && cols[i] < obj->hscroll; ++i)
+ first = i;
+
+ for (i = first; (i <= limit) && ((cols[i] - cols[first]) < width); ++i)
+ last = i;
+
+ (void) waddch(obj->text, ' ');
+ (void) waddnstr(obj->text, line + indx[first], indx[last] - indx[first]);
+
+ getyx(obj->text, y, x);
+ if (y == row) { /* Clear 'residue' of previous line */
+ for (i = 0; i <= width - x; i++) {
+ (void) waddch(obj->text, ' ');
+ }
+ }
+ }
+}
+
+/*
+ * Print a new page of text.
+ */
+static void
+print_page(MY_OBJ * obj, int height, int width)
+{
+ int i, passed_end = 0;
+
+ obj->page_length = 0;
+ for (i = 0; i < height; i++) {
+ print_line(obj, i, width);
+ if (!passed_end)
+ obj->page_length++;
+ if (obj->end_reached && !passed_end)
+ passed_end = 1;
+ }
+ (void) wnoutrefresh(obj->text);
+}
+
+/*
+ * Print current position
+ */
+static void
+print_position(MY_OBJ * obj, WINDOW *win, int height, int width)
+{
+ chtype save = getattrs(win);
+ long fpos;
+ long size;
+ int percent;
+ int len;
+ long first = -1;
+ char buffer[80];
+
+ fpos = ftell_obj(obj);
+ if (dialog_vars.tab_correct)
+ size = tabize(obj, obj->in_buf, &first);
+ else
+ first = find_first(obj, obj->buf, size = obj->in_buf);
+
+ wattrset(win, position_indicator_attr);
+ percent = (!obj->file_size
+ ? 100
+ : (int) (((fpos - obj->fd_bytes_read + size) * 100)
+ / obj->file_size));
+
+ if (percent < 0)
+ percent = 0;
+ if (percent > 100)
+ percent = 100;
+
+ (void) sprintf(buffer, "%d%%", percent);
+ (void) wmove(win, PAGE_LENGTH + 1, PAGE_WIDTH - 7);
+ (void) waddstr(win, buffer);
+ if ((len = dlg_count_columns(buffer)) < 4) {
+ wattrset(win, border_attr);
+ whline(win, dlg_boxchar(ACS_HLINE), 4 - len);
+ }
+
+ wattrset(win, save);
+ dlg_draw_arrows2(win,
+ first != 0,
+ size < obj->fd_bytes_read,
+ ARROWS_COL, 0, PAGE_LENGTH + 1,
+ border_attr,
+ border_attr);
+}
+
+/*
+ * Display a dialog box and get the search term from user.
+ */
+static int
+get_search_term(WINDOW *dialog, char *input, int height, int width)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ INPUTSTR_BINDINGS,
+ ENTERKEY_BINDINGS,
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+ int old_x, old_y;
+ int box_x, box_y;
+ int box_height, box_width;
+ int offset = 0;
+ int key = 0;
+ int fkey = 0;
+ bool first = TRUE;
+ int result = DLG_EXIT_UNKNOWN;
+ char *caption = _("Search");
+ int len_caption = dlg_count_columns(caption);
+ const int *indx;
+ int limit;
+ WINDOW *widget;
+
+ getbegyx(dialog, old_y, old_x);
+
+ box_height = 1 + (2 * MARGIN);
+ box_width = len_caption + (2 * (MARGIN + 2));
+ box_width = MAX(box_width, 30);
+ box_width = MIN(box_width, getmaxx(dialog) - 2 * MARGIN);
+ len_caption = MIN(len_caption, box_width - (2 * (MARGIN + 1)));
+
+ box_x = (width - box_width) / 2;
+ box_y = (height - box_height) / 2;
+ widget = dlg_new_modal_window(dialog,
+ box_height, box_width,
+ old_y + box_y, old_x + box_x);
+ keypad(widget, TRUE);
+ dlg_register_window(widget, "searchbox", binding);
+
+ dlg_draw_box(widget, 0, 0, box_height, box_width,
+ searchbox_attr,
+ searchbox_border_attr);
+ wattrset(widget, searchbox_title_attr);
+ (void) wmove(widget, 0, (box_width - len_caption) / 2);
+
+ indx = dlg_index_wchars(caption);
+ limit = dlg_limit_columns(caption, len_caption, 0);
+ (void) waddnstr(widget, caption + indx[0], indx[limit] - indx[0]);
+
+ box_y++;
+ box_x++;
+ box_width -= 2;
+ offset = dlg_count_columns(input);
+
+ while (result == DLG_EXIT_UNKNOWN) {
+ if (!first) {
+ key = dlg_getc(widget, &fkey);
+ if (fkey) {
+ switch (fkey) {
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ result = DLG_EXIT_CANCEL;
+ continue;
+#endif
+ case DLGK_ENTER:
+ result = DLG_EXIT_OK;
+ continue;
+ }
+ } else if (key == ESC) {
+ result = DLG_EXIT_ESC;
+ continue;
+ } else if (key == ERR) {
+ napms(50);
+ continue;
+ }
+ }
+ if (dlg_edit_string(input, &offset, key, fkey, first)) {
+ dlg_show_string(widget, input, offset, searchbox_attr,
+ 1, 1, box_width, FALSE, first);
+ first = FALSE;
+ }
+ }
+ dlg_del_window(widget);
+ return result;
+}
+
+static bool
+perform_search(MY_OBJ * obj, int height, int width, int key, char *search_term)
+{
+ int dir;
+ long tempinx;
+ long fpos;
+ int result;
+ bool found;
+ bool temp, temp1;
+ bool moved = FALSE;
+
+ /* set search direction */
+ dir = (key == '/' || key == 'n') ? 1 : 0;
+ if (dir ? !obj->end_reached : !obj->begin_reached) {
+ if (key == 'n' || key == 'N') {
+ if (search_term[0] == '\0') { /* No search term yet */
+ (void) beep();
+ return FALSE;
+ }
+ /* Get search term from user */
+ } else if ((result = get_search_term(obj->text, search_term,
+ PAGE_LENGTH,
+ PAGE_WIDTH)) != DLG_EXIT_OK
+ || search_term[0] == '\0') {
+#ifdef KEY_RESIZE
+ if (result == DLG_EXIT_CANCEL) {
+ ungetch(key);
+ ungetch(KEY_RESIZE);
+ /* FALLTHRU */
+ }
+#endif
+ /* ESC pressed, or no search term, reprint page to clear box */
+ wattrset(obj->text, dialog_attr);
+ back_lines(obj, obj->page_length);
+ return TRUE;
+ }
+ /* Save variables for restoring in case search term can't be found */
+ tempinx = obj->in_buf;
+ temp = obj->begin_reached;
+ temp1 = obj->end_reached;
+ fpos = ftell_obj(obj) - obj->fd_bytes_read;
+ /* update 'in_buf' to point to next (previous) line before
+ forward (backward) searching */
+ back_lines(obj, (dir
+ ? obj->page_length - 1
+ : obj->page_length + 1));
+ found = FALSE;
+ if (dir) { /* Forward search */
+ while ((found = match_string(obj, search_term)) == FALSE) {
+ if (obj->end_reached)
+ break;
+ }
+ } else { /* Backward search */
+ while ((found = match_string(obj, search_term)) == FALSE) {
+ if (obj->begin_reached)
+ break;
+ back_lines(obj, 2);
+ }
+ }
+ if (found == FALSE) { /* not found */
+ (void) beep();
+ /* Restore program state to that before searching */
+ lseek_obj(obj, fpos, SEEK_SET);
+
+ read_high(obj, BUF_SIZE);
+
+ obj->in_buf = tempinx;
+ obj->begin_reached = temp;
+ obj->end_reached = temp1;
+ /* move 'in_buf' to point to start of current page to
+ * re-print current page. Note that 'in_buf' always points
+ * to start of next page, so this is necessary
+ */
+ back_lines(obj, obj->page_length);
+ } else { /* Search term found */
+ back_lines(obj, 1);
+ }
+ /* Reprint page */
+ wattrset(obj->text, dialog_attr);
+ moved = TRUE;
+ } else { /* no need to find */
+ (void) beep();
+ }
+ return moved;
+}
+
+/*
+ * Display text from a file in a dialog box.
+ */
+int
+dialog_textbox(const char *title, const char *file, int height, int width)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, 'J' ),
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, 'j' ),
+ DLG_KEYS_DATA( DLGK_GRID_DOWN, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, 'H' ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, 'h' ),
+ DLG_KEYS_DATA( DLGK_GRID_LEFT, KEY_LEFT ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, 'L' ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, 'l' ),
+ DLG_KEYS_DATA( DLGK_GRID_RIGHT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, 'K' ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, 'k' ),
+ DLG_KEYS_DATA( DLGK_GRID_UP, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_PAGE_FIRST, 'g' ),
+ DLG_KEYS_DATA( DLGK_PAGE_FIRST, KEY_HOME ),
+ DLG_KEYS_DATA( DLGK_PAGE_LAST, 'G' ),
+ DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_END ),
+ DLG_KEYS_DATA( DLGK_PAGE_LAST, KEY_LL ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, ' ' ),
+ DLG_KEYS_DATA( DLGK_PAGE_NEXT, KEY_NPAGE ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, 'B' ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, 'b' ),
+ DLG_KEYS_DATA( DLGK_PAGE_PREV, KEY_PPAGE ),
+ DLG_KEYS_DATA( DLGK_BEGIN, '0' ),
+ DLG_KEYS_DATA( DLGK_BEGIN, KEY_BEG ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+ long fpos;
+ int x, y, cur_x, cur_y;
+ int key = 0, fkey;
+ int next = 0;
+ int i, code, passed_end;
+ char search_term[MAX_LEN + 1];
+ MY_OBJ obj;
+ WINDOW *dialog;
+ bool moved;
+ int result = DLG_EXIT_UNKNOWN;
+ int button = dialog_vars.extra_button ? dlg_defaultno_button() : 0;
+
+ search_term[0] = '\0'; /* no search term entered yet */
+
+ memset(&obj, 0, sizeof(obj));
+
+ obj.begin_reached = TRUE;
+ obj.buffer_first = TRUE;
+ obj.end_reached = FALSE;
+ obj.buttons = dlg_exit_label();
+
+ /* Open input file for reading */
+ if ((obj.fd = open(file, O_RDONLY)) == -1)
+ dlg_exiterr("Can't open input file %s", file);
+
+ /* Get file size. Actually, 'file_size' is the real file size - 1,
+ since it's only the last byte offset from the beginning */
+ obj.file_size = lseek_obj(&obj, 0, SEEK_END);
+
+ /* Restore file pointer to beginning of file after getting file size */
+ lseek_obj(&obj, 0, SEEK_SET);
+
+ read_high(&obj, BUF_SIZE);
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+ moved = TRUE;
+
+ dlg_auto_sizefile(title, file, &height, &width, 2, 12);
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+ dialog = dlg_new_window(height, width, y, x);
+ dlg_register_window(dialog, "textbox", binding);
+ dlg_register_buttons(dialog, "textbox", obj.buttons);
+
+ dlg_mouse_setbase(x, y);
+
+ /* Create window for text region, used for scrolling text */
+ obj.text = dlg_sub_window(dialog, PAGE_LENGTH, PAGE_WIDTH, y + 1, x + 1);
+
+ /* register the new window, along with its borders */
+ dlg_mouse_mkbigregion(0, 0, PAGE_LENGTH + 2, width, KEY_MAX, 1, 1, 1 /* lines */ );
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ dlg_draw_buttons(dialog, PAGE_LENGTH + 2, 0, obj.buttons, button, FALSE, width);
+ (void) wnoutrefresh(dialog);
+ getyx(dialog, cur_y, cur_x); /* Save cursor position */
+
+ dlg_attr_clear(obj.text, PAGE_LENGTH, PAGE_WIDTH, dialog_attr);
+
+ while (result == DLG_EXIT_UNKNOWN) {
+
+ /*
+ * Update the screen according to whether we shifted up/down by a line
+ * or not.
+ */
+ if (moved) {
+ if (next < 0) {
+ (void) scrollok(obj.text, TRUE);
+ (void) scroll(obj.text); /* Scroll text region up one line */
+ (void) scrollok(obj.text, FALSE);
+ print_line(&obj, PAGE_LENGTH - 1, PAGE_WIDTH);
+ (void) wnoutrefresh(obj.text);
+ } else if (next > 0) {
+ /*
+ * We don't call print_page() here but use scrolling to ensure
+ * faster screen update. However, 'end_reached' and
+ * 'page_length' should still be updated, and 'in_buf' should
+ * point to start of next page. This is done by calling
+ * get_line() in the following 'for' loop.
+ */
+ (void) scrollok(obj.text, TRUE);
+ (void) wscrl(obj.text, -1); /* Scroll text region down one line */
+ (void) scrollok(obj.text, FALSE);
+ obj.page_length = 0;
+ passed_end = 0;
+ for (i = 0; i < PAGE_LENGTH; i++) {
+ if (!i) {
+ print_line(&obj, 0, PAGE_WIDTH); /* print first line of page */
+ (void) wnoutrefresh(obj.text);
+ } else
+ (void) get_line(&obj); /* Called to update 'end_reached' and 'in_buf' */
+ if (!passed_end)
+ obj.page_length++;
+ if (obj.end_reached && !passed_end)
+ passed_end = 1;
+ }
+ } else {
+ print_page(&obj, PAGE_LENGTH, PAGE_WIDTH);
+ }
+ print_position(&obj, dialog, height, width);
+ (void) wmove(dialog, cur_y, cur_x); /* Restore cursor position */
+ wrefresh(dialog);
+ }
+ moved = FALSE; /* assume we'll not move */
+ next = 0; /* ...but not scroll by a line */
+
+ key = dlg_mouse_wgetch(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+
+ if (!fkey && (code = dlg_char_to_button(key, obj.buttons)) >= 0) {
+ result = dlg_ok_buttoncode(code);
+ break;
+ }
+
+ if (fkey) {
+ switch (key) {
+ default:
+ if (is_DLGK_MOUSE(key)) {
+ result = dlg_exit_buttoncode(key - M_EVENT);
+ if (result < 0)
+ result = DLG_EXIT_OK;
+ } else {
+ beep();
+ }
+ break;
+ case DLGK_FIELD_NEXT:
+ button = dlg_next_button(obj.buttons, button);
+ if (button < 0)
+ button = 0;
+ dlg_draw_buttons(dialog,
+ height - 2, 0,
+ obj.buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_FIELD_PREV:
+ button = dlg_prev_button(obj.buttons, button);
+ if (button < 0)
+ button = 0;
+ dlg_draw_buttons(dialog,
+ height - 2, 0,
+ obj.buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_ENTER:
+ result = dlg_exit_buttoncode(button);
+ break;
+ case DLGK_PAGE_FIRST:
+ if (!obj.begin_reached) {
+ obj.begin_reached = 1;
+ /* First page not in buffer? */
+ fpos = ftell_obj(&obj);
+
+ if (fpos > obj.fd_bytes_read) {
+ /* Yes, we have to read it in */
+ lseek_obj(&obj, 0, SEEK_SET);
+
+ read_high(&obj, BUF_SIZE);
+ }
+ obj.in_buf = 0;
+ moved = TRUE;
+ }
+ break;
+ case DLGK_PAGE_LAST:
+ obj.end_reached = TRUE;
+ /* Last page not in buffer? */
+ fpos = ftell_obj(&obj);
+
+ if (fpos < obj.file_size) {
+ /* Yes, we have to read it in */
+ lseek_obj(&obj, -BUF_SIZE, SEEK_END);
+
+ read_high(&obj, BUF_SIZE);
+ }
+ obj.in_buf = obj.bytes_read;
+ back_lines(&obj, PAGE_LENGTH);
+ moved = TRUE;
+ break;
+ case DLGK_GRID_UP: /* Previous line */
+ if (!obj.begin_reached) {
+ back_lines(&obj, obj.page_length + 1);
+ next = 1;
+ moved = TRUE;
+ }
+ break;
+ case DLGK_PAGE_PREV: /* Previous page */
+ case DLGK_MOUSE(KEY_PPAGE):
+ if (!obj.begin_reached) {
+ back_lines(&obj, obj.page_length + PAGE_LENGTH);
+ moved = TRUE;
+ }
+ break;
+ case DLGK_GRID_DOWN: /* Next line */
+ if (!obj.end_reached) {
+ obj.begin_reached = 0;
+ next = -1;
+ moved = TRUE;
+ }
+ break;
+ case DLGK_PAGE_NEXT: /* Next page */
+ case DLGK_MOUSE(KEY_NPAGE):
+ if (!obj.end_reached) {
+ obj.begin_reached = 0;
+ moved = TRUE;
+ }
+ break;
+ case DLGK_BEGIN: /* Beginning of line */
+ if (obj.hscroll > 0) {
+ obj.hscroll = 0;
+ /* Reprint current page to scroll horizontally */
+ back_lines(&obj, obj.page_length);
+ moved = TRUE;
+ }
+ break;
+ case DLGK_GRID_LEFT: /* Scroll left */
+ if (obj.hscroll > 0) {
+ obj.hscroll--;
+ /* Reprint current page to scroll horizontally */
+ back_lines(&obj, obj.page_length);
+ moved = TRUE;
+ }
+ break;
+ case DLGK_GRID_RIGHT: /* Scroll right */
+ if (obj.hscroll < MAX_LEN) {
+ obj.hscroll++;
+ /* Reprint current page to scroll horizontally */
+ back_lines(&obj, obj.page_length);
+ moved = TRUE;
+ }
+ break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ /* reset data */
+ height = old_height;
+ width = old_width;
+ back_lines(&obj, obj.page_length);
+ moved = TRUE;
+ /* repaint */
+ dlg_clear();
+ dlg_del_window(dialog);
+ refresh();
+ dlg_mouse_free_regions();
+ goto retry;
+#endif
+ }
+ } else {
+ switch (key) {
+ case '/': /* Forward search */
+ case 'n': /* Repeat forward search */
+ case '?': /* Backward search */
+ case 'N': /* Repeat backward search */
+ moved = perform_search(&obj, height, width, key, search_term);
+ fkey = FALSE;
+ break;
+ default:
+ beep();
+ break;
+ }
+ }
+ }
+
+ dlg_del_window(dialog);
+ free(obj.buf);
+ (void) close(obj.fd);
+ dlg_mouse_free_regions();
+ return result;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/timebox.c b/Build/source/utils/dialog/dialog-1.1-20080819/timebox.c
new file mode 100644
index 00000000000..517a14c0244
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/timebox.c
@@ -0,0 +1,388 @@
+/*
+ * $Id: timebox.c,v 1.38 2008/06/21 12:34:06 tom Exp $
+ *
+ * timebox.c -- implements the timebox dialog
+ *
+ * Copyright 2001-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#include <time.h>
+
+#define ONE_HIGH 1
+#define ONE_WIDE 2
+#define BTN_HIGH 2
+
+#define MIN_HIGH (ONE_HIGH + BTN_HIGH + (4 * MARGIN))
+#define MIN_WIDE ((3 * (ONE_WIDE + 2 * MARGIN)) + 2 + (2 * MARGIN))
+
+typedef enum {
+ sHR = -3
+ ,sMN = -2
+ ,sSC = -1
+} STATES;
+
+struct _box;
+
+typedef int (*BOX_DRAW) (struct _box *, struct tm *);
+
+typedef struct _box {
+ WINDOW *parent;
+ WINDOW *window;
+ int x;
+ int y;
+ int width;
+ int height;
+ int period;
+ int value;
+} BOX;
+
+static int
+next_or_previous(int key)
+{
+ int result = 0;
+
+ switch (key) {
+ case DLGK_ITEM_PREV:
+ result = -1;
+ break;
+ case DLGK_ITEM_NEXT:
+ result = 1;
+ break;
+ default:
+ beep();
+ break;
+ }
+ return result;
+}
+/*
+ * Draw the hour-of-month selection box
+ */
+static int
+draw_cell(BOX * data)
+{
+ werase(data->window);
+ dlg_draw_box(data->parent,
+ data->y - MARGIN, data->x - MARGIN,
+ data->height + (2 * MARGIN), data->width + (2 * MARGIN),
+ menubox_border_attr, menubox_attr);
+
+ wattrset(data->window, item_attr);
+ wprintw(data->window, "%02d", data->value);
+ return 0;
+}
+
+static int
+init_object(BOX * data,
+ WINDOW *parent,
+ int x, int y,
+ int width, int height,
+ int period, int value,
+ int code)
+{
+ data->parent = parent;
+ data->x = x;
+ data->y = y;
+ data->width = width;
+ data->height = height;
+ data->period = period;
+ data->value = value % period;
+
+ data->window = derwin(data->parent,
+ data->height, data->width,
+ data->y, data->x);
+ if (data->window == 0)
+ return -1;
+ (void) keypad(data->window, TRUE);
+
+ dlg_mouse_setbase(getbegx(parent), getbegy(parent));
+ dlg_mouse_mkregion(y, x, height, width, code);
+
+ return 0;
+}
+
+static int
+CleanupResult(int code, WINDOW *dialog, char *prompt, DIALOG_VARS *save_vars)
+{
+ dlg_del_window(dialog);
+ dlg_mouse_free_regions();
+ free(prompt);
+ dlg_restore_vars(save_vars);
+
+ return code;
+}
+
+#define DrawObject(data) draw_cell(data)
+
+/*
+ * Display a dialog box for entering a date
+ */
+int
+dialog_timebox(const char *title,
+ const char *subtitle,
+ int height,
+ int width,
+ int hour,
+ int minute,
+ int second)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ DLG_KEYS_DATA( DLGK_DELETE_RIGHT,KEY_DC ),
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
+ DLG_KEYS_DATA( DLGK_FIELD_FIRST,KEY_HOME ),
+ DLG_KEYS_DATA( DLGK_FIELD_LAST, KEY_END ),
+ DLG_KEYS_DATA( DLGK_FIELD_LAST, KEY_LL ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, CHR_NEXT ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, CHR_BACKSPACE ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, CHR_PREVIOUS ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_DOWN),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_NEXT),
+ DLG_KEYS_DATA( DLGK_ITEM_NEXT, KEY_NPAGE),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_PPAGE ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_PREVIOUS ),
+ DLG_KEYS_DATA( DLGK_ITEM_PREV, KEY_UP ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+#ifdef KEY_RESIZE
+ int old_height = height;
+ int old_width = width;
+#endif
+ BOX hr_box, mn_box, sc_box;
+ int key = 0, key2, fkey;
+ int button;
+ int result = DLG_EXIT_UNKNOWN;
+ WINDOW *dialog;
+ time_t now_time = time((time_t *) 0);
+ struct tm current;
+ int state = dlg_defaultno_button();
+ const char **buttons = dlg_ok_labels();
+ char *prompt = dlg_strclone(subtitle);
+ char buffer[MAX_LEN];
+ DIALOG_VARS save_vars;
+
+ now_time = time((time_t *) 0);
+ current = *localtime(&now_time);
+
+ dlg_save_vars(&save_vars);
+ dialog_vars.separate_output = TRUE;
+
+ dlg_does_output();
+
+#ifdef KEY_RESIZE
+ retry:
+#endif
+
+ dlg_auto_size(title, prompt, &height, &width, 0, 0);
+ height += MIN_HIGH;
+ if (width < MIN_WIDE)
+ width = MIN_WIDE;
+ dlg_button_layout(buttons, &width);
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ dialog = dlg_new_window(height, width,
+ dlg_box_y_ordinate(height),
+ dlg_box_x_ordinate(width));
+ dlg_register_window(dialog, "timebox", binding);
+ dlg_register_buttons(dialog, "timebox", buttons);
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+ dlg_print_autowrap(dialog, prompt, height, width);
+
+ /* compute positions of hour, month and year boxes */
+ memset(&hr_box, 0, sizeof(hr_box));
+ memset(&mn_box, 0, sizeof(mn_box));
+ memset(&sc_box, 0, sizeof(sc_box));
+
+ if (init_object(&hr_box,
+ dialog,
+ (width - MIN_WIDE + 1) / 2 + MARGIN,
+ (height - MIN_HIGH + MARGIN),
+ ONE_WIDE,
+ ONE_HIGH,
+ 24,
+ hour >= 0 ? hour : current.tm_hour,
+ 'H') < 0
+ || DrawObject(&hr_box) < 0) {
+ return CleanupResult(DLG_EXIT_ERROR, dialog, prompt, &save_vars);
+ }
+
+ mvwprintw(dialog, hr_box.y, hr_box.x + ONE_WIDE + MARGIN, ":");
+ if (init_object(&mn_box,
+ dialog,
+ hr_box.x + (ONE_WIDE + 2 * MARGIN + 1),
+ hr_box.y,
+ hr_box.width,
+ hr_box.height,
+ 60,
+ minute >= 0 ? minute : current.tm_min,
+ 'M') < 0
+ || DrawObject(&mn_box) < 0) {
+ return CleanupResult(DLG_EXIT_ERROR, dialog, prompt, &save_vars);
+ }
+
+ mvwprintw(dialog, mn_box.y, mn_box.x + ONE_WIDE + MARGIN, ":");
+ if (init_object(&sc_box,
+ dialog,
+ mn_box.x + (ONE_WIDE + 2 * MARGIN + 1),
+ mn_box.y,
+ mn_box.width,
+ mn_box.height,
+ 60,
+ second >= 0 ? second : current.tm_sec,
+ 'S') < 0
+ || DrawObject(&sc_box) < 0) {
+ return CleanupResult(DLG_EXIT_ERROR, dialog, prompt, &save_vars);
+ }
+
+ while (result == DLG_EXIT_UNKNOWN) {
+ BOX *obj = (state == sHR ? &hr_box
+ : (state == sMN ? &mn_box :
+ (state == sSC ? &sc_box : 0)));
+
+ button = (state < 0) ? 0 : state;
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
+ if (obj != 0)
+ dlg_set_focus(dialog, obj->window);
+
+ key = dlg_mouse_wgetch(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+
+ if ((key2 = dlg_char_to_button(key, buttons)) >= 0) {
+ result = key2;
+ } else {
+ /* handle function-keys */
+ if (fkey) {
+ switch (key) {
+ case DLGK_MOUSE(0):
+ result = DLG_EXIT_OK;
+ break;
+ case DLGK_MOUSE(1):
+ result = DLG_EXIT_CANCEL;
+ break;
+ case DLGK_MOUSE('H'):
+ state = sHR;
+ break;
+ case DLGK_MOUSE('M'):
+ state = sMN;
+ break;
+ case DLGK_MOUSE('S'):
+ state = sSC;
+ break;
+ case DLGK_ENTER:
+ result = button;
+ break;
+ case DLGK_FIELD_PREV:
+ state = dlg_prev_ok_buttonindex(state, sHR);
+ break;
+ case DLGK_FIELD_NEXT:
+ state = dlg_next_ok_buttonindex(state, sHR);
+ break;
+ case DLGK_FIELD_FIRST:
+ if (obj != 0) {
+ obj->value = 0;
+ (void) DrawObject(obj);
+ }
+ break;
+ case DLGK_FIELD_LAST:
+ if (obj != 0) {
+ switch (state) {
+ case sHR:
+ obj->value = 23;
+ break;
+ case sMN:
+ case sSC:
+ obj->value = 59;
+ break;
+ }
+ (void) DrawObject(obj);
+ }
+ break;
+ case DLGK_DELETE_RIGHT:
+ if (obj != 0) {
+ obj->value /= 10;
+ (void) DrawObject(obj);
+ }
+ break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ /* reset data */
+ height = old_height;
+ width = old_width;
+ hour = hr_box.value;
+ minute = mn_box.value;
+ second = sc_box.value;
+ /* repaint */
+ dlg_clear();
+ dlg_del_window(dialog);
+ refresh();
+ dlg_mouse_free_regions();
+ goto retry;
+#endif
+ default:
+ if (obj != 0) {
+ int step = next_or_previous(key);
+ if (step != 0) {
+ obj->value += step;
+ while (obj->value < 0)
+ obj->value += obj->period;
+ obj->value %= obj->period;
+ (void) DrawObject(obj);
+ }
+ }
+ break;
+ }
+ } else if (isdigit(key)) {
+ if (obj != 0) {
+ int digit = (key - '0');
+ int value = (obj->value * 10) + digit;
+ if (value < obj->period) {
+ obj->value = value;
+ (void) DrawObject(obj);
+ } else {
+ beep();
+ }
+ }
+ } else {
+ beep();
+ }
+ }
+ }
+
+ sprintf(buffer, "%02d:%02d:%02d",
+ hr_box.value, mn_box.value, sc_box.value);
+ dlg_add_result(buffer);
+ dlg_add_separator();
+
+ return CleanupResult(result, dialog, prompt, &save_vars);
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/trace.c b/Build/source/utils/dialog/dialog-1.1-20080819/trace.c
new file mode 100644
index 00000000000..69ad13973f2
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/trace.c
@@ -0,0 +1,154 @@
+/*
+ * $Id: trace.c,v 1.8 2008/06/20 00:17:45 tom Exp $
+ *
+ * trace.c -- implements screen-dump and keystroke-logging
+ *
+ * Copyright 2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ *
+ * 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+
+#ifdef HAVE_DLG_TRACE
+
+#include <dlg_keys.h>
+#include <time.h>
+
+#define myFP dialog_state.trace_output
+
+void
+dlg_trace_msg(const char *fmt,...)
+{
+ if (myFP != 0) {
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(myFP, fmt, ap);
+ va_end(ap);
+ fflush(myFP);
+ }
+}
+
+void
+dlg_trace_win(WINDOW *win)
+{
+ if (myFP != 0) {
+ int y, x;
+ int j, k;
+ int rc = getmaxy(win);
+ int cc = getmaxx(win);
+ chtype ch, c2;
+
+ fprintf(myFP, "window %dx%d at %d,%d\n",
+ rc, cc, getbegy(win), getbegx(win));
+
+ getyx(win, y, x);
+ for (j = 0; j < rc; ++j) {
+ fprintf(myFP, "%3d:", j);
+ for (k = 0; k < cc; ++k) {
+ ch = mvwinch(win, j, k) & (A_CHARTEXT | A_ALTCHARSET);
+ c2 = dlg_asciibox(ch);
+ if (c2 != 0) {
+ ch = c2;
+ } else if (unctrl(ch) == 0 || strlen(unctrl(ch)) > 1) {
+ ch = '.';
+ }
+ fputc(ch & 0xff, myFP);
+ }
+ fputc('\n', myFP);
+ }
+ wmove(win, y, x);
+ fflush(myFP);
+ }
+}
+
+void
+dlg_trace_chr(int ch, int fkey)
+{
+ if (myFP != 0) {
+ const char *fkey_name = "?";
+ if (fkey) {
+ if (fkey > KEY_MAX || (fkey_name = keyname(fkey)) == 0) {
+#define CASE(name) case name: fkey_name = #name; break
+ switch ((DLG_KEYS_ENUM) fkey) {
+ CASE(DLGK_MIN);
+ CASE(DLGK_OK);
+ CASE(DLGK_CANCEL);
+ CASE(DLGK_EXTRA);
+ CASE(DLGK_HELP);
+ CASE(DLGK_ESC);
+ CASE(DLGK_PAGE_FIRST);
+ CASE(DLGK_PAGE_LAST);
+ CASE(DLGK_PAGE_NEXT);
+ CASE(DLGK_PAGE_PREV);
+ CASE(DLGK_ITEM_FIRST);
+ CASE(DLGK_ITEM_LAST);
+ CASE(DLGK_ITEM_NEXT);
+ CASE(DLGK_ITEM_PREV);
+ CASE(DLGK_FIELD_FIRST);
+ CASE(DLGK_FIELD_LAST);
+ CASE(DLGK_FIELD_NEXT);
+ CASE(DLGK_FIELD_PREV);
+ CASE(DLGK_GRID_UP);
+ CASE(DLGK_GRID_DOWN);
+ CASE(DLGK_GRID_LEFT);
+ CASE(DLGK_GRID_RIGHT);
+ CASE(DLGK_DELETE_LEFT);
+ CASE(DLGK_DELETE_RIGHT);
+ CASE(DLGK_DELETE_ALL);
+ CASE(DLGK_ENTER);
+ CASE(DLGK_BEGIN);
+ CASE(DLGK_FINAL);
+ CASE(DLGK_SELECT);
+ CASE(DLGK_TRACE);
+ }
+ }
+ } else {
+ fkey_name = unctrl(ch);
+ if (fkey_name == 0)
+ fkey_name = "UNKNOWN";
+ }
+ fprintf(myFP, "chr %s (ch=%#x, fkey=%d)\n",
+ fkey_name,
+ ch, fkey);
+ fflush(myFP);
+ }
+}
+
+void
+dlg_trace(const char *fname)
+{
+ if (fname != 0) {
+ if (myFP == 0) {
+ myFP = fopen(fname, "a");
+ if (myFP != 0) {
+ time_t now = time((time_t *) 0);
+ fprintf(myFP, "** %s", ctime(&now));
+ }
+ }
+ } else if (myFP != 0) {
+ fclose(myFP);
+ myFP = 0;
+ }
+}
+#else
+#undef dlg_trace
+extern void dlg_trace(const char *);
+void
+dlg_trace(const char *fname)
+{
+ (void) fname;
+}
+#endif
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/ui_getc.c b/Build/source/utils/dialog/dialog-1.1-20080819/ui_getc.c
new file mode 100644
index 00000000000..a00c5f70105
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/ui_getc.c
@@ -0,0 +1,450 @@
+/*
+ * $Id: ui_getc.c,v 1.42 2008/03/16 20:02:20 tom Exp $
+ *
+ * ui_getc.c - user interface glue for getc()
+ *
+ * Copyright 2001-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#ifdef NEED_WCHAR_H
+#include <wchar.h>
+#endif
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#ifdef __QNX__
+#include <sys/select.h>
+#endif
+
+#ifndef WEXITSTATUS
+# ifdef HAVE_TYPE_UNIONWAIT
+# define WEXITSTATUS(status) (status.w_retcode)
+# else
+# define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
+# endif
+#endif
+
+#ifndef WTERMSIG
+# ifdef HAVE_TYPE_UNIONWAIT
+# define WTERMSIG(status) (status.w_termsig)
+# else
+# define WTERMSIG(status) ((status) & 0x7f)
+# endif
+#endif
+
+void
+dlg_add_callback(DIALOG_CALLBACK * p)
+{
+ p->next = dialog_state.getc_callbacks;
+ dialog_state.getc_callbacks = p;
+ wtimeout(p->win, WTIMEOUT_VAL);
+}
+
+void
+dlg_remove_callback(DIALOG_CALLBACK * p)
+{
+ DIALOG_CALLBACK *q;
+
+ if (p->input != 0) {
+ fclose(p->input);
+ p->input = 0;
+ }
+
+ dlg_del_window(p->win);
+ if ((q = dialog_state.getc_callbacks) == p) {
+ dialog_state.getc_callbacks = p->next;
+ } else {
+ while (q != 0) {
+ if (q->next == p) {
+ q->next = p->next;
+ break;
+ }
+ q = q->next;
+ }
+ }
+ free(p);
+}
+
+/*
+ * FIXME: this could be replaced by a select/poll on several file descriptors
+ */
+static int
+dlg_getc_ready(DIALOG_CALLBACK * p)
+{
+ fd_set read_fds;
+ int fd = fileno(p->input);
+ struct timeval test;
+
+ FD_ZERO(&read_fds);
+ FD_SET(fd, &read_fds);
+
+ test.tv_sec = 0; /* Seconds. */
+ test.tv_usec = WTIMEOUT_VAL * 1000; /* Microseconds. */
+ return (select(fd + 1, &read_fds, (fd_set *) 0, (fd_set *) 0, &test) == 1)
+ && (FD_ISSET(fd, &read_fds));
+}
+
+int
+dlg_getc_callbacks(int ch, int fkey, int *result)
+{
+ DIALOG_CALLBACK *p, *q;
+
+ if ((p = dialog_state.getc_callbacks) != 0) {
+ do {
+ q = p->next;
+ if (dlg_getc_ready(p)) {
+ if (!(p->handle_getc(p, ch, fkey, result))) {
+ dlg_remove_callback(p);
+ }
+ }
+ } while ((p = q) != 0);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static void
+dlg_raise_window(WINDOW *win)
+{
+ touchwin(win);
+ wmove(win, getcury(win), getcurx(win));
+ wnoutrefresh(win);
+ doupdate();
+}
+
+/*
+ * This is a work-around for the case where we actually need the wide-character
+ * code versus a byte stream.
+ */
+static int last_getc = ERR;
+
+#ifdef USE_WIDE_CURSES
+static char last_getc_bytes[80];
+static int have_last_getc;
+static int used_last_getc;
+#endif
+
+int
+dlg_last_getc(void)
+{
+#ifdef USE_WIDE_CURSES
+ if (used_last_getc != 1)
+ return ERR; /* not really an error... */
+#endif
+ return last_getc;
+}
+
+void
+dlg_flush_getc(void)
+{
+ last_getc = ERR;
+#ifdef USE_WIDE_CURSES
+ have_last_getc = 0;
+ used_last_getc = 0;
+#endif
+}
+
+/*
+ * Check if the stream has been unexpectedly closed, returning false in that
+ * case.
+ */
+static bool
+valid_file(FILE *fp)
+{
+ bool code = FALSE;
+ int fd = fileno(fp);
+
+ if (fd >= 0) {
+ long result = 0;
+ if ((result = fcntl(fd, F_GETFL, 0)) >= 0) {
+ code = TRUE;
+ }
+ }
+ return code;
+}
+
+/*
+ * Read a character from the given window. Handle repainting here (to simplify
+ * things in the calling application). Also, if input-callback(s) are set up,
+ * poll the corresponding files and handle the updates, e.g., for displaying a
+ * tailbox.
+ */
+int
+dlg_getc(WINDOW *win, int *fkey)
+{
+ WINDOW *save_win = win;
+ int ch = ERR;
+ int before_lookup;
+ int result;
+ bool done = FALSE;
+ bool literal = FALSE;
+ DIALOG_CALLBACK *p;
+ int interval = dialog_vars.timeout_secs;
+ time_t expired = time((time_t *) 0) + dialog_vars.timeout_secs;
+ time_t current;
+
+ if (dialog_state.getc_callbacks != 0)
+ wtimeout(win, WTIMEOUT_VAL);
+ else if (interval > 0)
+ wtimeout(win, interval);
+
+ while (!done) {
+#ifdef USE_WIDE_CURSES
+ int code;
+ mbstate_t state;
+ wchar_t my_wchar;
+ wint_t my_wint;
+
+ /*
+ * We get a wide character, translate it to multibyte form to avoid
+ * having to change the rest of the code to use wide-characters.
+ */
+ if (used_last_getc >= have_last_getc) {
+ used_last_getc = 0;
+ have_last_getc = 0;
+ ch = ERR;
+ *fkey = 0;
+ code = wget_wch(win, &my_wint);
+ my_wchar = my_wint;
+ switch (code) {
+ case KEY_CODE_YES:
+ ch = *fkey = my_wchar;
+ last_getc = my_wchar;
+ break;
+ case OK:
+ memset(&state, 0, sizeof(state));
+ have_last_getc = wcrtomb(last_getc_bytes, my_wchar, &state);
+ if (have_last_getc < 0) {
+ have_last_getc = used_last_getc = 0;
+ last_getc_bytes[0] = my_wchar;
+ }
+ ch = CharOf(last_getc_bytes[used_last_getc++]);
+ last_getc = my_wchar;
+ break;
+ case ERR:
+ ch = ERR;
+ last_getc = ERR;
+ break;
+ default:
+ break;
+ }
+ } else {
+ ch = CharOf(last_getc_bytes[used_last_getc++]);
+ }
+#else
+ ch = wgetch(win);
+ last_getc = ch;
+ *fkey = (ch > KEY_MIN && ch < KEY_MAX);
+#endif
+ if (literal) {
+ done = TRUE;
+ continue;
+ }
+
+ before_lookup = ch;
+ ch = dlg_lookup_key(win, ch, fkey);
+ dlg_trace_chr(ch, *fkey);
+
+ current = time((time_t *) 0);
+
+ switch (ch) {
+ case CHR_LITERAL:
+ if (!literal) {
+ literal = TRUE;
+ keypad(win, FALSE);
+ continue;
+ }
+ break;
+ case CHR_REPAINT:
+ (void) touchwin(win);
+ (void) wrefresh(curscr);
+ break;
+ case ERR: /* wtimeout() in effect; check for file I/O */
+ if (interval > 0
+ && current >= expired) {
+ dlg_exiterr("timeout");
+ }
+ if (dlg_getc_callbacks(ch, *fkey, &result)) {
+ dlg_raise_window(win);
+ } else {
+ done = (interval <= 0);
+ }
+ if (!valid_file(stdin)
+ && !valid_file(dialog_state.screen_output)) {
+ ch = ESC;
+ done = TRUE;
+ }
+ break;
+ case DLGK_FIELD_NEXT:
+ /* FALLTHRU */
+ case TAB:
+ /* Handle tab as a special case for traversing between the nominal
+ * "current" window, and other windows having callbacks. If the
+ * nominal (control) window closes, we'll close the windows with
+ * callbacks.
+ */
+ if (dialog_state.getc_callbacks != 0 &&
+ before_lookup == TAB) {
+ if ((p = dialog_state.getc_redirect) != 0) {
+ p = p->next;
+ } else {
+ p = dialog_state.getc_callbacks;
+ }
+ if ((dialog_state.getc_redirect = p) != 0) {
+ win = p->win;
+ } else {
+ win = save_win;
+ }
+ dlg_raise_window(win);
+ break;
+ }
+ /* FALLTHRU */
+ default:
+#ifdef NO_LEAKS
+ if (before_lookup == DLG_CTRL('P')) {
+ /* for testing, ^P closes the connection */
+ close(0);
+ close(1);
+ close(2);
+ break;
+ }
+#endif
+ if ((p = dialog_state.getc_redirect) != 0) {
+ if (!(p->handle_getc(p, ch, *fkey, &result))) {
+ dlg_remove_callback(p);
+ dialog_state.getc_redirect = 0;
+ win = save_win;
+ }
+ } else {
+ done = TRUE;
+ }
+ break;
+#ifdef HAVE_DLG_TRACE
+ case CHR_TRACE:
+ dlg_trace_win(win);
+ break;
+#endif
+ }
+ }
+ if (literal)
+ keypad(win, TRUE);
+ return ch;
+}
+
+static void
+finish_bg(int sig GCC_UNUSED)
+{
+ end_dialog();
+ dlg_exit(DLG_EXIT_ERROR);
+}
+
+/*
+ * If we have callbacks active, purge the list of all that are not marked
+ * to keep in the background. If any remain, run those in a background
+ * process.
+ */
+void
+dlg_killall_bg(int *retval)
+{
+ DIALOG_CALLBACK *cb;
+ int pid;
+#ifdef HAVE_TYPE_UNIONWAIT
+ union wait wstatus;
+#else
+ int wstatus;
+#endif
+
+ if ((cb = dialog_state.getc_callbacks) != 0) {
+ while (cb != 0) {
+ if (cb->keep_bg) {
+ cb = cb->next;
+ } else {
+ dlg_remove_callback(cb);
+ cb = dialog_state.getc_callbacks;
+ }
+ }
+ if (dialog_state.getc_callbacks != 0) {
+
+ refresh();
+ fflush(stdout);
+ fflush(stderr);
+ reset_shell_mode();
+ if ((pid = fork()) != 0) {
+ _exit(pid > 0 ? DLG_EXIT_OK : DLG_EXIT_ERROR);
+ } else if (pid == 0) { /* child */
+ if ((pid = fork()) != 0) {
+ /*
+ * Echo the process-id of the grandchild so a shell script
+ * can read that, and kill that process. We'll wait around
+ * until then. Our parent has already left, leaving us
+ * temporarily orphaned.
+ */
+ if (pid > 0) { /* parent */
+ fprintf(stderr, "%d\n", pid);
+ fflush(stderr);
+ }
+ /* wait for child */
+#ifdef HAVE_WAITPID
+ while (-1 == waitpid(pid, &wstatus, 0)) {
+#ifdef EINTR
+ if (errno == EINTR)
+ continue;
+#endif /* EINTR */
+#ifdef ERESTARTSYS
+ if (errno == ERESTARTSYS)
+ continue;
+#endif /* ERESTARTSYS */
+ break;
+ }
+#else
+ while (wait(&wstatus) != pid) /* do nothing */
+ ;
+#endif
+ _exit(WEXITSTATUS(wstatus));
+ } else if (pid == 0) {
+ if (!dialog_vars.cant_kill)
+ (void) signal(SIGHUP, finish_bg);
+ (void) signal(SIGINT, finish_bg);
+ (void) signal(SIGQUIT, finish_bg);
+ (void) signal(SIGSEGV, finish_bg);
+ while (dialog_state.getc_callbacks != 0) {
+ int fkey = 0;
+ dlg_getc_callbacks(ERR, fkey, retval);
+ napms(1000);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/util.c b/Build/source/utils/dialog/dialog-1.1-20080819/util.c
new file mode 100644
index 00000000000..ea743865cbb
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/util.c
@@ -0,0 +1,2040 @@
+/*
+ * $Id: util.c,v 1.196 2008/08/20 00:26:37 tom Exp $
+ *
+ * util.c -- miscellaneous utilities for dialog
+ *
+ * Copyright 2000-2007,2008 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors
+ * Savio Lam (lam836@cs.cuhk.hk)
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+#ifdef NCURSES_VERSION
+#if defined(HAVE_NCURSESW_TERM_H)
+#include <ncursesw/term.h>
+#elif defined(HAVE_NCURSES_TERM_H)
+#include <ncurses/term.h>
+#else
+#include <term.h>
+#endif
+#endif
+
+/* globals */
+DIALOG_STATE dialog_state;
+DIALOG_VARS dialog_vars;
+
+#define concat(a,b) a##b
+
+#ifdef HAVE_RC_FILE
+#define RC_DATA(name,comment) , #name "_color", comment " color"
+#else
+#define RC_DATA(name,comment) /*nothing */
+#endif
+
+#ifdef HAVE_COLOR
+#include <dlg_colors.h>
+#define COLOR_DATA(upr) , \
+ concat(DLGC_FG_,upr), \
+ concat(DLGC_BG_,upr), \
+ concat(DLGC_HL_,upr)
+#else
+#define COLOR_DATA(upr) /*nothing */
+#endif
+
+#define DATA(atr,upr,lwr,cmt) { atr COLOR_DATA(upr) RC_DATA(lwr,cmt) }
+
+/*
+ * Table of color and attribute values, default is for mono display.
+ */
+/* *INDENT-OFF* */
+DIALOG_COLORS dlg_color_table[] =
+{
+ DATA(A_NORMAL, SCREEN, screen, "Screen"),
+ DATA(A_NORMAL, SHADOW, shadow, "Shadow"),
+ DATA(A_REVERSE, DIALOG, dialog, "Dialog box"),
+ DATA(A_REVERSE, TITLE, title, "Dialog box title"),
+ DATA(A_REVERSE, BORDER, border, "Dialog box border"),
+ DATA(A_BOLD, BUTTON_ACTIVE, button_active, "Active button"),
+ DATA(A_DIM, BUTTON_INACTIVE, button_inactive, "Inactive button"),
+ DATA(A_UNDERLINE, BUTTON_KEY_ACTIVE, button_key_active, "Active button key"),
+ DATA(A_UNDERLINE, BUTTON_KEY_INACTIVE, button_key_inactive, "Inactive button key"),
+ DATA(A_NORMAL, BUTTON_LABEL_ACTIVE, button_label_active, "Active button label"),
+ DATA(A_NORMAL, BUTTON_LABEL_INACTIVE, button_label_inactive, "Inactive button label"),
+ DATA(A_REVERSE, INPUTBOX, inputbox, "Input box"),
+ DATA(A_REVERSE, INPUTBOX_BORDER, inputbox_border, "Input box border"),
+ DATA(A_REVERSE, SEARCHBOX, searchbox, "Search box"),
+ DATA(A_REVERSE, SEARCHBOX_TITLE, searchbox_title, "Search box title"),
+ DATA(A_REVERSE, SEARCHBOX_BORDER, searchbox_border, "Search box border"),
+ DATA(A_REVERSE, POSITION_INDICATOR, position_indicator, "File position indicator"),
+ DATA(A_REVERSE, MENUBOX, menubox, "Menu box"),
+ DATA(A_REVERSE, MENUBOX_BORDER, menubox_border, "Menu box border"),
+ DATA(A_REVERSE, ITEM, item, "Item"),
+ DATA(A_NORMAL, ITEM_SELECTED, item_selected, "Selected item"),
+ DATA(A_REVERSE, TAG, tag, "Tag"),
+ DATA(A_REVERSE, TAG_SELECTED, tag_selected, "Selected tag"),
+ DATA(A_NORMAL, TAG_KEY, tag_key, "Tag key"),
+ DATA(A_BOLD, TAG_KEY_SELECTED, tag_key_selected, "Selected tag key"),
+ DATA(A_REVERSE, CHECK, check, "Check box"),
+ DATA(A_REVERSE, CHECK_SELECTED, check_selected, "Selected check box"),
+ DATA(A_REVERSE, UARROW, uarrow, "Up arrow"),
+ DATA(A_REVERSE, DARROW, darrow, "Down arrow"),
+ DATA(A_NORMAL, ITEMHELP, itemhelp, "Item help-text"),
+ DATA(A_BOLD, FORM_ACTIVE_TEXT, form_active_text, "Active form text"),
+ DATA(A_REVERSE, FORM_TEXT, form_text, "Form text"),
+ DATA(A_NORMAL, FORM_ITEM_READONLY, form_item_readonly, "Readonly form item")
+};
+/* *INDENT-ON* */
+
+/*
+ * Display background title if it exists ...
+ */
+void
+dlg_put_backtitle(void)
+{
+ int i;
+
+ if (dialog_vars.backtitle != NULL) {
+ chtype attr = A_NORMAL;
+ int backwidth = dlg_count_columns(dialog_vars.backtitle);
+
+ wattrset(stdscr, screen_attr);
+ (void) wmove(stdscr, 0, 1);
+ dlg_print_text(stdscr, dialog_vars.backtitle, COLS - 2, &attr);
+ for (i = 0; i < COLS - backwidth; i++)
+ (void) waddch(stdscr, ' ');
+ (void) wmove(stdscr, 1, 1);
+ for (i = 0; i < COLS - 2; i++)
+ (void) waddch(stdscr, dlg_boxchar(ACS_HLINE));
+ }
+
+ (void) wnoutrefresh(stdscr);
+}
+
+/*
+ * Set window to attribute 'attr'. There are more efficient ways to do this,
+ * but will not work on older/buggy ncurses versions.
+ */
+void
+dlg_attr_clear(WINDOW *win, int height, int width, chtype attr)
+{
+ int i, j;
+
+ wattrset(win, attr);
+ for (i = 0; i < height; i++) {
+ (void) wmove(win, i, 0);
+ for (j = 0; j < width; j++)
+ (void) waddch(win, ' ');
+ }
+ (void) touchwin(win);
+}
+
+void
+dlg_clear(void)
+{
+ dlg_attr_clear(stdscr, LINES, COLS, screen_attr);
+}
+
+#define isprivate(s) ((s) != 0 && strstr(s, "\033[?") != 0)
+
+#define TTY_DEVICE "/dev/tty"
+
+/*
+ * If $DIALOG_TTY exists, allow the program to try to open the terminal
+ * directly when stdout is redirected. By default we require the "--stdout"
+ * option to be given, but some scripts were written making use of the
+ * behavior of dialog which tried opening the terminal anyway.
+ */
+static char *
+dialog_tty(void)
+{
+ char *result = getenv("DIALOG_TTY");
+ if (result != 0 && atoi(result) == 0)
+ result = 0;
+ return result;
+}
+
+/*
+ * Open the terminal directly. If one of stdin, stdout or stderr really points
+ * to a tty, use it. Otherwise give up and open /dev/tty.
+ */
+static int
+open_terminal(char **result, int mode)
+{
+ const char *device = TTY_DEVICE;
+ if (!isatty(fileno(stderr))
+ || (device = ttyname(fileno(stderr))) == 0) {
+ if (!isatty(fileno(stdout))
+ || (device = ttyname(fileno(stdout))) == 0) {
+ if (!isatty(fileno(stdin))
+ || (device = ttyname(fileno(stdin))) == 0) {
+ device = TTY_DEVICE;
+ }
+ }
+ }
+ *result = dlg_strclone(device);
+ return open(device, mode);
+}
+
+/*
+ * Do some initialization for dialog.
+ *
+ * 'input' is the real tty input of dialog. Usually it is stdin, but if
+ * --input-fd option is used, it may be anything.
+ *
+ * 'output' is where dialog will send its result. Usually it is stderr, but
+ * if --stdout or --output-fd is used, it may be anything. We are concerned
+ * mainly with the case where it happens to be the same as stdout.
+ */
+void
+init_dialog(FILE *input, FILE *output)
+{
+ int fd1, fd2;
+ char *device = 0;
+
+ dialog_state.output = output;
+ dialog_state.tab_len = TAB_LEN;
+ dialog_state.aspect_ratio = DEFAULT_ASPECT_RATIO;
+#ifdef HAVE_COLOR
+ dialog_state.use_colors = USE_COLORS; /* use colors by default? */
+ dialog_state.use_shadow = USE_SHADOW; /* shadow dialog boxes by default? */
+#endif
+
+#ifdef HAVE_RC_FILE
+ if (dlg_parse_rc() == -1) /* Read the configuration file */
+ dlg_exiterr("init_dialog: dlg_parse_rc");
+#endif
+
+ /*
+ * Some widgets (such as gauge) may read from the standard input. Pipes
+ * only connect stdout/stdin, so there is not much choice. But reading a
+ * pipe would get in the way of curses' normal reading stdin for getch.
+ *
+ * As in the --stdout (see below), reopening the terminal does not always
+ * work properly. dialog provides a --pipe-fd option for this purpose. We
+ * test that case first (differing fileno's for input/stdin). If the
+ * fileno's are equal, but we're not reading from a tty, see if we can open
+ * /dev/tty.
+ */
+ dialog_state.pipe_input = stdin;
+ if (fileno(input) != fileno(stdin)) {
+ if ((fd1 = dup(fileno(input))) >= 0
+ && (fd2 = dup(fileno(stdin))) >= 0) {
+ (void) dup2(fileno(input), fileno(stdin));
+ dialog_state.pipe_input = fdopen(fd2, "r");
+ if (fileno(stdin) != 0) /* some functions may read fd #0 */
+ (void) dup2(fileno(stdin), 0);
+ } else
+ dlg_exiterr("cannot open tty-input");
+ } else if (!isatty(fileno(stdin))) {
+ if ((fd1 = open_terminal(&device, O_RDONLY)) >= 0
+ && (fd2 = dup(fileno(stdin))) >= 0) {
+ dialog_state.pipe_input = fdopen(fd2, "r");
+ if (freopen(device, "r", stdin) == 0)
+ dlg_exiterr("cannot open tty-input");
+ if (fileno(stdin) != 0) /* some functions may read fd #0 */
+ (void) dup2(fileno(stdin), 0);
+ }
+ free(device);
+ }
+
+ /*
+ * If stdout is not a tty and dialog is called with the --stdout option, we
+ * have to provide for a way to write to the screen.
+ *
+ * The curses library normally writes its output to stdout, leaving stderr
+ * free for scripting. Scripts are simpler when stdout is redirected. The
+ * newterm function is useful; it allows us to specify where the output
+ * goes. Reopening the terminal is not portable since several
+ * configurations do not allow this to work properly:
+ *
+ * a) some getty implementations (and possibly broken tty drivers, e.g., on
+ * HPUX 10 and 11) cause stdin to act as if it is still in cooked mode
+ * even though results from ioctl's state that it is successfully
+ * altered to raw mode. Broken is the proper term.
+ *
+ * b) the user may not have permissions on the device, e.g., if one su's
+ * from the login user to another non-privileged user.
+ */
+ if (!isatty(fileno(stdout))
+ && (fileno(stdout) == fileno(output) || dialog_tty())) {
+ if ((fd1 = open_terminal(&device, O_WRONLY)) >= 0
+ && (dialog_state.screen_output = fdopen(fd1, "w")) != 0) {
+ if (newterm(NULL, dialog_state.screen_output, stdin) == 0) {
+ dlg_exiterr("cannot initialize curses");
+ }
+ free(device);
+ } else {
+ dlg_exiterr("cannot open tty-output");
+ }
+ } else {
+ dialog_state.screen_output = stdout;
+ (void) initscr();
+ }
+#ifdef NCURSES_VERSION
+ /*
+ * Cancel xterm's alternate-screen mode.
+ */
+ if (!dialog_vars.keep_tite
+ && (dialog_state.screen_output != stdout
+ || isatty(fileno(dialog_state.screen_output)))
+ && key_mouse != 0 /* xterm and kindred */
+ && isprivate(enter_ca_mode)
+ && isprivate(exit_ca_mode)) {
+ /*
+ * initscr() or newterm() already did putp(enter_ca_mode) as a side
+ * effect of initializing the screen. It would be nice to not even
+ * do that, but we do not really have access to the correct copy of
+ * the terminfo description until those functions have been invoked.
+ */
+ (void) putp(exit_ca_mode);
+ (void) putp(clear_screen);
+ /*
+ * Prevent ncurses from switching "back" to the normal screen when
+ * exiting from dialog. That would move the cursor to the original
+ * location saved in xterm. Normally curses sets the cursor position
+ * to the first line after the display, but the alternate screen
+ * switching is done after that point.
+ *
+ * Cancelling the strings altogether also works around the buggy
+ * implementation of alternate-screen in rxvt, etc., which clear
+ * more of the display than they should.
+ */
+ enter_ca_mode = 0;
+ exit_ca_mode = 0;
+ }
+#endif
+#ifdef HAVE_FLUSHINP
+ (void) flushinp();
+#endif
+ (void) keypad(stdscr, TRUE);
+ (void) cbreak();
+ (void) noecho();
+ mouse_open();
+ dialog_state.screen_initialized = TRUE;
+
+#ifdef HAVE_COLOR
+ if (dialog_state.use_colors || dialog_state.use_shadow)
+ dlg_color_setup(); /* Set up colors */
+#endif
+
+ /* Set screen to screen attribute */
+ dlg_clear();
+}
+
+#ifdef HAVE_COLOR
+static int defined_colors = 1; /* pair-0 is reserved */
+/*
+ * Setup for color display
+ */
+void
+dlg_color_setup(void)
+{
+ unsigned i;
+
+ if (has_colors()) { /* Terminal supports color? */
+ (void) start_color();
+
+#if defined(HAVE_USE_DEFAULT_COLORS)
+ use_default_colors();
+#endif
+
+#if defined(__NetBSD__) && defined(_CURSES_)
+#define C_ATTR(x,y) (((x) != 0 ? A_BOLD : 0) | COLOR_PAIR((y)))
+ /* work around bug in NetBSD curses */
+ for (i = 0; i < sizeof(dlg_color_table) /
+ sizeof(dlg_color_table[0]); i++) {
+
+ /* Initialize color pairs */
+ (void) init_pair(i + 1,
+ dlg_color_table[i].fg,
+ dlg_color_table[i].bg);
+
+ /* Setup color attributes */
+ dlg_color_table[i].atr = C_ATTR(dlg_color_table[i].hilite, i + 1);
+ }
+ defined_colors = i + 1;
+#else
+ for (i = 0; i < sizeof(dlg_color_table) /
+ sizeof(dlg_color_table[0]); i++) {
+
+ /* Initialize color pairs */
+ chtype color = dlg_color_pair(dlg_color_table[i].fg,
+ dlg_color_table[i].bg);
+
+ /* Setup color attributes */
+ dlg_color_table[i].atr = ((dlg_color_table[i].hilite
+ ? A_BOLD
+ : 0)
+ | color);
+ }
+#endif
+ } else {
+ dialog_state.use_colors = FALSE;
+ dialog_state.use_shadow = FALSE;
+ }
+}
+
+int
+dlg_color_count(void)
+{
+ return sizeof(dlg_color_table) / sizeof(dlg_color_table[0]);
+}
+
+/*
+ * Reuse color pairs (they are limited), returning a COLOR_PAIR() value if we
+ * have (or can) define a pair with the given color as foreground on the
+ * window's defined background.
+ */
+chtype
+dlg_color_pair(int foreground, int background)
+{
+ chtype result = 0;
+ int pair;
+ short fg, bg;
+ bool found = FALSE;
+
+ for (pair = 1; pair < defined_colors; ++pair) {
+ if (pair_content(pair, &fg, &bg) != ERR
+ && fg == foreground
+ && bg == background) {
+ result = COLOR_PAIR(pair);
+ found = TRUE;
+ break;
+ }
+ }
+ if (!found && (defined_colors + 1) < COLOR_PAIRS) {
+ pair = defined_colors++;
+ (void) init_pair(pair, foreground, background);
+ result = COLOR_PAIR(pair);
+ }
+ return result;
+}
+
+/*
+ * Reuse color pairs (they are limited), returning a COLOR_PAIR() value if we
+ * have (or can) define a pair with the given color as foreground on the
+ * window's defined background.
+ */
+static chtype
+define_color(WINDOW *win, int foreground)
+{
+ chtype attrs = getattrs(win);
+ int pair;
+ short fg, bg, background;
+
+ if ((pair = PAIR_NUMBER(attrs)) != 0
+ && pair_content(pair, &fg, &bg) != ERR) {
+ background = bg;
+ } else {
+ background = COLOR_BLACK;
+ }
+ return dlg_color_pair(foreground, background);
+}
+#endif
+
+/*
+ * End using dialog functions.
+ */
+void
+end_dialog(void)
+{
+ if (dialog_state.screen_initialized) {
+ dialog_state.screen_initialized = FALSE;
+ mouse_close();
+ (void) endwin();
+ (void) fflush(stdout);
+ }
+}
+
+#define isOurEscape(p) (((p)[0] == '\\') && ((p)[1] == 'Z') && ((p)[2] != 0))
+
+static int
+centered(int width, const char *string)
+{
+ int len = dlg_count_columns(string);
+ int left;
+ int hide = 0;
+ int n;
+
+ if (dialog_vars.colors) {
+ for (n = 0; n < len; ++n) {
+ if (isOurEscape(string + n)) {
+ hide += 3;
+ }
+ }
+ }
+ left = (width - (len - hide)) / 2 - 1;
+ if (left < 0)
+ left = 0;
+ return left;
+}
+
+/*
+ * Print up to 'cols' columns from 'text', optionally rendering our escape
+ * sequence for attributes and color.
+ */
+void
+dlg_print_text(WINDOW *win, const char *txt, int cols, chtype *attr)
+{
+ int y_origin, x_origin;
+ int y_before, x_before = 0;
+ int y_after, x_after;
+ int tabbed = 0;
+ bool thisTab;
+ bool ended = FALSE;
+ chtype useattr;
+
+ getyx(win, y_origin, x_origin);
+ while (cols > 0 && (*txt != '\0')) {
+ if (dialog_vars.colors) {
+ while (isOurEscape(txt)) {
+ int code;
+
+ txt += 2;
+ switch (code = CharOf(*txt)) {
+#ifdef HAVE_COLOR
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ *attr &= ~A_COLOR;
+ *attr |= define_color(win, code - '0');
+ break;
+#endif
+ case 'B':
+ *attr &= ~A_BOLD;
+ break;
+ case 'b':
+ *attr |= A_BOLD;
+ break;
+ case 'R':
+ *attr &= ~A_REVERSE;
+ break;
+ case 'r':
+ *attr |= A_REVERSE;
+ break;
+ case 'U':
+ *attr &= ~A_UNDERLINE;
+ break;
+ case 'u':
+ *attr |= A_UNDERLINE;
+ break;
+ case 'n':
+ *attr = A_NORMAL;
+ break;
+ }
+ ++txt;
+ }
+ }
+ if (ended || *txt == '\n' || *txt == '\0')
+ break;
+ useattr = (*attr) & A_ATTRIBUTES;
+#ifdef HAVE_COLOR
+ /*
+ * Prevent this from making text invisible when the foreground and
+ * background colors happen to be the same, and there's no bold
+ * attribute.
+ */
+ if ((useattr & A_COLOR) != 0 && (useattr & A_BOLD) == 0) {
+ short pair = PAIR_NUMBER(useattr);
+ short fg, bg;
+ if (pair_content(pair, &fg, &bg) != ERR
+ && fg == bg) {
+ useattr &= ~A_COLOR;
+ useattr |= dlg_color_pair(fg, ((bg == COLOR_BLACK)
+ ? COLOR_WHITE
+ : COLOR_BLACK));
+ }
+ }
+#endif
+ /*
+ * Write the character, using curses to tell exactly how wide it
+ * is. If it is a tab, discount that, since the caller thinks
+ * tabs are nonprinting, and curses will expand tabs to one or
+ * more blanks.
+ */
+ thisTab = (CharOf(*txt) == TAB);
+ if (thisTab)
+ getyx(win, y_before, x_before);
+ (void) waddch(win, CharOf(*txt++) | useattr);
+ getyx(win, y_after, x_after);
+ if (thisTab && (y_after == y_origin))
+ tabbed += (x_after - x_before);
+ if (y_after != y_origin || x_after >= cols + tabbed + x_origin) {
+ ended = TRUE;
+ }
+ }
+}
+
+/*
+ * Print one line of the prompt in the window within the limits of the
+ * specified right margin. The line will end on a word boundary and a pointer
+ * to the start of the next line is returned, or a NULL pointer if the end of
+ * *prompt is reached.
+ */
+const char *
+dlg_print_line(WINDOW *win,
+ chtype *attr,
+ const char *prompt,
+ int lm, int rm, int *x)
+{
+ const char *wrap_ptr = prompt;
+ const char *test_ptr = prompt;
+ const int *cols = dlg_index_columns(prompt);
+ const int *indx = dlg_index_wchars(prompt);
+ int wrap_inx = 0;
+ int test_inx = 0;
+ int cur_x = lm;
+ int hidden = 0;
+ int limit = dlg_count_wchars(prompt);
+ int n;
+ int tabbed = 0;
+
+ *x = 1;
+
+ /*
+ * Set *test_ptr to the end of the line or the right margin (rm), whichever
+ * is less, and set wrap_ptr to the end of the last word in the line.
+ */
+ for (n = 0; n < limit; ++n) {
+ test_ptr = prompt + indx[test_inx];
+ if (*test_ptr == '\n' || *test_ptr == '\0' || cur_x >= (rm + hidden))
+ break;
+ if (*test_ptr == TAB && n == 0) {
+ tabbed = 8; /* workaround for leading tabs */
+ } else if (*test_ptr == ' ' && n != 0 && prompt[indx[n - 1]] != ' ') {
+ wrap_inx = n;
+ *x = cur_x;
+ } else if (isOurEscape(test_ptr)) {
+ hidden += 3;
+ n += 2;
+ }
+ cur_x = lm + tabbed + cols[n + 1];
+ if (cur_x > (rm + hidden))
+ break;
+ test_inx = n + 1;
+ }
+
+ /*
+ * If the line doesn't reach the right margin in the middle of a word, then
+ * we don't have to wrap it at the end of the previous word.
+ */
+ test_ptr = prompt + indx[test_inx];
+ if (*test_ptr == '\n' || *test_ptr == ' ' || *test_ptr == '\0') {
+ wrap_inx = test_inx;
+ while (wrap_inx > 0 && prompt[indx[wrap_inx - 1]] == ' ') {
+ wrap_inx--;
+ }
+ *x = lm + indx[wrap_inx];
+ } else if (*x == 1 && cur_x >= rm) {
+ /*
+ * If the line has no spaces, then wrap it anyway at the right margin
+ */
+ *x = rm;
+ wrap_inx = test_inx;
+ }
+ wrap_ptr = prompt + indx[wrap_inx];
+
+ /*
+ * Print the line if we have a window pointer. Otherwise this routine
+ * is just being called for sizing the window.
+ */
+ if (win) {
+ dlg_print_text(win, prompt, (cols[wrap_inx] - hidden), attr);
+ }
+
+ /* *x tells the calling function how long the line was */
+ if (*x == 1)
+ *x = rm;
+
+ /* Find the start of the next line and return a pointer to it */
+ test_ptr = wrap_ptr;
+ while (*test_ptr == ' ')
+ test_ptr++;
+ if (*test_ptr == '\n')
+ test_ptr++;
+ return (test_ptr);
+}
+
+static void
+justify_text(WINDOW *win,
+ const char *prompt,
+ int limit_y,
+ int limit_x,
+ int *high, int *wide)
+{
+ chtype attr = A_NORMAL;
+ int x = (2 * MARGIN);
+ int y = MARGIN;
+ int max_x = 2;
+ int lm = (2 * MARGIN); /* left margin (box-border plus a space) */
+ int rm = limit_x; /* right margin */
+ int bm = limit_y; /* bottom margin */
+ int last_y = 0, last_x = 0;
+
+ if (win) {
+ rm -= (2 * MARGIN);
+ bm -= (2 * MARGIN);
+ }
+ if (prompt == 0)
+ prompt = "";
+
+ if (win != 0)
+ getyx(win, last_y, last_x);
+ while (y <= bm && *prompt) {
+ x = lm;
+
+ if (*prompt == '\n') {
+ while (*prompt == '\n' && y < bm) {
+ if (*(prompt + 1) != '\0') {
+ ++y;
+ if (win != 0)
+ (void) wmove(win, y, lm);
+ }
+ prompt++;
+ }
+ } else if (win != 0)
+ (void) wmove(win, y, lm);
+
+ if (*prompt) {
+ prompt = dlg_print_line(win, &attr, prompt, lm, rm, &x);
+ if (win != 0)
+ getyx(win, last_y, last_x);
+ }
+ if (*prompt) {
+ ++y;
+ if (win != 0)
+ (void) wmove(win, y, lm);
+ }
+ max_x = MAX(max_x, x);
+ }
+ /* Move back to the last position after drawing prompt, for msgbox. */
+ if (win != 0)
+ (void) wmove(win, last_y, last_x);
+
+ /* Set the final height and width for the calling function */
+ if (high != 0)
+ *high = y;
+ if (wide != 0)
+ *wide = max_x;
+}
+
+/*
+ * Print a string of text in a window, automatically wrap around to the next
+ * line if the string is too long to fit on one line. Note that the string may
+ * contain embedded newlines.
+ */
+void
+dlg_print_autowrap(WINDOW *win, const char *prompt, int height, int width)
+{
+ justify_text(win, prompt,
+ height,
+ width,
+ (int *) 0, (int *) 0);
+}
+
+/*
+ * Calculate the window size for preformatted text. This will calculate box
+ * dimensions that are at or close to the specified aspect ratio for the prompt
+ * string with all spaces and newlines preserved and additional newlines added
+ * as necessary.
+ */
+static void
+auto_size_preformatted(const char *prompt, int *height, int *width)
+{
+ int high = 0, wide = 0;
+ float car; /* Calculated Aspect Ratio */
+ float diff;
+ int max_y = SLINES - 1;
+ int max_x = SCOLS - 2;
+ int max_width = max_x;
+ int ar = dialog_state.aspect_ratio;
+
+ /* Get the initial dimensions */
+ justify_text((WINDOW *) 0, prompt, max_y, max_x, &high, &wide);
+ car = (float) (wide / high);
+
+ /*
+ * If the aspect ratio is greater than it should be, then decrease the
+ * width proportionately.
+ */
+ if (car > ar) {
+ diff = car / (float) ar;
+ max_x = (int) (wide / diff + 4);
+ justify_text((WINDOW *) 0, prompt, max_y, max_x, &high, &wide);
+ car = (float) wide / high;
+ }
+
+ /*
+ * If the aspect ratio is too small after decreasing the width, then
+ * incrementally increase the width until the aspect ratio is equal to or
+ * greater than the specified aspect ratio.
+ */
+ while (car < ar && max_x < max_width) {
+ max_x += 4;
+ justify_text((WINDOW *) 0, prompt, max_y, max_x, &high, &wide);
+ car = (float) (wide / high);
+ }
+
+ *height = high;
+ *width = wide;
+}
+
+/*
+ * Find the length of the longest "word" in the given string. By setting the
+ * widget width at least this long, we can avoid splitting a word on the
+ * margin.
+ */
+static int
+longest_word(const char *string)
+{
+ int length, result = 0;
+
+ while (*string != '\0') {
+ length = 0;
+ while (*string != '\0' && !isspace(UCH(*string))) {
+ length++;
+ string++;
+ }
+ result = MAX(result, length);
+ if (*string != '\0')
+ string++;
+ }
+ return result;
+}
+
+/*
+ * if (height or width == -1) Maximize()
+ * if (height or width == 0), justify and return actual limits.
+ */
+static void
+real_auto_size(const char *title,
+ const char *prompt,
+ int *height, int *width,
+ int boxlines, int mincols)
+{
+ int x = (dialog_vars.begin_set ? dialog_vars.begin_x : 2);
+ int y = (dialog_vars.begin_set ? dialog_vars.begin_y : 1);
+ int title_length = title ? dlg_count_columns(title) : 0;
+ int nc = 4;
+ int high;
+ int wide;
+ int save_high = *height;
+ int save_wide = *width;
+
+ if (prompt == 0) {
+ if (*height == 0)
+ *height = -1;
+ if (*width == 0)
+ *width = -1;
+ }
+
+ if (*height > 0) {
+ high = *height;
+ } else {
+ high = SLINES - y;
+ }
+
+ if (*width > 0) {
+ wide = *width;
+ } else if (prompt != 0) {
+ wide = MAX(title_length, mincols);
+ if (strchr(prompt, '\n') == 0) {
+ double val = dialog_state.aspect_ratio * dlg_count_columns(prompt);
+ double xxx = sqrt(val);
+ int tmp = (int) xxx;
+ wide = MAX(wide, tmp);
+ wide = MAX(wide, longest_word(prompt));
+ justify_text((WINDOW *) 0, prompt, high, wide, height, width);
+ } else {
+ auto_size_preformatted(prompt, height, width);
+ }
+ } else {
+ wide = SCOLS - x;
+ justify_text((WINDOW *) 0, prompt, high, wide, height, width);
+ }
+
+ if (*width < title_length) {
+ justify_text((WINDOW *) 0, prompt, high, title_length, height, width);
+ *width = title_length;
+ }
+
+ if (*width < mincols && save_wide == 0)
+ *width = mincols;
+ if (prompt != 0) {
+ *width += nc;
+ *height += boxlines + 2;
+ }
+ if (save_high > 0)
+ *height = save_high;
+ if (save_wide > 0)
+ *width = save_wide;
+}
+
+/* End of real_auto_size() */
+
+void
+dlg_auto_size(const char *title,
+ const char *prompt,
+ int *height,
+ int *width,
+ int boxlines,
+ int mincols)
+{
+ real_auto_size(title, prompt, height, width, boxlines, mincols);
+
+ if (*width > SCOLS) {
+ (*height)++;
+ *width = SCOLS;
+ }
+
+ if (*height > SLINES)
+ *height = SLINES;
+}
+
+/*
+ * if (height or width == -1) Maximize()
+ * if (height or width == 0)
+ * height=MIN(SLINES, num.lines in fd+n);
+ * width=MIN(SCOLS, MAX(longer line+n, mincols));
+ */
+void
+dlg_auto_sizefile(const char *title,
+ const char *file,
+ int *height,
+ int *width,
+ int boxlines,
+ int mincols)
+{
+ int count = 0;
+ int len = title ? dlg_count_columns(title) : 0;
+ int nc = 4;
+ int numlines = 2;
+ long offset;
+ int ch;
+ FILE *fd;
+
+ /* Open input file for reading */
+ if ((fd = fopen(file, "rb")) == NULL)
+ dlg_exiterr("dlg_auto_sizefile: Cannot open input file %s", file);
+
+ if ((*height == -1) || (*width == -1)) {
+ *height = SLINES - (dialog_vars.begin_set ? dialog_vars.begin_y : 0);
+ *width = SCOLS - (dialog_vars.begin_set ? dialog_vars.begin_x : 0);
+ }
+ if ((*height != 0) && (*width != 0)) {
+ (void) fclose(fd);
+ if (*width > SCOLS)
+ *width = SCOLS;
+ if (*height > SLINES)
+ *height = SLINES;
+ return;
+ }
+
+ while (!feof(fd)) {
+ offset = 0;
+ while (((ch = getc(fd)) != '\n') && !feof(fd))
+ if ((ch == TAB) && (dialog_vars.tab_correct))
+ offset += dialog_state.tab_len - (offset % dialog_state.tab_len);
+ else
+ offset++;
+
+ if (offset > len)
+ len = offset;
+
+ count++;
+ }
+
+ /* now 'count' has the number of lines of fd and 'len' the max lenght */
+
+ *height = MIN(SLINES, count + numlines + boxlines);
+ *width = MIN(SCOLS, MAX((len + nc), mincols));
+ /* here width and height can be maximized if > SCOLS|SLINES because
+ textbox-like widgets don't put all <file> on the screen.
+ Msgbox-like widget instead have to put all <text> correctly. */
+
+ (void) fclose(fd);
+}
+
+/*
+ * Draw a rectangular box with line drawing characters.
+ *
+ * borderchar is used to color the upper/left edges.
+ *
+ * boxchar is used to color the right/lower edges. It also is fill-color used
+ * for the box contents.
+ *
+ * Normally, if you are drawing a scrollable box, use menubox_border_attr for
+ * boxchar, and menubox_attr for borderchar since the scroll-arrows are drawn
+ * with menubox_attr at the top, and menubox_border_attr at the bottom. That
+ * also (given the default color choices) produces a recessed effect.
+ *
+ * If you want a raised effect (and are not going to use the scroll-arrows),
+ * reverse this choice.
+ */
+void
+dlg_draw_box(WINDOW *win, int y, int x, int height, int width,
+ chtype boxchar, chtype borderchar)
+{
+ int i, j;
+ chtype save = getattrs(win);
+
+ wattrset(win, 0);
+ for (i = 0; i < height; i++) {
+ (void) wmove(win, y + i, x);
+ for (j = 0; j < width; j++)
+ if (!i && !j)
+ (void) waddch(win, borderchar | dlg_boxchar(ACS_ULCORNER));
+ else if (i == height - 1 && !j)
+ (void) waddch(win, borderchar | dlg_boxchar(ACS_LLCORNER));
+ else if (!i && j == width - 1)
+ (void) waddch(win, boxchar | dlg_boxchar(ACS_URCORNER));
+ else if (i == height - 1 && j == width - 1)
+ (void) waddch(win, boxchar | dlg_boxchar(ACS_LRCORNER));
+ else if (!i)
+ (void) waddch(win, borderchar | dlg_boxchar(ACS_HLINE));
+ else if (i == height - 1)
+ (void) waddch(win, boxchar | dlg_boxchar(ACS_HLINE));
+ else if (!j)
+ (void) waddch(win, borderchar | dlg_boxchar(ACS_VLINE));
+ else if (j == width - 1)
+ (void) waddch(win, boxchar | dlg_boxchar(ACS_VLINE));
+ else
+ (void) waddch(win, boxchar | ' ');
+ }
+ wattrset(win, save);
+}
+
+#ifdef HAVE_COLOR
+/*
+ * Draw a shadow on the parent window corresponding to the right- and
+ * bottom-edge of the child window, to give a 3-dimensional look.
+ */
+static void
+draw_childs_shadow(WINDOW *parent, WINDOW *child)
+{
+ if (has_colors()) { /* Whether terminal supports color? */
+ chtype save = getattrs(parent);
+
+ dlg_draw_shadow(parent,
+ getbegy(child) - getbegy(parent),
+ getbegx(child) - getbegx(parent),
+ getmaxy(child),
+ getmaxx(child));
+ wattrset(parent, save);
+ }
+}
+
+/*
+ * Draw shadows along the right and bottom edge to give a more 3D look
+ * to the boxes
+ */
+void
+dlg_draw_shadow(WINDOW *win, int y, int x, int height, int width)
+{
+ int i, j;
+
+ if (has_colors()) { /* Whether terminal supports color? */
+ wattrset(win, shadow_attr);
+ for (i = 0; i < SHADOW_ROWS; ++i) {
+ for (j = 0; j < width; ++j) {
+ if (wmove(win, i + y + height, j + x + SHADOW_COLS) != ERR) {
+ (void) waddch(win, winch(win) & (chtype) (~A_COLOR));
+ }
+ }
+ }
+ for (i = 0; i < height; i++) {
+ for (j = 0; j < SHADOW_COLS; ++j) {
+ if (wmove(win, i + y + SHADOW_ROWS, j + x + width) != ERR) {
+ (void) waddch(win, winch(win) & (chtype) (~A_COLOR));
+ }
+ }
+ }
+ (void) wnoutrefresh(win);
+ }
+}
+#endif /* HAVE_COLOR */
+
+/*
+ * Allow shell scripts to remap the exit codes so they can distinguish ESC
+ * from ERROR.
+ */
+void
+dlg_exit(int code)
+{
+ /* *INDENT-OFF* */
+ static const struct {
+ int code;
+ const char *name;
+ } table[] = {
+ { DLG_EXIT_CANCEL, "DIALOG_CANCEL" },
+ { DLG_EXIT_ERROR, "DIALOG_ERROR" },
+ { DLG_EXIT_ESC, "DIALOG_ESC" },
+ { DLG_EXIT_EXTRA, "DIALOG_EXTRA" },
+ { DLG_EXIT_HELP, "DIALOG_HELP" },
+ { DLG_EXIT_OK, "DIALOG_OK" },
+ { DLG_EXIT_ITEM_HELP, "DIALOG_ITEM_HELP" },
+ };
+ /* *INDENT-ON* */
+
+ unsigned n;
+ char *name;
+ char *temp;
+ long value;
+ bool overridden = FALSE;
+
+ retry:
+ for (n = 0; n < sizeof(table) / sizeof(table[0]); n++) {
+ if (table[n].code == code) {
+ if ((name = getenv(table[n].name)) != 0) {
+ value = strtol(name, &temp, 0);
+ if (temp != 0 && temp != name && *temp == '\0') {
+ code = value;
+ overridden = TRUE;
+ }
+ }
+ break;
+ }
+ }
+
+ /*
+ * Prior to 2004/12/19, a widget using --item-help would exit with "OK"
+ * if the help button were selected. Now we want to exit with "HELP",
+ * but allow the environment variable to override.
+ */
+ if (code == DLG_EXIT_ITEM_HELP && !overridden) {
+ code = DLG_EXIT_HELP;
+ goto retry;
+ }
+#ifdef NO_LEAKS
+ _dlg_inputstr_leaks();
+#if defined(NCURSES_VERSION) && defined(HAVE__NC_FREE_AND_EXIT)
+ _nc_free_and_exit(code);
+#endif
+#endif
+
+ if (dialog_state.input == stdin) {
+ exit(code);
+ } else {
+ /*
+ * Just in case of using --input-fd option, do not
+ * call atexit functions of ncurses which may hang.
+ */
+ if (dialog_state.input) {
+ fclose(dialog_state.input);
+ dialog_state.input = 0;
+ }
+ if (dialog_state.pipe_input) {
+ if (dialog_state.pipe_input != stdin) {
+ fclose(dialog_state.pipe_input);
+ dialog_state.pipe_input = 0;
+ }
+ }
+ _exit(code);
+ }
+}
+
+/* quit program killing all tailbg */
+void
+dlg_exiterr(const char *fmt,...)
+{
+ int retval;
+ va_list ap;
+
+ end_dialog();
+
+ (void) fputc('\n', stderr);
+ va_start(ap, fmt);
+ (void) vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ (void) fputc('\n', stderr);
+
+ dlg_killall_bg(&retval);
+
+ (void) fflush(stderr);
+ (void) fflush(stdout);
+ dlg_exit(DLG_EXIT_ERROR);
+}
+
+void
+dlg_beeping(void)
+{
+ if (dialog_vars.beep_signal) {
+ (void) beep();
+ dialog_vars.beep_signal = 0;
+ }
+}
+
+void
+dlg_print_size(int height, int width)
+{
+ if (dialog_vars.print_siz)
+ fprintf(dialog_state.output, "Size: %d, %d\n", height, width);
+}
+
+void
+dlg_ctl_size(int height, int width)
+{
+ if (dialog_vars.size_err) {
+ if ((width > COLS) || (height > LINES)) {
+ dlg_exiterr("Window too big. (height, width) = (%d, %d). Max allowed (%d, %d).",
+ height, width, LINES, COLS);
+ }
+#ifdef HAVE_COLOR
+ else if ((dialog_state.use_shadow)
+ && ((width > SCOLS || height > SLINES))) {
+ if ((width <= COLS) && (height <= LINES)) {
+ /* try again, without shadows */
+ dialog_state.use_shadow = 0;
+ } else {
+ dlg_exiterr("Window+Shadow too big. (height, width) = (%d, %d). Max allowed (%d, %d).",
+ height, width, SLINES, SCOLS);
+ }
+ }
+#endif
+ }
+}
+
+/*
+ * If the --tab-correct was not selected, convert tabs to single spaces.
+ */
+void
+dlg_tab_correct_str(char *prompt)
+{
+ char *ptr;
+
+ if (dialog_vars.tab_correct) {
+ while ((ptr = strchr(prompt, TAB)) != NULL) {
+ *ptr = ' ';
+ prompt = ptr;
+ }
+ }
+}
+
+void
+dlg_calc_listh(int *height, int *list_height, int item_no)
+{
+ /* calculate new height and list_height */
+ int rows = SLINES - (dialog_vars.begin_set ? dialog_vars.begin_y : 0);
+ if (rows - (*height) > 0) {
+ if (rows - (*height) > item_no)
+ *list_height = item_no;
+ else
+ *list_height = rows - (*height);
+ }
+ (*height) += (*list_height);
+}
+
+/* obsolete */
+int
+dlg_calc_listw(int item_no, char **items, int group)
+{
+ int n, i, len1 = 0, len2 = 0;
+ for (i = 0; i < (item_no * group); i += group) {
+ if ((n = dlg_count_columns(items[i])) > len1)
+ len1 = n;
+ if ((n = dlg_count_columns(items[i + 1])) > len2)
+ len2 = n;
+ }
+ return len1 + len2;
+}
+
+int
+dlg_calc_list_width(int item_no, DIALOG_LISTITEM * items)
+{
+ int n, i, len1 = 0, len2 = 0;
+ for (i = 0; i < item_no; ++i) {
+ if ((n = dlg_count_columns(items[i].name)) > len1)
+ len1 = n;
+ if ((n = dlg_count_columns(items[i].text)) > len2)
+ len2 = n;
+ }
+ return len1 + len2;
+}
+
+char *
+dlg_strempty(void)
+{
+ static char empty[] = "";
+ return empty;
+}
+
+char *
+dlg_strclone(const char *cprompt)
+{
+ char *prompt = dlg_malloc(char, strlen(cprompt) + 1);
+ assert_ptr(prompt, "dlg_strclone");
+ strcpy(prompt, cprompt);
+ return prompt;
+}
+
+chtype
+dlg_asciibox(chtype ch)
+{
+ chtype result = 0;
+
+ if (ch == ACS_ULCORNER)
+ result = '+';
+ else if (ch == ACS_LLCORNER)
+ result = '+';
+ else if (ch == ACS_URCORNER)
+ result = '+';
+ else if (ch == ACS_LRCORNER)
+ result = '+';
+ else if (ch == ACS_HLINE)
+ result = '-';
+ else if (ch == ACS_VLINE)
+ result = '|';
+ else if (ch == ACS_LTEE)
+ result = '+';
+ else if (ch == ACS_RTEE)
+ result = '+';
+ else if (ch == ACS_UARROW)
+ result = '^';
+ else if (ch == ACS_DARROW)
+ result = 'v';
+
+ return result;
+}
+
+chtype
+dlg_boxchar(chtype ch)
+{
+ chtype result = dlg_asciibox(ch);
+
+ if (result != 0) {
+ if (dialog_vars.ascii_lines)
+ ch = result;
+ else if (dialog_vars.no_lines)
+ ch = ' ';
+ }
+ return ch;
+}
+
+int
+dlg_box_x_ordinate(int width)
+{
+ int x;
+
+ if (dialog_vars.begin_set == 1) {
+ x = dialog_vars.begin_x;
+ } else {
+ /* center dialog box on screen unless --begin-set */
+ x = (SCOLS - width) / 2;
+ }
+ return x;
+}
+
+int
+dlg_box_y_ordinate(int height)
+{
+ int y;
+
+ if (dialog_vars.begin_set == 1) {
+ y = dialog_vars.begin_y;
+ } else {
+ /* center dialog box on screen unless --begin-set */
+ y = (SLINES - height) / 2;
+ }
+ return y;
+}
+
+void
+dlg_draw_title(WINDOW *win, const char *title)
+{
+ if (title != NULL) {
+ chtype attr = A_NORMAL;
+ chtype save = getattrs(win);
+ int x = centered(getmaxx(win), title);
+
+ wattrset(win, title_attr);
+ wmove(win, 0, x);
+ dlg_print_text(win, title, getmaxx(win) - x, &attr);
+ wattrset(win, save);
+ }
+}
+
+void
+dlg_draw_bottom_box(WINDOW *win)
+{
+ int width = getmaxx(win);
+ int height = getmaxy(win);
+ int i;
+
+ wattrset(win, border_attr);
+ (void) wmove(win, height - 3, 0);
+ (void) waddch(win, dlg_boxchar(ACS_LTEE));
+ for (i = 0; i < width - 2; i++)
+ (void) waddch(win, dlg_boxchar(ACS_HLINE));
+ wattrset(win, dialog_attr);
+ (void) waddch(win, dlg_boxchar(ACS_RTEE));
+ (void) wmove(win, height - 2, 1);
+ for (i = 0; i < width - 2; i++)
+ (void) waddch(win, ' ');
+}
+
+/*
+ * Remove a window, repainting everything else. This would be simpler if we
+ * used the panel library, but that is not _always_ available.
+ */
+void
+dlg_del_window(WINDOW *win)
+{
+ DIALOG_WINDOWS *p, *q, *r;
+
+ /*
+ * If --keep-window was set, do not delete/repaint the windows.
+ */
+ if (dialog_vars.keep_window)
+ return;
+
+ /* Leave the main window untouched if there are no background windows.
+ * We do this so the current window will not be cleared on exit, allowing
+ * things like the infobox demo to run without flicker.
+ */
+ if (dialog_state.getc_callbacks != 0) {
+ touchwin(stdscr);
+ wnoutrefresh(stdscr);
+ }
+
+ for (p = dialog_state.all_windows, q = r = 0; p != 0; r = p, p = p->next) {
+ if (p->normal == win) {
+ q = p; /* found a match - should be only one */
+ if (r == 0) {
+ dialog_state.all_windows = p->next;
+ } else {
+ r->next = p->next;
+ }
+ } else {
+ if (p->shadow != 0) {
+ touchwin(p->shadow);
+ wnoutrefresh(p->shadow);
+ }
+ touchwin(p->normal);
+ wnoutrefresh(p->normal);
+ }
+ }
+
+ if (q) {
+ delwin(q->normal);
+ dlg_unregister_window(q->normal);
+ free(q);
+ }
+ doupdate();
+}
+
+/*
+ * Create a window, optionally with a shadow.
+ */
+WINDOW *
+dlg_new_window(int height, int width, int y, int x)
+{
+ WINDOW *win;
+ DIALOG_WINDOWS *p = dlg_calloc(DIALOG_WINDOWS, 1);
+
+ if ((win = newwin(height, width, y, x)) == 0) {
+ dlg_exiterr("Can't make new window at (%d,%d), size (%d,%d).\n",
+ y, x, height, width);
+ }
+ p->next = dialog_state.all_windows;
+ p->normal = win;
+ dialog_state.all_windows = p;
+#ifdef HAVE_COLOR
+ if (dialog_state.use_shadow) {
+ draw_childs_shadow(p->shadow = stdscr, win);
+ }
+#endif
+
+ (void) keypad(win, TRUE);
+ return win;
+}
+
+WINDOW *
+dlg_new_modal_window(WINDOW *parent, int height, int width, int y, int x)
+{
+ WINDOW *win;
+ DIALOG_WINDOWS *p = dlg_calloc(DIALOG_WINDOWS, 1);
+
+ (void) parent;
+ if ((win = newwin(height, width, y, x)) == 0) {
+ dlg_exiterr("Can't make new window at (%d,%d), size (%d,%d).\n",
+ y, x, height, width);
+ }
+ p->next = dialog_state.all_windows;
+ p->normal = win;
+ dialog_state.all_windows = p;
+#ifdef HAVE_COLOR
+ if (dialog_state.use_shadow) {
+ draw_childs_shadow(p->shadow = parent, win);
+ }
+#endif
+
+ (void) keypad(win, TRUE);
+ return win;
+}
+
+/*
+ * Move/Resize a window, optionally with a shadow.
+ */
+#ifdef KEY_RESIZE
+void
+dlg_move_window(WINDOW *win, int height, int width, int y, int x)
+{
+ DIALOG_WINDOWS *p, *q;
+
+ if (win != 0) {
+ dlg_ctl_size(height, width);
+
+ for (p = dialog_state.all_windows; p != 0; p = q) {
+ q = p->next;
+ if (p->normal == win) {
+ break;
+ }
+ }
+
+ if (p != 0) {
+ (void) wresize(win, height, width);
+ (void) mvwin(win, y, x);
+#ifdef HAVE_COLOR
+ if (p->shadow != 0) {
+ if (dialog_state.use_shadow) {
+ (void) mvwin(p->shadow, y + SHADOW_ROWS, x + SHADOW_COLS);
+ } else {
+ p->shadow = 0;
+ }
+ }
+#endif
+ (void) refresh();
+
+#ifdef HAVE_COLOR
+ if (p->shadow)
+ draw_childs_shadow(p->shadow, win);
+#endif
+ }
+ }
+}
+#endif /* KEY_RESIZE */
+
+WINDOW *
+dlg_sub_window(WINDOW *parent, int height, int width, int y, int x)
+{
+ WINDOW *win;
+
+ if ((win = subwin(parent, height, width, y, x)) == 0) {
+ dlg_exiterr("Can't make sub-window at (%d,%d), size (%d,%d).\n",
+ y, x, height, width);
+ }
+
+ (void) keypad(win, TRUE);
+ return win;
+}
+
+/* obsolete */
+int
+dlg_default_item(char **items, int llen)
+{
+ int result = 0;
+
+ if (dialog_vars.default_item != 0) {
+ int count = 0;
+ while (*items != 0) {
+ if (!strcmp(dialog_vars.default_item, *items)) {
+ result = count;
+ break;
+ }
+ items += llen;
+ count++;
+ }
+ }
+ return result;
+}
+
+int
+dlg_default_listitem(DIALOG_LISTITEM * items)
+{
+ int result = 0;
+
+ if (dialog_vars.default_item != 0) {
+ int count = 0;
+ while (items->name != 0) {
+ if (!strcmp(dialog_vars.default_item, items->name)) {
+ result = count;
+ break;
+ }
+ ++items;
+ count++;
+ }
+ }
+ return result;
+}
+
+/*
+ * Draw the string for item_help
+ */
+void
+dlg_item_help(char *txt)
+{
+ if (USE_ITEM_HELP(txt)) {
+ chtype attr = A_NORMAL;
+ int y, x;
+
+ wattrset(stdscr, itemhelp_attr);
+ (void) wmove(stdscr, LINES - 1, 0);
+ (void) wclrtoeol(stdscr);
+ (void) addch(' ');
+ dlg_print_text(stdscr, txt, COLS - 1, &attr);
+ if (itemhelp_attr & A_COLOR) {
+ /* fill the remainder of the line with the window's attributes */
+ getyx(stdscr, y, x);
+ while (x < COLS) {
+ (void) addch(' ');
+ ++x;
+ }
+ }
+ (void) wnoutrefresh(stdscr);
+ }
+}
+
+#ifndef HAVE_STRCASECMP
+int
+dlg_strcmp(const char *a, const char *b)
+{
+ int ac, bc, cmp;
+
+ for (;;) {
+ ac = UCH(*a++);
+ bc = UCH(*b++);
+ if (isalpha(ac) && islower(ac))
+ ac = _toupper(ac);
+ if (isalpha(bc) && islower(bc))
+ bc = _toupper(bc);
+ cmp = ac - bc;
+ if (ac == 0 || bc == 0 || cmp != 0)
+ break;
+ }
+ return cmp;
+}
+#endif
+
+/*
+ * Returns true if 'dst' points to a blank which follows another blank which
+ * is not a leading blank on a line.
+ */
+static bool
+trim_blank(char *base, char *dst)
+{
+ int count = 0;
+
+ while (dst-- != base) {
+ if (*dst == '\n') {
+ return FALSE;
+ } else if (*dst != ' ') {
+ return (count > 1);
+ } else {
+ count++;
+ }
+ }
+ return FALSE;
+}
+
+/*
+ * Change embedded "\n" substrings to '\n' characters and tabs to single
+ * spaces. If there are no "\n"s, it will strip all extra spaces, for
+ * justification. If it has "\n"'s, it will preserve extra spaces. If cr_wrap
+ * is set, it will preserve '\n's.
+ */
+void
+dlg_trim_string(char *s)
+{
+ char *base = s;
+ char *p1;
+ char *p = s;
+ int has_newlines = (strstr(s, "\\n") != 0);
+
+ while (*p != '\0') {
+ if (*p == TAB && !dialog_vars.nocollapse)
+ *p = ' ';
+
+ if (has_newlines) { /* If prompt contains "\n" strings */
+ if (*p == '\\' && *(p + 1) == 'n') {
+ *s++ = '\n';
+ p += 2;
+ p1 = p;
+ /*
+ * Handle end of lines intelligently. If '\n' follows "\n"
+ * then ignore the '\n'. This eliminates the need to escape
+ * the '\n' character (no need to use "\n\").
+ */
+ while (*p1 == ' ')
+ p1++;
+ if (*p1 == '\n')
+ p = p1 + 1;
+ } else if (*p == '\n') {
+ if (dialog_vars.cr_wrap)
+ *s++ = *p++;
+ else {
+ /* Replace the '\n' with a space if cr_wrap is not set */
+ if (!trim_blank(base, s))
+ *s++ = ' ';
+ p++;
+ }
+ } else /* If *p != '\n' */
+ *s++ = *p++;
+ } else if (dialog_vars.trim_whitespace) {
+ if (*p == ' ') {
+ if (*(s - 1) != ' ') {
+ *s++ = ' ';
+ p++;
+ } else
+ p++;
+ } else if (*p == '\n') {
+ if (dialog_vars.cr_wrap)
+ *s++ = *p++;
+ else if (*(s - 1) != ' ') {
+ /* Strip '\n's if cr_wrap is not set. */
+ *s++ = ' ';
+ p++;
+ } else
+ p++;
+ } else
+ *s++ = *p++;
+ } else { /* If there are no "\n" strings */
+ if (*p == ' ' && !dialog_vars.nocollapse) {
+ if (!trim_blank(base, s))
+ *s++ = *p;
+ p++;
+ } else
+ *s++ = *p++;
+ }
+ }
+
+ *s = '\0';
+}
+
+void
+dlg_set_focus(WINDOW *parent, WINDOW *win)
+{
+ if (win != 0) {
+ (void) wmove(parent,
+ getpary(win) + getcury(win),
+ getparx(win) + getcurx(win));
+ (void) wnoutrefresh(win);
+ (void) doupdate();
+ }
+}
+
+/*
+ * Returns the nominal maximum buffer size.
+ */
+int
+dlg_max_input(int max_len)
+{
+ if (dialog_vars.max_input != 0 && dialog_vars.max_input < MAX_LEN)
+ max_len = dialog_vars.max_input;
+
+ return max_len;
+}
+
+/*
+ * Free storage used for the result buffer.
+ */
+void
+dlg_clr_result(void)
+{
+ if (dialog_vars.input_length) {
+ dialog_vars.input_length = 0;
+ if (dialog_vars.input_result)
+ free(dialog_vars.input_result);
+ }
+ dialog_vars.input_result = 0;
+}
+
+/*
+ * Setup a fixed-buffer for the result.
+ */
+char *
+dlg_set_result(const char *string)
+{
+ unsigned need = string ? strlen(string) + 1 : 0;
+
+ /* inputstr.c needs a fixed buffer */
+ if (need < MAX_LEN)
+ need = MAX_LEN;
+
+ /*
+ * If the buffer is not big enough, allocate a new one.
+ */
+ if (dialog_vars.input_length != 0
+ || dialog_vars.input_result == 0
+ || need > MAX_LEN) {
+
+ dlg_clr_result();
+
+ dialog_vars.input_length = need;
+ dialog_vars.input_result = dlg_malloc(char, need);
+ assert_ptr(dialog_vars.input_result, "dlg_set_result");
+ }
+
+ strcpy(dialog_vars.input_result, string ? string : "");
+
+ return dialog_vars.input_result;
+}
+
+/*
+ * Accumulate results in dynamically allocated buffer.
+ * If input_length is zero, it is a MAX_LEN buffer belonging to the caller.
+ */
+void
+dlg_add_result(const char *string)
+{
+ unsigned have = (dialog_vars.input_result
+ ? strlen(dialog_vars.input_result)
+ : 0);
+ unsigned want = strlen(string) + 1 + have;
+
+ if ((want >= MAX_LEN)
+ || (dialog_vars.input_length != 0)
+ || (dialog_vars.input_result == 0)) {
+
+ if (dialog_vars.input_length == 0
+ || dialog_vars.input_result == 0) {
+
+ char *save = dialog_vars.input_result;
+
+ dialog_vars.input_length = want * 2;
+ dialog_vars.input_result = dlg_malloc(char, dialog_vars.input_length);
+ assert_ptr(dialog_vars.input_result, "dlg_add_result malloc");
+ dialog_vars.input_result[0] = 0;
+ if (save != 0)
+ strcpy(dialog_vars.input_result, save);
+ } else if (want >= dialog_vars.input_length) {
+ dialog_vars.input_length = want * 2;
+ dialog_vars.input_result = dlg_realloc(char,
+ dialog_vars.input_length,
+ dialog_vars.input_result);
+ assert_ptr(dialog_vars.input_result, "dlg_add_result realloc");
+ }
+ }
+ strcat(dialog_vars.input_result, string);
+}
+
+/*
+ * These are characters that (aside from the quote-delimiter) will have to
+ * be escaped in a single- or double-quoted string.
+ */
+#define FIX_SINGLE "\n\\"
+#define FIX_DOUBLE FIX_SINGLE "[]{}?*;`~#$^&()|<>"
+
+/*
+ * Returns the quote-delimiter.
+ */
+static const char *
+quote_delimiter(void)
+{
+ return dialog_vars.single_quoted ? "'" : "\"";
+}
+
+/*
+ * Returns true if we should quote the given string.
+ */
+static bool
+must_quote(char *string)
+{
+ bool code = FALSE;
+
+ if (*string != '\0') {
+ unsigned len = strlen(string);
+ if (strcspn(string, quote_delimiter()) != len)
+ code = TRUE;
+ else if (strcspn(string, "\n\t ") != len)
+ code = TRUE;
+ else
+ code = (strcspn(string, FIX_DOUBLE) != len);
+ } else {
+ code = TRUE;
+ }
+
+ return code;
+}
+
+/*
+ * Add a quoted string to the result buffer.
+ */
+void
+dlg_add_quoted(char *string)
+{
+ char temp[2];
+ const char *my_quote = quote_delimiter();
+ const char *must_fix = (dialog_vars.single_quoted
+ ? FIX_SINGLE
+ : FIX_DOUBLE);
+
+ if (dialog_vars.quoted || must_quote(string)) {
+ temp[1] = '\0';
+ dlg_add_result(my_quote);
+ while (*string != '\0') {
+ temp[0] = *string++;
+ if (strchr(my_quote, *temp) || strchr(must_fix, *temp))
+ dlg_add_result("\\");
+ dlg_add_result(temp);
+ }
+ dlg_add_result(my_quote);
+ } else {
+ dlg_add_result(string);
+ }
+}
+
+/*
+ * When adding a result, make that depend on whether "--quoted" is used.
+ */
+void
+dlg_add_string(char *string)
+{
+ if (dialog_vars.quoted) {
+ dlg_add_quoted(string);
+ } else {
+ dlg_add_result(string);
+ }
+}
+
+bool
+dlg_need_separator(void)
+{
+ bool result = FALSE;
+
+ if (dialog_vars.output_separator) {
+ result = TRUE;
+ } else if (dialog_vars.input_result && *(dialog_vars.input_result)) {
+ result = TRUE;
+ }
+ return result;
+}
+
+void
+dlg_add_separator(void)
+{
+ const char *separator = (dialog_vars.separate_output) ? "\n" : " ";
+
+ if (dialog_vars.output_separator)
+ separator = dialog_vars.output_separator;
+
+ dlg_add_result(separator);
+}
+
+/*
+ * Some widgets support only one value of a given variable - save/restore the
+ * global dialog_vars so we can override it consistently.
+ */
+void
+dlg_save_vars(DIALOG_VARS * vars)
+{
+ *vars = dialog_vars;
+}
+
+void
+dlg_restore_vars(DIALOG_VARS * vars)
+{
+ dialog_vars = *vars;
+}
+
+/*
+ * Called each time a widget is invoked which may do output, increment a count.
+ */
+void
+dlg_does_output(void)
+{
+ dialog_state.output_count += 1;
+}
+
+/*
+ * Compatibility for different versions of curses.
+ */
+#if !(defined(HAVE_GETBEGX) && defined(HAVE_GETBEGY))
+int
+getbegx(WINDOW *win)
+{
+ int y, x;
+ getbegyx(win, y, x);
+ return x;
+}
+int
+getbegy(WINDOW *win)
+{
+ int y, x;
+ getbegyx(win, y, x);
+ return y;
+}
+#endif
+
+#if !(defined(HAVE_GETCURX) && defined(HAVE_GETCURY))
+int
+getcurx(WINDOW *win)
+{
+ int y, x;
+ getyx(win, y, x);
+ return x;
+}
+int
+getcury(WINDOW *win)
+{
+ int y, x;
+ getyx(win, y, x);
+ return y;
+}
+#endif
+
+#if !(defined(HAVE_GETMAXX) && defined(HAVE_GETMAXY))
+int
+getmaxx(WINDOW *win)
+{
+ int y, x;
+ getmaxyx(win, y, x);
+ return x;
+}
+int
+getmaxy(WINDOW *win)
+{
+ int y, x;
+ getmaxyx(win, y, x);
+ return y;
+}
+#endif
+
+#if !(defined(HAVE_GETPARX) && defined(HAVE_GETPARY))
+int
+getparx(WINDOW *win)
+{
+ int y, x;
+ getparyx(win, y, x);
+ return x;
+}
+int
+getpary(WINDOW *win)
+{
+ int y, x;
+ getparyx(win, y, x);
+ return y;
+}
+#endif
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/version.c b/Build/source/utils/dialog/dialog-1.1-20080819/version.c
new file mode 100644
index 00000000000..bb78cd11822
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/version.c
@@ -0,0 +1,33 @@
+/*
+ * $Id: version.c,v 1.5 2006/12/27 00:50:24 tom Exp $
+ *
+ * version.c -- dialog's version string
+ *
+ * Copyright 2005,2006 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ */
+#include <dialog.h>
+
+#define quoted(a) #a
+#define concat(a,b) a "-" quoted(b)
+#define DLG_VERSION concat(DIALOG_VERSION,DIALOG_PATCHDATE)
+
+char *
+dialog_version(void)
+{
+ return DLG_VERSION;
+}
diff --git a/Build/source/utils/dialog/dialog-1.1-20080819/yesno.c b/Build/source/utils/dialog/dialog-1.1-20080819/yesno.c
new file mode 100644
index 00000000000..128ae2b91b4
--- /dev/null
+++ b/Build/source/utils/dialog/dialog-1.1-20080819/yesno.c
@@ -0,0 +1,151 @@
+/*
+ * $Id: yesno.c,v 1.46 2007/02/23 21:39:34 tom Exp $
+ *
+ * yesno.c -- implements the yes/no box
+ *
+ * Copyright 1999-2005,2006 Thomas E. Dickey
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License, version 2.1
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to
+ * Free Software Foundation, Inc.
+ * 51 Franklin St., Fifth Floor
+ * Boston, MA 02110, USA.
+ *
+ * An earlier version of this program lists as authors
+ * Savio Lam (lam836@cs.cuhk.hk)
+ */
+
+#include <dialog.h>
+#include <dlg_keys.h>
+
+/*
+ * Display a dialog box with two buttons - Yes and No.
+ */
+int
+dialog_yesno(const char *title, const char *cprompt, int height, int width)
+{
+ /* *INDENT-OFF* */
+ static DLG_KEYS_BINDING binding[] = {
+ ENTERKEY_BINDINGS,
+ DLG_KEYS_DATA( DLGK_ENTER, ' ' ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_DOWN ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, KEY_RIGHT ),
+ DLG_KEYS_DATA( DLGK_FIELD_NEXT, TAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_UP ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_BTAB ),
+ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ),
+ END_KEYS_BINDING
+ };
+ /* *INDENT-ON* */
+
+ int x, y;
+ int key = 0, fkey;
+ int code;
+ int button = dlg_defaultno_button();
+ WINDOW *dialog = 0;
+ int result = DLG_EXIT_UNKNOWN;
+ char *prompt = dlg_strclone(cprompt);
+ const char **buttons = dlg_yes_labels();
+
+#ifdef KEY_RESIZE
+ int req_high = height;
+ int req_wide = width;
+ restart:
+#endif
+
+ dlg_tab_correct_str(prompt);
+ dlg_auto_size(title, prompt, &height, &width, 2, 25);
+ dlg_print_size(height, width);
+ dlg_ctl_size(height, width);
+
+ x = dlg_box_x_ordinate(width);
+ y = dlg_box_y_ordinate(height);
+
+#ifdef KEY_RESIZE
+ if (dialog != 0)
+ dlg_move_window(dialog, height, width, y, x);
+ else
+#endif
+ {
+ dialog = dlg_new_window(height, width, y, x);
+ dlg_register_window(dialog, "yesno", binding);
+ dlg_register_buttons(dialog, "yesno", buttons);
+ }
+
+ dlg_draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
+ dlg_draw_bottom_box(dialog);
+ dlg_draw_title(dialog, title);
+
+ wattrset(dialog, dialog_attr);
+ dlg_print_autowrap(dialog, prompt, height, width);
+
+ dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
+
+ while (result == DLG_EXIT_UNKNOWN) {
+ key = dlg_mouse_wgetch(dialog, &fkey);
+ if (dlg_result_key(key, fkey, &result))
+ break;
+ if ((code = dlg_char_to_button(key, buttons)) >= 0) {
+ result = dlg_ok_buttoncode(code);
+ break;
+ }
+ /* handle function keys */
+ if (fkey) {
+ switch (key) {
+ case DLGK_FIELD_NEXT:
+ button = dlg_next_button(buttons, button);
+ if (button < 0)
+ button = 0;
+ dlg_draw_buttons(dialog,
+ height - 2, 0,
+ buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_FIELD_PREV:
+ button = dlg_prev_button(buttons, button);
+ if (button < 0)
+ button = 0;
+ dlg_draw_buttons(dialog,
+ height - 2, 0,
+ buttons, button,
+ FALSE, width);
+ break;
+ case DLGK_ENTER:
+ result = dlg_yes_buttoncode(button);
+ break;
+#ifdef KEY_RESIZE
+ case KEY_RESIZE:
+ dlg_clear();
+ height = req_high;
+ width = req_wide;
+ goto restart;
+#endif
+ default:
+ if (is_DLGK_MOUSE(key)) {
+ result = dlg_yes_buttoncode(key - M_EVENT);
+ if (result < 0)
+ result = DLG_EXIT_OK;
+ } else {
+ beep();
+ }
+ break;
+ }
+ } else {
+ beep();
+ }
+ }
+
+ dlg_del_window(dialog);
+ dlg_mouse_free_regions();
+ free(prompt);
+ return result;
+}
diff --git a/Build/source/utils/dummy/Makefile.am b/Build/source/utils/dummy/Makefile.am
new file mode 100644
index 00000000000..9b611c108f5
--- /dev/null
+++ b/Build/source/utils/dummy/Makefile.am
@@ -0,0 +1,10 @@
+##
+noinst_DATA = ../subutilsdir-configure
+
+DISTCLEANFILES = $(noinst_DATA)
+
+all-local: $(noinst_DATA)
+
+../subutilsdir-configure:
+ echo "${srcdir}/configure" | sed 's,dummy/,SUBUTILSDIR/,' >$@
+
diff --git a/Build/source/utils/dummy/Makefile.in b/Build/source/utils/dummy/Makefile.in
new file mode 100644
index 00000000000..bcddd01e1f2
--- /dev/null
+++ b/Build/source/utils/dummy/Makefile.in
@@ -0,0 +1,420 @@
+# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = .
+DIST_COMMON = $(am__configure_deps) \
+ $(srcdir)/../../build-aux/install-sh \
+ $(srcdir)/../../build-aux/missing $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/configure \
+ ../../build-aux/config.guess ../../build-aux/config.sub \
+ ../../build-aux/depcomp ../../build-aux/install-sh \
+ ../../build-aux/ltmain.sh ../../build-aux/missing \
+ ../../build-aux/texinfo.tex ../../build-aux/ylwrap
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DATA = $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+am__leading_dot = @am__leading_dot@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+noinst_DATA = ../subutilsdir-configure
+DISTCLEANFILES = $(noinst_DATA)
+all: all-am
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d $(distdir) || mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA) all-local
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am all-local am--refresh check check-am clean \
+ clean-generic dist dist-all dist-bzip2 dist-gzip dist-lzma \
+ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-generic distcleancheck distdir distuninstallcheck \
+ dvi dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+ pdf-am ps ps-am uninstall uninstall-am
+
+
+all-local: $(noinst_DATA)
+
+../subutilsdir-configure:
+ echo "${srcdir}/configure" | sed 's,dummy/,SUBUTILSDIR/,' >$@
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/Build/source/utils/dummy/aclocal.m4 b/Build/source/utils/dummy/aclocal.m4
new file mode 100644
index 00000000000..a249a8e6d87
--- /dev/null
+++ b/Build/source/utils/dummy/aclocal.m4
@@ -0,0 +1,618 @@
+# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10.2], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10.2])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 13
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+AC_DEFUN([AM_MAINTAINER_MODE],
+[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode is disabled by default
+ AC_ARG_ENABLE(maintainer-mode,
+[ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer],
+ USE_MAINTAINER_MODE=$enableval,
+ USE_MAINTAINER_MODE=no)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST(MAINT)dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/Build/source/utils/dummy/configure b/Build/source/utils/dummy/configure
new file mode 100755
index 00000000000..fde84dbe370
--- /dev/null
+++ b/Build/source/utils/dummy/configure
@@ -0,0 +1,3403 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for TeX live utils dummy 2009.
+#
+# Report bugs to <tex-k@tug.org>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ case $as_dir in
+ /*)
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell bug-autoconf@gnu.org about your system,
+ echo including any error possibly output before this message.
+ echo This can help us improve future autoconf versions.
+ echo Configuration will now proceed without shell functions.
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='TeX live utils dummy'
+PACKAGE_TARNAME='tex-live-utils-dummy'
+PACKAGE_VERSION='2009'
+PACKAGE_STRING='TeX live utils dummy 2009'
+PACKAGE_BUGREPORT='tex-k@tug.org'
+
+ac_unique_file="../../build-aux/missing"
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+ { (exit 1); exit 1; }; }
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+ { (exit 1); exit 1; }; } ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { $as_echo "$as_me: error: working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+ { (exit 1); exit 1; }; }
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures TeX live utils dummy 2009 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root
+ [DATAROOTDIR/doc/tex-live-utils-dummy]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of TeX live utils dummy 2009:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+
+Report bugs to <tex-k@tug.org>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+TeX live utils dummy configure 2009
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by TeX live utils dummy $as_me 2009, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args '$ac_arg'"
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test -r "$ac_site_file"; then
+ { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+ac_aux_dir=
+for ac_dir in ../../build-aux "$srcdir"/../../build-aux; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in ../../build-aux \"$srcdir\"/../../build-aux" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in ../../build-aux \"$srcdir\"/../../build-aux" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+
+am__api_version='1.10'
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+done
+IFS=$as_save_IFS
+
+fi
+
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ test -d ./--version && rmdir ./--version
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='tex-live-utils-dummy'
+ VERSION='2009'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=no
+fi
+
+ { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+echo "$ac_configure_args" | sed 's,/dummy,/SUBUTILSDIR,g' >../subutilsdir-conf.args
+
+ac_config_files="$ac_config_files Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ else
+ { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section. Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+ g
+ s/^\n//
+ s/\n/ /g
+ p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by TeX live utils dummy $as_me 2009, which was
+generated by GNU Autoconf 2.63. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+TeX live utils dummy config.status 2009
+configured by $0, generated by GNU Autoconf 2.63,
+ with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h | --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+ *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} ||
+{
+ $as_echo "$as_me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=' '
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+ { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X " :F $CONFIG_FILES "
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ ac_file_inputs="$ac_file_inputs '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin" \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+ esac \
+ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+
+
+
+ esac
+
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/Build/source/utils/dummy/configure.ac b/Build/source/utils/dummy/configure.ac
new file mode 100644
index 00000000000..5bb9c28abee
--- /dev/null
+++ b/Build/source/utils/dummy/configure.ac
@@ -0,0 +1,21 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl
+dnl Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
+dnl
+dnl This file is free software; the copyright holder
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+AC_INIT([TeX live utils dummy], [2009], [tex-k@tug.org])
+AC_PREREQ([2.63])
+AC_CONFIG_SRCDIR([../../build-aux/missing])
+AC_CONFIG_AUX_DIR([../../build-aux])
+
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_MAINTAINER_MODE
+
+echo "$ac_configure_args" | sed 's,/dummy,/SUBUTILSDIR,g' >../subutilsdir-conf.args
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
diff --git a/Build/source/utils/pdfopen/Makefile.am.orig b/Build/source/utils/pdfopen/Makefile.am.orig
new file mode 100644
index 00000000000..7aab0fdef8a
--- /dev/null
+++ b/Build/source/utils/pdfopen/Makefile.am.orig
@@ -0,0 +1,12 @@
+
+AM_CFLAGS = $(X_CFLAGS)
+
+LDADD = $(X_LIBS) -lX11 -lXmu $(X_EXTRA_LIBS)
+
+bin_PROGRAMS = pdfopen pdfclose
+
+pdfopen_SOURCES = pdfopen.c sendx.c
+
+pdfclose_SOURCES = pdfclose.c sendx.c
+
+
diff --git a/Build/source/utils/pdfopen/ac/withenable.ac b/Build/source/utils/pdfopen/ac/withenable.ac
new file mode 100644
index 00000000000..6d01cecc640
--- /dev/null
+++ b/Build/source/utils/pdfopen/ac/withenable.ac
@@ -0,0 +1,3 @@
+## utils/pdfopen/ac/withenable.ac
+## configure options and TL libraries required for pdfopen
+KPSE_WITH_PROG([pdfopen])
diff --git a/Build/source/utils/pdfopen/configure.ac.orig b/Build/source/utils/pdfopen/configure.ac.orig
new file mode 100644
index 00000000000..882aa35bd14
--- /dev/null
+++ b/Build/source/utils/pdfopen/configure.ac.orig
@@ -0,0 +1,25 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl this is for autoconf 2.5x
+
+AC_INIT(pdfopen, 0.5, taco@metatex.org)
+
+AC_CONFIG_AUX_DIR(config)
+
+AM_INIT_AUTOMAKE(pdfopen, 0.5)
+
+AC_CONFIG_FILES(Makefile)
+
+AC_PROG_CC
+
+dnl AC_PROG_INSTALL
+
+dnl Checks for header files.
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+
+dnl Checks for library functions.
+
+dnl Find Xlibs.
+AC_PATH_XTRA
+
+AC_OUTPUT
diff --git a/Build/source/utils/ps2eps/Makefile.in.orig b/Build/source/utils/ps2eps/Makefile.in.orig
new file mode 100644
index 00000000000..f7dd345b3c6
--- /dev/null
+++ b/Build/source/utils/ps2eps/Makefile.in.orig
@@ -0,0 +1,53 @@
+# Public domain, written by Vladimir Volovich.
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+CC = @CC@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+
+prefix = @prefix@
+datarootdir = @datarootdir@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+mandir = @mandir@
+manext = 1
+man1dir = $(mandir)/man$(manext)
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_DATA = @INSTALL_DATA@
+
+default all: bbox
+
+bbox: bbox.o
+ $(CC) $(LDFLAGS) bbox.o -o bbox
+
+.c.o:
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
+
+install: bbox
+ $(INSTALL) -d $(bindir)
+ $(INSTALL) -d $(man1dir)
+ $(INSTALL_SCRIPT) $(srcdir)/ps2eps $(bindir)/ps2eps
+ $(INSTALL_PROGRAM) bbox $(bindir)/bbox
+ $(INSTALL_DATA) $(srcdir)/ps2eps.1 $(man1dir)/ps2eps.1
+ $(INSTALL_DATA) $(srcdir)/bbox.1 $(man1dir)/bbox.1
+
+check:
+
+uninstall:
+ -rm -f $(bindir)/ps2eps $(bindir)/bbox $(man1dir)/ps2eps.1 $(man1dir)/bbox.1
+
+clean:
+ -rm -f bbox bbox.o
+
+distclean: clean
+ -rm -f Makefile config.status config.log config.cache
+
+realclean: distclean
+
+mostlyclean: clean
diff --git a/Build/source/utils/ps2eps/ac/withenable.ac b/Build/source/utils/ps2eps/ac/withenable.ac
new file mode 100644
index 00000000000..71c67b9ef40
--- /dev/null
+++ b/Build/source/utils/ps2eps/ac/withenable.ac
@@ -0,0 +1,3 @@
+## utils/ps2eps/ac/withenable.ac
+## configure options and TL libraries required for ps2eps
+KPSE_WITH_PROG([ps2eps])
diff --git a/Build/source/utils/ps2eps/configure.in.orig b/Build/source/utils/ps2eps/configure.in.orig
new file mode 100644
index 00000000000..23a72b87b3d
--- /dev/null
+++ b/Build/source/utils/ps2eps/configure.in.orig
@@ -0,0 +1,9 @@
+AC_INIT(ps2eps, 1.61, texlive@tug.org)
+
+AC_CONFIG_FILES(Makefile)
+
+AC_PROG_INSTALL
+
+AC_PROG_CC
+
+AC_OUTPUT
diff --git a/Build/source/utils/psutils/Makefile.in.orig b/Build/source/utils/psutils/Makefile.in.orig
new file mode 100644
index 00000000000..28b8f61b48d
--- /dev/null
+++ b/Build/source/utils/psutils/Makefile.in.orig
@@ -0,0 +1,230 @@
+# @configure_input@
+#
+# Makefile for psutils
+#
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+CC = @CC@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+defines = -DUNIX -DPAPER=\"$(PAPER)\"
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+scriptdir = $(bindir)
+mandir = @mandir@
+man1dir = $(mandir)/man$(manext)
+manext = 1
+
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL = @INSTALL@
+
+BIN = psbook psselect pstops epsffit psnup psresize
+SHELLSCRIPTS = getafm showchar
+PERLSCRIPTS = fixfmps fixmacps fixpsditps fixpspps fixtpps fixwfwps fixwpps fixscribeps fixwwps fixdlsrps extractres includeres psmerge
+MANPAGES = psbook.$(manext) psselect.$(manext) pstops.$(manext) epsffit.$(manext) psnup.$(manext) psresize.$(manext) psmerge.$(manext) fixscribeps.$(manext) getafm.$(manext) fixdlsrps.$(manext) fixfmps.$(manext) fixmacps.$(manext) fixpsditps.$(manext) fixpspps.$(manext) fixtpps.$(manext) fixwfwps.$(manext) fixwpps.$(manext) fixwwps.$(manext) extractres.$(manext) includeres.$(manext)
+INCLUDES = md68_0.ps md71_0.ps
+OS = UNIX
+PAPER = a4
+
+default all: $(BIN) $(PERLSCRIPTS) $(MANPAGES) $(SHELLSCRIPTS)
+
+.SUFFIXES:
+.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
+
+.c.o:
+ $(CC) $(defines) -c -I. -I$(srcdir) $(CPPFLAGS) $(CFLAGS) $<
+
+PERL = /usr/bin/env perl
+BINMODE = 0755
+MANMODE = 0644
+CHMOD = chmod
+MAKETEXT = $(PERL) $(srcdir)/maketext
+
+epsffit: epsffit.o pserror.o
+ $(CC) $(LDFLAGS) -o epsffit pserror.o epsffit.o
+
+psnup: psnup.o psutil.o psspec.o pserror.o
+ $(CC) $(LDFLAGS) -o psnup psutil.o psspec.o pserror.o psnup.o
+
+psresize: psresize.o psutil.o pserror.o psspec.o
+ $(CC) $(LDFLAGS) -o psresize psutil.o psspec.o pserror.o psresize.o
+
+psbook: psbook.o psutil.o pserror.o
+ $(CC) $(LDFLAGS) -o psbook psutil.o pserror.o psbook.o
+
+psselect: psselect.o psutil.o pserror.o
+ $(CC) $(LDFLAGS) -o psselect psutil.o pserror.o psselect.o
+
+pstops: pstops.o psutil.o psspec.o pserror.o
+ $(CC) $(LDFLAGS) -o pstops psutil.o psspec.o pserror.o pstops.o
+
+getafm: getafm.sh
+ cp $(srcdir)/getafm.sh getafm
+ $(CHMOD) $(BINMODE) getafm
+
+showchar: showchar.sh
+ cp $(srcdir)/showchar.sh showchar
+ $(CHMOD) $(BINMODE) showchar
+
+psmerge: psmerge.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/psmerge.pl > psmerge
+ $(CHMOD) $(BINMODE) psmerge
+
+fixfmps: fixfmps.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixfmps.pl > fixfmps
+ $(CHMOD) $(BINMODE) fixfmps
+
+fixmacps: fixmacps.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" INCLUDE=$(INCLUDEDIR) $(srcdir)/fixmacps.pl > fixmacps
+ $(CHMOD) $(BINMODE) fixmacps
+
+fixpsditps: fixpsditps.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixpsditps.pl > fixpsditps
+ $(CHMOD) $(BINMODE) fixpsditps
+
+fixpspps: fixpspps.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixpspps.pl > fixpspps
+ $(CHMOD) $(BINMODE) fixpspps
+
+fixscribeps: fixscribeps.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixscribeps.pl > fixscribeps
+ $(CHMOD) $(BINMODE) fixscribeps
+
+fixtpps: fixtpps.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixtpps.pl > fixtpps
+ $(CHMOD) $(BINMODE) fixtpps
+
+fixwfwps: fixwfwps.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixwfwps.pl > fixwfwps
+ $(CHMOD) $(BINMODE) fixwfwps
+
+fixwpps: fixwpps.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixwpps.pl > fixwpps
+ $(CHMOD) $(BINMODE) fixwpps
+
+fixwwps: fixwwps.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixwwps.pl > fixwwps
+ $(CHMOD) $(BINMODE) fixwwps
+
+fixdlsrps: fixdlsrps.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/fixdlsrps.pl > fixdlsrps
+ $(CHMOD) $(BINMODE) fixdlsrps
+
+extractres: extractres.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" $(srcdir)/extractres.pl > extractres
+ $(CHMOD) $(BINMODE) extractres
+
+includeres: includeres.pl
+ $(MAKETEXT) OS=$(OS) PERL="$(PERL)" INCLUDE=$(INCLUDEDIR) $(srcdir)/includeres.pl > includeres
+ $(CHMOD) $(BINMODE) includeres
+
+epsffit.$(manext): epsffit.man
+ $(MAKETEXT) MAN="$(MANPAGES)" $(srcdir)/epsffit.man > epsffit.$(manext)
+
+psnup.$(manext): psnup.man
+ $(MAKETEXT) MAN="$(MANPAGES)" PAPER=$(PAPER) $(srcdir)/psnup.man > psnup.$(manext)
+
+psresize.$(manext): psresize.man
+ $(MAKETEXT) MAN="$(MANPAGES)" PAPER=$(PAPER) $(srcdir)/psresize.man > psresize.$(manext)
+
+psbook.$(manext): psbook.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/psbook.man > psbook.$(manext)
+
+psselect.$(manext): psselect.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/psselect.man > psselect.$(manext)
+
+pstops.$(manext): pstops.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" PAPER=$(PAPER) $(srcdir)/pstops.man > pstops.$(manext)
+
+psmerge.$(manext): psmerge.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/psmerge.man > psmerge.$(manext)
+
+fixfmps.$(manext): fixfmps.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixfmps.man > fixfmps.$(manext)
+
+fixmacps.$(manext): fixmacps.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $(srcdir)/fixmacps.man > fixmacps.$(manext)
+
+fixpsditps.$(manext): fixpsditps.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixpsditps.man > fixpsditps.$(manext)
+
+fixpspps.$(manext): fixpspps.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixpspps.man > fixpspps.$(manext)
+
+fixscribeps.$(manext): fixscribeps.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixscribeps.man > fixscribeps.$(manext)
+
+fixtpps.$(manext): fixtpps.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixtpps.man > fixtpps.$(manext)
+
+fixwfwps.$(manext): fixwfwps.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixwfwps.man > fixwfwps.$(manext)
+
+fixwpps.$(manext): fixwpps.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixwpps.man > fixwpps.$(manext)
+
+fixwwps.$(manext): fixwwps.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixwwps.man > fixwwps.$(manext)
+
+fixdlsrps.$(manext): fixdlsrps.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/fixdlsrps.man > fixdlsrps.$(manext)
+
+extractres.$(manext): extractres.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/extractres.man > extractres.$(manext)
+
+includeres.$(manext): includeres.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" INCLUDE=$(INCLUDEDIR) $(srcdir)/includeres.man > includeres.$(manext)
+
+getafm.$(manext): getafm.man
+ $(MAKETEXT) "MAN=$(MANPAGES)" $(srcdir)/getafm.man > getafm.$(manext)
+
+info:
+dvi:
+
+SHELL = /bin/sh
+@SET_MAKE@
+
+.PHONY: install installdirs install-exec install-man clean realclean distclean mostlyclean all check info dvi
+install: install-exec install-man
+
+install-exec: installdirs
+ for p in $(BIN); do $(INSTALL_PROGRAM) $$p $(bindir)/$$p; done
+ for p in $(SHELLSCRIPTS) $(PERLSCRIPTS); do $(INSTALL_PROGRAM) $$p $(scriptdir)/$$p; done
+
+install-man: installdirs
+ for p in $(MANPAGES); do $(INSTALL_DATA) $$p $(man1dir)/$$p; done
+
+installdirs:
+ $(SHELL) ${srcdir}/../../texk/mkinstalldirs $(bindir) $(scriptdir) $(man1dir)
+
+clean:
+ rm -f *.o $(BIN) $(SHELLSCRIPTS) $(PERLSCRIPTS) $(MANPAGES)
+
+distclean: mostlyclean
+ rm -f Makefile config.cache config.log config.status patchlev.h
+
+realclean: distclean
+mostlyclean: clean
+
+Makefile: config.status $(srcdir)/Makefile.in
+ $(SHELL) config.status
+
+# This tells versions [3.59,3.63) of GNU make not to export all variables.
+.NOEXPORT:
+
+# Automatically generated dependencies will be put at the end of the file.
+psutil.o: psutil.h patchlev.h pserror.h psutil.c
+psspec.o: psutil.h patchlev.h psspec.h pserror.h psspec.c
+pserror.o: psutil.h patchlev.h pserror.h pserror.c
+epsffit.o: epsffit.c pserror.h patchlev.h
+psnup.o: psutil.h patchlev.h psspec.h pserror.h psnup.c
+psresize.o: psutil.h patchlev.h psspec.h pserror.h psresize.c
+psbook.o: psutil.h patchlev.h pserror.h psbook.c
+psselect.o: psutil.h patchlev.h pserror.h psselect.c
+pstops.o: psutil.h patchlev.h psspec.h pserror.h pstops.c
diff --git a/Build/source/utils/psutils/ac/withenable.ac b/Build/source/utils/psutils/ac/withenable.ac
new file mode 100644
index 00000000000..80306bea00e
--- /dev/null
+++ b/Build/source/utils/psutils/ac/withenable.ac
@@ -0,0 +1,3 @@
+## utils/psutils/ac/withenable.ac
+## configure options and TL libraries required for psutils
+KPSE_WITH_PROG([psutils])
diff --git a/Build/source/utils/psutils/configure.in.orig b/Build/source/utils/psutils/configure.in.orig
new file mode 100644
index 00000000000..35a06cdf7c1
--- /dev/null
+++ b/Build/source/utils/psutils/configure.in.orig
@@ -0,0 +1,15 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(psutil.c)
+
+AC_CONFIG_AUX_DIR(../../config)
+
+AC_PROG_CC
+AC_PROG_CPP
+AC_ISC_POSIX
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+sinclude(../../multiplatform.ac)
+
+AC_CONFIG_FILES([Makefile patchlev.h])
+AC_OUTPUT
diff --git a/Build/source/utils/t1utils/ac/withenable.ac b/Build/source/utils/t1utils/ac/withenable.ac
new file mode 100644
index 00000000000..473ca872120
--- /dev/null
+++ b/Build/source/utils/t1utils/ac/withenable.ac
@@ -0,0 +1,3 @@
+## utils/t1utils/ac/withenable.ac
+## configure options and TL libraries required for t1utils
+KPSE_WITH_PROG([t1utils])
diff --git a/Build/source/utils/tpic2pdftex/Makefile.in.orig b/Build/source/utils/tpic2pdftex/Makefile.in.orig
new file mode 100644
index 00000000000..3e36f0b10aa
--- /dev/null
+++ b/Build/source/utils/tpic2pdftex/Makefile.in.orig
@@ -0,0 +1,57 @@
+# Makefile.in for tpic2pdftex
+# created from Makefile by Norbert Preining
+#
+#$Id: Makefile,v 1.21 2007/01/14 13:35:17 hahe Exp hahe $
+
+.PRECIOUS: %.tpic %.tex
+.PHONY: first all
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+SHELL = @SHELL@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+
+INSTALL = @INSTALL@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_DATA = @INSTALL_DATA@
+
+first:
+ : nothing to be done
+
+all:
+ : nothing to be done
+
+doc: example.pdf beamerexample.pdf
+
+example.pdf: example.tex
+ pdftex $<
+
+beamerexample.pdf: beamerexample.tex
+ pdflatex $<
+
+%.tpic: %.pic Makefile
+ pic -z -t $< > $@
+
+%.tex: %.tpic
+ $(srcdir)/tpic2pdftex $< > $@
+
+install:
+ $(INSTALL) -d $(bindir)
+ $(INSTALL_SCRIPT) $(srcdir)/tpic2pdftex $(bindir)/tpic2pdftex
+
+clean:
+ - rm *.tex
+ - rm *.log
+ - rm *.toc
+ - rm *.out
+ - rm *.snm
+ - rm *.nav
+ - rm *.aux
+ - rm *.tpic
+
+allclean:
+ make clean
+ - rm *.pdf
diff --git a/Build/source/utils/tpic2pdftex/ac/withenable.ac b/Build/source/utils/tpic2pdftex/ac/withenable.ac
new file mode 100644
index 00000000000..f2e49b65139
--- /dev/null
+++ b/Build/source/utils/tpic2pdftex/ac/withenable.ac
@@ -0,0 +1,3 @@
+## utils/tpic2pdftex/ac/withenable.ac
+## configure options and TL libraries required for tpic2pdftex
+KPSE_WITH_PROG([tpic2pdftex])
diff --git a/Build/source/utils/tpic2pdftex/configure.ac.orig b/Build/source/utils/tpic2pdftex/configure.ac.orig
new file mode 100644
index 00000000000..9cc1eef3cf3
--- /dev/null
+++ b/Build/source/utils/tpic2pdftex/configure.ac.orig
@@ -0,0 +1,15 @@
+dnl configure.ac
+dnl
+dnl Copyright 2007 by Norbert Preining.
+dnl
+dnl This file was generated for the tpic2pdftex program in the TeX Live
+dnl distribution.
+dnl GNU General Public License
+dnl
+AC_INIT(tpic2pdftex, 1.94, hartmut_henkel@gmx.de)
+
+AC_CONFIG_FILES(Makefile)
+
+AC_PROG_INSTALL
+
+AC_OUTPUT